diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-06-27 11:48:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-27 11:48:48 -0700 |
commit | 6c210e58130211d4aee6c61437cad920a7666710 (patch) | |
tree | a6acdc602209e7fef80ee429bcda15a61c2703f7 /passes | |
parent | 760819e10d1866ef4590f2fbaf20eed36cd7925d (diff) | |
parent | 18acb72c05d270e2224ce55919cfb0524efb5757 (diff) | |
download | yosys-6c210e58130211d4aee6c61437cad920a7666710.tar.gz yosys-6c210e58130211d4aee6c61437cad920a7666710.tar.bz2 yosys-6c210e58130211d4aee6c61437cad920a7666710.zip |
Merge pull request #1143 from YosysHQ/clifford/fix1135
Add "pmux2shiftx -norange"
Diffstat (limited to 'passes')
-rw-r--r-- | passes/opt/pmux2shiftx.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/passes/opt/pmux2shiftx.cc b/passes/opt/pmux2shiftx.cc index 29870f510..65d8b8f32 100644 --- a/passes/opt/pmux2shiftx.cc +++ b/passes/opt/pmux2shiftx.cc @@ -221,6 +221,9 @@ struct Pmux2ShiftxPass : public Pass { log(" select strategy for one-hot encoded control signals\n"); log(" default: pmux\n"); log("\n"); + log(" -norange\n"); + log(" disable $sub inference for \"range decoders\"\n"); + log("\n"); } void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE { @@ -230,6 +233,7 @@ struct Pmux2ShiftxPass : public Pass { bool optimize_onehot = true; bool verbose = false; bool verbose_onehot = false; + bool norange = false; log_header(design, "Executing PMUX2SHIFTX pass.\n"); @@ -270,6 +274,10 @@ struct Pmux2ShiftxPass : public Pass { verbose_onehot = true; continue; } + if (args[argidx] == "-norange") { + norange = true; + continue; + } break; } extra_args(args, argidx, design); @@ -559,7 +567,7 @@ struct Pmux2ShiftxPass : public Pass { int this_inv_delta = this_maxval - this_minval; bool this_inv = false; - if (this_delta != this_inv_delta) + if (!norange && this_delta != this_inv_delta) this_inv = this_inv_delta < this_delta; else if (this_maxval != this_inv_maxval) this_inv = this_inv_maxval < this_maxval; @@ -574,7 +582,7 @@ struct Pmux2ShiftxPass : public Pass { if (best_src_col < 0) this_is_better = true; - else if (this_delta != best_delta) + else if (!norange && this_delta != best_delta) this_is_better = this_delta < best_delta; else if (this_maxval != best_maxval) this_is_better = this_maxval < best_maxval; @@ -656,7 +664,7 @@ struct Pmux2ShiftxPass : public Pass { // check density percentages Const offset(State::S0, GetSize(sig)); - if (absolute_density < min_density && range_density >= min_density) + if (!norange && absolute_density < min_density && range_density >= min_density) { offset = Const(min_choice, GetSize(sig)); log(" offset: %s\n", log_signal(offset)); |