3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-09-13 13:11:27 +00:00

Update passes/tests to avoid bits()

This commit is contained in:
Robert O'Callahan 2025-08-28 03:54:00 +00:00
parent a8cc9202b9
commit bebd10377b

View file

@ -641,15 +641,16 @@ static void run_eval_test(RTLIL::Design *design, bool verbose, bool nosat, std::
if (!gold_wire->port_input) if (!gold_wire->port_input)
continue; continue;
RTLIL::Const in_value; RTLIL::Const::Builder in_value_builder(GetSize(gold_wire));
for (int i = 0; i < GetSize(gold_wire); i++) for (int i = 0; i < GetSize(gold_wire); i++)
in_value.bits().push_back(xorshift32(2) ? State::S1 : State::S0); in_value_builder.push_back(xorshift32(2) ? State::S1 : State::S0);
RTLIL::Const in_value = in_value_builder.build();
if (xorshift32(4) == 0) { if (xorshift32(4) == 0) {
int inv_chance = 1 + xorshift32(8); int inv_chance = 1 + xorshift32(8);
for (int i = 0; i < GetSize(gold_wire); i++) for (int i = 0; i < GetSize(gold_wire); i++)
if (xorshift32(inv_chance) == 0) if (xorshift32(inv_chance) == 0)
in_value.bits()[i] = RTLIL::Sx; in_value.set(i, RTLIL::Sx);
} }
if (verbose) if (verbose)