summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rtlil.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index 138287ce..9dfe196d 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -1550,9 +1550,9 @@ bool RTLIL::SigSpec::parse(RTLIL::SigSpec &sig, RTLIL::Module *module, std::stri
sigspec_parse_split(tokens, str, ',');
sig = RTLIL::SigSpec();
- for (auto &tok : tokens)
+ for (int tokidx = int(tokens.size())-1; tokidx >= 0; tokidx--)
{
- std::string netname = tok;
+ std::string netname = tokens[tokidx];
std::string indices;
if (netname.size() == 0)
@@ -1618,6 +1618,16 @@ bool RTLIL::SigSpec::parse(RTLIL::SigSpec &sig, RTLIL::Module *module, std::stri
bool RTLIL::SigSpec::parse_rhs(const RTLIL::SigSpec &lhs, RTLIL::SigSpec &sig, RTLIL::Module *module, std::string str)
{
+ if (str == "0") {
+ sig = RTLIL::SigSpec(RTLIL::State::S0, lhs.width);
+ return true;
+ }
+
+ if (str == "~0") {
+ sig = RTLIL::SigSpec(RTLIL::State::S1, lhs.width);
+ return true;
+ }
+
if (lhs.chunks.size() == 1) {
char *p = (char*)str.c_str(), *endptr;
long long int val = strtoll(p, &endptr, 10);