功能覆盖率的类型

在验证计划中编写test case时,需要编写功能覆盖率计划。一般而言,在验证环境中有4个地方可以编写coverage points.

F1 : Functional coverage points are very near the randomization

F2 : Functional coverage points are sampled at input interface of DUT

F3 : Functional coverage points which sample internal DUT states

F4 : Functional coverage points which sample output interface of DUT

功能覆盖率的简单例子:

 1 //+++++++++++++++++++++++++++++++++++++++++++++++++
 2 //   DUT With Coverage
 3 //+++++++++++++++++++++++++++++++++++++++++++++++++
 4 module simple_coverage();
 5 
 6 logic [7:0]  addr;
 7 logic [7:0]  data;
 8 logic        par;
 9 logic        rw;
10 logic        en;
11 //=================================================
12 // Coverage Group
13 //=================================================
14 covergroup memory @ (posedge en);
15   address : coverpoint addr {
16     bins low    = {0,50};
17     bins med    = {51,150};
18     bins high   = {151,255};
19   }
20   parity : coverpoint  par {
21     bins even  = {0};
22     bins odd   = {1};
23   }
24   read_write : coverpoint rw {
25     bins  read  = {0};
26     bins  write = {1};
27   }
28 endgroup
29 //=================================================
30 // Instance of covergroup memory
31 //=================================================
32 memory mem = new();
33 //=================================================
34 // Task to drive values
35 //=================================================
36 task drive (input [7:0] a, input [7:0] d, input r);
37   #5 en <= 1;
38   addr  <= a;
39   rw    <= r;
40   data  <= d;
41   par   <= ^d;
42   $display ("@%2tns Address :%d data %x, rw %x, parity %x",
43      $time,a,d,r, ^d);
44   #5    en <= 0;
45   rw    <= 0;
46   data  <= 0;
47   par   <= 0;
48   addr  <= 0;
49   rw    <= 0;
50 endtask
51 //=================================================
52 // Testvector generation
53 //=================================================
54 initial begin
55   en = 0;
56   repeat (10) begin
57     drive ($random,$random,$random);
58   end
59   #10 $finish;
60 end
61 
62 endmodule
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-04
  • 2021-08-04
  • 2021-10-06
  • 2021-06-18
  • 2021-12-24
  • 2022-12-23
猜你喜欢
  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2021-04-14
  • 2021-12-21
  • 2021-05-23
相关资源
相似解决方案