Skip to content

Pass source directories to Verilator as include paths - #54

Merged
timkpaine merged 5 commits into
mainfrom
tkp/cocotb-include-dirs
Aug 14, 2026
Merged

Pass source directories to Verilator as include paths#54
timkpaine merged 5 commits into
mainfrom
tkp/cocotb-include-dirs

Conversation

@timkpaine

Copy link
Copy Markdown
Member

Verilator does not search an including file's own directory, so a source with ```include "types.svh"`` fails with "Cannot find include file" unless the directory is given as -I. One shared header added in dau-core broke five benches in `dau` this way, none of which had any reason to know a header existed — they listed the same tile sources they always had.

Treat every directory contributing a source as an include path. That is what a caller listing those sources already means, and it keeps adopting a header from being a change every downstream bench has to make.

The regression test builds a module whose width comes from a header beside it, and was verified to fail without the fix.

505 pass.

Verilator does not search an including file's own directory, so a source
that includes a header sitting beside it fails to compile with 'Cannot
find include file' unless the directory is given as -I. dau-core adding
one shared header broke five benches in dau this way, none of which had
any reason to know a header existed -- they listed the same tile sources
they always had.

Treat every directory contributing a source as an include path. That is
what a caller listing those sources already means, and it keeps adopting
a header from being a change every downstream bench has to make.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
Matches every other cocotb test here: CI runners have no verilator, and a
test that needs one must skip rather than fail.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Test Results

507 tests  +2   503 ✅ +1   26s ⏱️ -2s
  2 suites ±0     4 💤 +1 
  2 files   ±0     0 ❌ ±0 

Results for commit 506c686. ± Comparison against base commit c283c9f.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.69%. Comparing base (c283c9f) to head (506c686).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #54      +/-   ##
==========================================
+ Coverage   84.54%   84.69%   +0.14%     
==========================================
  Files          60       61       +1     
  Lines        9702     9723      +21     
  Branches     1240     1242       +2     
==========================================
+ Hits         8203     8235      +32     
+ Misses       1198     1184      -14     
- Partials      301      304       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The end-to-end test needs verilator, which CI does not have, so it skips
exactly where a regression would land unnoticed. Stand in for the runner
and assert what the build was asked for, so the behaviour is checked
everywhere the suite runs.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
A test that needs verilator reports its own body as uncovered on every
runner that lacks one. tests/integration/ is already omitted from
coverage and had no contents; this is what it is for. The unit-level
companion keeps the contract checked everywhere the suite runs.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
A bare directory path matches no file; coverage omit takes globs. The
entry has been inert since it was written, which went unnoticed while the
directory had no contents.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@timkpaine
timkpaine merged commit 27350af into main Aug 14, 2026
4 checks passed
@timkpaine
timkpaine deleted the tkp/cocotb-include-dirs branch August 14, 2026 01:34
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.

1 participant