From 88af059fad92631537c94b319ed2123224798351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Tue, 21 May 2024 14:56:15 +0200 Subject: [PATCH] bbox_derive: Fix `done` base type confusion --- passes/cmds/bbox_derive.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/passes/cmds/bbox_derive.cc b/passes/cmds/bbox_derive.cc index a35e9629058..e4fcb79637b 100644 --- a/passes/cmds/bbox_derive.cc +++ b/passes/cmds/bbox_derive.cc @@ -54,7 +54,7 @@ struct BboxDerivePass : Pass { log_cmd_error("Base module %s not found.\n", log_id(base_name)); } - dict, Module*> done; + dict>, Module*> done; for (auto module : d->selected_modules()) { for (auto cell : module->selected_cells()) { @@ -62,13 +62,15 @@ struct BboxDerivePass : Pass { if (!inst_module || !inst_module->get_blackbox_attribute()) continue; - if (cell->parameters.empty() || done.count(cell->parameters)) - continue; - Module *base = inst_module; if (base_override) base = base_override; + auto index = std::make_pair(base->name, cell->parameters); + + if (cell->parameters.empty() || done.count(index)) + continue; + IdString derived_type = base->derive(d, cell->parameters); Module *derived = d->module(derived_type); log_assert(derived && "Failed to derive module\n"); @@ -83,7 +85,7 @@ struct BboxDerivePass : Pass { d->rename(derived, new_name); } - done[cell->parameters] = derived; + done[index] = derived; } } }