From c2901e398546c34384aa5ce50e31099fbe2a15d1 Mon Sep 17 00:00:00 2001 From: Mike Thompson Date: Thu, 21 Mar 2024 16:56:48 +0000 Subject: [PATCH] Incorporate UNSUPPORTED_WITH kludge for VCS --- .gitignore | 1 + .../env/uvme/cov/uvme_cv32e40p_cov_model_macros.sv | 13 +++++++++++++ .../env/uvme/cov/uvme_cv32e40p_fp_instr_covg.sv | 6 +++++- lib/uvm_agents/uvma_isacov/uvma_isacov_macros.sv | 7 +++++++ mk/uvmt/vcs.mk | 3 +++ 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 cv32e40p/env/uvme/cov/uvme_cv32e40p_cov_model_macros.sv diff --git a/.gitignore b/.gitignore index bb335417fb..d2258bd644 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,4 @@ VRMDATA *whetstone* *.do *eembc* +*.code-workspace diff --git a/cv32e40p/env/uvme/cov/uvme_cv32e40p_cov_model_macros.sv b/cv32e40p/env/uvme/cov/uvme_cv32e40p_cov_model_macros.sv new file mode 100644 index 0000000000..bf2e261b58 --- /dev/null +++ b/cv32e40p/env/uvme/cov/uvme_cv32e40p_cov_model_macros.sv @@ -0,0 +1,13 @@ +// Copyright 2024 OpenHW Group +// SPDX-License-Identifier: Apache-2.0 WITH SHL-210 +`ifndef __UVMA_CV32E40P_COV_MODEL_MACROS_SV__ +`define __UVMA_CV32E40P_COV_MODEL_MACROS_SV__ + +// Macro to remove instrucitons that are not supported based on standard ext_*_supported variable names (from commmon core control cfg class) +`ifdef UNSUPPORTED_WITH + `define WITH iff +`else + `define WITH with +`endif + +`endif // __UVMA_CV32E40P_COV_MODEL_MACROS_SV__ \ No newline at end of file diff --git a/cv32e40p/env/uvme/cov/uvme_cv32e40p_fp_instr_covg.sv b/cv32e40p/env/uvme/cov/uvme_cv32e40p_fp_instr_covg.sv index 13a99cbbf3..600a962ca6 100644 --- a/cv32e40p/env/uvme/cov/uvme_cv32e40p_fp_instr_covg.sv +++ b/cv32e40p/env/uvme/cov/uvme_cv32e40p_fp_instr_covg.sv @@ -35,6 +35,8 @@ class uvme_cv32e40p_fp_instr_covg extends uvm_component; extern task run_phase(uvm_phase phase); extern task sample_clk_i(); + `include "uvme_cv32e40p_cov_model_macros.sv" + `define FPU_MULTICYCLE_WINDOW_ILLEGAL_CASES \ illegal_bins clk_2_19_group_NON_DIVSQRT = ( (!binsof(cp_curr_fpu_apu_op) intersect {APU_OP_FDIV, APU_OP_FSQRT}) && (!binsof(cp_f_multicycle_clk_window) intersect {1}) ) \ with ( (cp_f_multicycle_clk_window != 0) & (fpu_latency == 0) ); \ @@ -391,7 +393,9 @@ class uvme_cv32e40p_fp_instr_covg extends uvm_component; (`COVIF_CB.apu_gnt == 1) && (`COVIF_CB.apu_rvalid_i == 1) ) { - bins rd[] = {[0:31]} with (fpu_latency == 0); + // FIXME: this is a kludge for a known VCS issue + //bins rd[] = {[0:31]} with (fpu_latency == 0); + bins rd[] = {[0:31]} `WITH (fpu_latency == 0); } // from bhv_logic_3 diff --git a/lib/uvm_agents/uvma_isacov/uvma_isacov_macros.sv b/lib/uvm_agents/uvma_isacov/uvma_isacov_macros.sv index 861b166ca7..caa5ab381f 100644 --- a/lib/uvm_agents/uvma_isacov/uvma_isacov_macros.sv +++ b/lib/uvm_agents/uvma_isacov/uvma_isacov_macros.sv @@ -18,6 +18,13 @@ `ifndef __UVMA_ISACOV_MACROS_SV__ `define __UVMA_ISACOV_MACROS_SV__ +// Macro to remove instrucitons that are not supported based on standard ext_*_supported variable names (from commmon core control cfg class) +`ifdef UNSUPPORTED_WITH + `define WITH iff +`else + `define WITH with +`endif + // Macro to remove instrucitons that are not supported based on standard ext_*_supported variable names (from commmon core control cfg class) `define ISACOV_IGN_BINS \ ignore_bins IGN_UNKNOWN = {UNKNOWN}; \ diff --git a/mk/uvmt/vcs.mk b/mk/uvmt/vcs.mk index 89b0179312..0df5f1ae38 100644 --- a/mk/uvmt/vcs.mk +++ b/mk/uvmt/vcs.mk @@ -156,6 +156,9 @@ endif VCS_FILE_LIST ?= -f $(DV_UVMT_PATH)/uvmt_$(CV_CORE_LC).flist +# FIXME: this is a kludge to work-around a known VCS bug +VCS_USER_COMPILE_ARGS += +define+UNSUPPORTED_WITH + ifeq ($(call IS_YES,$(ENABLE_TRACE_LOG)),YES) VCS_USER_COMPILE_ARGS += +define+$(CV_CORE_UC)_TRACE_EXECUTION VCS_USER_COMPILE_ARGS += +define+$(CV_CORE_UC)_RVFI_TRACE_EXECUTION