diff --git a/core/include/build_config_pkg.sv b/core/include/build_config_pkg.sv index 0a3b4d901..c86c89cf2 100644 --- a/core/include/build_config_pkg.sv +++ b/core/include/build_config_pkg.sv @@ -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; diff --git a/core/include/config_pkg.sv b/core/include/config_pkg.sv index 71b43d203..83685b3bc 100644 --- a/core/include/config_pkg.sv +++ b/core/include/config_pkg.sv @@ -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; diff --git a/core/include/cv32a60x_config_pkg.sv b/core/include/cv32a60x_config_pkg.sv index 41c93dff7..a81dcd986 100644 --- a/core/include/cv32a60x_config_pkg.sv +++ b/core/include/cv32a60x_config_pkg.sv @@ -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), diff --git a/core/include/cv32a65x_config_pkg.sv b/core/include/cv32a65x_config_pkg.sv index 6b43c1fcd..9a5c4d461 100644 --- a/core/include/cv32a65x_config_pkg.sv +++ b/core/include/cv32a65x_config_pkg.sv @@ -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), diff --git a/core/include/cv32a6_embedded_config_pkg.sv b/core/include/cv32a6_embedded_config_pkg.sv index f4e84829c..78db77d29 100644 --- a/core/include/cv32a6_embedded_config_pkg.sv +++ b/core/include/cv32a6_embedded_config_pkg.sv @@ -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), diff --git a/core/include/cv32a6_ima_sv32_fpga_config_pkg.sv b/core/include/cv32a6_ima_sv32_fpga_config_pkg.sv index 9fec25c65..cdaa26a36 100644 --- a/core/include/cv32a6_ima_sv32_fpga_config_pkg.sv +++ b/core/include/cv32a6_ima_sv32_fpga_config_pkg.sv @@ -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), diff --git a/core/include/cv32a6_imac_sv0_config_pkg.sv b/core/include/cv32a6_imac_sv0_config_pkg.sv index b7084e6fa..9d4f3d3b7 100644 --- a/core/include/cv32a6_imac_sv0_config_pkg.sv +++ b/core/include/cv32a6_imac_sv0_config_pkg.sv @@ -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), diff --git a/core/include/cv32a6_imac_sv32_config_pkg.sv b/core/include/cv32a6_imac_sv32_config_pkg.sv index 44e5276e0..a2774e5f9 100644 --- a/core/include/cv32a6_imac_sv32_config_pkg.sv +++ b/core/include/cv32a6_imac_sv32_config_pkg.sv @@ -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), diff --git a/core/include/cv32a6_imafc_sv32_config_pkg.sv b/core/include/cv32a6_imafc_sv32_config_pkg.sv index b91a2514f..2a54267b1 100644 --- a/core/include/cv32a6_imafc_sv32_config_pkg.sv +++ b/core/include/cv32a6_imafc_sv32_config_pkg.sv @@ -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), diff --git a/core/include/cv64a6_imadfcv_sv39_polara_config_pkg.sv b/core/include/cv64a6_imadfcv_sv39_polara_config_pkg.sv index 3eff8cc37..ef4ff6220 100644 --- a/core/include/cv64a6_imadfcv_sv39_polara_config_pkg.sv +++ b/core/include/cv64a6_imadfcv_sv39_polara_config_pkg.sv @@ -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), diff --git a/core/include/cv64a6_imafdc_sv39_config_pkg.sv b/core/include/cv64a6_imafdc_sv39_config_pkg.sv index c029490ae..a9c29be88 100644 --- a/core/include/cv64a6_imafdc_sv39_config_pkg.sv +++ b/core/include/cv64a6_imafdc_sv39_config_pkg.sv @@ -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), diff --git a/core/include/cv64a6_imafdc_sv39_hpdcache_config_pkg.sv b/core/include/cv64a6_imafdc_sv39_hpdcache_config_pkg.sv index 5ab06d004..9e33e8995 100644 --- a/core/include/cv64a6_imafdc_sv39_hpdcache_config_pkg.sv +++ b/core/include/cv64a6_imafdc_sv39_hpdcache_config_pkg.sv @@ -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), diff --git a/core/include/cv64a6_imafdc_sv39_openpiton_config_pkg.sv b/core/include/cv64a6_imafdc_sv39_openpiton_config_pkg.sv index 057557b54..513cb3d2f 100644 --- a/core/include/cv64a6_imafdc_sv39_openpiton_config_pkg.sv +++ b/core/include/cv64a6_imafdc_sv39_openpiton_config_pkg.sv @@ -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), diff --git a/core/include/cv64a6_imafdc_sv39_wb_config_pkg.sv b/core/include/cv64a6_imafdc_sv39_wb_config_pkg.sv index 77b4467be..15464173a 100644 --- a/core/include/cv64a6_imafdc_sv39_wb_config_pkg.sv +++ b/core/include/cv64a6_imafdc_sv39_wb_config_pkg.sv @@ -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), diff --git a/core/include/cv64a6_imafdcv_sv39_config_pkg.sv b/core/include/cv64a6_imafdcv_sv39_config_pkg.sv index 891196076..194edb99b 100644 --- a/core/include/cv64a6_imafdcv_sv39_config_pkg.sv +++ b/core/include/cv64a6_imafdcv_sv39_config_pkg.sv @@ -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, diff --git a/core/include/rvfi_types.svh b/core/include/rvfi_types.svh index 5db2f42de..427eee7d4 100644 --- a/core/include/rvfi_types.svh +++ b/core/include/rvfi_types.svh @@ -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 { \ diff --git a/verif/tb/uvmt/uvmt_cva6_tb.sv b/verif/tb/uvmt/uvmt_cva6_tb.sv index 7d3ddc511..c13cc22e7 100644 --- a/verif/tb/uvmt/uvmt_cva6_tb.sv +++ b/verif/tb/uvmt/uvmt_cva6_tb.sv @@ -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);