|
|
1 module test();
2
3 logic [2:0] addr;
4 reg ce;
5
6 covergroup address_cov () @ (posedge ce);
7 ADDRESS : coverpoint addr {
8 // simple transition bin
9 bins adr_low[] = (0,1=>2,3);
10 bins adr_med[] = (1,2=>3,4);
11 bins adr_high[] = (3,4=>5,6);
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 ce <= 1;
23 addr <= $random;
24 #10 ;
25 ce <= 0;
26 #10 ;
27 end
28 end
29
30 endmodule
You could download file set_bin.sv here
|