Vivado simulator provides a utility using which you can generate the functional coverage report either in text or html format. The Xilinx Coverage Report Generator (XCRG) can also be used for merging multiple coverage databases into a single database.
xcrg Option | Description |
---|---|
-db_name
arg
|
Name of the database inside xsim.covdb. If unspecified all databases present in the directory are used. |
-dir arg
|
Path where the xsim.covdb database directory is located. Default is ./xsim.covdb. |
-file
arg
|
Specify file with location of the coverage databases to be restored. |
-h
|
Print help message and exit. |
-help
|
Print help message and exit. |
-merge_db_name
arg
|
Name of the merged database. Default is xcrg_mdb. |
-merge_dir
arg
|
Directory where the merged database is saved. Default is ./xsim.covdb. |
-nolog
|
Suppresses the log file generation. |
-report_dir
arg
|
Directory where the coverage database and the report are saved. This option is mandatory. |
-report_format
arg
|
Specify the desired format of the coverage report html or text or all. Default is html. |
-log arg
|
Specify the file name which has the log saved. Default is xcrg.log. |
-version
|
Print the version of XCRG and exit. |
-cc_db <arg>
|
Specify the DB Name (Snapshot Name) which is used to save the code coverage database. Code coverage database can be restored from <cc_dir_argvalue>/xsim.codeCov/<cc_db_argvalue>. |
-cc_dir <arg>
|
Specify the directory where the code coverage information database is saved. Code coverage database can be restored from <cc_dir_argvalue>/xsim.codeCov/<cc_db_argvalue>. Default is ./xsim.CodeCov/. |
-cc_fullfile
|
Show the entire file in the code coverage report. By default this is OFF for files more than 50000 lines and only the file's module contents are shown. |
-cc_report <arg>
|
Directory where the code coverage HTML report is saved. Default is xcrg_code_cov_report. |
-merge_cc
|
Merge the code coverage databases specified and create a output merged code coverage database. |
-cc_instancescount <arg>
|
Specify the maximum number of instances shown in the code coverage report. Default is 100. |
xcrg Examples
# Functional Coverage with one DUT and one TB generating html and text reports
xelab -svlog DUT1.v -svlog TB1.v -cov_db_dir ./fRun1 -cov_db_name DB1 -R
xcrg -dir ./fRun1/ -db_name DB1 -report_dir ./fReport1 -report_format html
firefox ./fReport1/dashboard.html &
xcrg -dir ./fRun1/ -db_name DB1 -report_dir ./fReport1 -report_format text
gvim ./fReport1/xcrg_report.txt
# Merging Functional Coverage runs of one DUT and 2 TBs generating merged html report (using TB from previous example)
xelab -svlog DUT1.v -svlog TB2.v -cov_db_dir ./fRun2 -cov_db_name DB2 -R
xcrg -dir ./fRun1 -db_name DB1 -dir ./fRun2 -db_name DB2 -merge_dir ./fMerge1 -merge_db_name mDB1 -report_dir ./mfReport1
firefox ./mfReport1/dashboard.html &
# Code Coverage run and html report generation
xelab -svlog ccDUT.v -svlog ccTB.v -cc_type sbct -cc_db DB1 -cc_dir ./cRun1 -R
xcrg -cc_db DB1 -cc_dir ./cRun1 -cc_report ./cReport1
firefox ./cReport1/dashboard.html &
# Other examples
xcrg -h
xcrg -file /path/to/file
xcrg -file /path/to/file -db_name work.top
xcrg -dir /path/to/abc
xcrg -dir ./abc -report_dir def -report_format html
xcrg -dir ./abc -db_name work.top -report_dir def -report_format html
xcrg -dir /path/to/abc -db_name work.top -report_dir def -report_format text
xcrg -merge_dir m
xcrg -merge_db_name xyz -report_dir def
xcrg -report_format html -nolog
xcrg -report_format html -log xcrgOutput.log
xcrg -cc_db a1 -cc_dir ./
xcrg -cc_report abc -cc_db work.testbench -cc_dir ./xsim.codeCov/