|
|
1 class coverage_cumulative_off {
2 bit [3:0] value;
3 event now;
4
5 coverage_group something {
6 sample_event = sync(ALL,now);
7 cumulative = OFF;
8 sample value;
9 }
10
11 task update_coverage (bit [3:0] value) {
12 this.value = value;
13 trigger(now);
14 }
15 }
16
17
18
19 program test {
20 coverage_cumulative_off cov [2];
21 bit [3:0] v;
22 cov[0] = new();
23 cov[1] = new();
24 repeat (10) {
25 v = random();
26 printf("Value is 0 %d\n",v);
27 cov[0].update_coverage(v);
28 v = random();
29 printf("Value is 1 %d\n",v);
30 cov[1].update_coverage(v);
31 delay(1);
32 }
33 }
You could download file coverage_cumulative_off.vr here
|