cores/gpio: add assertion on pads (has to be a Signal).

Due to the bi-directional nature of tristate, Cat is not supported (so also
not platform.request_all).
This commit is contained in:
Florent Kermarrec 2021-01-06 09:50:53 +01:00
parent 8109806609
commit 0984308318

View file

@ -45,6 +45,7 @@ class GPIOInOut(Module):
class GPIOTristate(Module, AutoCSR): class GPIOTristate(Module, AutoCSR):
def __init__(self, pads): def __init__(self, pads):
assert isinstance(pads, Signal)
nbits = len(pads) nbits = len(pads)
self._oe = CSRStorage(nbits, description="GPIO Tristate(s) Control.") self._oe = CSRStorage(nbits, description="GPIO Tristate(s) Control.")
self._in = CSRStatus(nbits, description="GPIO Input(s) Status.") self._in = CSRStatus(nbits, description="GPIO Input(s) Status.")