pipeline refactoring
This commit is contained in:
20
hw/rtl/cache/VX_bank.v
vendored
20
hw/rtl/cache/VX_bank.v
vendored
@@ -106,8 +106,8 @@ module VX_bank #(
|
||||
`ifdef DBG_CORE_REQ_INFO
|
||||
/* verilator lint_off UNUSED */
|
||||
wire[31:0] debug_use_pc_st0;
|
||||
wire[1:0] debug_wb_st0;
|
||||
wire[4:0] debug_rd_st0;
|
||||
wire[`WB_BITS-1:0] debug_wb_st0;
|
||||
wire[`NR_BITS-1:0] debug_rd_st0;
|
||||
wire[`NW_BITS-1:0] debug_warp_num_st0;
|
||||
wire debug_rw_st0;
|
||||
wire[WORD_SIZE-1:0] debug_byteen_st0;
|
||||
@@ -115,8 +115,8 @@ module VX_bank #(
|
||||
wire[`UP(CORE_TAG_ID_BITS)-1:0] debug_tagid_st0;
|
||||
|
||||
wire[31:0] debug_use_pc_st1e;
|
||||
wire[1:0] debug_wb_st1e;
|
||||
wire[4:0] debug_rd_st1e;
|
||||
wire[`WB_BITS-1:0] debug_wb_st1e;
|
||||
wire[`NR_BITS-1:0] debug_rd_st1e;
|
||||
wire[`NW_BITS-1:0] debug_warp_num_st1e;
|
||||
wire debug_rw_st1e;
|
||||
wire[WORD_SIZE-1:0] debug_byteen_st1e;
|
||||
@@ -124,8 +124,8 @@ module VX_bank #(
|
||||
wire[`UP(CORE_TAG_ID_BITS)-1:0] debug_tagid_st1e;
|
||||
|
||||
wire[31:0] debug_use_pc_st2;
|
||||
wire[1:0] debug_wb_st2;
|
||||
wire[4:0] debug_rd_st2;
|
||||
wire[`WB_BITS-1:0] debug_wb_st2;
|
||||
wire[`NR_BITS-1:0] debug_rd_st2;
|
||||
wire[`NW_BITS-1:0] debug_warp_num_st2;
|
||||
wire debug_rw_st2;
|
||||
wire[WORD_SIZE-1:0] debug_byteen_st2;
|
||||
@@ -370,7 +370,7 @@ module VX_bank #(
|
||||
.clk (clk),
|
||||
.reset (reset),
|
||||
.stall (stall_bank_pipe),
|
||||
.flush (1'b0),
|
||||
.flush (0),
|
||||
.in ({qual_is_mrvq_st0, qual_is_snp_st0, qual_snp_invalidate_st0, qual_going_to_write_st0, qual_valid_st0, qual_addr_st0, qual_wsel_st0, qual_writeword_st0, qual_inst_meta_st0, qual_is_fill_st0, qual_writedata_st0}),
|
||||
.out ({is_mrvq_st1[0] , is_snp_st1[0], snp_invalidate_st1[0], going_to_write_st1[0], valid_st1[0], addr_st1[0], wsel_st1[0], writeword_st1[0], inst_meta_st1[0], is_fill_st1[0], writedata_st1[0]})
|
||||
);
|
||||
@@ -383,7 +383,7 @@ module VX_bank #(
|
||||
.clk (clk),
|
||||
.reset (reset),
|
||||
.stall (stall_bank_pipe),
|
||||
.flush (1'b0),
|
||||
.flush (0),
|
||||
.in ({is_mrvq_st1[i-1], is_snp_st1[i-1], snp_invalidate_st1[i-1], going_to_write_st1[i-1], valid_st1[i-1], addr_st1[i-1], wsel_st1[i-1], writeword_st1[i-1], inst_meta_st1[i-1], is_fill_st1[i-1], writedata_st1[i-1]}),
|
||||
.out ({is_mrvq_st1[i] , is_snp_st1[i], snp_invalidate_st1[i], going_to_write_st1[i], valid_st1[i], addr_st1[i], wsel_st1[i], writeword_st1[i], inst_meta_st1[i], is_fill_st1[i], writedata_st1[i]})
|
||||
);
|
||||
@@ -512,7 +512,7 @@ module VX_bank #(
|
||||
.clk (clk),
|
||||
.reset (reset),
|
||||
.stall (stall_bank_pipe),
|
||||
.flush (1'b0),
|
||||
.flush (0),
|
||||
.in ({mrvq_recover_ready_state_st1e, is_mrvq_st1e_st2, mrvq_init_ready_state_st1e , snp_to_mrvq_st1e, is_snp_st1e, snp_invalidate_st1e, fill_saw_dirty_st1e, is_fill_st1[STAGE_1_CYCLES-1] , qual_valid_st1e_2, addr_st1e, wsel_st1[STAGE_1_CYCLES-1], writeword_st1[STAGE_1_CYCLES-1], readword_st1e, readdata_st1e, readtag_st1e, miss_st1e, dirty_st1e, dirtyb_st1e, inst_meta_st1[STAGE_1_CYCLES-1]}),
|
||||
.out ({mrvq_recover_ready_state_st2 , is_mrvq_st2 , mrvq_init_ready_state_unqual_st2, snp_to_mrvq_st2 , is_snp_st2 , snp_invalidate_st2, fill_saw_dirty_st2 , is_fill_st2 , valid_st2 , addr_st2 , wsel_st2, writeword_st2 , readword_st2 , readdata_st2 , readtag_st2 , miss_st2 , dirty_st2 , dirtyb_st2, inst_meta_st2 })
|
||||
);
|
||||
@@ -765,4 +765,4 @@ module VX_bank #(
|
||||
`SCOPE_ASSIGN(scope_bank_addr_st1, `LINE_TO_BYTE_ADDR(addr_st1e, BANK_ID));
|
||||
`SCOPE_ASSIGN(scope_bank_addr_st2, `LINE_TO_BYTE_ADDR(addr_st2, BANK_ID));
|
||||
|
||||
endmodule : VX_bank
|
||||
endmodule
|
||||
|
||||
4
hw/rtl/cache/VX_cache.v
vendored
4
hw/rtl/cache/VX_cache.v
vendored
@@ -130,8 +130,8 @@ module VX_cache #(
|
||||
`ifdef DBG_CORE_REQ_INFO
|
||||
/* verilator lint_off UNUSED */
|
||||
wire[31:0] debug_core_req_use_pc;
|
||||
wire[1:0] debug_core_req_wb;
|
||||
wire[4:0] debug_core_req_rd;
|
||||
wire[`WB_BITS-1:0] debug_core_req_wb;
|
||||
wire[`NR_BITS-1:0] debug_core_req_rd;
|
||||
wire[`NW_BITS-1:0] debug_core_req_warp_num;
|
||||
wire[`LOG2UP(CREQ_SIZE)-1:0] debug_core_req_idx;
|
||||
/* verilator lint_on UNUSED */
|
||||
|
||||
58
hw/rtl/cache/VX_cache_core_rsp_merge.v
vendored
58
hw/rtl/cache/VX_cache_core_rsp_merge.v
vendored
@@ -23,9 +23,9 @@ module VX_cache_core_rsp_merge #(
|
||||
output wire [NUM_BANKS-1:0] per_bank_core_rsp_ready,
|
||||
|
||||
// Core Writeback
|
||||
output reg [NUM_REQUESTS-1:0] core_rsp_valid,
|
||||
output reg [NUM_REQUESTS-1:0][`WORD_WIDTH-1:0] core_rsp_data,
|
||||
output reg [`CORE_REQ_TAG_COUNT-1:0][CORE_TAG_WIDTH-1:0] core_rsp_tag,
|
||||
output wire [NUM_REQUESTS-1:0] core_rsp_valid,
|
||||
output wire [NUM_REQUESTS-1:0][`WORD_WIDTH-1:0] core_rsp_data,
|
||||
output wire [`CORE_REQ_TAG_COUNT-1:0][CORE_TAG_WIDTH-1:0] core_rsp_tag,
|
||||
input wire core_rsp_ready
|
||||
);
|
||||
|
||||
@@ -41,47 +41,63 @@ module VX_cache_core_rsp_merge #(
|
||||
`UNUSED_PIN (grant_onehot)
|
||||
);
|
||||
|
||||
reg [NUM_BANKS-1:0] per_bank_core_rsp_pop_unqual;
|
||||
reg [NUM_REQUESTS-1:0] core_rsp_valid_unqual;
|
||||
reg [NUM_REQUESTS-1:0][`WORD_WIDTH-1:0] core_rsp_data_unqual;
|
||||
reg [`CORE_REQ_TAG_COUNT-1:0][CORE_TAG_WIDTH-1:0] core_rsp_tag_unqual;
|
||||
reg [NUM_BANKS-1:0] core_rsp_bank_select;
|
||||
|
||||
assign per_bank_core_rsp_ready = per_bank_core_rsp_pop_unqual & {NUM_BANKS{core_rsp_ready}};
|
||||
wire stall = ~core_rsp_ready;
|
||||
|
||||
integer i;
|
||||
|
||||
if (CORE_TAG_ID_BITS != 0) begin
|
||||
assign core_rsp_tag = per_bank_core_rsp_tag[main_bank_index];
|
||||
always @(*) begin
|
||||
core_rsp_valid = 0;
|
||||
core_rsp_data = 0;
|
||||
core_rsp_valid_unqual = 0;
|
||||
core_rsp_data_unqual = 0;
|
||||
core_rsp_tag_unqual = per_bank_core_rsp_tag[main_bank_index];
|
||||
for (i = 0; i < NUM_BANKS; i++) begin
|
||||
if (per_bank_core_rsp_valid[i]
|
||||
&& (per_bank_core_rsp_tag[i][CORE_TAG_ID_BITS-1:0] == per_bank_core_rsp_tag[main_bank_index][CORE_TAG_ID_BITS-1:0])) begin
|
||||
core_rsp_valid[per_bank_core_rsp_tid[i]] = 1;
|
||||
core_rsp_data[per_bank_core_rsp_tid[i]] = per_bank_core_rsp_data[i];
|
||||
per_bank_core_rsp_pop_unqual[i] = 1;
|
||||
core_rsp_valid_unqual[per_bank_core_rsp_tid[i]] = 1;
|
||||
core_rsp_data_unqual[per_bank_core_rsp_tid[i]] = per_bank_core_rsp_data[i];
|
||||
core_rsp_bank_select[i] = 1;
|
||||
end else begin
|
||||
per_bank_core_rsp_pop_unqual[i] = 0;
|
||||
core_rsp_bank_select[i] = 0;
|
||||
end
|
||||
end
|
||||
end
|
||||
end else begin
|
||||
always @(*) begin
|
||||
core_rsp_valid = 0;
|
||||
core_rsp_data = 0;
|
||||
core_rsp_tag = 0;
|
||||
core_rsp_valid_unqual = 0;
|
||||
core_rsp_data_unqual = 0;
|
||||
core_rsp_tag_unqual = 0;
|
||||
for (i = 0; i < NUM_BANKS; i++) begin
|
||||
if (per_bank_core_rsp_valid[i]
|
||||
&& !core_rsp_valid[per_bank_core_rsp_tid[i]]
|
||||
&& !core_rsp_valid_unqual[per_bank_core_rsp_tid[i]]
|
||||
&& ((main_bank_index == `BANK_BITS'(i))
|
||||
|| (per_bank_core_rsp_tid[i] != per_bank_core_rsp_tid[main_bank_index]))) begin
|
||||
core_rsp_valid[per_bank_core_rsp_tid[i]] = 1;
|
||||
core_rsp_data[per_bank_core_rsp_tid[i]] = per_bank_core_rsp_data[i];
|
||||
core_rsp_tag[per_bank_core_rsp_tid[i]] = per_bank_core_rsp_tag[i];
|
||||
per_bank_core_rsp_pop_unqual[i] = 1;
|
||||
core_rsp_valid_unqual[per_bank_core_rsp_tid[i]] = 1;
|
||||
core_rsp_data_unqual[per_bank_core_rsp_tid[i]] = per_bank_core_rsp_data[i];
|
||||
core_rsp_tag_unqual[per_bank_core_rsp_tid[i]] = per_bank_core_rsp_tag[i];
|
||||
core_rsp_bank_select[i] = 1;
|
||||
end else begin
|
||||
per_bank_core_rsp_pop_unqual[i] = 0;
|
||||
core_rsp_bank_select[i] = 0;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
VX_generic_register #(
|
||||
.N(NUM_REQUESTS + (NUM_REQUESTS *`WORD_WIDTH) + (`CORE_REQ_TAG_COUNT * CORE_TAG_WIDTH))
|
||||
) core_wb_reg (
|
||||
.clk (clk),
|
||||
.reset (reset),
|
||||
.stall (stall),
|
||||
.flush (0),
|
||||
.in ({core_rsp_valid_unqual, core_rsp_data_unqual, core_rsp_tag_unqual}),
|
||||
.out ({core_rsp_valid, core_rsp_data, core_rsp_tag})
|
||||
);
|
||||
|
||||
assign per_bank_core_rsp_ready = core_rsp_bank_select & {NUM_BANKS{~stall}};
|
||||
|
||||
endmodule
|
||||
|
||||
2
hw/rtl/cache/VX_snp_forwarder.v
vendored
2
hw/rtl/cache/VX_snp_forwarder.v
vendored
@@ -59,7 +59,7 @@ module VX_snp_forwarder #(
|
||||
assign sfq_push = snp_req_valid && !sfq_full && fwdout_ready;
|
||||
assign sfq_pop = snp_rsp_valid;
|
||||
|
||||
VX_indexable_queue #(
|
||||
VX_index_queue #(
|
||||
.DATAW (`LOG2UP(SNRQ_SIZE) + 1 +`DRAM_ADDR_WIDTH+SNP_REQ_TAG_WIDTH),
|
||||
.SIZE (SNRQ_SIZE)
|
||||
) snp_fwd_queue (
|
||||
|
||||
4
hw/rtl/cache/VX_tag_data_access.v
vendored
4
hw/rtl/cache/VX_tag_data_access.v
vendored
@@ -116,7 +116,7 @@ module VX_tag_data_access #(
|
||||
.clk (clk),
|
||||
.reset (reset),
|
||||
.stall (stall),
|
||||
.flush (1'b0),
|
||||
.flush (0),
|
||||
.in ({qual_read_valid_st1, qual_read_dirty_st1, qual_read_dirtyb_st1, qual_read_tag_st1, qual_read_data_st1}),
|
||||
.out ({read_valid_st1c[0], read_dirty_st1c[0], read_dirtyb_st1c[0], read_tag_st1c[0], read_data_st1c[0]})
|
||||
);
|
||||
@@ -129,7 +129,7 @@ module VX_tag_data_access #(
|
||||
.clk (clk),
|
||||
.reset (reset),
|
||||
.stall (stall),
|
||||
.flush (1'b0),
|
||||
.flush (0),
|
||||
.in ({read_valid_st1c[i-1], read_dirty_st1c[i-1], read_dirtyb_st1c[i-1], read_tag_st1c[i-1], read_data_st1c[i-1]}),
|
||||
.out ({read_valid_st1c[i], read_dirty_st1c[i], read_dirtyb_st1c[i], read_tag_st1c[i], read_data_st1c[i]})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user