diff options
author | Miodrag Milanović <mmicko@gmail.com> | 2022-04-01 19:37:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-01 19:37:02 +0200 |
commit | 2a76af9eb668c9ce7d59bfde7fe02d983be6ae29 (patch) | |
tree | 70c22445c689f27d6c534fef1ce0fe337b876a33 | |
parent | 2ec4af56e6ec83fe320cd7af958020ea56e1d9ab (diff) | |
parent | 86ce441af63b639fc4455cdb541048add253de49 (diff) | |
download | yosys-2a76af9eb668c9ce7d59bfde7fe02d983be6ae29.tar.gz yosys-2a76af9eb668c9ce7d59bfde7fe02d983be6ae29.tar.bz2 yosys-2a76af9eb668c9ce7d59bfde7fe02d983be6ae29.zip |
Merge pull request #3263 from YosysHQ/micko/clk2ff_init
Set init values for wrapped async control signals
-rw-r--r-- | passes/sat/clk2fflogic.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/passes/sat/clk2fflogic.cc b/passes/sat/clk2fflogic.cc index f37e07a89..bc18bbbd6 100644 --- a/passes/sat/clk2fflogic.cc +++ b/passes/sat/clk2fflogic.cc @@ -44,6 +44,7 @@ struct Clk2fflogicPass : public Pass { } SigSpec wrap_async_control(Module *module, SigSpec sig, bool polarity, IdString past_sig_id) { Wire *past_sig = module->addWire(past_sig_id, GetSize(sig)); + past_sig->attributes[ID::init] = RTLIL::Const(polarity ? State::S0 : State::S1, GetSize(sig)); module->addFf(NEW_ID, sig, past_sig); if (polarity) sig = module->Or(NEW_ID, sig, past_sig); @@ -56,6 +57,7 @@ struct Clk2fflogicPass : public Pass { } SigSpec wrap_async_control_gate(Module *module, SigSpec sig, bool polarity) { Wire *past_sig = module->addWire(NEW_ID); + past_sig->attributes[ID::init] = RTLIL::Const(polarity ? State::S0 : State::S1, GetSize(sig)); module->addFfGate(NEW_ID, sig, past_sig); if (polarity) sig = module->OrGate(NEW_ID, sig, past_sig); |