Modify AXI assertion and coverage model for easy utilization of WT and HPDcache (#2125)

This commit is contained in:
AEzzejjari 2024-05-17 21:34:36 +01:00 committed by GitHub
parent ca0cfbcb4e
commit 3cd458d03c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 28 additions and 30 deletions

View file

@ -67,15 +67,15 @@ covergroup cg_axi_w_channel(string name)
endgroup : cg_axi_w_channel
covergroup cg_axi_b_channel(string name)
with function sample(uvma_axi_transaction_c item, bit RVA);
with function sample(uvma_axi_transaction_c item, bit RVA, bit hpdcache);
option.per_instance = 1;
option.name = name;
bid: coverpoint (item.b_id){
bins one = {[1:3]};
illegal_bins ILLEGAL_BINS = {2};
ignore_bins IGN_EXID = {3} iff(!RVA);
bins one = {[1:3]} iff(!hpdcache);
illegal_bins ILLEGAL_BINS = {2} iff(!hpdcache);
ignore_bins IGN_EXID = {3} iff(!RVA && !hpdcache);
}
bresp: coverpoint (item.b_resp){
bins zero = {0};
@ -88,13 +88,13 @@ covergroup cg_axi_b_channel(string name)
endgroup : cg_axi_b_channel
covergroup cg_axi_ar_channel(string name)
with function sample(uvma_axi_transaction_c item, bit RVA);
with function sample(uvma_axi_transaction_c item, bit RVA, bit hpdcache);
option.per_instance = 1;
option.name = name;
arid: coverpoint (item.ar_id) {
bins ID[] = {[0:1]};
bins ID[] = {[0:1]} iff(!hpdcache);
}
arlen: coverpoint (item.ar_len) {
@ -131,15 +131,15 @@ covergroup cg_axi_ar_channel(string name)
endgroup : cg_axi_ar_channel
covergroup cg_axi_r_channel(string name)
with function sample(uvma_axi_transaction_c item, int index, bit RVA);
with function sample(uvma_axi_transaction_c item, int index, bit RVA, bit hpdcache);
option.per_instance = 1;
option.name = name;
rid: coverpoint (item.r_data_trs[index].r_id) {
bins ID[] = {[0:3]};
illegal_bins ILLEGAL_BINS = {2};
ignore_bins IGN_EXID = {3} iff(!RVA);
bins ID[] = {[0:3]} iff(!hpdcache);
illegal_bins ILLEGAL_BINS = {2} iff(!hpdcache);
ignore_bins IGN_EXID = {3} iff(!RVA && !hpdcache);
}
rlast: coverpoint (item.r_data_trs[index].r_last);
@ -165,6 +165,7 @@ class uvme_axi_covg_c extends uvm_component;
uvme_cva6_cntxt_c cntxt;
uvme_cva6_cfg_c cfg;
bit RVA;
bit HPDCache;
// TLM
uvm_tlm_analysis_fifo #(uvma_axi_transaction_c) uvme_axi_cov_resp_fifo;
@ -226,6 +227,7 @@ function void uvme_axi_covg_c::build_phase(uvm_phase phase);
end
RVA = cfg.ext_a_supported;
HPDCache = cfg.HPDCache_supported;
uvme_axi_cov_resp_fifo = new("uvme_axi_cov_resp_fifo" , this);
@ -249,14 +251,14 @@ task uvme_axi_covg_c::run_phase(uvm_phase phase);
UVMA_AXI_ACCESS_WRITE : begin
w_axi_cg.sample(resp_item, RVA);
b_axi_cg.sample(resp_item, RVA);
b_axi_cg.sample(resp_item, RVA, HPDCache);
end
UVMA_AXI_ACCESS_READ : begin
ar_axi_cg.sample(resp_item, RVA);
ar_axi_cg.sample(resp_item, RVA, HPDCache);
for(int i = 0; i <= resp_item.ar_len; i++) begin
r_axi_cg.sample(resp_item, i, RVA);
r_axi_cg.sample(resp_item, i, RVA, HPDCache);
end
end

View file

@ -47,6 +47,7 @@ class uvme_cva6_cfg_c extends uvma_core_cntrl_cfg_c;
// Zicond extension
rand bit ext_zicond_supported;
rand bit HPDCache_supported;
//pmp entries
rand int nr_pmp_entries;
@ -58,6 +59,7 @@ class uvme_cva6_cfg_c extends uvma_core_cntrl_cfg_c;
`uvm_field_int ( cov_model_enabled , UVM_DEFAULT )
`uvm_field_int ( trn_log_enabled , UVM_DEFAULT )
`uvm_field_int ( ext_zicond_supported , UVM_DEFAULT )
`uvm_field_int ( HPDCache_supported , UVM_DEFAULT )
`uvm_field_int ( nr_pmp_entries , UVM_DEFAULT )
`uvm_field_int ( sys_clk_period , UVM_DEFAULT + UVM_DEC)
@ -138,6 +140,7 @@ class uvme_cva6_cfg_c extends uvma_core_cntrl_cfg_c;
dm_halt_addr_valid == 1;
dm_exception_addr_valid == 1;
nmi_addr_valid == 1;
HPDCache_supported == 1;
}
constraint ext_const {

View file

@ -7,7 +7,8 @@
//
// Original Author: Alae Eddine EZ ZEJJARI (alae-eddine.ez-zejjari@external.thalesgroup.com)  sub-contractor MU-Electronics for Thales group
module uvmt_axi_assert (uvma_axi_intf axi_assert_if);
module uvmt_axi_assert#(int HPDCache=2)
(uvma_axi_intf axi_assert_if);
import uvm_pkg::*;
@ -25,7 +26,7 @@ module uvmt_axi_assert (uvma_axi_intf axi_assert_if);
uvma_axi_amo_assert axi_amo_assert(.axi_assert(axi_assert_if));
uvmt_cva6_axi_assert cva6_axi_assert(.axi_assert_if(axi_assert_if));
uvmt_cva6_axi_assert#(HPDCache) cva6_axi_assert(.axi_assert_if(axi_assert_if));
endmodule : uvmt_axi_assert

View file

@ -11,19 +11,19 @@
`include "uvm_macros.svh"
module uvmt_cva6_axi_assert (uvma_axi_intf axi_assert_if);
module uvmt_cva6_axi_assert#(int HPDCache=2)
(uvma_axi_intf axi_assert_if);
import uvm_pkg::*;
//check if the CVA6 identify read transaction with an ID equal to 0 or 1
property AXI4_CVA6_ARID;
@(posedge axi_assert_if.clk) disable iff (!axi_assert_if.rst_n) axi_assert_if.ar_valid |-> axi_assert_if.ar_id == 0 || axi_assert_if.ar_id == 1 || (axi_assert_if.ar_id == 3 && axi_assert_if.ar_lock == 1);
@(posedge axi_assert_if.clk && (HPDCache != 2)) disable iff (!axi_assert_if.rst_n) axi_assert_if.ar_valid |-> axi_assert_if.ar_id == 0 || axi_assert_if.ar_id == 1 || (axi_assert_if.ar_id == 3 && axi_assert_if.ar_lock == 1);
endproperty
//check if the CVA6 identify write transaction with an ID equal to 0 or 1
property AXI4_CVA6_AWID;
@(posedge axi_assert_if.clk) disable iff (!axi_assert_if.rst_n) axi_assert_if.aw_valid |-> axi_assert_if.aw_id == 1 || (axi_assert_if.aw_id == 3 && axi_assert_if.aw_atop != 0) || (axi_assert_if.aw_id == 3 && axi_assert_if.aw_lock == 1);
@(posedge axi_assert_if.clk && (HPDCache != 2)) disable iff (!axi_assert_if.rst_n) axi_assert_if.aw_valid |-> axi_assert_if.aw_id == 1 || (axi_assert_if.aw_id == 3 && axi_assert_if.aw_atop != 0) || (axi_assert_if.aw_id == 3 && axi_assert_if.aw_lock == 1);
endproperty
//Check if user-defined extension for read address channel is equal to 0b00
@ -58,12 +58,12 @@ module uvmt_cva6_axi_assert (uvma_axi_intf axi_assert_if);
//Check if AWCACHE is always equal to 0b0000
property AXI4_CVA6_AWCACHE;
@(posedge axi_assert_if.clk) disable iff (!axi_assert_if.rst_n) axi_assert_if.aw_valid |-> axi_assert_if.aw_cache == 2;
@(posedge axi_assert_if.clk && (HPDCache != 2)) disable iff (!axi_assert_if.rst_n) axi_assert_if.aw_valid |-> axi_assert_if.aw_cache == 2;
endproperty
//Check if ARCACHE is always equal to 0b0000
property AXI4_CVA6_ARCACHE;
@(posedge axi_assert_if.clk) disable iff (!axi_assert_if.rst_n) axi_assert_if.ar_valid |-> axi_assert_if.ar_cache == 2;
@(posedge axi_assert_if.clk && (HPDCache != 2)) disable iff (!axi_assert_if.rst_n) axi_assert_if.ar_valid |-> axi_assert_if.ar_cache == 2;
endproperty
//Check if Protection attributes for write transaction always take the 0b000
@ -103,14 +103,11 @@ module uvmt_cva6_axi_assert (uvma_axi_intf axi_assert_if);
/********************************************** Assert Property ******************************************************/
// TODO: commented when integrating HPDCache
if (0) begin
cva6_arid : assert property (AXI4_CVA6_ARID)
else `uvm_error (" AXI4 protocol checks assertion ", "Violation of AXI4_CVA6_ARID");
cva6_awid : assert property (AXI4_CVA6_AWID)
else `uvm_error (" AXI4 protocol checks assertion ", "Violation of AXI4_CVA6_AWID");
end
cva6_aruser : assert property (AXI4_CVA6_ARUSER)
else `uvm_error (" AXI4 protocol checks assertion ", "Violation of AXI4_CVA6_ARUSER");
@ -130,14 +127,11 @@ module uvmt_cva6_axi_assert (uvma_axi_intf axi_assert_if);
cva6_awregion : assert property (AXI4_CVA6_AWREGION)
else `uvm_error (" AXI4 protocol checks assertion ", "Violation of AXI4_CVA6_AWREGION");
// TODO: commented when integrating HPDCache
if (0) begin
cva6_arcache : assert property (AXI4_CVA6_ARCACHE)
else `uvm_error (" AXI4 protocol checks assertion ", "Violation of AXI4_CVA6_ARCAHCE");
cva6_awcache : assert property (AXI4_CVA6_AWCACHE)
else `uvm_error (" AXI4 protocol checks assertion ", "Violation of AXI4_CVA6_AWCAHCE");
end
cva6_arprot : assert property (AXI4_CVA6_ARPROT)
else `uvm_error (" AXI4 protocol checks assertion ", "Violation of AXI4_CVA6_ARPROT");
@ -199,5 +193,3 @@ module uvmt_cva6_axi_assert (uvma_axi_intf axi_assert_if);
endmodule : uvmt_cva6_axi_assert

View file

@ -86,7 +86,7 @@ module uvmt_cva6_tb;
);
//bind assertion module for axi interface
bind uvmt_cva6_dut_wrap
uvmt_axi_assert axi_assert(.axi_assert_if(axi_if));
uvmt_axi_assert #(CVA6Cfg.DCacheType) axi_assert(.axi_assert_if(axi_if));
// DUT Wrapper Interfaces
uvmt_rvfi_if #(