diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-08-06 15:18:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-06 15:18:18 +0200 |
commit | a4b59de5d48a89ba5e1b46eb44877a91ceb6fa44 (patch) | |
tree | e94e14733c13e234d5c5055082d732be26fd6d9b /kernel/consteval.h | |
parent | 44a9dcbbbf47f1a6f524c6328ff775f29573a935 (diff) | |
parent | 023086bd46bc828621ebb171b159efe1398aaecf (diff) | |
download | yosys-a4b59de5d48a89ba5e1b46eb44877a91ceb6fa44.tar.gz yosys-a4b59de5d48a89ba5e1b46eb44877a91ceb6fa44.tar.bz2 yosys-a4b59de5d48a89ba5e1b46eb44877a91ceb6fa44.zip |
Merge pull request #1251 from YosysHQ/clifford/nmux
Add $_NMUX_, add "abc -g cmos", add proper cmos cell costs
Diffstat (limited to 'kernel/consteval.h')
-rw-r--r-- | kernel/consteval.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/consteval.h b/kernel/consteval.h index 154373a8d..f70dfa0fb 100644 --- a/kernel/consteval.h +++ b/kernel/consteval.h @@ -145,7 +145,7 @@ struct ConstEval if (cell->hasPort("\\B")) sig_b = cell->getPort("\\B"); - if (cell->type == "$mux" || cell->type == "$pmux" || cell->type == "$_MUX_") + if (cell->type.in("$mux", "$pmux", "$_MUX_", "$_NMUX_")) { std::vector<RTLIL::SigSpec> y_candidates; int count_maybe_set_s_bits = 0; @@ -175,7 +175,10 @@ struct ConstEval for (auto &yc : y_candidates) { if (!eval(yc, undef, cell)) return false; - y_values.push_back(yc.as_const()); + if (cell->type == "$_NMUX_") + y_values.push_back(RTLIL::const_not(yc.as_const(), Const(), false, false, GetSize(yc))); + else + y_values.push_back(yc.as_const()); } if (y_values.size() > 1) |