Change Net name merge policy in the Blif parser.

* Change: In CRL/BlifParser::Model::mergeAlias(), do not always merge the
    net2 with net1 (RHS with LHS of the ".name" instruction). This may
    result in a name change in the design interface (external net).
      Instead, merge any internal net with the external, so keep the
    external net name. If both are external, keep the one with the lower
    id (which should have been created first).
This commit is contained in:
Jean-Paul Chaput 2019-07-31 18:29:22 +02:00
parent 85e969bca9
commit 1359fe4ba6
1 changed files with 10 additions and 3 deletions

View File

@ -506,10 +506,17 @@ namespace {
Net* net2 = _cell->getNet( name2 );
if (net1 and (net1 == net2)) return net1;
if (net1 and net2) { net1->merge( net2 ); return net1; }
if (net1 and net2) {
if ( (not net1->isExternal() and net2->isExternal())
or ( net1->isExternal() and net2->isExternal() and (net1->getId() > net2->getId()) ) ) {
std::swap( net1 , net2 );
std::swap( name1, name2 );
}
net1->merge( net2 ); return net1;
}
if (net2) {
swap( net1 , net2 );
swap( name1, name2 );
std::swap( net1 , net2 );
std::swap( name1, name2 );
}
if (not net1) {