Skip to content

Commit 4118f97

Browse files
committed
Express some coverpoint crosses in an equivalent way
The previous code caused VCS to complain that the "with" clause didn't use any of the constituent coverpoints. I *think* that VCS wasn't understanding that cp_interrupt_taken[5:4] does indeed depend on cp_interrupt_taken (concentrating on core_ibex_fcov_if for concreteness). Fortunately, the check is easy to express a different way. There, we were just asking that the top two bits are zero. Another way to say that is "if I shift everything else off the bottom, the result is zero". So we say it that way.
1 parent 1985c76 commit 4118f97

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

dv/uvm/core_ibex/fcov/core_ibex_fcov_if.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ interface core_ibex_fcov_if import ibex_pkg::*; (
643643
// No interrupt would be taken in M-mode when its mstatus.MIE = 0 unless it's an NMI
644644
illegal_bins mmode_mstatus_mie =
645645
binsof(cs_registers_i.mstatus_q.mie) intersect {1'b0} &&
646-
binsof(cp_priv_mode_id) intersect {PRIV_LVL_M} with (cp_interrupt_taken[5:4] == 2'b00);
646+
binsof(cp_priv_mode_id) intersect {PRIV_LVL_M} with (cp_interrupt_taken >> 4 == 6'd0);
647647
}
648648

649649
priv_mode_exception_cross: cross cp_priv_mode_id, cp_ls_pmp_exception, cp_ls_error_exception {

dv/uvm/core_ibex/fcov/core_ibex_pmp_fcov_if.sv

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,11 +463,12 @@ interface core_ibex_pmp_fcov_if import ibex_pkg::*; #(
463463
((!pmp_region_priv_bits[2] && pmp_region_priv_bits != MML_XM_XU) ||
464464
pmp_region_priv_bits inside {MML_WRM_WRU, MML_RM_RU})) {
465465

466-
// Only interested in MML configuration
467-
ignore_bins non_mml_in = binsof(pmp_region_priv_bits) with (!pmp_region_priv_bits[4]);
466+
// Only interested in MML configuration, so ignore anything where the top bit is not set
467+
ignore_bins non_mml_in =
468+
binsof(pmp_region_priv_bits) with (pmp_region_priv_bits >> 4 == 5'b0);
468469

469470
ignore_bins non_mml_out =
470-
binsof(pmp_region_priv_bits_wr) with (!pmp_region_priv_bits_wr[4]);
471+
binsof(pmp_region_priv_bits_wr) with (pmp_region_priv_bits_wr >> 4 == 5'b0);
471472

472473
// Only interested in starting configs that weren't executable so ignore executable
473474
// regions

0 commit comments

Comments
 (0)