write_xsim_coverage - write_xsim_coverage - 2026.1 English - UG900

Vivado Design Suite User Guide: Logic Simulation (UG900)

Document ID
UG900
Release Date
2026-07-08
Version
2026.1 English

Use the write_xsim_coverage command to save the in-memory coverage data collected during a simulation run to persistent files on disk. Once saved, the coverage databases can be used with export_xsim_coverage or the standalone xcrg tool to generate coverage reports. This command must be executed from the Tcl Console while the simulation session is still active. Closing the simulation discards any unsaved coverage data.

syntax

write_xsim_coverage [-cov_db_name <arg>] [-cov_db_dir <arg>] [-quiet] [-verbose]

Usage

Table 1. write_xsim_coverage
Name Description
[-cov_db_name] Specify the coverage database to be saved. Default: <snapshot_name>, default snapshot_name is work.<simulation_top>
[-cov_db_dir] The output coverage database directory where the database is saved. Default: .
[-quiet] Ignore command errors.
[-verbose] Suspend message limits during command execution.

Description

During simulation, the AMD Vivado simulator kernel accumulates coverage data in memory. The write_xsim_coverage command persists this data to disk so that it survives after the simulation session ends. A single invocation writes both the functional coverage database and the code coverage database (when applicable).

Code coverage data is only available when the design has been elaborated with one or more code coverage switches in xelab (for example, -cc_type sbct). For the full list of code coverage elaboration options, see the xelab Command Options table or run xelab -help

Functional coverage data is generated automatically when the design contains SystemVerilog functional coverage constructs such as covergroup and coverpoint. No additional elaboration switches are required for functional coverage.

Arguments

-cov_db_dir <arg>
(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).
-cov_db_name <arg>
(Optional) Specifies the database folder name inside the coverage database directory. The default value for this argument is the simulation snapshot name.
-quiet
(Optional) Execute the command quietly, returning no messages from the command. The command also returns TCL_OK regardless 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_config command.

Examples

Below example shows writing XSIM coverage databases inside the directory cov_db1 with the database folder name as iter1.
write_xsim_coverage -cov_db_dir cov_db1 -cov_db_name iter1