define WtDcacheWbufDepth as cva6 parameter and fix rvfi.svh (#2040)

This commit is contained in:
JeanRochCoulon 2024-04-15 15:05:30 +02:00 committed by GitHub
parent e2401d3e88
commit e1ee77e02d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 33 additions and 20 deletions

View file

@ -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;

View file

@ -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
@ -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;

View file

@ -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),

View file

@ -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
@ -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
@ -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),
@ -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),

View file

@ -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),

View file

@ -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),

View file

@ -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),

View file

@ -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),

View file

@ -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),

View file

@ -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),

View file

@ -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),

View file

@ -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),

View file

@ -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),

View file

@ -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),

View file

@ -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,

View file

@ -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; \
@ -105,13 +105,13 @@
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; \
@ -119,11 +119,11 @@
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 { \

View file

@ -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);