frontend: remove geom/timing parameters from LiteDRAMPort since this prevent providing async or arbitraty length port easily
This commit is contained in:
parent
d7458a3c34
commit
9d2c8bf1cf
|
@ -73,12 +73,9 @@ class LiteDRAMInterface(Record):
|
|||
|
||||
|
||||
class LiteDRAMPort(Record):
|
||||
def __init__(self, aw, dw, cmd_buffer_depth=0, read_latency=0, write_latency=0):
|
||||
def __init__(self, aw, dw):
|
||||
self.aw = aw
|
||||
self.dw = dw
|
||||
self.cmd_buffer_depth = cmd_buffer_depth
|
||||
self.read_latency = read_latency
|
||||
self.write_latency = write_latency
|
||||
|
||||
layout = cmd_layout(aw) + data_layout(dw)
|
||||
Record.__init__(self, layout)
|
||||
|
|
|
@ -27,10 +27,7 @@ class LiteDRAMCrossbar(Module):
|
|||
if self.finalized:
|
||||
raise FinalizeError
|
||||
port = LiteDRAMPort(self.rca_bits + self.bank_bits,
|
||||
self.dw,
|
||||
self.cmd_buffer_depth,
|
||||
self.read_latency,
|
||||
self.write_latency)
|
||||
self.dw)
|
||||
self.masters.append(port)
|
||||
return port
|
||||
|
||||
|
|
|
@ -5,16 +5,12 @@ from litex.soc.interconnect import stream
|
|||
|
||||
|
||||
class LiteDRAMDMAReader(Module):
|
||||
def __init__(self, port, fifo_depth=None):
|
||||
def __init__(self, port, fifo_depth=16):
|
||||
self.sink = sink = stream.Endpoint([("address", port.aw)])
|
||||
self.source = source = stream.Endpoint([("data", port.dw)])
|
||||
self.busy = Signal()
|
||||
|
||||
# # #
|
||||
|
||||
if fifo_depth is None:
|
||||
fifo_depth = port.cmd_buffer_depth + port.read_latency + 2
|
||||
|
||||
# request issuance
|
||||
request_enable = Signal()
|
||||
request_issued = Signal()
|
||||
|
@ -39,10 +35,7 @@ class LiteDRAMDMAReader(Module):
|
|||
rsv_level.eq(rsv_level - 1)
|
||||
)
|
||||
]
|
||||
self.comb += [
|
||||
self.busy.eq(rsv_level != 0),
|
||||
request_enable.eq(rsv_level != fifo_depth)
|
||||
]
|
||||
self.comb += request_enable.eq(rsv_level != fifo_depth)
|
||||
|
||||
# FIFO
|
||||
fifo = SyncFIFO(port.dw, fifo_depth)
|
||||
|
@ -60,16 +53,12 @@ class LiteDRAMDMAReader(Module):
|
|||
|
||||
|
||||
class LiteDRAMDMAWriter(Module):
|
||||
def __init__(self, port, fifo_depth=None):
|
||||
def __init__(self, port, fifo_depth=16):
|
||||
self.sink = sink = stream.Endpoint([("address", port.aw),
|
||||
("data", port.dw)])
|
||||
self.busy = Signal()
|
||||
|
||||
# # #
|
||||
|
||||
if fifo_depth is None:
|
||||
fifo_depth = port.cmd_buffer_depth + port.write_latency + 2
|
||||
|
||||
fifo = SyncFIFO(port.dw, fifo_depth)
|
||||
self.submodules += fifo
|
||||
|
||||
|
@ -87,6 +76,5 @@ class LiteDRAMDMAWriter(Module):
|
|||
fifo.re.eq(1),
|
||||
port.wdata_we.eq(2**(port.dw//8)-1),
|
||||
port.wdata.eq(fifo.dout)
|
||||
),
|
||||
self.busy.eq(fifo.readable)
|
||||
)
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue