Skip to content

Commit

Permalink
define WtDcacheWbufDepth as cva6 parameter and fix rvfi.svh (#2040)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanRochCoulon committed Apr 15, 2024
1 parent e2401d3 commit e1ee77e
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 20 deletions.
1 change: 1 addition & 0 deletions core/include/build_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ package build_config_pkg;
cfg.DCACHE_MAX_TX = unsigned'(2 ** CVA6Cfg.MemTidWidth);

cfg.DATA_USER_EN = CVA6Cfg.DataUserEn;
cfg.WtDcacheWbufDepth = CVA6Cfg.WtDcacheWbufDepth;
cfg.FETCH_USER_WIDTH = CVA6Cfg.FetchUserWidth;
cfg.FETCH_USER_EN = CVA6Cfg.FetchUserEn;
cfg.AXI_USER_EN = CVA6Cfg.DataUserEn | CVA6Cfg.FetchUserEn;
Expand Down
3 changes: 3 additions & 0 deletions core/include/config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ package config_pkg;
int unsigned DcacheLineWidth;
// User field on data bus enable
int unsigned DataUserEn;
// Write-through data cache write buffer depth
int unsigned WtDcacheWbufDepth;
// User field on fetch bus enable
int unsigned FetchUserEn;
// Width of fetch user field
Expand Down Expand Up @@ -293,6 +295,7 @@ package config_pkg;
int unsigned DCACHE_MAX_TX;

int unsigned DATA_USER_EN;
int unsigned WtDcacheWbufDepth;
int unsigned FETCH_USER_WIDTH;
int unsigned FETCH_USER_EN;
bit AXI_USER_EN;
Expand Down
1 change: 1 addition & 0 deletions core/include/cv32a60x_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ package cva6_config_pkg;
DcacheSetAssoc: unsigned'(CVA6ConfigDcacheSetAssoc),
DcacheLineWidth: unsigned'(CVA6ConfigDcacheLineWidth),
DataUserEn: unsigned'(CVA6ConfigDataUserEn),
WtDcacheWbufDepth: int'(CVA6ConfigWtDcacheWbufDepth),
FetchUserWidth: unsigned'(CVA6ConfigFetchUserWidth),
FetchUserEn: unsigned'(CVA6ConfigFetchUserEn),
InstrTlbEntries: int'(CVA6ConfigInstrTlbEntries),
Expand Down
12 changes: 5 additions & 7 deletions core/include/cv32a65x_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ package cva6_config_pkg;

localparam CVA6ConfigXlen = 32;

localparam CVA6ConfigCvxifEn = 1; // RVFI.svh
localparam CVA6ConfigBExtEn = 1; // UVM
localparam CVA6ConfigVExtEn = 0; // RVFI.svh
localparam CVA6ConfigNrCommitPorts = 1; // RVFI.svh and UVM
localparam CVA6ConfigNrCommitPorts = 1; // UVM
localparam CVA6ConfigRvfiTrace = 1;

localparam CVA6ConfigAxiIdWidth = 4; // axi_pkg.sv
Expand All @@ -27,8 +25,7 @@ package cva6_config_pkg;
localparam CVA6ConfigDcacheSetAssoc = 8; // hpdcache
localparam CVA6ConfigDcacheLineWidth = 128; // hpdcache
localparam CVA6ConfigNrLoadBufEntries = 1; // hpdcache

localparam CVA6ConfigWtDcacheWbufDepth = 2; // new param
localparam CVA6ConfigWtDcacheWbufDepth = 2; // hpdcache

localparam CVA6ConfigSuperscalarEn = 0; // superscalar

Expand All @@ -53,13 +50,13 @@ package cva6_config_pkg;
XF8: bit'(0),
RVA: bit'(0),
RVB: bit'(CVA6ConfigBExtEn),
RVV: bit'(CVA6ConfigVExtEn),
RVV: bit'(0),
RVC: bit'(1),
RVH: bit'(0),
RVZCB: bit'(1),
RVZCMP: bit'(0),
XFVec: bit'(0),
CvxifEn: bit'(CVA6ConfigCvxifEn),
CvxifEn: bit'(1),
RVZiCond: bit'(0),
NrScoreboardEntries: unsigned'(CVA6ConfigNrScoreboardEntries),
PerfCounterEn: bit'(0),
Expand Down Expand Up @@ -98,6 +95,7 @@ package cva6_config_pkg;
DcacheSetAssoc: unsigned'(CVA6ConfigDcacheSetAssoc),
DcacheLineWidth: unsigned'(CVA6ConfigDcacheLineWidth),
DataUserEn: unsigned'(0),
WtDcacheWbufDepth: int'(2),
FetchUserWidth: unsigned'(32),
FetchUserEn: unsigned'(0),
InstrTlbEntries: int'(CVA6ConfigInstrTlbEntries),
Expand Down
1 change: 1 addition & 0 deletions core/include/cv32a6_embedded_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ package cva6_config_pkg;
DcacheSetAssoc: unsigned'(CVA6ConfigDcacheSetAssoc),
DcacheLineWidth: unsigned'(CVA6ConfigDcacheLineWidth),
DataUserEn: unsigned'(CVA6ConfigDataUserEn),
WtDcacheWbufDepth: int'(CVA6ConfigWtDcacheWbufDepth),
FetchUserWidth: unsigned'(CVA6ConfigFetchUserWidth),
FetchUserEn: unsigned'(CVA6ConfigFetchUserEn),
InstrTlbEntries: int'(CVA6ConfigInstrTlbEntries),
Expand Down
1 change: 1 addition & 0 deletions core/include/cv32a6_ima_sv32_fpga_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ package cva6_config_pkg;
DcacheSetAssoc: unsigned'(CVA6ConfigDcacheSetAssoc),
DcacheLineWidth: unsigned'(CVA6ConfigDcacheLineWidth),
DataUserEn: unsigned'(CVA6ConfigDataUserEn),
WtDcacheWbufDepth: int'(CVA6ConfigWtDcacheWbufDepth),
FetchUserWidth: unsigned'(CVA6ConfigFetchUserWidth),
FetchUserEn: unsigned'(CVA6ConfigFetchUserEn),
InstrTlbEntries: int'(CVA6ConfigInstrTlbEntries),
Expand Down
1 change: 1 addition & 0 deletions core/include/cv32a6_imac_sv0_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ package cva6_config_pkg;
DcacheSetAssoc: unsigned'(CVA6ConfigDcacheSetAssoc),
DcacheLineWidth: unsigned'(CVA6ConfigDcacheLineWidth),
DataUserEn: unsigned'(CVA6ConfigDataUserEn),
WtDcacheWbufDepth: int'(CVA6ConfigWtDcacheWbufDepth),
FetchUserWidth: unsigned'(CVA6ConfigFetchUserWidth),
FetchUserEn: unsigned'(CVA6ConfigFetchUserEn),
InstrTlbEntries: int'(CVA6ConfigInstrTlbEntries),
Expand Down
1 change: 1 addition & 0 deletions core/include/cv32a6_imac_sv32_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ package cva6_config_pkg;
DcacheSetAssoc: unsigned'(CVA6ConfigDcacheSetAssoc),
DcacheLineWidth: unsigned'(CVA6ConfigDcacheLineWidth),
DataUserEn: unsigned'(CVA6ConfigDataUserEn),
WtDcacheWbufDepth: int'(CVA6ConfigWtDcacheWbufDepth),
FetchUserWidth: unsigned'(CVA6ConfigFetchUserWidth),
FetchUserEn: unsigned'(CVA6ConfigFetchUserEn),
InstrTlbEntries: int'(CVA6ConfigInstrTlbEntries),
Expand Down
1 change: 1 addition & 0 deletions core/include/cv32a6_imafc_sv32_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ package cva6_config_pkg;
DcacheLineWidth: unsigned'(CVA6ConfigDcacheLineWidth),
DCacheType: CVA6ConfigDcacheType,
DataUserEn: unsigned'(CVA6ConfigDataUserEn),
WtDcacheWbufDepth: int'(CVA6ConfigWtDcacheWbufDepth),
FetchUserWidth: unsigned'(CVA6ConfigFetchUserWidth),
FetchUserEn: unsigned'(CVA6ConfigFetchUserEn),
InstrTlbEntries: int'(CVA6ConfigInstrTlbEntries),
Expand Down
1 change: 1 addition & 0 deletions core/include/cv64a6_imadfcv_sv39_polara_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ package cva6_config_pkg;
DcacheSetAssoc: unsigned'(CVA6ConfigDcacheSetAssoc),
DcacheLineWidth: unsigned'(CVA6ConfigDcacheLineWidth),
DataUserEn: unsigned'(CVA6ConfigDataUserEn),
WtDcacheWbufDepth: int'(CVA6ConfigWtDcacheWbufDepth),
FetchUserWidth: unsigned'(CVA6ConfigFetchUserWidth),
FetchUserEn: unsigned'(CVA6ConfigFetchUserEn),
InstrTlbEntries: int'(CVA6ConfigInstrTlbEntries),
Expand Down
1 change: 1 addition & 0 deletions core/include/cv64a6_imafdc_sv39_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ package cva6_config_pkg;
DcacheSetAssoc: unsigned'(CVA6ConfigDcacheSetAssoc),
DcacheLineWidth: unsigned'(CVA6ConfigDcacheLineWidth),
DataUserEn: unsigned'(CVA6ConfigDataUserEn),
WtDcacheWbufDepth: int'(CVA6ConfigWtDcacheWbufDepth),
FetchUserWidth: unsigned'(CVA6ConfigFetchUserWidth),
FetchUserEn: unsigned'(CVA6ConfigFetchUserEn),
InstrTlbEntries: int'(CVA6ConfigInstrTlbEntries),
Expand Down
1 change: 1 addition & 0 deletions core/include/cv64a6_imafdc_sv39_hpdcache_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ package cva6_config_pkg;
DcacheSetAssoc: unsigned'(CVA6ConfigDcacheSetAssoc),
DcacheLineWidth: unsigned'(CVA6ConfigDcacheLineWidth),
DataUserEn: unsigned'(CVA6ConfigDataUserEn),
WtDcacheWbufDepth: int'(CVA6ConfigWtDcacheWbufDepth),
FetchUserWidth: unsigned'(CVA6ConfigFetchUserWidth),
FetchUserEn: unsigned'(CVA6ConfigFetchUserEn),
InstrTlbEntries: int'(CVA6ConfigInstrTlbEntries),
Expand Down
1 change: 1 addition & 0 deletions core/include/cv64a6_imafdc_sv39_openpiton_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ package cva6_config_pkg;
DcacheSetAssoc: unsigned'(CVA6ConfigDcacheSetAssoc),
DcacheLineWidth: unsigned'(CVA6ConfigDcacheLineWidth),
DataUserEn: unsigned'(CVA6ConfigDataUserEn),
WtDcacheWbufDepth: int'(CVA6ConfigWtDcacheWbufDepth),
FetchUserWidth: unsigned'(CVA6ConfigFetchUserWidth),
FetchUserEn: unsigned'(CVA6ConfigFetchUserEn),
InstrTlbEntries: int'(CVA6ConfigInstrTlbEntries),
Expand Down
1 change: 1 addition & 0 deletions core/include/cv64a6_imafdc_sv39_wb_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ package cva6_config_pkg;
DcacheSetAssoc: unsigned'(CVA6ConfigDcacheSetAssoc),
DcacheLineWidth: unsigned'(CVA6ConfigDcacheLineWidth),
DataUserEn: unsigned'(CVA6ConfigDataUserEn),
WtDcacheWbufDepth: int'(CVA6ConfigWtDcacheWbufDepth),
FetchUserWidth: unsigned'(CVA6ConfigFetchUserWidth),
FetchUserEn: unsigned'(CVA6ConfigFetchUserEn),
InstrTlbEntries: int'(CVA6ConfigInstrTlbEntries),
Expand Down
1 change: 1 addition & 0 deletions core/include/cv64a6_imafdcv_sv39_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ package cva6_config_pkg;
DcacheSetAssoc: unsigned'(CVA6ConfigDcacheSetAssoc),
DcacheLineWidth: unsigned'(CVA6ConfigDcacheLineWidth),
DataUserEn: unsigned'(CVA6ConfigDataUserEn),
WtDcacheWbufDepth: int'(CVA6ConfigWtDcacheWbufDepth),
FetchUserWidth: unsigned'(CVA6ConfigFetchUserWidth),
FetchUserEn: unsigned'(CVA6ConfigFetchUserEn),
DCacheType: CVA6ConfigDcacheType,
Expand Down
22 changes: 11 additions & 11 deletions core/include/rvfi_types.svh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
// RVFI PROBES
`define RVFI_PROBES_INSTR_T(Cfg) struct packed { \
logic [Cfg.TRANS_ID_BITS-1:0] issue_pointer; \
logic [cva6_config_pkg::CVA6ConfigNrCommitPorts-1:0][Cfg.TRANS_ID_BITS-1:0] commit_pointer; \
logic [Cfg.NrCommitPorts-1:0][Cfg.TRANS_ID_BITS-1:0] commit_pointer; \
logic flush_unissued_instr; \
logic decoded_instr_valid; \
logic decoded_instr_ack; \
Expand All @@ -105,25 +105,25 @@
logic is_compressed; \
logic [Cfg.XLEN-1:0] rs1_forwarding; \
logic [Cfg.XLEN-1:0] rs2_forwarding; \
logic [cva6_config_pkg::CVA6ConfigNrCommitPorts-1:0][Cfg.VLEN-1:0] commit_instr_pc; \
ariane_pkg::fu_op [cva6_config_pkg::CVA6ConfigNrCommitPorts-1:0] commit_instr_op; \
logic [cva6_config_pkg::CVA6ConfigNrCommitPorts-1:0][ariane_pkg::REG_ADDR_SIZE-1:0] commit_instr_rs1; \
logic [cva6_config_pkg::CVA6ConfigNrCommitPorts-1:0][ariane_pkg::REG_ADDR_SIZE-1:0] commit_instr_rs2; \
logic [cva6_config_pkg::CVA6ConfigNrCommitPorts-1:0][ariane_pkg::REG_ADDR_SIZE-1:0] commit_instr_rd; \
logic [cva6_config_pkg::CVA6ConfigNrCommitPorts-1:0][Cfg.XLEN-1:0] commit_instr_result; \
logic [cva6_config_pkg::CVA6ConfigNrCommitPorts-1:0] commit_instr_valid; \
logic [Cfg.NrCommitPorts-1:0][Cfg.VLEN-1:0] commit_instr_pc; \
ariane_pkg::fu_op [Cfg.NrCommitPorts-1:0] commit_instr_op; \
logic [Cfg.NrCommitPorts-1:0][ariane_pkg::REG_ADDR_SIZE-1:0] commit_instr_rs1; \
logic [Cfg.NrCommitPorts-1:0][ariane_pkg::REG_ADDR_SIZE-1:0] commit_instr_rs2; \
logic [Cfg.NrCommitPorts-1:0][ariane_pkg::REG_ADDR_SIZE-1:0] commit_instr_rd; \
logic [Cfg.NrCommitPorts-1:0][Cfg.XLEN-1:0] commit_instr_result; \
logic [Cfg.NrCommitPorts-1:0] commit_instr_valid; \
logic [Cfg.XLEN-1:0] ex_commit_cause; \
logic ex_commit_valid; \
riscv::priv_lvl_t priv_lvl; \
logic [Cfg.VLEN-1:0] lsu_ctrl_vaddr; \
ariane_pkg::fu_t lsu_ctrl_fu; \
logic [(Cfg.XLEN/8)-1:0] lsu_ctrl_be; \
logic [Cfg.TRANS_ID_BITS-1:0] lsu_ctrl_trans_id; \
logic [((cva6_config_pkg::CVA6ConfigCvxifEn || cva6_config_pkg::CVA6ConfigVExtEn) ? 5 : 4)-1:0][Cfg.XLEN-1:0] wbdata; \
logic [cva6_config_pkg::CVA6ConfigNrCommitPorts-1:0] commit_ack; \
logic [((Cfg.CvxifEn || Cfg.RVV) ? 5 : 4)-1:0][Cfg.XLEN-1:0] wbdata; \
logic [Cfg.NrCommitPorts-1:0] commit_ack; \
logic [Cfg.PLEN-1:0] mem_paddr; \
logic debug_mode; \
logic [cva6_config_pkg::CVA6ConfigNrCommitPorts-1:0][Cfg.XLEN-1:0] wdata; \
logic [Cfg.NrCommitPorts-1:0][Cfg.XLEN-1:0] wdata; \
}

`define RVFI_PROBES_CSR_T(Cfg) struct packed { \
Expand Down
3 changes: 1 addition & 2 deletions verif/tb/uvmt/uvmt_cva6_tb.sv
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ module uvmt_cva6_tb;
import uvmt_cva6_pkg::*;
import uvme_cva6_pkg::*;

localparam RVFI_NRET = cva6_config_pkg::CVA6ConfigNrCommitPorts;

// CVA6 config
localparam config_pkg::cva6_cfg_t CVA6Cfg = build_config_pkg::build_config(cva6_config_pkg::cva6_cfg);
localparam RVFI_NRET = CVA6Cfg.NrCommitPorts;

// RVFI
localparam type rvfi_instr_t = `RVFI_INSTR_T(CVA6Cfg);
Expand Down

0 comments on commit e1ee77e

Please sign in to comment.