From bce411ec9531972b2a30c8c1212af31a0ec89c79 Mon Sep 17 00:00:00 2001 From: John Sully Date: Wed, 10 Oct 2018 17:27:58 +0200 Subject: [PATCH] common: move tXXDController to common --- litedram/common.py | 24 ++++++++++++++++++++++++ litedram/core/multiplexer.py | 24 ------------------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/litedram/common.py b/litedram/common.py index 70f3a32..0f2cf2a 100644 --- a/litedram/common.py +++ b/litedram/common.py @@ -167,3 +167,27 @@ def cmd_request_rw_layout(a, ba): ("is_read", 1), ("is_write", 1) ] + + +class tXXDController(Module): + def __init__(self, txxd): + self.valid = valid = Signal() + self.ready = ready = Signal(reset=1) + ready.attr.add("no_retiming") + + # # # + + if txxd is not None: + count = Signal(max=max(txxd, 2)) + self.sync += \ + If(valid, + count.eq(txxd-1), + If((txxd - 1) == 0, + ready.eq(1) + ).Else( + ready.eq(0) + ) + ).Elif(~ready, + count.eq(count - 1), + If(count == 1, ready.eq(1)) + ) diff --git a/litedram/core/multiplexer.py b/litedram/core/multiplexer.py index ad2df22..b721202 100644 --- a/litedram/core/multiplexer.py +++ b/litedram/core/multiplexer.py @@ -133,30 +133,6 @@ class _Steerer(Module): ] -class tXXDController(Module): - def __init__(self, txxd): - self.valid = valid = Signal() - self.ready = ready = Signal(reset=1) - ready.attr.add("no_retiming") - - # # # - - if txxd is not None: - count = Signal(max=max(txxd, 2)) - self.sync += \ - If(valid, - count.eq(txxd-1), - If((txxd - 1) == 0, - ready.eq(1) - ).Else( - ready.eq(0) - ) - ).Elif(~ready, - count.eq(count - 1), - If(count == 1, ready.eq(1)) - ) - - class tFAWController(Module): def __init__(self, tfaw): self.valid = valid = Signal()