show how to get the boundary scan information from the JSON file
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 1 Apr 2021 22:05:51 +0000 (23:05 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 1 Apr 2021 22:05:51 +0000 (23:05 +0100)
generated by "make mkpinpux" in soc

ls180/pre_pnr/test.py

index c73790b21e2deff627a21ce0a10787764c6dd38e..f86be15a5928edcbb363a18e3ad288491b0edac8 100644 (file)
@@ -7,10 +7,27 @@ from cocotb.binary import BinaryValue
 from c4m.cocotb.jtag.c4m_jtag import JTAG_Master
 from c4m.cocotb.jtag.c4m_jtag_svfcocotb import SVF_Executor
 
+from soc.config.pinouts import get_pinspecs
+from soc.debug.jtag import Pins
+
 #
 # Helper functions
 #
 
+def get_jtag_boundary():
+    """gets the list of information for jtag boundary scan
+    """
+    # currently only a subset of pins is enabled. nuisance
+    subset = ['uart',
+              # 'mtwi',  - disabled for now
+              'eint', 'gpio', 'mspi0',
+              # 'mspi1', - disabled for now
+              # 'pwm', 'sd0', - disabled for now
+               'sdr']
+    pins = Pins(get_pinspecs(subset=subset))
+    return pins
+
+
 def setup_sim(dut, *, clk_period, run):
     """Initialize CPU and setup clock"""
 
@@ -115,3 +132,10 @@ def idcode_run(dut):
 
     dut._log.info("IDCODE test completed")
 
+
+# demo / debug how to get boundary scan names. run "python3 test.py"
+if __name__ == '__main__':
+    pinouts = get_jtag_boundary()
+    for pin in pinouts:
+        # example: ('eint', '2', <IOType.In: 1>, 'eint_2', 125)
+        print (pin)