Add Verilator-based verification environment for hwpe_ctrl_target - #33
Merged
Conversation
Introduce a dedicated, self-checking test environment for the SystemRDL-based hwpe_ctrl_target, together with a GitHub Actions CI that runs it. The build and regression infrastructure mirrors RedMulE's (bender script -> verilator --binary, bwruntests.py parallel runner, portless *_tb_wrap top). Fix the register-interface naming contract: commits 86e7706 and ce04de5 shortened the names in hwpe_ctrl_regif_example.rdl without updating hwpe_ctrl_target.sv, which left the example incoherent with target. Restore the naming used by the target (and by other HWPE like redmule), and replace the placeholder job-independent and job-dependent regfiles with an example set that exercises writable, read-only, nonzero-reset, reserved-masked and hw-driven fields. hwpe_ctrl_target.sv itself is unchanged. The testbench drives hwpe_ctrl_intf_periph directly (no core, no golden model), which allows cycle-exact stimulus for the backpressure and commit/trigger-overlap corners. Four scenarios, selected with +TEST=: reg_access every register at its offset: reset values, write/readback, read-only immutability, reserved-bit masking, byte enables, and the hardware-to-software paths (STATUS, RUNNING_JOB) offload repeated ACQUIRE -> COMMIT -> TRIGGER, overlapped and separated, job-ID sequencing, job FIFO payload ordering, autotrigger on/off, trigger masking while a job runs fifo_backpressure job queue filled to NB_CONTEXT, ACQUIRE returning the queue-full code while gnt stays asserted, then recovery soft_clear all four encodings, clear_o pulse width, register-file versus state clear isolation, and reuse after a clear Other changes: - rdl.sh: replace the GNU-only sed -i (broken on macOS) with a portable form, and prepend the SPDX header PeakRDL does not emit - Bender.yml: sources are guarded by a project-specific hwpe_ctrl_test target; the generic 'test' target would also select common_cells' own testbenches, since bender applies target flags across the whole dependency tree - CI matrix covers NB_CONTEXT 2 and 4, an elaboration-time parameter The pre-existing QuestaSim flow under sim/ and tb/ is untouched in this commit.
The lint-license CI job expects three consecutive comment lines at the top of each file: a Copyright line, the Solderpad notice, and SPDX-License-Identifier. The legacy headers carried the long-form Solderpad boilerplate but no SPDX identifier. Prepend the three-line block to every .sv/.svh, preserving each file's existing copyright years and keeping the original header underneath.
The licence job checks every tracked file, not just RTL, so the dependency manifests (Bender.yml, src_files.yml) and the legacy QuestaSim helper scripts (rtl/rdl.sh, sim/*) failed it -- none of them carries a header today. Waive them via exclude_paths. Patterns are fnmatch'd against the repo-relative path, so sim/* covers only the top-level sim/ tree; target/sim (the Verilator flow) stays checked.
FrancescoConti
marked this pull request as ready for review
August 5, 2026 17:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a dedicated, self-checking test environment for the SystemRDL-based
hwpe_ctrl_target, together with a GitHub Actions CI that runs it. The build and
regression infrastructure mirrors RedMulE's (bender script -> verilator --binary,
bwruntests.py parallel runner, portless *_tb_wrap top).
The testbench drives hwpe_ctrl_intf_periph directly (no core, no golden model),
which allows cycle-exact stimulus for the backpressure and commit/trigger-overlap
corners. Four scenarios, selected with +TEST=:
reg_access every register at its offset: reset values, write/readback,
read-only immutability, reserved-bit masking, byte enables,
and the hardware-to-software paths (STATUS, RUNNING_JOB)
offload repeated ACQUIRE -> COMMIT -> TRIGGER, overlapped and
separated, job-ID sequencing, job FIFO payload ordering,
autotrigger on/off, trigger masking while a job runs
fifo_backpressure job queue filled to NB_CONTEXT, ACQUIRE returning the
queue-full code while gnt stays asserted, then recovery
soft_clear all four encodings, clear_o pulse width, register-file
versus state clear isolation, and reuse after a clear
Other changes:
and prepend the SPDX header PeakRDL does not emit
the generic 'test' target would also select common_cells' own testbenches,
since bender applies target flags across the whole dependency tree