-from itertools import product
+from itertools import chain
import cocotb
from cocotb.clock import Clock
else:
raise ValueError(f"Unsupported pin type {self.type_}")
+ def data(self, val):
+ if self.type_ in (IOType.In, IOType.Out):
+ return [val]
+ elif self.type_ == IOType.TriOut:
+ return [1, val]
+ elif self.type_ == IOType.InTriOut:
+ return [val, 1, val]
+ else:
+ raise ValueError(f"Unsupported pin type {self.type_}")
+
def check(self, dut, val):
if self.type_ == IOType.In:
assert getattr(dut.test_issuer, f"{self.name}__core__i").value == val
yield jtag.reset()
+ dut._log.info("")
dut._log.info("Before scan")
log_pins(dut, pins)
yield jtag.load_ir([0, 0, 0, 0])
- yield jtag.shift_data([1])
+ data = chain(*(pin.data(i%2) for i, pin in enumerate(pins)))
+ yield jtag.shift_data(data)
+ dut._log.info("")
dut._log.info("After scan")
log_pins(dut, pins)
- pins[0].check(dut, 1)
yield jtag.reset()
+ dut._log.info("")
dut._log.info("After reset")
log_pins(dut, pins)
- pins[0].check(dut, 0)
@cocotb.test()