3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-07 01:54:10 +00:00

Added RTLIL::SigSpec::optimized() API

This commit is contained in:
Clifford Wolf 2014-01-03 02:43:31 +01:00
parent fb2bf934dc
commit eec2cd1e78
2 changed files with 8 additions and 0 deletions

View file

@ -1024,6 +1024,13 @@ void RTLIL::SigSpec::optimize()
check(); check();
} }
RTLIL::SigSpec RTLIL::SigSpec::optimized() const
{
RTLIL::SigSpec ret = *this;
ret.optimize();
return ret;
}
bool RTLIL::SigChunk::compare(const RTLIL::SigChunk &a, const RTLIL::SigChunk &b) bool RTLIL::SigChunk::compare(const RTLIL::SigChunk &a, const RTLIL::SigChunk &b)
{ {
if (a.wire != b.wire) { if (a.wire != b.wire) {

View file

@ -373,6 +373,7 @@ struct RTLIL::SigSpec {
SigSpec(std::vector<RTLIL::SigBit> bits); SigSpec(std::vector<RTLIL::SigBit> bits);
void expand(); void expand();
void optimize(); void optimize();
RTLIL::SigSpec optimized() const;
void sort(); void sort();
void sort_and_unify(); void sort_and_unify();
void replace(const RTLIL::SigSpec &pattern, const RTLIL::SigSpec &with); void replace(const RTLIL::SigSpec &pattern, const RTLIL::SigSpec &with);