Make forwarding-to-stores a config option

Signed-off-by: Eric Matthews <ematthew@sfu.ca>
This commit is contained in:
Eric Matthews 2023-01-30 20:31:39 -05:00
parent ff8b3f3f46
commit 4bada38942
6 changed files with 10 additions and 4 deletions

View file

@ -114,6 +114,7 @@ package cva5_config;
csr_config_t CSRS;
//Memory Options
int unsigned SQ_DEPTH;//CAM-based reasonable max of 4
bit INCLUDE_FORWARDING_TO_STORES;
//Caches
bit INCLUDE_ICACHE;
cache_config_t ICACHE;
@ -182,6 +183,7 @@ package cva5_config;
},
//Memory Options
SQ_DEPTH : 4,
INCLUDE_FORWARDING_TO_STORES : 1,
INCLUDE_ICACHE : 0,
ICACHE_ADDR : '{
L: 32'h80000000,

View file

@ -157,7 +157,7 @@ module load_store_unit
always_comb begin
uses_rs = '0;
uses_rs[RS1] = decode_stage.instruction inside {LB, LH, LW, LBU, LHU, SB, SH, SW};
uses_rs[RS2] = 0;//Store forwarding support //decode_stage.instruction inside {SB, SH, SW};
uses_rs[RS2] = CONFIG.INCLUDE_FORWARDING_TO_STORES ? 0 : decode_stage.instruction inside {SB, SH, SW};
uses_rd = decode_stage.instruction inside {LB, LH, LW, LBU, LHU};
end

View file

@ -205,8 +205,8 @@ module store_queue
logic [CONFIG.SQ_DEPTH-1:0] write_forward [2];
always_comb begin
for (int i = 0; i < CONFIG.SQ_DEPTH; i++) begin
write_forward[0][i] = {1'b1, wb_snoop_r[1].valid, wb_snoop_r[1].id} == {data_needed[i], 1'b1, id_needed[i]};
write_forward[1][i] = {1'b1, wb_snoop_r[2].valid, wb_snoop_r[2].id} == {data_needed[i], 1'b1, id_needed[i]};
write_forward[0][i] = CONFIG.INCLUDE_FORWARDING_TO_STORES & {1'b1, wb_snoop_r[1].valid, wb_snoop_r[1].id} == {data_needed[i], 1'b1, id_needed[i]};
write_forward[1][i] = CONFIG.INCLUDE_FORWARDING_TO_STORES & {1'b1, wb_snoop_r[2].valid, wb_snoop_r[2].id} == {data_needed[i], 1'b1, id_needed[i]};
end
end

View file

@ -103,6 +103,7 @@ module litex_wrapper
},
//Memory Options
SQ_DEPTH : 2,
INCLUDE_FORWARDING_TO_STORES : 0,
INCLUDE_ICACHE : 0,
ICACHE_ADDR : '{
L: 32'h40000000,
@ -204,6 +205,7 @@ module litex_wrapper
},
//Memory Options
SQ_DEPTH : 4,
INCLUDE_FORWARDING_TO_STORES : 1,
INCLUDE_ICACHE : 1,
ICACHE_ADDR : '{
L : 32'h00000000,

View file

@ -130,6 +130,7 @@ module cva5_sim
},
//Memory Options
SQ_DEPTH : 4,
INCLUDE_FORWARDING_TO_STORES : 1,
INCLUDE_ICACHE : 1,
ICACHE_ADDR : '{
L : 32'h80000000,

View file

@ -77,7 +77,7 @@ module nexys_wrapper
localparam cpu_config_t NEXYS_CONFIG = '{
//ISA options
INCLUDE_M_MODE : 0,
INCLUDE_M_MODE : 1,
INCLUDE_S_MODE : 0,
INCLUDE_U_MODE : 0,
INCLUDE_MUL : 1,
@ -104,6 +104,7 @@ module nexys_wrapper
},
//Memory Options
SQ_DEPTH : 4,
INCLUDE_FORWARDING_TO_STORES : 1,
INCLUDE_ICACHE : 1,
ICACHE_ADDR : '{
L : 32'h80000000,