diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-08-07 13:44:08 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-08-07 13:44:08 -0700 |
commit | e3d898dccb3cf535a213f313693b2b7a4ede7c68 (patch) | |
tree | ca5dfdf506a9a5bc37178eaa06f0d285b7649ff5 /backends/simplec | |
parent | cdf9c801347693c273309694685b2080ef00fd02 (diff) | |
parent | 3414ee1e3fe37d4bf383621542828d4fc8fc987f (diff) | |
download | yosys-e3d898dccb3cf535a213f313693b2b7a4ede7c68.tar.gz yosys-e3d898dccb3cf535a213f313693b2b7a4ede7c68.tar.bz2 yosys-e3d898dccb3cf535a213f313693b2b7a4ede7c68.zip |
Merge remote-tracking branch 'origin/master' into xc7dsp
Diffstat (limited to 'backends/simplec')
-rw-r--r-- | backends/simplec/simplec.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/backends/simplec/simplec.cc b/backends/simplec/simplec.cc index 6f2ccbe20..54dbb84af 100644 --- a/backends/simplec/simplec.cc +++ b/backends/simplec/simplec.cc @@ -472,7 +472,7 @@ struct SimplecWorker return; } - if (cell->type == "$_MUX_") + if (cell->type.in("$_MUX_", "$_NMUX_")) { SigBit a = sigmaps.at(work->module)(cell->getPort("\\A")); SigBit b = sigmaps.at(work->module)(cell->getPort("\\B")); @@ -484,7 +484,9 @@ struct SimplecWorker string s_expr = s.wire ? util_get_bit(work->prefix + cid(s.wire->name), s.wire->width, s.offset) : s.data ? "1" : "0"; // casts to bool are a workaround for CBMC bug (https://github.com/diffblue/cbmc/issues/933) - string expr = stringf("%s ? (bool)%s : (bool)%s", s_expr.c_str(), b_expr.c_str(), a_expr.c_str()); + string expr = stringf("%s ? %s(bool)%s : %s(bool)%s", s_expr.c_str(), + cell->type == "$_NMUX_" ? "!" : "", b_expr.c_str(), + cell->type == "$_NMUX_" ? "!" : "", a_expr.c_str()); log_assert(y.wire); funct_declarations.push_back(util_set_bit(work->prefix + cid(y.wire->name), y.wire->width, y.offset, expr) + |