Commit dbd1a226 by René

CG5

parent d71a13d2
Showing with 65 additions and 0 deletions
`timescale 1ps/1ps
module TB_CG5(
);
reg clk, rst;
int A, B;
covergroup cg @(posedge clk);
pb1: coverpoint A {
bins b0 = {0};
bins b1 = {1};
bins b2 = {2};
bins b3 = {3};
}
pb2: coverpoint B {
bins b0 = {0};
bins b1 = {1};
bins b2 = {2};
bins b3 = {3};
}
pb1x2: cross pb1,pb2;
endgroup
cg cg_inst;
initial begin
clk = 0;
end
always #5 clk = ~clk;
initial begin
cg_inst = new();
rst = 1;
A = 0; B = 0;
#10
rst = 0;
#10
A = 0; B = 2;
#10
A = 1; B = 3;
#10
A = 3; B = 1;
#10
wait (clk);
$display("%6.2f %%: Coverage (instance)", cg_inst.get_inst_coverage());
$display("%6.2f %%: Coverage (pb1)", cg_inst.pb1.get_coverage());
$display("%6.2f %%: Coverage (pb2)", cg_inst.pb2.get_coverage());
$display("%6.2f %%: Coverage (cross pb1,pb2)", cg_inst.pb1x2.get_coverage());
$stop;
end
endmodule
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment