From 514c9a7cd4422426de3127d5e118fe0bf28a0f26 Mon Sep 17 00:00:00 2001 From: ajalali Date: Mon, 12 Feb 2024 09:44:21 +0100 Subject: [PATCH] Functional coverage : Fix illegal cover_group sampling --- verif/env/uvme/cov/uvme_illegal_instr_covg.sv | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/verif/env/uvme/cov/uvme_illegal_instr_covg.sv b/verif/env/uvme/cov/uvme_illegal_instr_covg.sv index 471249a6d7..dc9becc05b 100644 --- a/verif/env/uvme/cov/uvme_illegal_instr_covg.sv +++ b/verif/env/uvme/cov/uvme_illegal_instr_covg.sv @@ -189,21 +189,21 @@ task uvme_illegal_instr_cov_model_c::sample_isa (uvma_isacov_instr_c instr); logic is_illegal_instr = (instr.cause == 2); - if (!have_sampled && is_illegal_instr && cfg.ext_i_supported) begin - have_sampled = 1; + if (is_illegal_instr && cfg.ext_i_supported) begin illegal_i_cg.sample(instr); - end - if (!have_sampled && is_illegal_instr && cfg.ext_m_supported) begin have_sampled = 1; - illegal_m_cg.sample(instr); end - if (!have_sampled && is_illegal_instr && cfg.ext_zicsr_supported) begin + if (is_illegal_instr && cfg.ext_m_supported) begin + illegal_m_cg.sample(instr); have_sampled = 1; - illegal_zicsr_cg.sample(instr); end - if (!have_sampled && is_illegal_instr && cfg.ext_zifencei_supported) begin + if (is_illegal_instr && cfg.ext_zicsr_supported) begin + illegal_zicsr_cg.sample(instr); have_sampled = 1; + end + if (is_illegal_instr && cfg.ext_zifencei_supported) begin illegal_zifencei_cg.sample(instr); + have_sampled = 1; end if (!have_sampled && is_illegal_instr) begin `uvm_error("ILLEGAL_INSTR", $sformatf("Could not sample instruction: %h", instr.rvfi.insn));