vram/VRAM: only expect a response on reads

The VRAMCore doesn't generate responses for writes, so demanding one here
deadlocks the port the first time it writes something.
This commit is contained in:
David Anderson 2024-09-14 16:40:14 -07:00
parent e021e7d356
commit 65d13a0e50
1 changed files with 5 additions and 2 deletions

View File

@ -44,9 +44,12 @@ module mkArbitratedVRAMServers(VRAMServer ram, MemArbiter#(n, VRAMAddr) arb, Vec
(* fire_when_enabled *)
rule submit (awaiting_response[1] matches tagged Invalid);
let port = arb.granted_port();
ram.request.put(requests[port].first);
let req = requests[port].first;
ram.request.put(req);
requests[port].deq();
awaiting_response[1] <= tagged Valid port;
// Only reads generate a response.
if (req.data matches tagged Invalid)
awaiting_response[1] <= tagged Valid port;
endrule
(* fire_when_enabled *)