From 9d9ed4bfe37e3fd9319962b3a6c7a67fd7c2c47f Mon Sep 17 00:00:00 2001 From: Stan Lee Date: Thu, 30 Apr 2026 12:05:57 -0700 Subject: [PATCH] flatten VCD/RTL scope hierarchy --- passes/silimate/reg_rename.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/passes/silimate/reg_rename.cc b/passes/silimate/reg_rename.cc index 6a257e84e..ea202b8ad 100644 --- a/passes/silimate/reg_rename.cc +++ b/passes/silimate/reg_rename.cc @@ -64,7 +64,7 @@ struct RegRenameInstance { // Processes registers in a given module hierarchy // and renames to allow for correct register annotation - void process_registers(dict, RegInfo> &vcd_reg_widths) + void process_registers(dict &vcd_reg_widths) { if (debug) log("Processing registers in scope: %s (module: %s)\n", @@ -125,7 +125,7 @@ struct RegRenameInstance { // Lookup wire information from VCD std::string regName = RTLIL::unescape_id(wireName); - RegInfo regInfo = vcd_reg_widths[{vcd_scope, regName}]; + RegInfo regInfo = vcd_reg_widths[vcd_scope + "." + regName]; int wireWidth = regInfo.width; int wireOffset = regInfo.offset; @@ -219,7 +219,7 @@ struct RegRenameInstance { module->remove(wireRemoveCache); } - void process_all(dict, RegInfo> &vcd_reg_widths) + void process_all(dict &vcd_reg_widths) { process_registers(vcd_reg_widths); for (auto &it : children) @@ -281,7 +281,7 @@ struct RegRenamePass : public Pass { log_error("No top module found!\n"); // Extract pre-optimization signal widths from VCD file - dict, RegInfo> vcd_reg_widths; + dict vcd_reg_widths; if (!vcd_filename.empty()) { log("Reading VCD file: %s\n", vcd_filename.c_str()); try { @@ -327,7 +327,7 @@ struct RegRenamePass : public Pass { // Map the register's vcd scope and name to // its original width and offset for later lookup. signal_name = RTLIL::unescape_id(signal_name); - vcd_reg_widths[{vcd_scope, signal_name}] = {width, offset}; + vcd_reg_widths[vcd_scope + "." + signal_name] = {width, offset}; if (debug) log("Found signal '%s' in scope '%s' with range [%d:%d] (width %d)\n", signal_name.c_str(), vcd_scope.c_str(),