common: move tXXDController to common
This commit is contained in:
parent
fef4701a45
commit
bce411ec95
|
@ -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))
|
||||
)
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue