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

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Mon Nov 15 14:28:03 GMT 2021


--- Comment #27 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---

Andrey i have to say, "very much good luck working this out" :)

there are 4 things: they have to be wired together.  i have
no idea which it is, or which direction: that's down to you
to work out.  i am partially-dsylexic when it comes to these
things.  it could be:

comb += pin.i.eq(io.core.i)
comb += io.pad.i.eq(self._invert_if(invert, port))

it could be like that, it could be completely the other way round.

the 4 things needing connecting are:

* self._invert_if(invert, port)
* pin.i
* io.pad.i
* io.core.i

the existing code is:

    comb += pin.i.eq(self._invert_if(invert, port))

so that already tells you that it is going to be:

       comb += pin.i.eq(SOMETHING1)
       comb += SOMETHING2.eq(self._invert_if(invert, port)

this took 5 months for me to get completely wrong, but that was
because of litex.  hopefully with nmigen you will get "driver
conflict errors" immediately if you get it wrong the first time,
because, here, line 587, the wrong thing will conflict with this


 586             if conn._iotype == IOType.In:
 587                 m.d.comb += conn.core.i.eq(Mux(bd2core, io_bd[idx],

that, actually, should be enough to work out what to do.

once done set_input, set_output can also be done, and that really
should be all that's needed.  no need for the tristate ones.

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

More information about the libre-soc-bugs mailing list