ci: add Cook-based Verilator Tier 1 and Tier 2 workflows for GitHub Actions - #3480
AlexChenIC wants to merge 8 commits into
Conversation
|
Thank you for this contribution! The testharness support is definitely useful. However, I don't think the current implementation fits well with the design philosophy of cook.py. The main concern is that, in this PR, verilator_testlist.py is currently a monolithic wrapper around the existing cva6.py flow. One of the goals of cook.py is to avoid carrying this kind of legacy orchestration into the new recipe structure. cook.py philosophy:
Proposed ArchitectureBased on the existing UVM flows for VCS, Xcelium, and Questa, I would suggest splitting the testharness support into separate compilation, execution, and testlist recipes. With this architecture, users would: # HW Compile testharness with Verilator
./cook.py verilator-testharness-comp -t cv32a60x
### Single test:
# SW Compile hello-world test
./cook.py hello-world -t cv32a60x -c llvm-20-1-8 # this recipe already exist!
# Run a single test
./cook.py verilator-testharness-run -t cv32a60x -n riscv-tests-rv32ui-p-add # TOBEDONE
### Run a testlist
# SW Compile all tests in testlist
./cook.py sw-compile-testlist -t cv32a60x -c llvm-20-1-8 -l custom/regression.yml # this recipe already exist!
# Run all tests in testlist
./cook.py testharness-run-testlist --simulator verilator -t cv32a60x -l tests.yml # TOBEDONE
1. Compilation Recipes (per simulator)Responsibilities:
Key differences from UVM:
Reference implementation: For example, the Verilator recipe could expose an interface along these lines: def verilator_testharness_comp(
target: str = typer.Option(..., "--target", "-t"),
comp_mode: CompMode = typer.Option(CompMode.rtl),
trace_mode: TraceMode = typer.Option(TraceMode.notrace),
stats: bool = typer.Option(False, help="Enable RTL perf tracer"),
quiet: bool = typer.Option(False, "--quiet", "-q"),
):
"""Verilator testharness compilation flow"""2. Run Recipes (per simulator)Responsibilities:
Key differences from UVM:
Reference implementation: For example, the Verilator recipe could expose an interface along these lines: def verilator_testharness_run(
target: str = typer.Option(..., "--target", "-t"),
test_name: str = typer.Option(..., "--testname", "-n"),
comp_mode: CompMode = typer.Option(CompMode.rtl),
trace_mode: TraceMode = typer.Option(TraceMode.notrace),
iss_enabled: bool = typer.Option(False, help="Enable ISS comparison"),
interactive_gui: bool = typer.Option(False),
quiet: bool = typer.Option(False, "--quiet", "-q"),
):
"""Verilator testharness run simulation flow"""3. TestHarness Testlist Runner (multi-simulator)Responsibilities:
Reference implementation: Signature: def testharness_run_testlist(
simulator: str = typer.Option(..., "--simulator", help="vcs/xcelium/questa/verilator"),
target: str = typer.Option(..., "--target", "-t"),
testlist: str = typer.Option(..., "--testlist", "-l"),
comp_mode: CompMode = typer.Option(CompMode.rtl),
trace_mode: TraceMode = typer.Option(TraceMode.notrace),
iss_enabled: bool = typer.Option(False),
quiet: bool = typer.Option(False, "--quiet", "-q"),
):
"""Run testharness testlist with specified simulator"""
# Dispatch to appropriate simulator run recipe
if simulator == "verilator":
verilator_testharness_run(...)
elif simulator == "vcs":
vcs_testharness_run(...)
# etc.-- Would you be willing to consider refactoring the implementation along these lines? I’d be happy to help with:
The goal is to make TestHarness support fully integrated into cook.py, with the same level of consistency and maintainability as the existing UVM flows. |
|
Hi @yanicasa, thank you for the detailed review and for proposing a clearer architecture. At present, this PR adds a single TestHarness testlist recipe, primarily used by the Tier CI path, that delegates each compiled test to the legacy My understanding is that the TestHarness support should be reorganized into three recipe layers:
The simulator-specific compilation and run recipes should invoke Verilator TestHarness directly where practical, rather than delegating to I would appreciate your help with both the recipe interface design and the incremental review. Before revising the implementation, could you please confirm the following points?
Once these points are clarified, I can begin implementing the Verilator compilation recipe based on the existing work and share that component for review. |
|
Hi @AlexChenIC
Let's start with the compilation recipe first and review it incrementally. Once that is in place, we can move on to the run recipe and then the testlist integration. Coverage, gate modes, and the other simulator backends can be addressed later. |
Summary
This PR extends the existing Tier CI flow used on the
masterbranch tomaster_candidateand adapts it to the Cook-based compilation and regression flow introduced onmaster_candidateby Thales contributors.Motivation and architecture
The existing
masterTier CI provides the overall model for organizing regression coverage into separate tiers. Themaster_candidatebranch uses the Thales Cook infrastructure as the basis of its software compilation and verification flow.This PR connects these two approaches. It preserves the Tier 1 and Tier 2 organization established by the
masterCI while adapting the execution path to the Cook-based infrastructure used bymaster_candidate.The longer-term goal is for the public GitHub Actions CI and the Thales GitLab CI to share the same underlying execution architecture wherever practical. Platform-specific concerns, such as job scheduling, caching, and artifact publication, remain implemented by the respective GitHub Actions and GitLab CI layers.
What this PR adds
The implementation:
cook.pyInitial validation scope
This is the first scoped integration of the proposed architecture on
master_candidate. Its purpose is to validate the complete end-to-end structure with a controlled set of configurations before expanding the regression coverage. It is not intended to provide the final testcase or core-configuration coverage in this PR.The current validation scope covers two RV32 AXI core configurations.
Tier 1 — hosted run, 2/2 matrix jobs passed:
cv32a60x_axiwithbase-rv32-pcv32a65x_axiwithbase-rv32-pTier 2 — hosted run, 3/3 matrix jobs passed:
cv32a60x_axiwithbase-rv32-pcv32a65x_axiwithbase-rv32-pcv32a65x_axiwithbase-pmpAll five hosted matrix jobs completed successfully, the targeted Verilator TestHarness safety tests passed, and artifacts were uploaded for every matrix job. This demonstrates the end-to-end path across both core configurations.
Dependency
This integration requires the
uvm_warningcompatibility fix proposed in #3478. Without that fix, the Verilator build used by the Cook-to-TestHarness path fails because themaster_candidateversion of the macro does not match the standard two-argument UVM signature. For validation, this branch temporarily includes the equivalent two-line fix.Follow-up work
Once the initial architecture is accepted, follow-up work is expected to include:
master_candidatecore configurations, using the Thales GitLab CI coverage as a referencemasterTier CI dashboardThese extensions are intentionally kept outside the scope of this first PR so that the Cook-based integration architecture can be reviewed and validated independently.