diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-07-08 10:59:12 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-07-08 10:59:12 -0700 |
commit | a34c5612e702d481798fa7fc27cf2fef06a2b544 (patch) | |
tree | ac55383976246dcd9c27b9fc474087fe2504def2 /passes/techmap | |
parent | 030483ffb909ab38e10d437d09ec922cb0ad2ce8 (diff) | |
download | yosys-a34c5612e702d481798fa7fc27cf2fef06a2b544.tar.gz yosys-a34c5612e702d481798fa7fc27cf2fef06a2b544.tar.bz2 yosys-a34c5612e702d481798fa7fc27cf2fef06a2b544.zip |
Add muxcover -mux2=cost option
Diffstat (limited to 'passes/techmap')
-rw-r--r-- | passes/techmap/muxcover.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/passes/techmap/muxcover.cc b/passes/techmap/muxcover.cc index c84cfc39a..4d9c111e7 100644 --- a/passes/techmap/muxcover.cc +++ b/passes/techmap/muxcover.cc @@ -631,7 +631,7 @@ struct MuxcoverPass : public Pass { log("\n"); log("Cover trees of $_MUX_ cells with $_MUX{4,8,16}_ cells\n"); log("\n"); - log(" -mux4[=cost], -mux8[=cost], -mux16[=cost]\n"); + log(" -mux2=cost, -mux4[=cost], -mux8[=cost], -mux16[=cost]\n"); log(" Use the specified types of MUXes (with optional integer costs). If none\n"); log(" of these options are given, the effect is the same as if all of them are.\n"); log(" Default costs: $_MUX_ = %d, $_MUX4_ = %d,\n", COST_MUX2, COST_MUX4); @@ -661,6 +661,7 @@ struct MuxcoverPass : public Pass { bool nodecode = false; bool nopartial = false; int cost_dmux = COST_DMUX; + int cost_mux2 = COST_MUX2; int cost_mux4 = COST_MUX4; int cost_mux8 = COST_MUX8; int cost_mux16 = COST_MUX16; @@ -669,6 +670,10 @@ struct MuxcoverPass : public Pass { for (argidx = 1; argidx < args.size(); argidx++) { const auto &arg = args[argidx]; + if (arg.size() >= 6 && arg.substr(0,6) == "-mux2=") { + cost_mux2 = atoi(arg.substr(6).c_str()); + continue; + } if (arg.size() >= 5 && arg.substr(0,5) == "-mux4") { use_mux4 = true; if (arg.size() > 5) { @@ -722,6 +727,7 @@ struct MuxcoverPass : public Pass { worker.use_mux8 = use_mux8; worker.use_mux16 = use_mux16; worker.cost_dmux = cost_dmux; + worker.cost_mux2 = cost_mux2; worker.cost_mux4 = cost_mux4; worker.cost_mux8 = cost_mux8; worker.cost_mux16 = cost_mux16; |