Skip to content

Commit

Permalink
Cache Partitioning:
Browse files Browse the repository at this point in the history
Adjust instantiation of tagger for multi-core use case.
  • Loading branch information
DiyouS committed Sep 28, 2023
1 parent 7777f33 commit 8583261
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 34 deletions.
85 changes: 53 additions & 32 deletions hw/cheshire_soc.sv
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,8 @@ module cheshire_soc import cheshire_pkg::*; #(

assign intr.intn.bus_err.cores = core_bus_err_intr_comb;

axi_mst_req_t tagger_req;
axi_mst_rsp_t tagger_rsp;
axi_mst_req_t [AxiIn.num_in-1:0] tagger_req;
axi_mst_rsp_t [AxiIn.num_in-1:0] tagger_rsp;

for (genvar i = 0; i < NumIntHarts; i++) begin : gen_cva6_cores
axi_cva6_req_t core_out_req, core_ur_req;
Expand Down Expand Up @@ -749,40 +749,61 @@ module cheshire_soc import cheshire_pkg::*; #(
) i_axi_id_serialize (
.clk_i,
.rst_ni,
.slv_req_i ( core_ur_req ),
.slv_resp_o ( core_ur_rsp ),
.mst_req_o ( tagger_req ),
.mst_resp_i ( tagger_rsp )
// .mst_req_o ( axi_in_req[AxiIn.cores[i]] ),
// .mst_resp_i ( axi_in_rsp[AxiIn.cores[i]] )
.slv_req_i ( core_ur_req ),
.slv_resp_o ( core_ur_rsp ),
.mst_req_o ( tagger_req[i] ),
.mst_resp_i ( tagger_rsp[i] )
);

if (Cfg.LlcCachePartition) begin : gen_tagger

tagger #(
.DATA_WIDTH ( Cfg.AxiDataWidth ),
.ADDR_WIDTH ( Cfg.AddrWidth ),
.MAXPARTITION ( Cfg.LlcMaxPartition ),
.AXI_USER_ID_MSB ( Cfg.LlcUserAmoMsb ),
.AXI_USER_ID_LSB ( Cfg.LlcUserAmoLsb ),
.TAGGER_GRAN ( 3 ),
.axi_req_t ( axi_mst_req_t ),
.axi_rsp_t ( axi_mst_rsp_t ),
.reg_req_t ( reg_req_t ),
.reg_rsp_t ( reg_rsp_t )
) i_tagger (
.clk_i,
.rst_ni,
.slv_req_i ( tagger_req ),
.slv_rsp_o ( tagger_rsp ),
.mst_req_o ( axi_in_req[AxiIn.cores[i]] ),
.mst_rsp_i ( axi_in_rsp[AxiIn.cores[i]] ),
.cfg_req_i ( reg_out_req[RegOut.tagger] ),
.cfg_rsp_o ( reg_out_rsp[RegOut.tagger] )
);
if (i == 0) begin
tagger #(
.DATA_WIDTH ( Cfg.AxiDataWidth ),
.ADDR_WIDTH ( Cfg.AddrWidth ),
.MAXPARTITION ( Cfg.LlcMaxPartition ),
.AXI_USER_ID_MSB ( Cfg.LlcUserAmoMsb ),
.AXI_USER_ID_LSB ( Cfg.LlcUserAmoLsb ),
.TAGGER_GRAN ( 3 ),
.axi_req_t ( axi_mst_req_t ),
.axi_rsp_t ( axi_mst_rsp_t ),
.reg_req_t ( reg_req_t ),
.reg_rsp_t ( reg_rsp_t )
) i_tagger (
.clk_i,
.rst_ni,
.slv_req_i ( tagger_req[i] ),
.slv_rsp_o ( tagger_rsp[i] ),
.mst_req_o ( axi_in_req[AxiIn.cores[i]] ),
.mst_rsp_i ( axi_in_rsp[AxiIn.cores[i]] ),
.cfg_req_i ( reg_out_req[RegOut.tagger] ),
.cfg_rsp_o ( reg_out_rsp[RegOut.tagger] )
);
end else begin
tagger #(
.DATA_WIDTH ( Cfg.AxiDataWidth ),
.ADDR_WIDTH ( Cfg.AddrWidth ),
.MAXPARTITION ( Cfg.LlcMaxPartition ),
.AXI_USER_ID_MSB ( Cfg.LlcUserAmoMsb ),
.AXI_USER_ID_LSB ( Cfg.LlcUserAmoLsb ),
.TAGGER_GRAN ( 3 ),
.axi_req_t ( axi_mst_req_t ),
.axi_rsp_t ( axi_mst_rsp_t ),
.reg_req_t ( reg_req_t ),
.reg_rsp_t ( reg_rsp_t )
) i_tagger (
.clk_i,
.rst_ni,
.slv_req_i ( tagger_req[i] ),
.slv_rsp_o ( tagger_rsp[i] ),
.mst_req_o ( axi_in_req[AxiIn.cores[i]] ),
.mst_rsp_i ( axi_in_rsp[AxiIn.cores[i]] ),
.cfg_req_i ( reg_out_req[RegOut.tagger] ),
.cfg_rsp_o ( )
);
end
end else begin
assign axi_in_req[AxiIn.cores[i]] = tagger_req;
assign tagger_rsp = axi_in_rsp[AxiIn.cores[i]];
assign axi_in_req[AxiIn.cores[i]] = tagger_req[i];
assign tagger_rsp[i] = axi_in_rsp[AxiIn.cores[i]];
end
end

Expand Down
5 changes: 3 additions & 2 deletions sw/tests/helloworld.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ int main(void) {
*a = 1;

// Configure Tagger for partitioning
a = (0x0300a044); // set user signal to 1
*a = 1;

a = (0x0300a004); // set addr range from 0 to 0xffff_ffff
*a = (0xffffffff >> 2);
a = (0x0300a050); // set TOR mode
*a = 1;
a = (0x0300a044); // set user signal to 1
*a = 1;
a = (0x0300a000); // commit changes for tagger
*a = 1;

Expand Down

0 comments on commit 8583261

Please sign in to comment.