Skip to content

Commit

Permalink
Fix xACK generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ricted98 committed Nov 22, 2024
1 parent 8a5903f commit 7650ca5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/cache_subsystem/axi_adapter.sv
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ module axi_adapter #(
// assert WACK the cycle after the BVALID/BREADY handshake is finished
wack_d = axi_req_o.b_ready & axi_resp_i.b_valid;
// assert RACK the cycle after the RVALID/RREADY handshake is finished
rack_d = axi_req_o.r_ready & axi_resp_i.r_valid;
rack_d = axi_req_o.r_ready & axi_resp_i.r_valid & axi_resp_i.r.last;
end

always_ff @(posedge clk_i or negedge rst_ni) begin
Expand Down
20 changes: 18 additions & 2 deletions core/cache_subsystem/std_cache_subsystem.sv
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ module std_cache_subsystem
);

assign axi_sort_req = {axi_req_icache, axi_req_bypass, axi_req_data};
assign axi_req_o.wack = axi_sort_req[w_select_arbiter].wack;

// Route responses based on ID
// 0000 -> I$
Expand Down Expand Up @@ -309,7 +308,15 @@ module std_cache_subsystem
.oup_ready_i({axi_req_icache.r_ready, axi_req_bypass.r_ready, axi_req_data.r_ready})
);

assign axi_req_o.rack = axi_sort_req[r_select].rack;
// RACK
logic [1:0] rack_select;

always_ff @(posedge clk_i or negedge rst_ni) begin
if (!rst_ni) rack_select <= '0;
else rack_select <= r_select;
end

assign axi_req_o.rack = axi_sort_req[rack_select].rack;

// B Channel
logic [1:0] b_select;
Expand Down Expand Up @@ -338,6 +345,15 @@ module std_cache_subsystem
.oup_ready_i({axi_req_icache.b_ready, axi_req_bypass.b_ready, axi_req_data.b_ready})
);

//WACK
logic [1:0] wack_select;

always_ff @(posedge clk_i or negedge rst_ni) begin
if (!rst_ni) wack_select <= '0;
else wack_select <= b_select;
end
assign axi_req_o.wack = axi_sort_req[wack_select].wack;

///////////////////////////////////////////////////////
// assertions
///////////////////////////////////////////////////////
Expand Down

0 comments on commit 7650ca5

Please sign in to comment.