From 7973b7d3611adfd63b015f34042b858f9b9848aa Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 12 Nov 2018 19:17:31 +0100 Subject: [PATCH] frontend/axi: emits the write command only if we have the write data --- litedram/frontend/axi.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/litedram/frontend/axi.py b/litedram/frontend/axi.py index 0a1ccaf..f278979 100644 --- a/litedram/frontend/axi.py +++ b/litedram/frontend/axi.py @@ -180,12 +180,15 @@ class LiteDRAMAXI2NativeW(Module): # Command self.comb += [ - self.cmd_request.eq(aw.valid & w_buffer.source.valid), - If(self.cmd_grant, - port.cmd.valid.eq(aw.valid & w_buffer.source.valid), - aw.ready.eq(port.cmd.ready), - port.cmd.we.eq(1), - port.cmd.addr.eq(aw.addr >> ashift) + # Emits the command only if we have the data + If(w_buffer.source.valid, + self.cmd_request.eq(aw.valid), + If(self.cmd_grant, + port.cmd.valid.eq(aw.valid), + aw.ready.eq(port.cmd.ready), + port.cmd.we.eq(1), + port.cmd.addr.eq(aw.addr >> ashift) + ) ) ]