If init is 1'bx, do not add to dict as per @cliffordwolf

This commit is contained in:
Eddie Hung 2019-05-03 08:06:16 -07:00
parent fc349de033
commit e08df0c739
1 changed files with 2 additions and 1 deletions

View File

@ -102,7 +102,8 @@ struct DffinitPass : public Pass {
if (wire->attributes.count("\\init")) {
Const value = wire->attributes.at("\\init");
for (int i = 0; i < min(GetSize(value), GetSize(wire)); i++)
init_bits[sigmap(SigBit(wire, i))] = value[i];
if (value[i] != State::Sx)
init_bits[sigmap(SigBit(wire, i))] = value[i];
}
if (wire->port_output)
for (auto bit : sigmap(wire))