From f71529d04c59a623c7aaa5b1470eedea93a57c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Thu, 14 Nov 2024 10:31:58 +0100 Subject: [PATCH] build: io: SDRIO/Tristate: check len after wrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit check len after wrap, because len won't work on int and bool. Signed-off-by: Fin Maaß --- litex/build/io.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litex/build/io.py b/litex/build/io.py index af8ecbcba5..8d59660bfb 100644 --- a/litex/build/io.py +++ b/litex/build/io.py @@ -84,7 +84,6 @@ 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) @@ -92,6 +91,7 @@ def __init__(self, i, o, clk=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 @@ -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