From: Staf Verhaegen Date: Fri, 2 Apr 2021 18:27:08 +0000 (+0200) Subject: Full boundary scan. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e0aed6302b8256c65616740656359d36cd5eac37;p=soc-cocotb-sim.git Full boundary scan. Show that *pad__oe are x when they are set by boundary scan to 1. Needs to be debugged. --- diff --git a/ls180/pre_pnr/test.py b/ls180/pre_pnr/test.py index bc0faff..8752043 100644 --- a/ls180/pre_pnr/test.py +++ b/ls180/pre_pnr/test.py @@ -1,4 +1,4 @@ -from itertools import product +from itertools import chain import cocotb from cocotb.clock import Clock @@ -48,6 +48,16 @@ class JTAGPin: 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 @@ -197,21 +207,23 @@ def boundary_scan(dut, *, jtag): 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()