mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 17:15:33 +00:00
Improved SigMap performance
This commit is contained in:
parent
e69efec588
commit
1e32e4bdae
3 changed files with 16 additions and 5 deletions
|
@ -985,6 +985,11 @@ public:
|
|||
parents[i] = -1;
|
||||
}
|
||||
|
||||
int lookup(const K &a) const
|
||||
{
|
||||
return ifind((*this)(a));
|
||||
}
|
||||
|
||||
const K &find(const K &a) const
|
||||
{
|
||||
return (*this)[ifind((*this)(a))];
|
||||
|
|
|
@ -253,18 +253,21 @@ struct SigMap
|
|||
|
||||
for (int i = 0; i < GetSize(from); i++)
|
||||
{
|
||||
RTLIL::SigBit bf = database.find(from[i]);
|
||||
RTLIL::SigBit bt = database.find(to[i]);
|
||||
int bfi = database.lookup(from[i]);
|
||||
int bti = database.lookup(to[i]);
|
||||
|
||||
const RTLIL::SigBit &bf = database[bfi];
|
||||
const RTLIL::SigBit &bt = database[bti];
|
||||
|
||||
if (bf.wire || bt.wire)
|
||||
{
|
||||
database.merge(bf, bt);
|
||||
database.imerge(bfi, bti);
|
||||
|
||||
if (bf.wire == nullptr)
|
||||
database.promote(bf);
|
||||
database.ipromote(bfi);
|
||||
|
||||
if (bt.wire == nullptr)
|
||||
database.promote(bt);
|
||||
database.ipromote(bti);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue