diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2019-08-09 09:46:37 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2019-08-09 09:46:37 +0200 |
commit | 7a860c562323b8279cdbb8626a47ac8466c78b4c (patch) | |
tree | d713b5c04ab34aadcbd310237a8cc46951f83e37 /backends/simplec | |
parent | 8a3329871ba7bab98982a101327b8375cd73344d (diff) | |
parent | ac2fc3a144fe1094bedcc6b3fda8a498ad43ae76 (diff) | |
download | yosys-7a860c562323b8279cdbb8626a47ac8466c78b4c.tar.gz yosys-7a860c562323b8279cdbb8626a47ac8466c78b4c.tar.bz2 yosys-7a860c562323b8279cdbb8626a47ac8466c78b4c.zip |
Merge remote-tracking branch 'upstream/master' into efinix
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) + |