diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-01-31 12:08:20 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-01-31 12:08:20 +0100 |
commit | f80f5b721da8188f2b00cc238075ef4e52a03d35 (patch) | |
tree | e9e39aa70f272ae05f92b8ec5a44b674e6de607c /kernel | |
parent | cb9d0a414dc899c3821af0e8f6231f887540c7a2 (diff) | |
download | yosys-f80f5b721da8188f2b00cc238075ef4e52a03d35.tar.gz yosys-f80f5b721da8188f2b00cc238075ef4e52a03d35.tar.bz2 yosys-f80f5b721da8188f2b00cc238075ef4e52a03d35.zip |
Added "equiv_make -blacklist <file> -encfile <file>"
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/rtlil.cc | 15 | ||||
-rw-r--r-- | kernel/rtlil.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 3fb98d1e2..9b55d4255 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -128,6 +128,21 @@ std::string RTLIL::Const::as_string() const return ret; } +RTLIL::Const RTLIL::Const::from_string(std::string str) +{ + Const c; + for (auto it = str.rbegin(); it != str.rend(); it++) + switch (*it) { + case '0': c.bits.push_back(State::S0); break; + case '1': c.bits.push_back(State::S1); break; + case 'x': c.bits.push_back(State::Sx); break; + case 'z': c.bits.push_back(State::Sz); break; + case 'm': c.bits.push_back(State::Sm); break; + default: c.bits.push_back(State::Sa); + } + return c; +} + std::string RTLIL::Const::decode_string() const { std::string string; diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 4d13897b9..c17ede3d0 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -469,6 +469,7 @@ struct RTLIL::Const bool as_bool() const; int as_int(bool is_signed = false) const; std::string as_string() const; + static Const from_string(std::string str); std::string decode_string() const; |