From e92998a79cec635270a350117eddb52c6232f388 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 12 Jul 2016 09:46:15 +0200 Subject: Minor bugfix in FSM reset state detection --- passes/fsm/fsm_extract.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'passes') diff --git a/passes/fsm/fsm_extract.cc b/passes/fsm/fsm_extract.cc index 95cb498e3..8a4ee3f26 100644 --- a/passes/fsm/fsm_extract.cc +++ b/passes/fsm/fsm_extract.cc @@ -92,12 +92,15 @@ static bool find_states(RTLIL::SigSpec sig, const RTLIL::SigSpec &dff_out, RTLIL if (reset_state && RTLIL::SigSpec(*reset_state).is_fully_undef()) do { + SigSpec new_reset_state; if (sig_aa.is_fully_def()) - *reset_state = sig_aa.as_const(); + new_reset_state = sig_aa.as_const(); else if (sig_bb.is_fully_def()) - *reset_state = sig_bb.as_const(); + new_reset_state = sig_bb.as_const(); else break; + new_reset_state.extend_u0(GetSize(*reset_state)); + *reset_state = new_reset_state.as_const(); log(" found reset state: %s (guessed from mux tree)\n", log_signal(*reset_state)); } while (0); -- cgit v1.2.3