From 423fd0d0fa5291b330a7c4490c3036b5ca46570f Mon Sep 17 00:00:00 2001 From: saaramahmoudi Date: Tue, 4 Nov 2025 11:34:45 -0800 Subject: [PATCH 1/2] fix the issue for pack pattern to recognize register connection --- vpr/src/pack/prepack.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vpr/src/pack/prepack.cpp b/vpr/src/pack/prepack.cpp index 9a16c49c0b..a26c53c011 100644 --- a/vpr/src/pack/prepack.cpp +++ b/vpr/src/pack/prepack.cpp @@ -1141,11 +1141,10 @@ static AtomBlockId get_sink_block(const AtomBlockId block_id, // Iterate through all sink blocks and check whether any of them // is compatible with the block specified in the pack pattern. bool connected_to_latch = false; - LogicalModelId latch_model_id = LogicalModels::MODEL_LATCH_ID; AtomBlockId pattern_sink_block_id = AtomBlockId::INVALID(); for (const auto& sink_pin_id : net_sinks) { auto sink_block_id = atom_nlist.pin_block(sink_pin_id); - if (atom_nlist.block_model(sink_block_id) == latch_model_id) { + if (!atom_nlist.block_is_combinational(sink_block_id)) { connected_to_latch = true; } if (primitive_type_feasible(sink_block_id, to_pb_type)) { From 4621cd311c6f70fe15b8bd5903220d6a8521297a Mon Sep 17 00:00:00 2001 From: saaramahmoudi Date: Tue, 4 Nov 2025 11:55:14 -0800 Subject: [PATCH 2/2] added a comment to explain the condition purpose --- vpr/src/pack/prepack.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vpr/src/pack/prepack.cpp b/vpr/src/pack/prepack.cpp index a26c53c011..9743d969fe 100644 --- a/vpr/src/pack/prepack.cpp +++ b/vpr/src/pack/prepack.cpp @@ -1144,6 +1144,8 @@ static AtomBlockId get_sink_block(const AtomBlockId block_id, AtomBlockId pattern_sink_block_id = AtomBlockId::INVALID(); for (const auto& sink_pin_id : net_sinks) { auto sink_block_id = atom_nlist.pin_block(sink_pin_id); + // If the sink block has a clock, it is considered stateful (e.g., a latch or flip-flop). + // Mark this so we can later decide whether to drop the block based on the net’s fanout. if (!atom_nlist.block_is_combinational(sink_block_id)) { connected_to_latch = true; }