This adds support for assigning to individual bits in an array of bits, e.g.
# defined in io of DUT
IO = ["myBits", m.In(m.Bits[2])]
# in fault tester
test.circuit.myBits[0] = 1
In verilator, this is done in C using bit twiddling to clear the bit index, then or in the poke value for the bit. In system verilog this simply uses the standard index assignment logic. This requires an update to the name generation logic when we encounter a reference to an index in an array of bits:
in C, don't emit the index for the array element, instead emit the containing array, and the poke logic handles the bit assignment by replacing the original value with the bit twiddled value
in system verilog, emit the index as a subscript x[{index}] to refer to the desired bit position (normally we assume array indices are flattened out into the name, for general recursive arrays).
This adds support for assigning to individual bits in an array of bits, e.g.
In verilator, this is done in C using bit twiddling to clear the bit index, then or in the poke value for the bit. In system verilog this simply uses the standard index assignment logic. This requires an update to the name generation logic when we encounter a reference to an index in an array of bits:
x[{index}]
to refer to the desired bit position (normally we assume array indices are flattened out into the name, for general recursive arrays).