From 481d596c43d92d298eeb134692c9562c99d16f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Thu, 5 Dec 2024 16:16:57 +0100 Subject: [PATCH 1/2] abc9_ops -prep_box: Adjust for repeated invocation `abc9_ops -prep_box` command interprets the `abc9_box` attribute and prepares a .box file for ABC consumption. Previously this command was removing the attribute as it was processing each module which prevented repeated invocation of this command unless the box definitions were refreshed from a source file. Also the command was keeping existing `abc9_box_id` attributes instead of overwriting them with values from a new number sequence. Change both behaviors to allow repeated invocations of the command on the same design. --- passes/techmap/abc9_ops.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/passes/techmap/abc9_ops.cc b/passes/techmap/abc9_ops.cc index 378f29042b3..6c8319f9f2d 100644 --- a/passes/techmap/abc9_ops.cc +++ b/passes/techmap/abc9_ops.cc @@ -969,13 +969,10 @@ void prep_box(RTLIL::Design *design) if (it == module->attributes.end()) continue; bool box = it->second.as_bool(); - module->attributes.erase(it); if (!box) continue; auto r = module->attributes.insert(ID::abc9_box_id); - if (!r.second) - continue; r.first->second = abc9_box_id++; if (module->get_bool_attribute(ID::abc9_flop)) { From f3f8037328af023d0c1852e4a6c2afa9f2473f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Thu, 5 Dec 2024 16:19:55 +0100 Subject: [PATCH 2/2] abc9_ops: Allow no arcs on box w/o inputs or w/o outputs --- passes/techmap/abc9_ops.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/passes/techmap/abc9_ops.cc b/passes/techmap/abc9_ops.cc index 6c8319f9f2d..c4137c1c895 100644 --- a/passes/techmap/abc9_ops.cc +++ b/passes/techmap/abc9_ops.cc @@ -1093,8 +1093,9 @@ void prep_box(RTLIL::Design *design) ss << std::endl; auto &t = timing.setup_module(module); - if (t.comb.empty()) + if (t.comb.empty() && !outputs.empty() && !inputs.empty()) { log_error("Module '%s' with (* abc9_box *) has no timing (and thus no connectivity) information.\n", log_id(module)); + } for (const auto &o : outputs) { first = true;