covergroup my_cover_group @(posedge aclk);
m_axi_awlen_cp : coverpoint m_axi_awlen;
m_axi_awcache_cp : coverpoint m_axi_awcache {
option.comment = "cp with transition bins";
bins a1 = (1=>2);
bins b1 = (1,3=>4,5);
bins b2[] = (1,3=>4,5);
bins b3 = (1=>2), ([4:6] => 11,12);
}
m_axi_bresp_cp : coverpoint m_axi_bresp;
endgroup
my_cover_group obj1 = new();
In this example, you are declaring a covergroup named as my_cover_group and the sampling event as posedge aclk. This covergroup contains three coverpoints. You will add the cover group declaration code in the example design.
- In Tcl console invoke the following
command:
current_scope /axi_vip_0__exdes_adv_mst_active_pt_mem__slv_passive/DUT/ex_design/axi_vip_mst
- Double-click axi_vip_mst scope to see
the source code.
- The following file path will appear in the text editor, then add the cover
group declaration before endmodule and save
it.
axi_vip_0_ex/axi_vip_0_ex.ip_user_files/bd/ex_sim/ip/ex_sim_axi_vip_mst_0/sim/ex_sim_axi_vip_mst_0.sv
- In Tcl console, invoke
close_sim
command to close the simulation running previously. - In Tcl console, invoke
reset_simulation
command to clean the simulation directory. - In Tcl console, invoke
launch_simulation
command to run the simulation. - Click Run All button .
The simulation will stop after reaching $finish statement. The Vivado® simulator has generated the coverage database at the following location with the name (default name) xsim.covdb:
./axi_vip_0_ex.sim/sim_adv_mst_active__pt_passive__slv_comb/behav/xsim/
Invoke the following command to generate a report:
xcrg -report_format html -dir ./axi_vip_0_ex.sim/sim_adv_mst_active__pt_passive__slv_comb/behav/xsim/xsim.covdb/ -report_dir ./axi_vip_0_ex.sim/sim_adv_mst_active__pt_passive__slv_comb/behav/xsim/
This will generate a directory with the name xcrg_report, it contains a .html report. The following is the description of an example report:
- Open dashboard.html file. The file contains details such as command, version, date and coverage summary that shows only 9.375% of total bins are covered.
- Click Groups button.
- Click the link under group report.
- You will see a detailed report as shown in the following figure:
This way you can view the coverage and change your test bench/seed value to improve the coverage.