diff options
author | Clifford Wolf <clifford@clifford.at> | 2017-12-14 02:17:01 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2017-12-14 02:17:01 +0100 |
commit | a48ec49017a8a792841cf486167c643db23eeb22 (patch) | |
tree | e1ec8f80c4c000275ca7e1c219947ea234cf6bf9 /kernel | |
parent | 546de7fa4fbd1b54e125fac06b588dbecfb033e0 (diff) | |
parent | 590e6961cb2ff352c2c01d5fcf6307db95d37129 (diff) | |
download | yosys-a48ec49017a8a792841cf486167c643db23eeb22.tar.gz yosys-a48ec49017a8a792841cf486167c643db23eeb22.tar.bz2 yosys-a48ec49017a8a792841cf486167c643db23eeb22.zip |
Merge branch 'master' into btor-ng
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/celltypes.h | 2 | ||||
-rw-r--r-- | kernel/cost.h | 2 | ||||
-rw-r--r-- | kernel/rtlil.cc | 11 | ||||
-rw-r--r-- | kernel/rtlil.h | 1 |
4 files changed, 14 insertions, 2 deletions
diff --git a/kernel/celltypes.h b/kernel/celltypes.h index 9f775cde7..5218b5363 100644 --- a/kernel/celltypes.h +++ b/kernel/celltypes.h @@ -20,7 +20,7 @@ #ifndef CELLTYPES_H #define CELLTYPES_H -#include <kernel/yosys.h> +#include "kernel/yosys.h" YOSYS_NAMESPACE_BEGIN diff --git a/kernel/cost.h b/kernel/cost.h index 84fd6cd6d..e795b571b 100644 --- a/kernel/cost.h +++ b/kernel/cost.h @@ -20,7 +20,7 @@ #ifndef COST_H #define COST_H -#include <kernel/yosys.h> +#include "kernel/yosys.h" YOSYS_NAMESPACE_BEGIN diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 7dc7107c1..3e873054f 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -172,6 +172,17 @@ bool RTLIL::Const::is_fully_zero() const return true; } +bool RTLIL::Const::is_fully_ones() const +{ + cover("kernel.rtlil.const.is_fully_ones"); + + for (auto bit : bits) + if (bit != RTLIL::State::S1) + return false; + + return true; +} + bool RTLIL::Const::is_fully_def() const { cover("kernel.rtlil.const.is_fully_def"); diff --git a/kernel/rtlil.h b/kernel/rtlil.h index b33cb53a3..fc29e1e65 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -480,6 +480,7 @@ struct RTLIL::Const inline const RTLIL::State &operator[](int index) const { return bits.at(index); } bool is_fully_zero() const; + bool is_fully_ones() const; bool is_fully_def() const; bool is_fully_undef() const; |