3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-12 04:03:45 +00:00

sigspec: swap disposable for benchmark

This commit is contained in:
Emil J. Tywoniak 2024-07-22 17:45:17 +02:00
parent 49f547782c
commit 5cf6223bf3

View file

@ -4034,12 +4034,14 @@ void RTLIL::SigSpec::unpack() const
cover("kernel.rtlil.sigspec.convert.unpack");
log_assert(that->bits_.empty());
std::vector<SigChunk> disposable;
that->bits_.reserve(that->width_);
for (auto &c : that->chunks_)
for (int i = 0; i < c.width; i++)
that->bits_.emplace_back(c, i);
that->chunks_.clear();
that->chunks_.swap(disposable);
that->hash_ = 0;
}