From 6ad4918121f5e71b1e79f7289a9812a630bf0db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Tue, 3 Dec 2024 11:11:59 +0100 Subject: [PATCH] Account for pre-existing `keep_hierarchy` in cost sum --- passes/hierarchy/keep_hierarchy.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/passes/hierarchy/keep_hierarchy.cc b/passes/hierarchy/keep_hierarchy.cc index 61c66551b..bfae9fa38 100644 --- a/passes/hierarchy/keep_hierarchy.cc +++ b/passes/hierarchy/keep_hierarchy.cc @@ -37,6 +37,9 @@ struct ThresholdHierarchyKeeping { if (module->has_attribute(ID(gate_cost_equivalent))) return module->attributes[ID(gate_cost_equivalent)].as_int(); + if (module->has_attribute(ID(keep_hierarchy))) + return 0; + if (module->get_blackbox_attribute()) log_error("Missing cost information on instanced blackbox %s\n", log_id(module));