Use the export_xsim_coverage command to generate coverage reports from
previously saved coverage databases. This command reads the databases written by
write_xsim_coverage and produces HTML or text reports for both
functional coverage and code coverage. It also supports merging databases from
multiple simulation runs into a single consolidated report. The command can be
executed from the Vivado IDE Tcl Console, a Tcl batch script, or any
Vivado Tcl session.
Syntax
export_xsim_coverage [-cov_db_name <args>] [-cov_db_dir <args>] [-output_dir <arg>][-ccExclusionFile <arg>] [-report_format <arg>][-merge_db_name <arg>] [-merge_dir <arg>] [-cc_fullfile][-cc_instancescount <arg>] [-file <arg>] [-open_html <arg>][-nolog] [-log <arg>] [-quiet] [-verbose]
Usage
| Name | Description |
|---|---|
[-cov_db_name]
|
Specify one or more coverage database names. Repeat for multiple:
-cov_db_name db1 -cov_db_name db2. Default:
./xsim.covdb/<snapshot_name>
|
[-cov_db_dir]
|
Specify one or more coverage database directories. Repeat for multiple:
-cov_db_dir dir1 -cov_db_dir dir2.
Default:. |
[-output_dir]
|
The report files are generated in the specified report directory.
Default: ./xsim_coverage_report
|
[-ccExclusionFile]
|
Code coverage exclusion file. |
[-report_format]
|
Specify the required format of Coverage report: html | text | all. Default: html |
[-merge_db_name]
|
Name for the merged coverage database output. |
[-merge_dir]
|
Directory where the merged coverage database is saved. |
[-cc_fullfile]
|
Show the entire file in the code coverage report. |
[-cc_instancescount]
|
Maximum number of instances shown in code coverage report .Default: 100 |
[-file]
|
Specify file with locations of coverage databases to restore. |
[-open_html]
|
Opens the generated report in the default browser. Default: false |
[-nolog]
|
Suppress log file generation. |
[-log]
|
Log file name. Default: xcrg.log
|
[-quiet]
|
Ignore command errors. |
[-verbose]
|
Suspend message limits during command execution. |
Description
The export_xsim_coverage command processes coverage databases that
were previously written to disk by write_xsim_coverage and
produces human readable reports. It supports generating reports for code coverage
(line, branch, condition, and toggle) as well as SystemVerilog functional coverage,
and can output in HTML format, plain text, or both simultaneously.
When multiple database directories or names are specified, the command automatically
merges the coverage data before generating the report. You can optionally save the
merged database for reuse by specifying -merge_dir and
-merge_db_name .
Code coverage reports require the design to have been elaborated with code coverage options
enabled (example, -cc_type sbct in xelab ).
Functional coverage reports require SystemVerilog coverage constructs (covergroup,
coverpoint) to be present in the design. The functional coverage database is located
at <cov_db_dir>/xsim.covdb/<cov_db_name>/xsim.covinfo.
This command does not return a value.
Arguments
-
-cov_db_dir <args> - (Optional) Specifies the database directory where the database is saved.
The functional coverage database is saved under <cov_db_dir_arg>/xsim.covdb/<cov_db_name_arg>/xsim.covinfo
and the code coverage database is written under <cov_db_dir_arg>/xsim.codeCov/<cov_db_name_arg>/xsim.CCInfo.The
default value for this option is "." (the current directory). This option
can be repeated to specify multiple database directories. When both multiple
-cov_db_dirand-cov_db_namevalues are given, each directory is paired with each name as a cross product. For example,-cov_db_dir dir1 -cov_db_dir dir2 -cov_db_name db1searchesdir1/db1 and dir2/db1. When multiple databases are found they are automatically merged for the report. -
-cov_db_name <args> - (Optional) Specifies the database folder name inside the coverage database
directory. The default value for this argument is the simulation snapshot
name. This option can be repeated to specify multiple database names. For
example,
-cov_db_dir dir1 -cov_db_name db1 -cov_db_name db2searchesdir1/db1 and dir1/db2. If-cov_db_nameis not specified, all databases present in the given-cov_db_dirare used. -
-output_dir <arg> - (Optional) Specifies the directory where the coverage report gets generated.
The default value for this argument is
./xsim_coverage_report -
-report_format <arg> - (Optional) Specifies the format of the generated coverage report. Supported values are: html, text, all. When set to "all", both HTML and text output are produced. The default value is html.
-
-ccExclusionFile <arg> - (Optional) This argument indicates the name of the user specified code coverage exclusion file. Exclusions can be applied at the directory, file, module, instance,and signal levels.
-
-merge_dir <arg> - (Optional) Specifies the directory where the merged coverage database is
saved. When this option is specified along with multiple
-cov_db_name/-cov_db_dirinputs, the databases are merged and the merged database is written to this directory. -
-merge_db_name <arg> - (Optional) Specifies the name for the merged coverage database output. Used
together with
-merge_dirto control the name of the saved merged database. -
-cc_fullfile - (Optional) When specified, the entire source file is shown in the code coverage report. By default, only the module contents are shown for source files with more than 50,000 lines.
-
-cc_instancescount <arg> - (Optional) Specifies the maximum number of instances shown in the code coverage report. The default value is 100.
-
-file <arg> - (Optional) Specifies a file containing the locations of coverage databases to restore. Each line in the file should specify a database directory and name.
-
-open_html <arg> - (Optional) Specifies whether the HTML report is to be opened in a browser or not. The default value for this argument is false.
-
-nolog - (Optional) Suppresses generation of the
xcrglog file. - -log <arg>
- (Optional) Specifies a custom name for the
xcrglog file. The default log file name isxcrg.log. -
-quiet - (Optional) Execute the command quietly, returning no messages from the
command. The command also returns
TCL_OKregardless of any errors encountered during execution.Note: The command returns any errors encountered on the command line during launch. It traps only errors that occur inside the command. -
-verbose - (Optional) Temporarily override any message limits and return all messages
from this command.Note: Message limits can be defined with the
set_msg_configcommand.
Examples
Below examples generates an export XSIM coverage report by merging multiple coverage databases with various reporting and logging options.
export_xsim_coverage -cov_db_name DB1 -cov_db_dir ./cRun1 \
-cov_db_name DB2 -cov_db_dir ./cRun2 \
-output_dir ./report \
-merge_dir ./mergedDB -merge_db_name mergedRun \
-report_format all \
-open_html true \
-ccExclusionFile exclusion.txt \
-cc_fullfile -cc_instancescount 50 \
-log ./my_coverage.log
The above single command demonstrates:
- Specifying multiple coverage databases (
DB1in./cRun1andDB2in./cRun2) for merging - Saving the merged database for later use (
-merge_dir,-merge_db_name) - Generating both HTML and text report formats (
-report_format all) - Opening the HTML report in a browser (
-open_html true) - Applying code coverage exclusions (
-ccExclusionFile) - Showing full source file content with an instance limit
(
-cc_fullfile,-cc_instancescount 50) - Using a custom log file name (
-log)