From 37aa2e6cd829b26acbc61a8ad7569fcc315b6251 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Wed, 12 Feb 2025 15:38:46 +0100 Subject: [PATCH] abstract: Wire vs port offset confusion bugfix This fixes the offsets_to_abstract collection in abstract_state so that it now works the same way as in abstract_value which was already correct. --- passes/cmds/abstract.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/passes/cmds/abstract.cc b/passes/cmds/abstract.cc index d0e1603ce..d07f19081 100644 --- a/passes/cmds/abstract.cc +++ b/passes/cmds/abstract.cc @@ -97,12 +97,14 @@ unsigned int abstract_state(Module* mod, EnableLogic enable) { for (auto ff : ffs) { // A bit inefficient std::set offsets_to_abstract; - for (auto bit : ff.sig_q) + for (int i = 0; i < GetSize(ff.sig_q); i++) { + SigBit bit = ff.sig_q[i]; if (selected_reps.count(sigmap(bit))) { log_debug("Abstracting state for bit %s due to selections:\n", log_signal(bit)); explain_selections(selected_reps.at(sigmap(bit))); - offsets_to_abstract.insert(bit.offset); + offsets_to_abstract.insert(i); } + } if (offsets_to_abstract.empty()) continue;