mirror of https://github.com/YosysHQ/yosys.git
wreduce: Introduce -mux_undef option (aligned with opt_expr).
This commit is contained in:
parent
6db2948938
commit
47efc04a7d
|
@ -30,6 +30,7 @@ struct WreduceConfig
|
|||
{
|
||||
pool<IdString> supported_cell_types;
|
||||
bool keepdc = false;
|
||||
bool mux_undef = false;
|
||||
|
||||
WreduceConfig()
|
||||
{
|
||||
|
@ -83,7 +84,7 @@ struct WreduceWorker
|
|||
|
||||
SigBit ref = sig_a[i];
|
||||
for (int k = 0; k < GetSize(sig_s); k++) {
|
||||
if ((config->keepdc || (ref != State::Sx && sig_b[k*GetSize(sig_a) + i] != State::Sx)) && ref != sig_b[k*GetSize(sig_a) + i])
|
||||
if ((config->keepdc || !config->mux_undef || (ref != State::Sx && sig_b[k*GetSize(sig_a) + i] != State::Sx)) && ref != sig_b[k*GetSize(sig_a) + i])
|
||||
goto no_match_ab;
|
||||
if (sig_b[k*GetSize(sig_a) + i] != State::Sx)
|
||||
ref = sig_b[k*GetSize(sig_a) + i];
|
||||
|
@ -479,6 +480,9 @@ struct WreducePass : public Pass {
|
|||
log(" Do not change the width of memory address ports. Use this options in\n");
|
||||
log(" flows that use the 'memory_memx' pass.\n");
|
||||
log("\n");
|
||||
log(" -mux_undef\n");
|
||||
log(" remove 'undef' inputs from $mux, $pmux and $_MUX_ cells\n");
|
||||
log("\n");
|
||||
log(" -keepdc\n");
|
||||
log(" Do not optimize explicit don't-care values.\n");
|
||||
log("\n");
|
||||
|
@ -500,6 +504,10 @@ struct WreducePass : public Pass {
|
|||
config.keepdc = true;
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-mux_undef") {
|
||||
config.mux_undef = true;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
extra_args(args, argidx, design);
|
||||
|
|
Loading…
Reference in New Issue