|
|
|

|
|
|
|
|
|

|
|
 |
Explicity bins creation
|
|
|
In the last page we saw, how compile creates auto bins, There are mutiple problems with that aproach. So it recommended that user specify all the coverage bins manually. |
|
|

|
|
|
|
|
|

|
|
 |
Example : Explicity bins creation
|
|
|

|
|
|
1 module test();
2
3 logic [7:0] addr;
4 reg ce;
5
6 covergroup address_cov () @ (posedge ce);
7 ADDRESS : coverpoint addr {
8 // Bins are explicity declared, This is prefered way
9 bins low = {0,10};
10 bins med = {11,20};
11 bins value_255 = {255};
12 }
13 endgroup
14
15 address_cov my_cov = new();
16
17 initial begin
18 ce <= 0;
19 addr <= 0;
20 $monitor("ce %b addr 8'h%x",ce,addr);
21 repeat (10) begin
22 addr = $random();
23 ce <= 1;
24 #10 ;
25 ce <= 0;
26 #10 ;
27 end
28 end
29
30 endmodule
You could download file explicity_bin.sv here
|
|
|

|
|
 |
Simulation : Explicity bins creation
|
|
|

|
|
|
ce 1 addr 8'h00
ce 0 addr 8'h00
ce 1 addr 8'h81
ce 0 addr 8'h81
ce 1 addr 8'h09
ce 0 addr 8'h09
ce 1 addr 8'h63
ce 0 addr 8'h63
ce 1 addr 8'h0d
ce 0 addr 8'h0d
ce 1 addr 8'h8d
ce 0 addr 8'h8d
ce 1 addr 8'h65
ce 0 addr 8'h65
ce 1 addr 8'h12
ce 0 addr 8'h12
ce 1 addr 8'h01
ce 0 addr 8'h01
ce 1 addr 8'h0d
ce 0 addr 8'h0d
|
|
|

|
|
 |
Report : Explicity bins creation
|
|
|

|
|
|
===========================================================
Group : test::address_cov
===========================================================
SCORE WEIGHT GOAL
33.33 1 100
-----------------------------------------------------------
Summary for Group test::address_cov
CATEGORY EXPECTED UNCOVERED COVERED PERCENT
Variables 3 2 1 33.33
Variables for Group test::address_cov
VARIABLE EXPECTED UNCOVERED COVERED PERCENT GOAL WEIGHT
ADDRESS 3 2 1 33.33 100 1
-----------------------------------------------------------
Summary for Variable ADDRESS
CATEGORY EXPECTED UNCOVERED COVERED PERCENT
User Defined Bins 3 2 1 33.33
User Defined Bins for ADDRESS
Uncovered bins
NAME COUNT AT LEAST NUMBER
value_255 0 1 1
med 0 1 1
Covered bins
NAME COUNT AT LEAST
low 1 1
|
|
|

|
|
|

|
|
|

|
|
|
|
|
|

|
|
|
|
|
|

|
|
Copyright © 1998-2025 |
Deepak Kumar Tala - All rights reserved |
Do you have any Comment? mail me at:deepak@asic-world.com
|
|