get_ports for verilog \foo[0].bar

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2024-09-21 11:58:03 -07:00
parent d4f221970d
commit 7de907223b
1 changed files with 16 additions and 0 deletions

View File

@ -664,6 +664,11 @@ SdcNetwork::findPort(const Cell *cell,
port = network_->findPort(cell, escaped2.c_str());
}
}
else {
// Try escaping brackets foo\[0\].bar
string escaped = escapeBrackets(name, this);
port = network_->findPort(cell, escaped.c_str());
}
}
return port;
}
@ -694,6 +699,12 @@ SdcNetwork::findPortsMatching(const Cell *cell,
matches = network_->findPortsMatching(cell, &escaped_pattern2);
}
}
else {
// Try escaping brackets foo\[0\].bar
string escaped = escapeBrackets(pattern->pattern(), this);
PatternMatch escaped_pattern(escaped.c_str(), pattern);
matches = network_->findPortsMatching(cell, &escaped_pattern);
}
}
return matches;
}
@ -897,6 +908,11 @@ SdcNetwork::findPin(const Instance *instance,
pin = network_->findPin(instance, escaped2.c_str());
}
}
else {
// Try escaping port brackets foo\[0\].bar
string escaped = escapeBrackets(port_name, this);
pin = network_->findPin(instance, escaped.c_str());
}
}
return pin;
}