Skip to content

Commit

Permalink
axi_to_reg: Filter zero strobe writes
Browse files Browse the repository at this point in the history
  • Loading branch information
thommythomaso committed Aug 4, 2023
1 parent ddd6b3c commit f157980
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions hw/future/axi_to_reg_v2.sv
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ module axi_to_reg_v2 #(
logic [NumBanks-1:0] mem_err;

// sub reg buses
reg_req_t [NumBanks-1:0] reg_req;
reg_rsp_t [NumBanks-1:0] reg_rsp;
reg_req_t [NumBanks-1:0] reg_req, valid_req, zero_w_req;
reg_rsp_t [NumBanks-1:0] reg_rsp, valid_rsp, zero_w_rsp;

// convert to TCDM first
axi_to_detailed_mem #(
Expand Down Expand Up @@ -129,9 +129,29 @@ module axi_to_reg_v2 #(
.reg_req_o ( reg_req [i] ),
.reg_rsp_i ( reg_rsp [i] )
);

// filter zero strobe writes early, directly ack them
reg_demux #(
.NoPorts ( 32'd2 ),
.req_t ( reg_req_t ),
.rsp_t ( reg_rsp_t )
) i_reg_demux (
.clk_i,
.rst_ni,
.in_select_i ( reg_req[i].write & (reg_req[i].wstrb == '0) ),
.in_req_i ( reg_req[i] ),
.in_rsp_o ( reg_rsp[i] ),
.out_req_o ( {zero_w_req[i], valid_req[i]} ),
.out_rsp_i ( {zero_w_rsp[i], valid_rsp[i]} )
);

// ack zero strobe writes here
assign zero_w_rsp[i].ready = 1'b1;
assign zero_w_rsp[i].error = 1'b0;
assign zero_w_rsp[i].rdata = '0;
end

// arbitrate over sub buses
// arbitrate over valid accesses in sub buses
reg_mux #(
.NoPorts( NumBanks ),
.AW ( AxiAddrWidth ),
Expand All @@ -141,8 +161,8 @@ module axi_to_reg_v2 #(
) i_reg_mux (
.clk_i,
.rst_ni,
.in_req_i ( reg_req ),
.in_rsp_o ( reg_rsp ),
.in_req_i ( valid_req ),
.in_rsp_o ( valid_rsp ),
.out_req_o ( reg_req_o ),
.out_rsp_i ( reg_rsp_i )
);
Expand Down

0 comments on commit f157980

Please sign in to comment.