From dc7c671da225e19f0dc0f442844807ba0a596134 Mon Sep 17 00:00:00 2001 From: Andrey Miroshnikov Date: Mon, 15 Nov 2021 18:18:24 +0000 Subject: [PATCH] Added get_input_output, will add diagram on wiki later. Demo hasn't used it yet. --- src/spec/testing_stage1.py | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/spec/testing_stage1.py b/src/spec/testing_stage1.py index 63955d8..067c218 100644 --- a/src/spec/testing_stage1.py +++ b/src/spec/testing_stage1.py @@ -293,15 +293,34 @@ class ASICPlatform(TemplatedPlatform): def get_input_output(self, pin, port, attrs, invert): self._check_feature("single-ended input/output", pin, attrs, valid_xdrs=(0,), valid_attrs=None) + print (" get_input_output", pin, "port", port, port.layout) - m = Module() + m = Module() + if pin.name in ['clk_0', 'rst_0']: # sigh + print("No JTAG chain in-between") + m.submodules += Instance("$tribuf", + p_WIDTH=pin.width, + i_EN=pin.oe, + i_A=self._invert_if(invert, pin.o), + o_Y=port, + ) + m.d.comb += pin.i.eq(self._invert_if(invert, port)) + return m + (res, pin, port, attrs) = self.padlookup[pin.name] + io = self.jtag.ios[pin.name] + print (" pad", res, pin, port, attrs) + print (" pin", pin.layout) + print (" jtag", io.core.layout, io.pad.layout) m.submodules += Instance("$tribuf", p_WIDTH=pin.width, - i_EN=pin.oe, - i_A=self._invert_if(invert, pin.o), + i_EN=io.pad.oe, + i_A=self._invert_if(invert, io.pad.o), o_Y=port, ) - m.d.comb += pin.i.eq(self._invert_if(invert, port)) + m.d.comb += io.pad.i.eq(self._invert_if(invert, port)) + m.d.comb += pin.i.eq(io.core.i) + m.d.comb += io.core.o.eq(pin.o) + m.d.comb += io.core.oe.eq(pin.oe) return m -- 2.30.2