From 13135e2e706b0340301fca718cb517cb0dc262df Mon Sep 17 00:00:00 2001 From: Rupert Swarbrick Date: Mon, 8 Jun 2020 12:59:39 +0100 Subject: [PATCH] Collect transaction functional coverage for ICache-Mem iface This single covergroup was extracted from the icache documentation (icache.rst). --- .../dv/ibex_icache_mem_agent/ibex_icache_mem_agent_cov.sv | 8 ++++++-- .../dv/ibex_icache_mem_agent/ibex_icache_mem_monitor.sv | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dv/uvm/icache/dv/ibex_icache_mem_agent/ibex_icache_mem_agent_cov.sv b/dv/uvm/icache/dv/ibex_icache_mem_agent/ibex_icache_mem_agent_cov.sv index 44bfa7fb..5788ed14 100644 --- a/dv/uvm/icache/dv/ibex_icache_mem_agent/ibex_icache_mem_agent_cov.sv +++ b/dv/uvm/icache/dv/ibex_icache_mem_agent/ibex_icache_mem_agent_cov.sv @@ -10,11 +10,15 @@ class ibex_icache_mem_agent_cov // the base class provides the following handles for use: // ibex_icache_mem_agent_cfg: cfg - // covergroups + // Spot the gnt and pmp_err signal being high at the same time (the error should take precedence). + // This is sampled when gnt is high and tracks whether pmp_err is high too. + covergroup gnt_err_cg with function sample(bit pmp_err); + coverpoint pmp_err; + endgroup : gnt_err_cg function new(string name, uvm_component parent); super.new(name, parent); - // instantiate all covergroups here + gnt_err_cg = new(); endfunction : new endclass diff --git a/dv/uvm/icache/dv/ibex_icache_mem_agent/ibex_icache_mem_monitor.sv b/dv/uvm/icache/dv/ibex_icache_mem_agent/ibex_icache_mem_monitor.sv index fd32da35..4a3b9479 100644 --- a/dv/uvm/icache/dv/ibex_icache_mem_agent/ibex_icache_mem_monitor.sv +++ b/dv/uvm/icache/dv/ibex_icache_mem_agent/ibex_icache_mem_monitor.sv @@ -84,6 +84,7 @@ class ibex_icache_mem_monitor if (cfg.vif.monitor_cb.req && cfg.vif.monitor_cb.gnt && !cfg.vif.monitor_cb.pmp_err) begin new_grant(cfg.vif.monitor_cb.addr); end + if (cfg.en_cov && cfg.vif.monitor_cb.gnt) cov.gnt_err_cg.sample(cfg.vif.monitor_cb.pmp_err); @(cfg.vif.monitor_cb); end