[Libre-soc-bugs] [Bug 50] nmigen pinmux

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Nov 19 20:41:46 GMT 2021


https://bugs.libre-soc.org/show_bug.cgi?id=50

--- Comment #42 from andrey at technepisteme.xyz ---
(In reply to Luke Kenneth Casson Leighton from comment #41)
> (In reply to andrey from comment #40)
> run it from the soc directory.
This fixed it for me. test_jtag_tap_srv.py now runs

> 
> (In reply to andrey from comment #39)
> 
> > Terminal 2:
> > - cd ~/src/soc/src/soc/debug/test/
> > - python3 test_jtag_tap.py
> 
> that's a (duplicate) stand-alone version.  notice the two
> simulation-processes:
> 
>     sim.add_sync_process(wrap(jtag_sim(dut))) # actual jtag tester
>     sim.add_sync_process(wrap(dmi_sim(dut)))  # handles (pretends to be) DMI
Ok, the jtag_sim tests the io connections, whereas the dmi_sim exercises the
DMI register interface?


Copied some of the code from test_jtag_tap_srv.py int testing_stage1.py.
https://git.libre-soc.org/?p=pinmux.git;a=blob;f=src/spec/testing_stage1.py;h=a55987cf488b72b2bab4159958a8c15eee673d37;hb=35ecdecc2bffea7b285ca0e166e89b640741641a

Code crashing:
Traceback (most recent call last):
  File "testing_stage1.py", line 447, in <module>
    sim = Simulator(top)
  File "/home/rohdo/src/nmigen/nmigen/sim/core.py", line 66, in __init__
    self._fragment = Fragment.get(fragment, platform=None).prepare()
  File "/home/rohdo/src/nmigen/nmigen/hdl/ir.py", line 37, in get
    obj = obj.elaborate(platform)
  File "testing_stage1.py", line 122, in elaborate
    print ("resources", platform.resources.items())
AttributeError: 'NoneType' object has no attribute 'resources'

For the simulation part of the code, I replaced any mention of "dut" with
top.jtag (as the sim invoked an instance of JTAG with the name "dut").

Honestly I've lost the plot, and going around in circles.
Done for today, I can't think properly.

Summary of what I understand:
-We need to write a program that takes a json pinset file and attaches the JTAG
boundary scan chain where appropriate (for I/O/OE GPIO). This is already kind
of working thanks to Luke's effort (although I barely understand the code).
-There needs to be a set of unit tests that check whether the generated logic
indeed adds a boundary scan chain. The plan is to leverage at least some of the
code from test_jtag_tap_srv.py.
So my guess is that IO needs to be driven manually, as well as by the JTAG
(hence the use of the server) to confirm functionality.
-Once the above are done, code needs to be expanded to support the rest of the
SoC's functions such as RGMII (which are basically GPIOs anyway)

What I don't understand:
-How to make a simulation for testing the Blinker block, given that it is
inside ASICPlatform.
-How to invoke the JTAG server code, without adding all the extra blocks (such
as SRAM) from the test_jtag_tap_srv.py
-What to do after the unit tests are working (not important atm, but useful for
overall picture)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list