This commit is contained in:
Stan Lee 2026-04-29 17:23:58 -07:00
parent 21a2a1b4f8
commit f6e6b4afef
1 changed files with 11 additions and 3 deletions

View File

@ -189,8 +189,16 @@ struct SplitcellsWorker
IdString slice_name;
if (blast) {
// Strip existing '[' or '.' from cell name
size_t bracket_pos = base_name.find_first_of('[.');
size_t bracket_pos = base_name.find_first_of("[.");
bool strip_reg = false;
if (bracket_pos != std::string::npos) {
// Check if we will strip off _reg suffix
size_t reg_pos = base_name.find("_reg");
if (reg_pos != std::string::npos && reg_pos > bracket_pos) {
base_name = base_name.substr(0, reg_pos);
strip_reg = true;
}
base_name = base_name.substr(0, bracket_pos);
}
@ -206,9 +214,9 @@ struct SplitcellsWorker
int bit_offset = user_index(slice_lsb);
// Concatenate struct attribute or wire index (ex: \Memory[0] -> [0]) to the bit offset
size_t bracket_pos = wire_name.find_first_of('[.');
size_t bracket_pos = wire_name.find_first_of("[.");
if (bracket_pos != std::string::npos) {
wire_indices = wire_name.substr(bracket_pos) + stringf(
wire_indices = wire_name.substr(bracket_pos) + (strip_reg ? "" : "_reg") + stringf(
"%c%d%c", format[0], bit_offset, format[1]);
} else { // no '[' or '.', so no concatenation using wire, use slice_lsb + name_lsb offset instead
wire_indices = stringf(