Skip to content

Commit

Permalink
[hardware] 🐛 Wait previous stores to be done before killing
Browse files Browse the repository at this point in the history
When an exception occurs on a store (e.g., page fault), the
store unit needs to wait until all the previous stores have been
ack on the b channel. This will bump the commit instruction correctly
and preserve consistency and memory ordering with CVA6 (we cannot
complete a store before receiving the ack from the memory system).
  • Loading branch information
mp-17 committed Jan 20, 2025
1 parent 3f768a2 commit 15b4265
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hardware/src/vlsu/vstu.sv
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,8 @@ module vstu import ara_pkg::*; import rvv_pkg::*; #(
////////////////////////

// Clear instruction from queue and data in case of exceptions from addrgen
if (vinsn_issue_valid && ((axi_addrgen_req_valid_i && axi_addrgen_req_i.is_exception) || addrgen_illegal_store_i)) begin : exception
// Wait until we have only one instruction to commit, i.e., the previous memory operations are over and have been successful (with an ack on the b channel)
if (vinsn_issue_valid && (vinsn_queue_q.commit_cnt == 1) && ((axi_addrgen_req_valid_i && axi_addrgen_req_i.is_exception) || addrgen_illegal_store_i)) begin : exception
// Bump issue counters and pointers of the vector instruction queue
vinsn_queue_d.issue_cnt -= 1;
issue_cnt_bytes_d = '0;
Expand Down

0 comments on commit 15b4265

Please sign in to comment.