resolving pin names (to litex ls180)
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 13 Apr 2021 16:38:55 +0000 (17:38 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 13 Apr 2021 16:38:55 +0000 (17:38 +0100)
ls180/pre_pnr/test.py

index dae23b5aed99331e426cdeac790da2d18726fd4a..cb1611c66064fd27bf60eb3cc65b5b192f575cc4 100644 (file)
@@ -10,7 +10,7 @@ from c4m.nmigen.jtag.tap import IOType
 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.config.pinouts import get_pinspecs, load_pinouts
 from soc.debug.jtag import Pins
 
 
@@ -40,9 +40,13 @@ class DUTWrapper:
 
 class JTAGPin:
     def __init__(self, pin):
+        self.pin = pin
         self.type_ = pin[2]
         self.name = pin[3]
 
+    def __repr__(self):
+        return str(self.pin)
+
     def log(self, wrap):
         if self.type_ == IOType.In:
             core_i = getattr(wrap.ti, f"{self.name}__core__i").value
@@ -287,7 +291,12 @@ def boundary_scan_reset(dut):
 
 # demo / debug how to get boundary scan names. run "python3 test.py"
 if __name__ == '__main__':
+    chip = load_pinouts()
+    pinmap = chip['litex.map']
     pinouts = get_jtag_boundary()
     for pin in pinouts:
-        # example: ('eint', '2', <IOType.In: 1>, 'eint_2', 125)
         print (pin)
+        # example: ('eint', '2', <IOType.In: 1>, 'eint_2', 125)
+        padname = pinmap[pin.pin[3]]
+        print ("    ", padname)
+