From 2c66557d2206e618ebc047b8eeb42fbd48f2cb82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Thu, 5 Dec 2024 16:20:20 +0100 Subject: [PATCH 1/2] portarcs: Fix for case of unused gates --- passes/cmds/portarcs.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/passes/cmds/portarcs.cc b/passes/cmds/portarcs.cc index 7a1d5497c26..b5d63c32e10 100644 --- a/passes/cmds/portarcs.cc +++ b/passes/cmds/portarcs.cc @@ -192,9 +192,11 @@ struct PortarcsPass : Pass { if (annotations.count(bit)) { // consistency check log_assert(annotations.at(bit)[0] == ((int) (intptr_t) bit.wire)); - - recycling.push_back(annotations.at(ordering[i])); + } else { + alloc_for_bit(bit); } + + recycling.push_back(annotations.at(ordering[i])); } log_debug("Allocated %lux%d\n", allocated.size(), inputs.size()); From f4f65493a18a6117d96f1119cd7d4a2ba8cf5d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Thu, 5 Dec 2024 16:28:48 +0100 Subject: [PATCH 2/2] portarcs: Fix confusing disconnected and zero-delay case --- passes/cmds/portarcs.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/passes/cmds/portarcs.cc b/passes/cmds/portarcs.cc index b5d63c32e10..a6ed75de3bd 100644 --- a/passes/cmds/portarcs.cc +++ b/passes/cmds/portarcs.cc @@ -203,7 +203,7 @@ struct PortarcsPass : Pass { for (auto bit : outputs) { int *p = annotations.at(canonical_bit(bit)); for (int i = 0; i < inputs.size(); i++) - p[i] = 0; + p[i] = -1; } for (int i = 0; i < ordering.size(); i++) {