diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-06-21 10:02:10 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2019-06-21 10:02:10 +0200 |
commit | 9286b6f013db06b473d009dfabb5e7c1526387b1 (patch) | |
tree | 39f9ec8c4cdd91a83da76e108b8a32dea26316f5 /passes/techmap | |
parent | 891ea6512e5254803b36a2a22121bc2733ac8b9e (diff) | |
download | yosys-9286b6f013db06b473d009dfabb5e7c1526387b1.tar.gz yosys-9286b6f013db06b473d009dfabb5e7c1526387b1.tar.bz2 yosys-9286b6f013db06b473d009dfabb5e7c1526387b1.zip |
Add "muxcover -freedecode"
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'passes/techmap')
-rw-r--r-- | passes/techmap/muxcover.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/passes/techmap/muxcover.cc b/passes/techmap/muxcover.cc index e952b04b6..7fa89bbe3 100644 --- a/passes/techmap/muxcover.cc +++ b/passes/techmap/muxcover.cc @@ -57,6 +57,7 @@ struct MuxcoverWorker bool use_mux8; bool use_mux16; bool nodecode; + bool freedecode; bool nopartial; int cost_mux2; @@ -70,6 +71,7 @@ struct MuxcoverWorker use_mux8 = false; use_mux16 = false; nodecode = false; + freedecode = false; nopartial = false; cost_mux2 = COST_MUX2; cost_mux4 = COST_MUX4; @@ -178,6 +180,9 @@ struct MuxcoverWorker if (A == State::Sx || B == State::Sx) return 0; + if (freedecode) + return 0; + return std::max((cost_mux2 / GetSize(std::get<1>(entry))) - 1, 1); } @@ -620,6 +625,9 @@ struct MuxcoverPass : public Pass { log(" substitutions, but guarantees that the resulting circuit is not\n"); log(" less efficient than the original circuit.\n"); log("\n"); + log(" -freedecode\n"); + log(" Do not count cost for generated decode logic\n"); + log("\n"); log(" -nopartial\n"); log(" Do not consider mappings that use $_MUX<N>_ to select from less\n"); log(" than <N> different signals.\n"); @@ -633,6 +641,7 @@ struct MuxcoverPass : public Pass { bool use_mux8 = false; bool use_mux16 = false; bool nodecode = false; + bool freedecode = false; bool nopartial = false; int cost_mux4 = COST_MUX4; int cost_mux8 = COST_MUX8; @@ -670,6 +679,10 @@ struct MuxcoverPass : public Pass { nodecode = true; continue; } + if (arg == "-freedecode") { + freedecode = true; + continue; + } if (arg == "-nopartial") { nopartial = true; continue; @@ -694,6 +707,7 @@ struct MuxcoverPass : public Pass { worker.cost_mux8 = cost_mux8; worker.cost_mux16 = cost_mux16; worker.nodecode = nodecode; + worker.freedecode = freedecode; worker.nopartial = nopartial; worker.run(); } |