frontend/avalon: Remove cmd_fifo (not useful).

This commit is contained in:
Florent Kermarrec 2023-05-31 18:35:24 +02:00
parent 49f48130e7
commit a86bd6c3d0
1 changed files with 10 additions and 19 deletions

View File

@ -55,7 +55,6 @@ class LiteDRAMAvalonMM2Native(LiteXModule):
self.comb += address_offset.eq(base_address >> log2_int(port.data_width//8)) self.comb += address_offset.eq(base_address >> log2_int(port.data_width//8))
# Layouts. # Layouts.
cmd_layout = [("address", len(address))]
wdata_layout = [ wdata_layout = [
("data", avalon_data_width), ("data", avalon_data_width),
("byteenable", avalon_data_width//8), ("byteenable", avalon_data_width//8),
@ -136,34 +135,26 @@ class LiteDRAMAvalonMM2Native(LiteXModule):
wdata_fifo.source.ready.eq(port.wdata.ready), wdata_fifo.source.ready.eq(port.wdata.ready),
] ]
self.cmd_fifo = cmd_fifo = stream.SyncFIFO(cmd_layout, max_burst_length)
fsm.act("BURST_WRITE", fsm.act("BURST_WRITE",
# FIFO producer avalon.waitrequest.eq(1),
avalon.waitrequest.eq(~(cmd_fifo.sink.ready & wdata_fifo.sink.ready)), port.cmd.addr.eq(address),
cmd_fifo.sink.payload.address.eq(address), port.cmd.we.eq(1),
cmd_fifo.sink.valid.eq(avalon.write & ~avalon.waitrequest), port.cmd.valid.eq(avalon.write & wdata_fifo.sink.ready),
If(port.cmd.valid & port.cmd.ready,
If(avalon.write & (burst_count > 0), avalon.waitrequest.eq(0)
If(cmd_fifo.sink.ready & cmd_fifo.sink.valid, ),
If(burst_count > 0,
If(port.cmd.valid & port.cmd.ready,
NextValue(burst_count, burst_count - 1), NextValue(burst_count, burst_count - 1),
NextValue(address, address + burst_increment) NextValue(address, address + burst_increment)
) )
).Else( ).Else(
avalon.waitrequest.eq(1), avalon.waitrequest.eq(1),
# Wait for the FIFO to be empty # Wait for the FIFO to be empty
If((cmd_fifo.level == 0) & (wdata_fifo.level == 1) & port.wdata.ready, If((~port.cmd.valid) & (~wdata_fifo.source.valid),
NextState("START") NextState("START")
) )
), ),
# FIFO consumer
port.cmd.addr.eq(cmd_fifo.source.payload.address),
port.cmd.we.eq(port.cmd.valid),
port.cmd.valid.eq(cmd_fifo.source.valid & (0 < wdata_fifo.level)),
cmd_fifo.source.ready.eq(port.cmd.ready),
) )
fsm.act("BURST_READ", fsm.act("BURST_READ",