mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-07 06:33:24 +00:00
Fix abc's remap_name to not ignore [^0-9] when extracting sid
This commit is contained in:
parent
9aa94370a5
commit
070a2d2fd6
1 changed files with 16 additions and 12 deletions
|
@ -331,19 +331,23 @@ std::string remap_name(RTLIL::IdString abc_name, RTLIL::Wire **orig_wire = nullp
|
||||||
{
|
{
|
||||||
std::string abc_sname = abc_name.substr(1);
|
std::string abc_sname = abc_name.substr(1);
|
||||||
if (abc_sname.substr(0, 5) == "ys__n") {
|
if (abc_sname.substr(0, 5) == "ys__n") {
|
||||||
int sid = std::stoi(abc_sname.substr(5));
|
|
||||||
bool inv = abc_sname.back() == 'v';
|
bool inv = abc_sname.back() == 'v';
|
||||||
for (auto sig : signal_list) {
|
if (inv) abc_sname.pop_back();
|
||||||
if (sig.id == sid && sig.bit.wire != nullptr) {
|
abc_sname.erase(0, 5);
|
||||||
std::stringstream sstr;
|
if (abc_sname.find_last_not_of("012345689") == std::string::npos) {
|
||||||
sstr << "$abc$" << map_autoidx << "$" << sig.bit.wire->name.substr(1);
|
int sid = std::stoi(abc_sname);
|
||||||
if (sig.bit.wire->width != 1)
|
for (auto sig : signal_list) {
|
||||||
sstr << "[" << sig.bit.offset << "]";
|
if (sig.id == sid && sig.bit.wire != nullptr) {
|
||||||
if (inv)
|
std::stringstream sstr;
|
||||||
sstr << "_inv";
|
sstr << "$abc$" << map_autoidx << "$" << sig.bit.wire->name.substr(1);
|
||||||
if (orig_wire != nullptr)
|
if (sig.bit.wire->width != 1)
|
||||||
*orig_wire = sig.bit.wire;
|
sstr << "[" << sig.bit.offset << "]";
|
||||||
return sstr.str();
|
if (inv)
|
||||||
|
sstr << "_inv";
|
||||||
|
if (orig_wire != nullptr)
|
||||||
|
*orig_wire = sig.bit.wire;
|
||||||
|
return sstr.str();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue