3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 17:15:33 +00:00

Added "equiv_make -blacklist <file> -encfile <file>"

This commit is contained in:
Clifford Wolf 2015-01-31 12:08:20 +01:00
parent cb9d0a414d
commit f80f5b721d
4 changed files with 189 additions and 5 deletions

View file

@ -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;

View file

@ -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;