3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-18 05:05:45 +00:00

Smallfixes

This commit is contained in:
Akash Levy 2025-11-11 23:50:04 -08:00
parent e21324d609
commit 950c619569
2 changed files with 8 additions and 8 deletions

View file

@ -5492,12 +5492,11 @@ bool RTLIL::SigSpec::is_mostly_const() const
{
cover("kernel.rtlil.sigspec.is_mostly_const");
pack();
int constbits = 0;
for (auto it = chunks_.begin(); it != chunks_.end(); it++)
if (it->width > 0 && it->wire == NULL)
constbits += it->width;
return (constbits > width_/2);
for (auto &chunk : chunks())
if (chunk.width > 0 && chunk.wire == NULL)
constbits += chunk.width;
return (constbits > size()/2);
}
bool RTLIL::SigSpec::known_driver() const