3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-24 16:12:33 +00:00

splitcells was the issue?

This commit is contained in:
Stan Lee 2026-04-29 17:07:50 -07:00
parent 550d48c417
commit 21a2a1b4f8
2 changed files with 12 additions and 22 deletions

View file

@ -108,16 +108,10 @@ struct RegRenameInstance {
size_t last_open = cellName.rfind('[');
size_t last_close = cellName.rfind(']');
if (last_open != std::string::npos && last_close != std::string::npos && last_close > last_open) {
// Check that bracket content is just a single bit index
std::string inner = cellName.substr(last_open + 1, last_close - last_open - 1);
if (!inner.empty() && inner.find_first_not_of("0123456789") == std::string::npos) {
wireName = cellName.substr(0, last_open);
bitIndex = std::stoi(inner);
} else {
wireName = cellName;
bitIndex = 0;
}
// Check that bracket content is just a single bit index
std::string inner = cellName.substr(last_open + 1, last_close - last_open - 1);
wireName = cellName.substr(0, last_open);
bitIndex = std::stoi(inner);
} else {
wireName = cellName;
bitIndex = 0;
@ -312,13 +306,9 @@ struct RegRenamePass : public Pass {
if (!signal_name.empty() && signal_name.back() == ']') {
size_t open = signal_name.rfind('[');
if (open != std::string::npos) {
std::string inner = signal_name.substr(open + 1,
signal_name.size() - open - 2);
// Check for alphabetical characters since they can be contained in brackets in a wire name.
if (!inner.empty() && inner.find_first_not_of("0123456789:") == std::string::npos) {
signal_bits = signal_name.substr(open);
signal_name.erase(open);
}
std::string inner = signal_name.substr(open + 1, signal_name.size() - open - 2);
signal_bits = signal_name.substr(open);
signal_name.erase(open);
}
}