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

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Wed Dec 1 23:11:33 GMT 2021


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

--- Comment #62 from andrey at technepisteme.xyz ---
Created attachment 149
  --> https://bugs.libre-soc.org/attachment.cgi?id=149&action=edit
GPIO output counter test

Added the for loop needed to go through all permutations of the GPIO output
signal states (very satisfying screenshot).

Before adding oe and i testing, I wanted to add the python asserts so that the
test could do the work for me.
Here's the code:
for gpio_o_val in range(0, num_gpio_o_states):
    yield top.gpio_o_test.eq(gpio_o_val)
    yield Settle()
    yield # Move to the next clk cycle

    print(type(top.gpio.gpio0.o), type(gpios_pad.gpio0.o))
    print(top.gpio.gpio0.o, gpios_pad.gpio0.o)
    core_out = yield top.gpio.gpio0.o
    pad_out = yield gpios_pad.gpio0.o
    assert core_out == pad_out

I get a runtime TypeError at the "core_out" assignment:
Traceback (most recent call last):
  File "testing_stage1.py", line 554, in <module>
    sim.run()
  File "/home/rohdo/src/nmigen/nmigen/sim/core.py", line 165, in run
    while self.advance():
  File "/home/rohdo/src/nmigen/nmigen/sim/core.py", line 156, in advance
    return self._engine.advance()
  File "/home/rohdo/src/nmigen/nmigen/sim/pysim.py", line 319, in advance
    self._step()
  File "/home/rohdo/src/nmigen/nmigen/sim/pysim.py", line 308, in _step
    process.run()
  File "/home/rohdo/src/nmigen/nmigen/sim/_pycoro.py", line 123, in run
    self.coroutine.throw(exn)
  File "/home/rohdo/src/nmigen/nmigen/sim/core.py", line 90, in wrapper
    yield from process()
  File "/home/rohdo/src/nmutil/src/nmutil/util.py", line 53, in wrapper
    yield from process
  File "testing_stage1.py", line 532, in test_gpios
    core_out = yield top.gpio.gpio0.o
  File "/home/rohdo/src/nmigen/nmigen/sim/_pycoro.py", line 115, in run
    .format(command, self.src_loc()))
TypeError: Received unsupported command (rec gpio_0__gpio0__o o) from process
'testing_stage1.py:532'

Looks like I'm not using the gpio object correctly, something like that?
I also guessed their might be a ".value" attribute I could access, but there
isn't.
Can you clarify tomorrow as to what I'm missing here?

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


More information about the libre-soc-bugs mailing list