ACT4: add Spike support and cvw-rv32gch/rv64gch configs#1048
ACT4: add Spike support and cvw-rv32gch/rv64gch configs#1048TnnsBeast wants to merge 4 commits intoriscv:act4from
Conversation
There was a problem hiding this comment.
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
SPIKEas a reference model type inRefModelTypeenum with corresponding signature and debug flags, plus a newref_model_argsconfig field - Refactored
makefile_gen.pyto 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-rv32gchandcvw-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 |
davidharrishmc
left a comment
There was a problem hiding this comment.
Minor comments. Ready to go when @jordancarlin approves.
…s for rvmodel_macros.h to ensure they don't fall out of date
jordancarlin
left a comment
There was a problem hiding this comment.
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 \ |
There was a problem hiding this comment.
There are no H tests being generated. Is this necessary?
| # - { 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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}", |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
| 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, |
There was a problem hiding this comment.
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 "" |
There was a problem hiding this comment.
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.
Enable Spike support for self checking usage in H tests, and create new cvw core configs with H enabled.
Notes