aboutsummaryrefslogtreecommitdiffstats
path: root/backends/simplec/simplec.cc
diff options
context:
space:
mode:
authorJim Lawson <ucbjrl@berkeley.edu>2019-08-07 10:14:45 -0700
committerJim Lawson <ucbjrl@berkeley.edu>2019-08-07 10:14:45 -0700
commit5e8a98c8fd5f31b514748676804dd1237bce4225 (patch)
treeead2b0029b55e078abc1023c434b87b4684ba498 /backends/simplec/simplec.cc
parent7e298084e458c3fcccece565df305271db51aec8 (diff)
parent5545cd3c108ef240ccf6278b2734412acf81cd2a (diff)
downloadyosys-5e8a98c8fd5f31b514748676804dd1237bce4225.tar.gz
yosys-5e8a98c8fd5f31b514748676804dd1237bce4225.tar.bz2
yosys-5e8a98c8fd5f31b514748676804dd1237bce4225.zip
Merge branch 'master' into firrtl_err_on_unsupported_cell
# Conflicts: # backends/firrtl/firrtl.cc
Diffstat (limited to 'backends/simplec/simplec.cc')
-rw-r--r--backends/simplec/simplec.cc6
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) +