diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-03-15 20:18:38 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2019-03-15 20:46:17 +0100 |
commit | 370db33a4c347049cb8f66c181d39fd2f2ce5e3a (patch) | |
tree | 747362c36a62f373d4fcd9beb30ad4b9f1ea6703 /kernel | |
parent | b5cf8c9442774bba49d308d75d72036d6b05ec38 (diff) | |
download | yosys-370db33a4c347049cb8f66c181d39fd2f2ce5e3a.tar.gz yosys-370db33a4c347049cb8f66c181d39fd2f2ce5e3a.tar.bz2 yosys-370db33a4c347049cb8f66c181d39fd2f2ce5e3a.zip |
Add fmcombine pass
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/celltypes.h | 45 | ||||
-rw-r--r-- | kernel/rtlil.cc | 4 |
2 files changed, 32 insertions, 17 deletions
diff --git a/kernel/celltypes.h b/kernel/celltypes.h index 8b8a56111..ae88f4aaf 100644 --- a/kernel/celltypes.h +++ b/kernel/celltypes.h @@ -82,6 +82,27 @@ struct CellTypes void setup_internals() { + setup_internals_eval(); + + IdString A = "\\A", B = "\\B", EN = "\\EN", Y = "\\Y"; + + setup_type("$tribuf", {A, EN}, {Y}, true); + + setup_type("$assert", {A, EN}, pool<RTLIL::IdString>(), true); + setup_type("$assume", {A, EN}, pool<RTLIL::IdString>(), true); + setup_type("$live", {A, EN}, pool<RTLIL::IdString>(), true); + setup_type("$fair", {A, EN}, pool<RTLIL::IdString>(), true); + setup_type("$cover", {A, EN}, pool<RTLIL::IdString>(), true); + setup_type("$initstate", pool<RTLIL::IdString>(), {Y}, true); + setup_type("$anyconst", pool<RTLIL::IdString>(), {Y}, true); + setup_type("$anyseq", pool<RTLIL::IdString>(), {Y}, true); + setup_type("$allconst", pool<RTLIL::IdString>(), {Y}, true); + setup_type("$allseq", pool<RTLIL::IdString>(), {Y}, true); + setup_type("$equiv", {A, B}, {Y}, true); + } + + void setup_internals_eval() + { std::vector<RTLIL::IdString> unary_ops = { "$not", "$pos", "$neg", "$reduce_and", "$reduce_or", "$reduce_xor", "$reduce_xnor", "$reduce_bool", @@ -111,20 +132,6 @@ struct CellTypes setup_type("$lcu", {P, G, CI}, {CO}, true); setup_type("$alu", {A, B, CI, BI}, {X, Y, CO}, true); setup_type("$fa", {A, B, C}, {X, Y}, true); - - setup_type("$tribuf", {A, EN}, {Y}, true); - - setup_type("$assert", {A, EN}, pool<RTLIL::IdString>(), true); - setup_type("$assume", {A, EN}, pool<RTLIL::IdString>(), true); - setup_type("$live", {A, EN}, pool<RTLIL::IdString>(), true); - setup_type("$fair", {A, EN}, pool<RTLIL::IdString>(), true); - setup_type("$cover", {A, EN}, pool<RTLIL::IdString>(), true); - setup_type("$initstate", pool<RTLIL::IdString>(), {Y}, true); - setup_type("$anyconst", pool<RTLIL::IdString>(), {Y}, true); - setup_type("$anyseq", pool<RTLIL::IdString>(), {Y}, true); - setup_type("$allconst", pool<RTLIL::IdString>(), {Y}, true); - setup_type("$allseq", pool<RTLIL::IdString>(), {Y}, true); - setup_type("$equiv", {A, B}, {Y}, true); } void setup_internals_mem() @@ -154,6 +161,15 @@ struct CellTypes void setup_stdcells() { + setup_stdcells_eval(); + + IdString A = "\\A", E = "\\E", Y = "\\Y"; + + setup_type("$_TBUF_", {A, E}, {Y}, true); + } + + void setup_stdcells_eval() + { IdString A = "\\A", B = "\\B", C = "\\C", D = "\\D"; IdString E = "\\E", F = "\\F", G = "\\G", H = "\\H"; IdString I = "\\I", J = "\\J", K = "\\K", L = "\\L"; @@ -179,7 +195,6 @@ struct CellTypes setup_type("$_OAI3_", {A, B, C}, {Y}, true); setup_type("$_AOI4_", {A, B, C, D}, {Y}, true); setup_type("$_OAI4_", {A, B, C, D}, {Y}, true); - setup_type("$_TBUF_", {A, E}, {Y}, true); } void setup_stdcells_mem() diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 7f1816190..d0fa88890 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -760,7 +760,7 @@ namespace { void check() { - if (cell->type.substr(0, 1) != "$" || cell->type.substr(0, 3) == "$__" || cell->type.substr(0, 8) == "$paramod" || + if (cell->type.substr(0, 1) != "$" || cell->type.substr(0, 3) == "$__" || cell->type.substr(0, 8) == "$paramod" || cell->type.substr(0,10) == "$fmcombine" || cell->type.substr(0, 9) == "$verific$" || cell->type.substr(0, 7) == "$array:" || cell->type.substr(0, 8) == "$extern:") return; @@ -2360,7 +2360,7 @@ void RTLIL::Cell::check() void RTLIL::Cell::fixup_parameters(bool set_a_signed, bool set_b_signed) { - if (type.substr(0, 1) != "$" || type.substr(0, 2) == "$_" || type.substr(0, 8) == "$paramod" || + if (type.substr(0, 1) != "$" || type.substr(0, 2) == "$_" || type.substr(0, 8) == "$paramod" || type.substr(0,10) == "$fmcombine" || type.substr(0, 9) == "$verific$" || type.substr(0, 7) == "$array:" || type.substr(0, 8) == "$extern:") return; |