diff options
Diffstat (limited to 'kernel/rtlil.cc')
-rw-r--r-- | kernel/rtlil.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index d03fb0448..a65f0bb24 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -1216,6 +1216,20 @@ bool RTLIL::SigSpec::parse(RTLIL::SigSpec &sig, RTLIL::Module *module, std::stri return true; } +bool RTLIL::SigSpec::parse_rhs(const RTLIL::SigSpec &lhs, RTLIL::SigSpec &sig, RTLIL::Module *module, std::string str) +{ + if (lhs.chunks.size() == 1) { + char *p = (char*)str.c_str(), *endptr; + long long int val = strtoll(p, &endptr, 10); + if (endptr && endptr != p && *endptr == 0) { + sig = RTLIL::SigSpec(val, lhs.width); + return true; + } + } + + return parse(sig, module, str); +} + RTLIL::CaseRule::~CaseRule() { for (auto it = switches.begin(); it != switches.end(); it++) |