diff options
author | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-10-02 00:42:36 +0200 |
---|---|---|
committer | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-10-02 03:24:57 +0200 |
commit | f9aad606ca9c8f875ce3c3091daf465b73d3f513 (patch) | |
tree | b33752b61bef503c930f5d0b1227b9d7286870a6 /kernel | |
parent | 62739f7bf7b82afccd10c22bdabf89d305485966 (diff) | |
download | yosys-f9aad606ca9c8f875ce3c3091daf465b73d3f513.tar.gz yosys-f9aad606ca9c8f875ce3c3091daf465b73d3f513.tar.bz2 yosys-f9aad606ca9c8f875ce3c3091daf465b73d3f513.zip |
simplemap: refactor to use FfData.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/ff.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/ff.h b/kernel/ff.h index 3e83db678..e555e15f1 100644 --- a/kernel/ff.h +++ b/kernel/ff.h @@ -312,7 +312,8 @@ struct FfData { res.val_arst.bits.push_back(val_arst[i]); if (has_srst) res.val_srst.bits.push_back(val_srst[i]); - res.val_init.bits.push_back(val_init[i]); + if (initvals) + res.val_init.bits.push_back(val_init[i]); } res.width = GetSize(res.sig_q); // Slicing bits out may cause D to become const. @@ -382,12 +383,14 @@ struct FfData { pol_en = pol_arst; } else { // No control inputs left. Turn into a const driver. - initvals->remove_init(sig_q); + if (initvals) + initvals->remove_init(sig_q); module->connect(sig_q, val_init); return nullptr; } } - initvals->set_init(sig_q, val_init); + if (initvals) + initvals->set_init(sig_q, val_init); Cell *cell; if (!is_fine) { if (!has_d) { |