Skip to content

ACT4: add Spike support and cvw-rv32gch/rv64gch configs#1048

Open
TnnsBeast wants to merge 4 commits intoriscv:act4from
TnnsBeast:act4_spike_cvwh
Open

ACT4: add Spike support and cvw-rv32gch/rv64gch configs#1048
TnnsBeast wants to merge 4 commits intoriscv:act4from
TnnsBeast:act4_spike_cvwh

Conversation

@TnnsBeast
Copy link

Enable Spike support for self checking usage in H tests, and create new cvw core configs with H enabled.

Notes

  • As recommended by Prof. Harris, generating ref_model_args from UDB extension list is not included and is saved as a TODO for later
  • This PR does not include h test generators. This will be included in a separate PR.

Copilot AI review requested due to automatic review settings March 7, 2026 02:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds Spike reference model support to the ACT4 framework and introduces two new Core-V Wally configurations (cvw-rv32gch and cvw-rv64gch) with the H (hypervisor) extension enabled. The framework changes generalize the Makefile generation to work with multiple reference models instead of being Sail-specific.

Changes:

  • Added SPIKE as a reference model type in RefModelType enum with corresponding signature and debug flags, plus a new ref_model_args config field
  • Refactored makefile_gen.py to make ref model invocation generic (moved Sail-specific config handling into conditional branches, added caching for generated Sail configs)
  • Added complete config directories for cvw-rv32gch and cvw-rv64gch (test_config, UDB YAML, sail.json, linker script, rvmodel_macros, rvtest_config files) and excluded H extension from QEMU regression

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
framework/src/act/config.py Added SPIKE enum member, debug_flags() method, and ref_model_args field
framework/src/act/makefile_gen.py Generalized ref model handling in Makefile generation; moved Sail config generation inline; added caching
config/cores/cvw/cvw-rv64gch/* New 64-bit CVW config with H extension, using Spike
config/cores/cvw/cvw-rv32gch/* New 32-bit CVW config with H extension, using Spike
.github/workflows/regress.yml Excluded H extension from QEMU regression tests

Copy link
Collaborator

@davidharrishmc davidharrishmc left a comment

Choose a reason for hiding this comment

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

Minor comments. Ready to go when @jordancarlin approves.

Copy link
Collaborator

@jordancarlin jordancarlin left a comment

Choose a reason for hiding this comment

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

The common test compilation logic seems like it is broken for Spike. If you have a config using Spike as the reference model with rv32imc and another with rv32imfdc it would compile all of the tests separately even though it should be possible to reuse the I, M, and C tests for both of them.

FAST=True \
EXTENSIONS= \
EXCLUDE_EXTENSIONS=Sm,ExceptionsZc,S,Zalrsc,Zacas,ZacasZabha \
EXCLUDE_EXTENSIONS=Sm,ExceptionsZc,S,Zalrsc,Zacas,ZacasZabha,H \
Copy link
Collaborator

Choose a reason for hiding this comment

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

There are no H tests being generated. Is this necessary?

Comment on lines +60 to +61
# - { name: Svade, version: "= 1.0.0" }
# - { name: Svadu, version: "= 1.0.0" } # TODO: Re-enable when https://github.com/riscv/riscv-unified-db/issues/1217 is fixed
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems to be based on an old UDB config. These extensions both work now and are enabled in the other CVW configs. Please update this to match the other CVW configs and just add H (and any other params/extensions) on top of it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is an old version of the linker script. Please update to match what is currently used by other CVW configs.

"""Get the debug/trace flags for this reference model."""
flags_map = {
RefModelType.SAIL: "--trace-all --trace-output {sig_trace_file}",
RefModelType.SPIKE: "-l --log={sig_trace_file}",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be nice to add the --log-commits flag to this. It prints out all register and memory updates in Spike and is useful for debugging.


# Hash reference model settings that affect signature generation command lines
hasher.update(config.ref_model_type.value.encode())
hasher.update((config.ref_model_args or "").encode())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
hasher.update((config.ref_model_args or "").encode())
if config.ref_model_args is not None:
hasher.update((config.ref_model_args).encode())

xlen: int,
config: Config,
sail_config_path: Path,
common_e_ext: bool | None = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

bool | None is a strange type and I am having trouble following the logic around this. It seem like right now it is overloaded such that None means it is not a common test, true means it is a common test with E, and false means it is a common test without E. What about instead passing in config_flag or something and for sail common tests it can pass the generated sail config, for sail not common tests it can pass the DUT sail config, and for spike tests it can pass the spike ISA string?

flen = test_metadata.flen
test_path = test_metadata.test_path
ref_model_sig_flags = config.ref_model_type.signature_flags.format(sig_file=sig_file, granularity=int(xlen / 8))
ref_model_args_line = f"\t\t{config.ref_model_args} \\\n" if config.ref_model_args else ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like we should combine (and rename) ref_model_args and ref_model_config. Right now one is used to configure Spike and the other is used to configure Sail. No need for them to be separate.

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.

4 participants