Skip to content

Conversation

@CharrierTim
Copy link
Contributor

@CharrierTim CharrierTim commented Nov 13, 2025

Resolves #984

Added coverage merge support for nvc.

Extended tests in test/vhdl/coverage/run.py and added coverage to test/vhdl/uart/run.py to show a more realistic use case.

@LarsAsplund
Copy link
Collaborator

Looks good! Please add a newsfragment describing this new feature, see https://vunit.github.io/contributing.html#release-notes-instructions. After that it can be merged.

@CharrierTim
Copy link
Contributor Author

Looks like 3 actions are failing:

  1. push / 🛳️ Container · 39-acceptance · NVC (pull_request)
    • Cause: The NVC version used in CI/CD seems to be < 1.14, which is the minimum version required for this coverage support
  2. push / 🛳️ Container · 313-acceptance · llvm (pull_request)
    • Cause: The UART test was enhanced with coverage support, which is incompatible with how the test is run
  3. push / 🟦 Windows · nightly · 310-acceptance-ghdl (pull_request)
    • Cause: Same as above

Not sure how I should resolve the first one. For the 2nd and 3rd, I can revert the UART test changes.

@LarsAsplund
Copy link
Collaborator

I can try to bump NVC to the latest version. At some point it had a problem so I pinned the version we were using in the CI in order for it to pass. I can see if that problem has disappeared with later versions

@LarsAsplund
Copy link
Collaborator

Our CI uses the https://hub.docker.com/r/hdlc/nvc docker image which hasn't been updated for over a year and uses nvc 1.14-devel (1.13.0.r46.g059d264f) (Using LLVM 11.0.1). Even if I workaround the issue in that version, I'm not sure it supports coverage. I will have to investigate further. Or do you already know?

@CharrierTim
Copy link
Contributor Author

Our CI uses the https://hub.docker.com/r/hdlc/nvc docker image which hasn't been updated for over a year and uses nvc 1.14-devel (1.13.0.r46.g059d264f) (Using LLVM 11.0.1). Even if I workaround the issue in that version, I'm not sure it supports coverage. I will have to investigate further. Or do you already know?

I just checked and need to correct myself, the minimum required version for the coverage is actually r1.15.0: https://github.com/nickg/nvc/releases/tag/r1.15.0 (for the --cover-file= option)
You'll need to use a newer version of NVC in the CI.

@Blebowski
Copy link

Hi @LarsAsplund,

the 1.14.0 does support coverage already. However, you state some commit pre 1.14 (1-14-devel). The thing is that the coverage API changed in 1.14 (-c command was deprecated with warning, and split to --cover-merge , --cover-report and --cover-export).

I did not have a look if the commit you referenced already contains this change, or not, however the changes made in this MR use --cover-file argument to specify name of the coverage database to be created by the simulation run. Therefore, you anyway need at least 1.15.0 in the runner to get this runner working. Either way I recommend taking latest release as there has been fixes in the coverage in the last year.

And, as I type it, I see that @CharrierTim just pushed a fix for this. That is Open source race condition...

@LarsAsplund
Copy link
Collaborator

@CharrierTim Please rebase on master and see if it works. I've updated to NVC 1.18.

@LarsAsplund
Copy link
Collaborator

Great, it works now. Thanks for your contribution!

@LarsAsplund LarsAsplund merged commit 9400790 into VUnit:master Jan 7, 2026
14 checks passed
@CharrierTim CharrierTim deleted the feature/add-nvc-coverage branch January 7, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for merging coverage results with nvc

3 participants