From f9aad606ca9c8f875ce3c3091daf465b73d3f513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelina=20Ko=C5=9Bcielnicka?= Date: Sat, 2 Oct 2021 00:42:36 +0200 Subject: simplemap: refactor to use FfData. --- kernel/ff.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'kernel') 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) { -- cgit v1.2.3