aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rtlil.cc
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-11-22 15:13:18 -0800
committerEddie Hung <eddie@fpgeh.com>2019-11-22 15:13:18 -0800
commit2a54fa41c40969841ba0574ba725caa436b0212f (patch)
tree1dbf518fc73dbe253612bdb5e466c50b78bce44b /kernel/rtlil.cc
parent6b9f90de789b1d0daf93ac1d2b608b057e7ca272 (diff)
parentc03b6a3e9cab9fc05b2d5b256676f5ddc6c2d763 (diff)
downloadyosys-2a54fa41c40969841ba0574ba725caa436b0212f.tar.gz
yosys-2a54fa41c40969841ba0574ba725caa436b0212f.tar.bz2
yosys-2a54fa41c40969841ba0574ba725caa436b0212f.zip
Merge branch 'master' of github.com:YosysHQ/yosys
Diffstat (limited to 'kernel/rtlil.cc')
-rw-r--r--kernel/rtlil.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index f42f5430f..bd2fd91a3 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -3083,6 +3083,7 @@ void RTLIL::SigSpec::replace(const dict<RTLIL::SigBit, RTLIL::SigBit> &rules, RT
log_assert(other != NULL);
log_assert(width_ == other->width_);
+ if (rules.empty()) return;
unpack();
other->unpack();
@@ -3107,6 +3108,7 @@ void RTLIL::SigSpec::replace(const std::map<RTLIL::SigBit, RTLIL::SigBit> &rules
log_assert(other != NULL);
log_assert(width_ == other->width_);
+ if (rules.empty()) return;
unpack();
other->unpack();
@@ -3552,6 +3554,12 @@ bool RTLIL::SigSpec::operator ==(const RTLIL::SigSpec &other) const
if (width_ != other.width_)
return false;
+ // Without this, SigSpec() == SigSpec(State::S0, 0) will fail
+ // since the RHS will contain one SigChunk of width 0 causing
+ // the size check below to fail
+ if (width_ == 0)
+ return true;
+
pack();
other.pack();