From a215ac7d8ba607abbcd82502a418e6a10622bdff Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 16 Aug 2018 15:32:29 +0200 Subject: [PATCH] core/multiplexer: fix count signal width (when max<2) --- litedram/core/multiplexer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litedram/core/multiplexer.py b/litedram/core/multiplexer.py index 7e232d7..fc3f4b5 100644 --- a/litedram/core/multiplexer.py +++ b/litedram/core/multiplexer.py @@ -125,7 +125,7 @@ class tXXDController(Module): # # # if txxd is not None: - count = Signal(max=txxd + 1) + count = Signal(max=max(txxd, 2)) self.sync += \ If(valid, count.eq(txxd - 1), @@ -149,7 +149,7 @@ class tFAWController(Module): # # # if tfaw is not None: - count = Signal(max=tfaw) + count = Signal(max=max(tfaw, 2)) window = Signal(tfaw) self.sync += window.eq(Cat(valid, window)) self.comb += count.eq(reduce(add, [window[i] for i in range(tfaw)]))