diff options
author | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-10-01 23:50:48 +0200 |
---|---|---|
committer | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-10-02 20:19:48 +0200 |
commit | 63b9df8693840d17def8abcb0e848112283b0231 (patch) | |
tree | 7cb46fa0119760ef17d9d8d3999090cb71342d40 /kernel/mem.cc | |
parent | ec2b5548fe9b8d291365a84a0c3fc87654643359 (diff) | |
download | yosys-63b9df8693840d17def8abcb0e848112283b0231.tar.gz yosys-63b9df8693840d17def8abcb0e848112283b0231.tar.bz2 yosys-63b9df8693840d17def8abcb0e848112283b0231.zip |
kernel/ff: Refactor FfData to enable FFs with async load.
- *_en is split into *_ce (clock enable) and *_aload (async load aka
latch gate enable), so both can be present at once
- has_d is removed
- has_gclk is added (to have a clear marker for $ff)
- d_is_const and val_d leftovers are removed
- async2sync, clk2fflogic, opt_dff are updated to operate correctly on
FFs with async load
Diffstat (limited to 'kernel/mem.cc')
-rw-r--r-- | kernel/mem.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/kernel/mem.cc b/kernel/mem.cc index b176e4057..40659b15b 100644 --- a/kernel/mem.cc +++ b/kernel/mem.cc @@ -961,9 +961,9 @@ Cell *Mem::extract_rdff(int idx, FfInitVals *initvals) { ff.sig_clk = port.clk; ff.pol_clk = port.clk_polarity; if (port.en != State::S1) { - ff.has_en = true; - ff.pol_en = true; - ff.sig_en = port.en; + ff.has_ce = true; + ff.pol_ce = true; + ff.sig_ce = port.en; } if (port.arst != State::S0) { ff.has_arst = true; @@ -976,7 +976,7 @@ Cell *Mem::extract_rdff(int idx, FfInitVals *initvals) { ff.pol_srst = true; ff.sig_srst = port.srst; ff.val_srst = port.srst_value; - ff.ce_over_srst = ff.has_en && port.ce_over_srst; + ff.ce_over_srst = ff.has_ce && port.ce_over_srst; } ff.sig_d = sig_d; ff.sig_q = port.data; @@ -1163,15 +1163,14 @@ void Mem::emulate_transparency(int widx, int ridx, FfInitVals *initvals) { FfData ff(initvals); ff.width = 1; ff.sig_q = cond_q; - ff.has_d = true; ff.sig_d = cond; ff.has_clk = true; ff.sig_clk = rport.clk; ff.pol_clk = rport.clk_polarity; if (rport.en != State::S1) { - ff.has_en = true; - ff.sig_en = rport.en; - ff.pol_en = true; + ff.has_ce = true; + ff.sig_ce = rport.en; + ff.pol_ce = true; } if (rport.arst != State::S0) { ff.has_arst = true; |