diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-08-06 04:47:55 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2019-08-06 04:47:55 +0200 |
commit | 023086bd46bc828621ebb171b159efe1398aaecf (patch) | |
tree | e94e14733c13e234d5c5055082d732be26fd6d9b /backends/simplec | |
parent | 44a9dcbbbf47f1a6f524c6328ff775f29573a935 (diff) | |
download | yosys-023086bd46bc828621ebb171b159efe1398aaecf.tar.gz yosys-023086bd46bc828621ebb171b159efe1398aaecf.tar.bz2 yosys-023086bd46bc828621ebb171b159efe1398aaecf.zip |
Add $_NMUX_, add "abc -g cmos", add proper cmos cell costs
Signed-off-by: Clifford Wolf <clifford@clifford.at>
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) + |