- Line/Statement coverage with exact execution count of statements
- Branch Coverage for if-else, if-elseif-else, switch case, ternary operators (?)
- Detection and Highlighting of Missing else and Missing default in code coverage report
- Condition Coverage with an exact count of the number of times a condition has been checked and evaluated to TRUE/FALSE
- Toggle Coverage for packed/unpacked reg, bit, logic, wire datatypes
- Toggle Coverage for int, shortint, integer, byte datatypes, and non-dynamic struct members
- Generation of code coverage HTML report by using xcrg
- Dashboard view of code coverage of design
- List of files, list of modules, hierarchical list of instances of module for the entire design
- File Specific Code Coverage view, Module and Instance Specific Code Coverage view
- Merging of Line/Statement, Branch, Condition, and Toggle coverage from different runs using xcrg
Note: Currently, Vivado
Simulator supports the above features for System Verilog/Verilog. VHDL code coverage is
not supported yet.
In the present example design, add a code coverage switch at elaboration to view the utility using xcrg.
- Under elaboration tab in settings menu, add coverage types, coverage
directory, and coverage database name as shown below and select OK. You should be able to see the following Tcl commands set in Tcl Console after the previous step:
set_property -name {xsim.elaborate.coverage.name} -value {DB1} -objects [get_filesets sim_adv_mst_active__pt_passive__slv_comb]
set_property -name {xsim.elaborate.coverage.dir} -value {cRun1} -objects [get_filesets sim_adv_mst_active__pt_passive__slv_comb]
set_property -name {xsim.elaborate.coverage.type} -value {sbct} -objects [get_filesets sim_adv_mst_active__pt_passive__slv_comb]
- Invoke the
close_sim
command in the Tcl Console to close the simulation running previously. - Invoke the
reset_simulation
command in the Tcl Console to clean the simulation directory. - Invoke the
launch_simulation
command in the Tcl Console to run the simulation. - Invoke the following command in the Tcl Console to dump the current
coverage database into the disk.
write_xsim_coverage -cov_db_dir cRun1 -cov_db_name DB1
- Invoke the following command in the Tcl Console to read the coverage
database generated by Vivado simulator and export it
as an HTML
report.
export_xsim_coverage -cov_db_name DB1 -cov_db_dir cRun1 -output_dir cReport1 -open_html true
- Now you can see the HTML report opened in the default browser as
shown below.
- Click on Files in the top
right corner to see the File Specific Information.
- Click on Modules in the top
right corner to see Module Specific Information.
- Click on axi_vip_v1_1_19_top_default module under module name in module
specific information table and select statement
coverage to see the statement coverage of the module.
- Select branch coverage to see
the branch coverage of the module.
- Select condition coverage to see the condition coverage of the
module.
- Select toggle coverage to see
the toggle coverage of the module.