mirror of
https://github.com/YosysHQ/yosys
synced 2025-11-05 05:49:15 +00:00
Avoid unnecessary copying when applying a SigMap to a SigSpec
Currently we duplicate the `SigSpec` first and then iterate over the duplicate, updating its bits. Instead just generate new bits and add them to an empty `SigSpec`.
This commit is contained in:
parent
e49f9765a2
commit
f4617104b6
1 changed files with 7 additions and 3 deletions
|
|
@ -259,10 +259,14 @@ struct SigMapView
|
||||||
return bit;
|
return bit;
|
||||||
}
|
}
|
||||||
|
|
||||||
RTLIL::SigSpec operator()(RTLIL::SigSpec sig) const
|
RTLIL::SigSpec operator()(const RTLIL::SigSpec &sig) const
|
||||||
{
|
{
|
||||||
apply(sig);
|
RTLIL::SigSpec result;
|
||||||
return sig;
|
for (RTLIL::SigBit bit : sig) {
|
||||||
|
apply(bit);
|
||||||
|
result.append(bit);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
RTLIL::SigSpec operator()(RTLIL::Wire *wire) const
|
RTLIL::SigSpec operator()(RTLIL::Wire *wire) const
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue