Skip to content

Commit

Permalink
Fix issue #2479 #2468 (#2318)
Browse files Browse the repository at this point in the history
  • Loading branch information
AyoubJalali authored Jul 3, 2024
1 parent ace1643 commit 702fedf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
3 changes: 3 additions & 0 deletions verif/env/uvme/uvme_cva6_cfg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ class uvme_cva6_cfg_c extends uvma_core_cntrl_cfg_c;
dm_exception_addr_valid == 1;
nmi_addr_valid == 1;
HPDCache_supported == (CVA6Cfg.DCacheType == 2);

DirectVecOnly == CVA6Cfg.DirectVecOnly;
TvalEn == CVA6Cfg.TvalEn;
}

constraint ext_const {
Expand Down
14 changes: 13 additions & 1 deletion verif/tb/core/uvma_cva6pkg_utils.sv
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ function st_core_cntrl_cfg cva6pkg_to_core_cntrl_cfg(st_core_cntrl_cfg cfg);
cfg.pmp_regions = CVA6Cfg.NrPMPEntries;
cfg.debug_supported = CVA6Cfg.DebugEn;

cfg.DirectVecOnly = CVA6Cfg.DirectVecOnly;
cfg.TvalEn = CVA6Cfg.TvalEn;

cfg.unsupported_csr_mask['h643] = 1; // HTVAL
cfg.unsupported_csr_mask['h64A] = 1; // HTINST

Expand All @@ -78,13 +81,22 @@ function st_core_cntrl_cfg cva6pkg_to_core_cntrl_cfg(st_core_cntrl_cfg cfg);
void'(spike_set_param_str(base, "extensions", "cv32a60x"));

// All enabled except XS and TW bits
void'(spike_set_param_uint64_t(base, "mstatus_write_mask", 'hFDFE_7FFF));
void'(spike_set_param_uint64_t(base, "mstatus_write_mask", 'hFFDE_7FFF));

if (cfg.DirectVecOnly) begin
void'(spike_set_param_uint64_t(base, "mtvec_write_mask", 32'hFFFF_FFFC));
end

void'(spike_set_param_uint64_t(base, "misa_override_value", get_misa(cfg)));
void'(spike_set_param_uint64_t(base, "misa_override_mask", 64'h0FFF_FFFF));
void'(spike_set_param_bool (base, "misa_we_enable", 1'b1));
void'(spike_set_param_bool (base, "misa_we", 1'b0));

if (!cfg.TvalEn) begin
void'(spike_set_param_bool (base, "mtval_we_enable", 1'b1));
void'(spike_set_param_bool (base, "mtval_we", 1'b0));
end

return cfg;

endfunction : cva6pkg_to_core_cntrl_cfg
Expand Down

0 comments on commit 702fedf

Please sign in to comment.