|
|
1 class coverage_no_tran {
2 bit [3:0] value;
3 event now;
4
5 coverage_group something {
6 sample_event = sync(ALL,now);
7 sample value {
8 trans ABC_0 (2->5);
9 trans ABC_1 (3->5);
10 trans ABC_2 (4->5);
11 trans ABC_3 (6->5);
12 trans ABC_4 (7->5);
13 trans ABC_INVALID (not trans);
14 }
15 }
16
17 task update_coverage (bit [3:0] value) {
18 this.value = value;
19 trigger(now);
20 }
21 }
22
23
24
25 program test {
26 coverage_no_tran cov = new();
27 bit [3:0] v;
28 repeat (10) {
29 v = urandom__range(14,0);
30 printf("Value is %d\n",v);
31 cov.update_coverage(v);
32 @ (posedge CLOCK);
33 }
34 }
You could download file coverage_no_tran.vr here
|