Skip to content

ci: Lint the testbenches too and clear what that exposes - #192

Merged
DanielKellerM merged 4 commits into
pulp-platform:develfrom
DanielKellerM:ci/lint-testdir
Aug 17, 2026
Merged

ci: Lint the testbenches too and clear what that exposes#192
DanielKellerM merged 4 commits into
pulp-platform:develfrom
DanielKellerM:ci/lint-testdir

Conversation

@DanielKellerM

Copy link
Copy Markdown
Collaborator

Stacked on #186 (which added the tree-scoped gate over src/); merge after it.

The style gate only ever walked src/, so test/ had never been linted and had accumulated 209 violations. This extends the gate to the testbenches and fixes what it reports, leaving the tree at zero.

The one change that is not cosmetic

tb_idma_otf_transpose.sv used $test$plusargs("BP"), which verible rejects. Swapping to $value$plusargs alone would have been a silent regression: idma.mk passed +BP with no value, so the parse would have failed, backpressure would have stayed 0, and the backpressured transpose stimulus would have become a byte-identical rerun of the first - verible quiet, suite green, one stimulus gone.

So the makefile and the testbench change together (+BP=1 plus $value$plusargs("BP=%d", ...)). Verified on the same binary:

./simv +BP=1  ->  [TB] case M=13 N=19 EB=1 ... BP=1
./simv +BP    ->  [TB] case M=13 N=19 EB=1 ... BP=0

and the two suite runs still differ (otf_transpose BP=0 vs otf_transpose_bp BP=1), so the second stimulus is genuinely live.

Other classes

Line length, trailing whitespace, tabs, explicit parameter and task-parameter types, constraint and parameter naming, unpacked dimension ordering. The task-lifetime changes in test/include/tb_tasks.svh are the ones with real semantics: those tasks contain no time control, so static storage is currently safe and automatic is identical, but it removes the hazard the day someone adds a @(posedge clk) to a memory task - that file backs all eight generated backend testbenches, and init_mem and compare_mem already run from different initial blocks.

Renaming constraint irq to irq_c also removes a name collision with the module-level logic irq in both desc64 testbenches.

One waiver, named and justified

interface-name-style on test/idma_intf.sv: IDMA_DV/IDMA_ND_DV are the exported verification API and are instantiated by name by downstream verification this repo's CI cannot see, so renaming them here would break it silently. No rule is disabled globally and no directory is excluded except the vendored files under test/future/, which are named explicitly.

Verified

  • make idma_lint_sv over src/ and test/: 0 violations
  • make idma_verify_all: rc=0, 24 elaboration OK, 21 sim PASS, 0 failures, 218 s
  • Real Questa simulations exercising the shared task library: rw_axi, r_obi_w_axi and rw_obi all pass with their own per-variant configurations, gated on the transcript rather than the exit code

Copilot AI lite review requested due to automatic review settings August 13, 2026 11:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The style gate walked src/ only, so test/ had never been linted and had
accumulated 209 violations.

Extend the tree-scoped gate to the testbenches and fix what it reports. The
backpressure flag needed a paired change: verible rejects a bare
$test$plusargs, and switching to $value$plusargs without also passing a value
would have left backpressure deasserted and turned the second transpose
stimulus into a copy of the first.
Eighty-four blocks across the files this branch touches. Fifty-nine are
rewritten as one line, eleven joined where they already fitted, and six deleted
outright: a disabled replay branch and five commented-out $display calls are
dead code, not comments to shorten.

Two are kept. The desc64 "Copied from frontend" blocks are a register bit-field
table, and a reader needs it at that spot; collapsing it would lose the map
rather than the prose.

The pretty-print format string kept twenty-four padding spaces per element when
it was rewritten as a concatenation, so the change satisfied the linter while
preserving what made it ugly. The padding sat before a newline, so dropping it
leaves the rendered output identical.
The waiver reason is one line; the commit that added it owns the rest.
The tree lint reaches test/ now and this case has no default. The eight arms
already cover e % 8, so the default is unreachable; it returns a sentinel that
would fail the byte-exact compare rather than a value that could pass.
@DanielKellerM
DanielKellerM merged commit 0d056a0 into pulp-platform:devel Aug 17, 2026
33 checks passed
@DanielKellerM DanielKellerM mentioned this pull request Aug 17, 2026
5 tasks
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.

2 participants