From 3bebe17e5d9e426445ee81e2502be9ae37784f8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelina=20Ko=C5=9Bcielnicka?= Date: Mon, 28 Mar 2022 16:14:56 +0200 Subject: [PATCH] kernel/mem: Only use FF init in read-first emu for mem with init --- kernel/mem.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/mem.cc b/kernel/mem.cc index 059f8f934..e5e855ef7 100644 --- a/kernel/mem.cc +++ b/kernel/mem.cc @@ -1633,7 +1633,10 @@ void Mem::emulate_read_first(FfInitVals *initvals) { ff_en.pol_clk = port.clk_polarity; ff_en.sig_d = compressed.first; ff_en.sig_q = new_en;; - ff_en.val_init = Const(State::S0, ff_en.width); + if (inits.empty()) + ff_en.val_init = Const(State::Sx, ff_en.width); + else + ff_en.val_init = Const(State::S0, ff_en.width); ff_en.emit(); port.data = new_data; port.addr = new_addr;