From e0aed6302b8256c65616740656359d36cd5eac37 Mon Sep 17 00:00:00 2001 From: Staf Verhaegen Date: Fri, 2 Apr 2021 20:27:08 +0200 Subject: [PATCH] Full boundary scan. Show that *pad__oe are x when they are set by boundary scan to 1. Needs to be debugged. --- ls180/pre_pnr/test.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) 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() -- 2.30.2