Skip to content

Commit

Permalink
update verilator coverage to work if vl_finish ends the testrun (coco…
Browse files Browse the repository at this point in the history
…tb#3217)

Remove vl_finish() from verilator.cpp to help make verilator coverage work more consistently

verified by adding '--coverage' to Makefile.verilator variable EXTRA_ARGS and
then running cocotb/tests/tests_1279. Pre verilator.cpp change, no coverage.dat
is generated. Post change, one is generated.

---------

Co-authored-by: David Stanford <[email protected]>
Co-authored-by: Marlon James <[email protected]>
  • Loading branch information
3 people authored Feb 9, 2023
1 parent 519963a commit 1fbf441
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion cocotb/share/lib/verilator/verilator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ int main(int argc, char** argv) {
// If there are no more cbAfterDelay callbacks,
// the next deadline is max value, so end the simulation now
if (next_time == static_cast<vluint64_t>(~0ULL)) {
vl_finish(__FILE__, __LINE__, "");
break;
} else {
main_time = next_time;
Expand Down
1 change: 1 addition & 0 deletions documentation/source/newsfragments/1478.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed Verilator not writing coverage files in some cases.

0 comments on commit 1fbf441

Please sign in to comment.