AXI muckbucket
axi_coveragecollector.svh
Go to the documentation of this file.
1 //
3 // Copyright (C) 2017, Matt Dew @ Dew Technologies, LLC
4 //
5 // This program is free software (logic verification): you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public License (LGPL)
7 // as published by the Free Software Foundation, either version 3 of the License,
8 // or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
12 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 // for more details.
14 //
15 // License: LGPL, v3, as defined and found on www.gnu.org,
16 // http://www.gnu.org/licenses/lgpl.html
17 //
18 //
19 // Author's intent: If you use this AXI verification code and find or fix bugs
20 // or make improvements, then share those fixes or improvements.
21 // If you use this in a bigger project, I don't care about,
22 // or want, any changes or code outside this block.
23 // Example: If you use this in an SoC simulation/testbench
24 // I don't want, or care about, your SoC or other blocks.
25 // I just care about the enhancements to these AXI files.
26 // That's why I have choosen the LGPL instead of the GPL.
28 
33 class axi_coveragecollector : public uvm_subscriber <axi_seq_item> { public:
34 
36 
37  covergroup aw_cg with function sample(axi_seq_item item) {
38  //option.name = "aw";
39  option.per_instance = 0;
40 
41  BURSTSIZE : coverpoint item.burst_size {
42  bins e_1BYTE = {axi_pkg::e_1BYTE};
43  bins e_2BYTES = {axi_pkg::e_2BYTES};
44  bins e_4BYTES = {axi_pkg::e_4BYTES};
45  bins e_8BYTES = {axi_pkg::e_8BYTES};
50  }
51 
52  BURSTTYPE : coverpoint item.burst_type {
53  bins e_FIXED = {axi_pkg::e_FIXED};
54  bins e_INCR = {axi_pkg::e_INCR};
55  bins e_WRAP = {axi_pkg::e_WRAP};
56  }
57 
58  AWLEN : coverpoint item.axlen[LEN_WIDTH-1:0];
59 
60  /* awcache, awlock, awprot, awqos here someday */
61 
62  }
63 
64  covergroup ar_cg with function sample(axi_seq_item item) {
65  //option.name = "aw";
66  option.per_instance = 0;
67 
68  BURSTSIZE : coverpoint item.burst_size {
69  bins e_1BYTE = {axi_pkg::e_1BYTE};
70  bins e_2BYTES = {axi_pkg::e_2BYTES};
71  bins e_4BYTES = {axi_pkg::e_4BYTES};
72  bins e_8BYTES = {axi_pkg::e_8BYTES};
77  }
78 
79  BURSTTYPE : coverpoint item.burst_type {
80  bins e_FIXED = {axi_pkg::e_FIXED};
81  bins e_INCR = {axi_pkg::e_INCR};
82  bins e_WRAP = {axi_pkg::e_WRAP};
83  }
84 
85  ARLEN : coverpoint item.axlen[LEN_WIDTH-1:0];
86 
87  /* awcache, awlock, awprot, awqos here someday */
88 
89  }
90 
91 
92 
93  new(string name="axi_coveragecollector", uvm_component parent=null);
94  virtual void write(axi_seq_item t);
95 
96 };
97 
101  axi_coveragecollector::new(string name="axi_coveragecollector", uvm_component parent=null) {
102  super.new(name, parent);
103 
104  aw_cg = new();
105  ar_cg = new();
106 
107 }
108 
114  uvm_info(this.get_type_name(), $sformatf("%s", t.convert2string()), UVM_HIGH)
115 
116  case (t.cmd) {
118  aw_cg.sample(t);
119  }
120 
122  ar_cg.sample(t);
123  }
124 
125  }
126 
127 }
rand cmd_t cmd
localparam LEN_WIDTH
Definition: axi_uvm_pkg.sv:41
string convert2string()
Convert item&#39;s variable into one printable string.
virtual void write(axi_seq_item t)
covergroup sampling
uvm_component_utils(axi_coveragecollector) covergroup aw_cg with function sample(axi_seq_item item)
covergroup ar_cg with function sample(axi_seq_item item)
rand logic< 2:0 > burst_size
new(string name="axi_coveragecollector", uvm_component parent=null)
Constructor.
bit< LEN_WIDTH-1:0 > axlen
rand logic< 1:0 > burst_type
contains all data and functions related to axi and usage