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

Added std::set<RTLIL::SigBit> to RTLIL::SigSpec conversion

This commit is contained in:
Clifford Wolf 2014-07-20 11:00:09 +02:00
parent efa7884026
commit e57db5e9b2
2 changed files with 11 additions and 3 deletions

View file

@ -1451,10 +1451,17 @@ RTLIL::SigSpec::SigSpec(RTLIL::SigBit bit, int width)
RTLIL::SigSpec::SigSpec(std::vector<RTLIL::SigBit> bits) RTLIL::SigSpec::SigSpec(std::vector<RTLIL::SigBit> bits)
{ {
chunks.reserve(bits.size()); this->width = 0;
for (auto &bit : bits) for (auto &bit : bits)
chunks.push_back(bit); append_bit(bit);
this->width = bits.size(); check();
}
RTLIL::SigSpec::SigSpec(std::set<RTLIL::SigBit> bits)
{
this->width = 0;
for (auto &bit : bits)
append_bit(bit);
check(); check();
} }

View file

@ -505,6 +505,7 @@ struct RTLIL::SigSpec {
SigSpec(RTLIL::State bit, int width = 1); SigSpec(RTLIL::State bit, int width = 1);
SigSpec(RTLIL::SigBit bit, int width = 1); SigSpec(RTLIL::SigBit bit, int width = 1);
SigSpec(std::vector<RTLIL::SigBit> bits); SigSpec(std::vector<RTLIL::SigBit> bits);
SigSpec(std::set<RTLIL::SigBit> bits);
void expand(); void expand();
void optimize(); void optimize();
RTLIL::SigSpec optimized() const; RTLIL::SigSpec optimized() const;