diff options
author | Jannis Harder <me@jix.one> | 2022-12-21 14:24:10 +0100 |
---|---|---|
committer | Jannis Harder <me@jix.one> | 2023-01-11 18:07:16 +0100 |
commit | 5042600c0d3adeae9ad7e936e92d4bf7ccff3e53 (patch) | |
tree | 165da5efba4120b999fa3522bf3a56d0918a9136 /passes | |
parent | 673ad561b8cf75abdafd9afb3d44edf0edf1f1e1 (diff) | |
download | yosys-5042600c0d3adeae9ad7e936e92d4bf7ccff3e53.tar.gz yosys-5042600c0d3adeae9ad7e936e92d4bf7ccff3e53.tar.bz2 yosys-5042600c0d3adeae9ad7e936e92d4bf7ccff3e53.zip |
xprop, setundef: Mark xprop decoding bwmuxes, exclude them from setundef
This adds the xprop_decoder attribute to bwmuxes that drive the original
unencoded signals. Setundef is changed to ignore the x inputs of these
bwmuxes, so that they survive the prep script of SBY's formal flow. This
is required to make simulation (via sim) using the prep model show the
decoded x signals instead of 0/1 values made up by the solver.
Diffstat (limited to 'passes')
-rw-r--r-- | passes/cmds/setundef.cc | 10 | ||||
-rw-r--r-- | passes/cmds/xprop.cc | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/passes/cmds/setundef.cc b/passes/cmds/setundef.cc index 590a7eb1d..7293002f3 100644 --- a/passes/cmds/setundef.cc +++ b/passes/cmds/setundef.cc @@ -502,7 +502,15 @@ struct SetundefPass : public Pass { } } - module->rewrite_sigspecs(worker); + for (auto &it : module->cells_) + if (!it.second->get_bool_attribute(ID::xprop_decoder)) + it.second->rewrite_sigspecs(worker); + for (auto &it : module->processes) + it.second->rewrite_sigspecs(worker); + for (auto &it : module->connections_) { + worker(it.first); + worker(it.second); + } if (worker.next_bit_mode == MODE_ANYSEQ || worker.next_bit_mode == MODE_ANYCONST) { diff --git a/passes/cmds/xprop.cc b/passes/cmds/xprop.cc index 5dee72e1b..5e78ff9fc 100644 --- a/passes/cmds/xprop.cc +++ b/passes/cmds/xprop.cc @@ -252,7 +252,8 @@ struct XpropWorker } if (!driven_orig.empty()) { - module->addBwmux(NEW_ID, driven_enc.is_1, Const(State::Sx, GetSize(driven_orig)), driven_enc.is_x, driven_orig); + auto decoder = module->addBwmux(NEW_ID, driven_enc.is_1, Const(State::Sx, GetSize(driven_orig)), driven_enc.is_x, driven_orig); + decoder->set_bool_attribute(ID::xprop_decoder); } if (!driven_never_x.first.empty()) { module->connect(driven_never_x); |