|
|
|
|
|
|
|
|
|
|
|
|
Wildcard bin creation
|
|
|
By default, a value or transition bin definition can specify 4-state values. When a bin definition includes an X or Z, it indicates that the bin count should only be incremented when the sampled value has an X or Z in the same bit positions, i.e., the comparison is done using ===. The wildcard bins definition causes all X, Z, or ? to be treated as wildcards for 0 or 1 (similar to the ==? operator). |
|
|
|
|
|
wildcard bins abc = {2'b1?}; |
|
|
|
|
|
This will cover following values |
|
|
|
|
|
|
|
|
|
|
|
transition bin :Wildcard bin can be created for transition bin, You can use X or ? based on your need. |
|
|
|
|
|
wildcard bins abc = (2'b1x => 2'bx0}; |
|
|
|
|
|
This will cover following values |
|
|
|
|
|
- 2'b10 => 2'b10
- 2'b10 => 2'b00
- 2'b11 => 2'b10
- 2'b11 => 2'b00
|
|
|
|
|
|
|
|
|
|
|
|
Example : wildcard bins creation
|
|
|
|
|
|
1 module test();
2
3 logic [2:0] addr;
4 reg ce;
5
6 covergroup address_cov () @ (posedge ce);
7 ADDRESS : coverpoint addr {
8 // Normal transition bibs
9 wildcard bins adr0 = {3'b11?};
10 // We can use wildcard in transition bins also
11 wildcard bins adr1 = (3'b1x0 => 3'bx00);
12 wildcard bins adr2 = (3'b1?0 => 3'b?00);
13 }
14 endgroup
15
16 address_cov my_cov = new();
17
18 initial begin
19 ce <= 0;
20 $monitor("ce %b addr 8'h%x",ce,addr);
21 repeat (10) begin
22 ce <= 1;
23 addr <= $urandom_range(0,2);
24 #10 ;
25 ce <= 0;
26 #10 ;
27 end
28 end
29
30 endmodule
You could download file wildcard_bin.sv here
|
|
|
|
|
|
Simulation : wildcard bins creation
|
|
|
|
|
|
ce 1 addr 8'h2
ce 0 addr 8'h2
ce 1 addr 8'h2
ce 0 addr 8'h2
ce 1 addr 8'h1
ce 0 addr 8'h1
ce 1 addr 8'h0
ce 0 addr 8'h0
ce 1 addr 8'h1
ce 0 addr 8'h1
ce 1 addr 8'h2
ce 0 addr 8'h2
ce 1 addr 8'h1
ce 0 addr 8'h1
ce 1 addr 8'h0
ce 0 addr 8'h0
ce 1 addr 8'h0
ce 0 addr 8'h0
ce 1 addr 8'h2
ce 0 addr 8'h2
|
|
|
|
|
|
Report : wildcard bins creation
|
|
|
|
|
|
===========================================================
Group : test::address_cov
===========================================================
SCORE WEIGHT GOAL
0.00 1 100
-----------------------------------------------------------
Summary for Group test::address_cov
CATEGORY EXPECTED UNCOVERED COVERED PERCENT
Variables 3 3 0 0.00
Variables for Group test::address_cov
VARIABLE EXPECTED UNCOVERED COVERED PERCENT GOAL WEIGHT
ADDRESS 3 3 0 0.00 100 1
-----------------------------------------------------------
Summary for Variable ADDRESS
CATEGORY EXPECTED UNCOVERED COVERED PERCENT
User Defined Bins 3 3 0 0.00
User Defined Bins for ADDRESS
Uncovered bins
NAME COUNT AT LEAST NUMBER
adr0 0 1 1
adr2 0 1 1
adr1 0 1 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Copyright © 1998-2014 |
Deepak Kumar Tala - All rights reserved |
Do you have any Comment? mail me at:deepak@asic-world.com
|
|