Cover Group Declaration - 2023.2 English

Vivado Design Suite Tutorial: Logic Simulation (UG937)

Document ID
UG937
Release Date
2023-11-01
Version
2023.2 English
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 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.

  1. 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
  2. Double-click axi_vip_mst scope to see the source code.

  3. 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


  4. In Tcl console, invoke the close_sim command to close the simulation running previously.
  5. In Tcl console, invoke the reset_simulation command to clean the simulation directory.
  6. In Tcl console, invoke the launch_simulation command to run the simulation.
  7. Click Run All button .

The simulation will stop after reaching the $finish statement. The AMD 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:

  1. 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.
  2. Click Groups button.
  3. Click the link under group report.
  4. 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.