coverage
Reports on the coverage the run step collected. Used by TestRIG, when dut.coverage.functional is set. The reporter goes with the simulator: IMC reads the databases Xcelium writes, and doris itself reads the file a Verilator run writes. A job gets the one that reads its simulator’s unless the config binds one as tool.coverage, by the name imc or doris, and binding one that can’t read them is an error when the job is planned (see Tools). Both give the same summary in the result.
The step reports on this run alone. Coverage is not merged across runs (see Open questions).
It runs after a run step that failed, too. A run with a failing test still collected coverage, and the report of it shows what the tests reached. So a job whose run step is failed has a coverage report, and coverage in its result. The step is skipped when the run step did not complete, with a step error or a setup error, or was skipped itself: its outputs are then not known to be complete.
Xcelium: IMC
| Depends on | run (the coverage database), passed or failed |
| Command | imc -licqueue [<args>] -execcmd '<commands>', run in coverage/ |
| Outputs | coverage/summary.txt, coverage/detail.txt, coverage/html/ |
| Key tools | imc, by the version imc -version prints |
| Passes when | IMC prints no *E or *F line and the three outputs exist |
| Cached | Yes. The key covers the run step’s outputs, so a new run is a new report |
<args> is tools.imc.coverage.args, as given.
The commands
IMC is given its commands on the command line, separated by ;, so they are part of the cache key:
load -run {<abs>/run/dut/cov_work/scope/<test>}
config reports.detachable_report_data -set true
report -summary -type -all -metrics covergroup -source off -out summary.txt
report -detail -type -all -metrics covergroup -source off -out detail.txt
report_metrics -out html -overwrite -detail -metrics all -kind aggregate \
-source on -exclComments -assertionStatus -allAssertionCounters -all
The database is given by its absolute path, <abs> here, in braces so that Tcl reads it as one word. <test> is dut.test, or test when it is unset.
| Output | Holds |
|---|---|
summary.txt | One row per module with covergroups: its covergroup average and its bins covered |
detail.txt | Every covergroup, coverpoint and bin, with hit counts. Look here for the bins not hit |
html/ | IMC’s HTML report of every metric. Open html/index.html |
detachable_report_data makes IMC write the HTML report’s data to html/report_data/, which is the file dvplan annotates a verification plan from. -licqueue waits for a licence rather than failing. The two report commands are IMC’s legacy text reports, so each prints a *W,REPDEP warning: report_metrics only writes HTML.
What passed means
IMC exits with code 0 whatever happened, so the exit code decides nothing. The step is a step error if coverage/stderr.log, where IMC writes its messages, or coverage/stdout.log has a line starting *E, or *F,, such as a database that can’t be loaded, or if an output is missing.
passed means the reports were written. It does not mean:
- Any level of coverage was reached. There is no coverage goal. A run that covered nothing passes.
- The summary has the modules you expect. A module with no covergroups, or left out of
dut.coverage.scopes, has no row.
To check by hand
coverage/stderr.log shows *I,RUNLD: Successfully loaded run, and coverage/stdout.log ends with Metrics report written to. Neither log is an output of the step, so for a step that passed they are only there after a run with --debug (see What is left in a step’s directory). The reports are always there. summary.txt has a row for each module in dut.coverage.scopes. In detail.txt, a bin shows (hits/1): check that the bins you expect to be hit have counts in line with the number of tests.
Verilator: doris
This is the doris plugin reading the file itself, not a command, so there are no logs. Config binds it by the name doris, and it has no options.
| Depends on | run (the coverage file), passed or failed |
| Reads | run/dut/coverage.dat |
| Outputs | coverage/summary.json, coverage/detail.txt, coverage/html/ |
| Passes when | The file was read and the outputs were written |
| Cached | Yes. The key covers the run step’s outputs, so a new run is a new report |
| Key | The plugin’s hash, and the coverage file’s path |
The file has a count for each cover property. doris takes those the instrument step made, whose names hold the module, covergroup, coverpoint and bin, and reports them as the covergroups they came from. A module with several instances has a count for each: they are added.
| Output | Holds |
|---|---|
summary.json | One entry per module with covergroups: its covergroup average and its bins covered |
detail.txt | Every covergroup, coverpoint and bin, with hit counts. Look here for the bins not hit |
html/ | The same as a page, html/index.html: the modules, each covergroup’s coverpoints with the bins not hit, and every bin’s hits |
For a testbench whose covergroups can all be rewritten, the figures are the ones IMC gives for the same tests in Xcelium, down to the hit count of each bin. What can’t be rewritten is left out. The HTML report has the covergroups only: IMC’s also has assertions and the source.
What passed means
passed means the reports were written. As for IMC, it does not mean any level of coverage was reached. A run that wrote no cover properties of doris’s gives an empty summary and passes.
To check by hand
detail.txt lists the modules in dut.coverage.scopes, and the bins you expect to be hit have counts in line with the number of tests. instrument/unsupported.txt is empty: if not, those bins are missing from the totals.
The summary in the result
doris reads the summary when it writes the result file. Each row becomes an entry of coverage: the module’s name, its covergroup average in percent, and the bins covered out of the total. The job’s page shows them as a table, and the flow’s index shows the bins covered over all modules.
average is IMC’s figure, and doris works it out the same way for Verilator: the mean of the module’s covergroups, each the mean of its coverpoints. It is not covered / total, which weights every bin the same.