frontend/axi/LiteDRAMAXI2NativeW: Decouple axi.w from axi.aw and allow buffering in w_buffer without waiting for cmd to be accepted.

This commit is contained in:
Florent Kermarrec 2022-02-15 17:27:51 +01:00
parent 5f722a1513
commit 72ca120fa0
1 changed files with 5 additions and 7 deletions

View File

@ -79,24 +79,22 @@ class LiteDRAMAXI2NativeW(Module):
# Command ----------------------------------------------------------------------------------
# Accept and send command to the controller only if:
# - Address & Data request are *both* valid.
# - Data buffer is not full.
# - Data buffer is not empty.
self.comb += [
self.cmd_request.eq(aw.valid & axi.w.valid & w_buffer.sink.ready),
self.cmd_request.eq(aw.valid & w_buffer.source.valid),
If(self.cmd_request & self.cmd_grant,
port.cmd.valid.eq(1),
port.cmd.we.eq(1),
port.cmd.addr.eq((aw.addr - base_address) >> ashift),
aw.ready.eq(port.cmd.ready),
axi.w.connect(w_buffer.sink, omit={"valid", "ready"}),
If(port.cmd.ready,
w_buffer.sink.valid.eq(1),
axi.w.ready.eq(1)
If(port.cmd.valid & port.cmd.ready,
aw.ready.eq(1),
)
)
]
# Write Data -------------------------------------------------------------------------------
self.comb += [
axi.w.connect(w_buffer.sink),
w_buffer.source.connect(port.wdata, omit={"strb", "id"}),
port.wdata.we.eq(w_buffer.source.strb)
]