Skip to content

Commit

Permalink
build: io: SDRIO/Tristate: check len after wrap
Browse files Browse the repository at this point in the history
check len after wrap, because len won't work on int and bool.

Signed-off-by: Fin Maaß <[email protected]>
  • Loading branch information
maass-hamburg committed Nov 14, 2024
1 parent 5249e20 commit f71529d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions litex/build/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ def __init__(self, i, o, clk):

class SDRIO(Special):
def __init__(self, i, o, clk=None):
assert len(i) == len(o)
Special.__init__(self)
self.i = wrap(i)
self.o = wrap(o)
if clk is None:
clk = ClockSignal()
self.clk = wrap(clk)
self.clk_domain = None if not hasattr(clk, "cd") else clk.cd
assert len(self.i) == len(self.o)

def iter_expressions(self):
yield self, "i" , SPECIAL_INPUT
Expand Down Expand Up @@ -119,13 +119,13 @@ def __init__(self, io, o, oe, i, clk):

class SDRTristate(Special):
def __init__(self, io, o, oe, i, clk=None):
assert len(i) == len(o) == len(oe)
Special.__init__(self)
self.io = wrap(io)
self.o = wrap(o)
self.oe = wrap(oe)
self.i = wrap(i)
self.clk = wrap(clk) if clk is not None else ClockSignal()
assert len(self.i) == len(self.o) == len(self.oe)

def iter_expressions(self):
yield self, "io" , SPECIAL_INOUT
Expand Down

0 comments on commit f71529d

Please sign in to comment.