-
Notifications
You must be signed in to change notification settings - Fork 950
Cv32a65x-act4 #3265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Cv32a65x-act4 #3265
Changes from all commits
132d9d6
7b4c8e8
9ee0ce2
a899ee9
127c023
21d2d2f
a5beea8
d2d2ae6
4e90053
f6c6cec
39b97dd
33619cd
5567e28
cb50e02
7a4336e
e388f5e
bb67dd4
3075c16
bbecbc3
409406d
ae5c9b1
dd0cbd1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| #!/bin/bash | ||
| # Run ACT 4.0 tests on cv32a65x via Makefile targets | ||
|
|
||
| # where are the tools | ||
| if ! [ -n "$RISCV" ]; then | ||
| echo "Error: RISCV variable undefined" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! [ -n "$DV_SIMULATORS" ]; then | ||
| DV_SIMULATORS=veri-testharness,spike | ||
| fi | ||
|
|
||
| # install the required tools | ||
| if [[ "$DV_SIMULATORS" == *"veri-testharness"* ]]; then | ||
| source ./verif/regress/install-verilator.sh | ||
| fi | ||
| source ./verif/regress/install-spike.sh | ||
|
|
||
| # setup sim env | ||
| source ./verif/sim/setup-env.sh | ||
|
|
||
| if [ ! -d "external/act4" ]; then | ||
| echo "ERROR: ACT4 submodule missing" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "$SPIKE_INSTALL_DIR" | ||
|
|
||
| set -e | ||
|
|
||
| # ================== CONFIGURATION ================== | ||
| export CVA6_REPO_DIR="$(pwd)" | ||
| export ACT4_PKG="$CVA6_REPO_DIR/external/act4" | ||
| export TARGET_RTL="cv32a65x" | ||
| export CV_SW_PREFIX="riscv64-unknown-elf-" | ||
| export max_cycles=2000000 | ||
|
|
||
| echo "Environment Setup Complete" | ||
|
|
||
| # Build the Verilator model | ||
| echo "Building Verilator model for ${TARGET_RTL}" | ||
| make verilate target="$TARGET_RTL" -j$(nproc) | ||
|
|
||
| cd "${CVA6_REPO_DIR}/verif/sim" | ||
|
|
||
| # Run generation and certification via Makefile | ||
| # This triggers the 'gen' then 'certify' targets defined in verif/sim/Makefile | ||
| echo "Starting ACT Regression (Generation + RTL Simulation)" | ||
| make gen-certify target="$TARGET_RTL" | ||
|
|
||
| #Display Summary | ||
| # Path derived from SIM_RESULTS and VERI_LOG_DIR in Makefile | ||
| SUMMARY_FILE="${CVA6_REPO_DIR}/verif/sim/simulation_results/certification_summary.txt" | ||
|
|
||
| if [ -f "${SUMMARY_FILE}" ]; then | ||
| echo "" | ||
| cat "${SUMMARY_FILE}" | ||
| else | ||
| echo "Error: Summary file not found at ${SUMMARY_FILE}" | ||
| exit 1 | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,6 +72,81 @@ else | |
| spike_params_final := $(spike_params_final) --extension=cvxif | ||
| endif | ||
|
|
||
|
|
||
| # ============================================================================== | ||
| # CVA6 ACT 4.0 Certification Targets (cv32a65x) | ||
| # ============================================================================== | ||
|
|
||
| # Updated paths for CVA6 directory structure | ||
| certification_PROGRAM_PATH = $(ACT4_PKG)/work/cv32a65x/elfs | ||
| certification_PROGRAM_RELPATH = ../../vendor_lib/cva6/external/act4/work/cv32a65x/elfs | ||
| VERI_LOG_DIR = $(CVA6_REPO_DIR)/verif/sim/simulation_results | ||
|
|
||
| .PHONY: gen | ||
| gen: $(ACT4_PKG) | ||
| @command -v uv >/dev/null 2>&1 || { echo "Error: 'uv' not found. Install from https://docs.astral.sh/uv/getting-started/installation/"; exit 1; } | ||
| @echo "* Cleaning ACT4.0 directory..." | ||
| $(MAKE) -C $(ACT4_PKG) clean | ||
| @echo "* Generating ACT4.0 tests for CVA6 (cv32a65x)..." | ||
| # Test generation now relies on the YAML config for extensions and parameters | ||
| $(MAKE) -C $(ACT4_PKG) \ | ||
| CONFIG_FILES=config/cores/cva6/cv32a65x/test_config.yaml EXTENSIONS="" EXCLUDE_EXTENSIONS="InterruptsSm,Sm" \ | ||
| --jobs $(shell nproc) | ||
| @echo "* Tests generated in: $(certification_PROGRAM_PATH)" | ||
|
|
||
| .PHONY: certify | ||
| certify: TEST = certification | ||
| certify: | ||
| @echo "$(BANNER)" | ||
| @echo "* Running ALL compliance ELFs with CVA6 Verilator Model" | ||
| @echo "$(BANNER)" | ||
| @set -e; \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this recipe should be moved to a new script file. What do you think about it?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keeping the logic in the Makefile allows developers to see the entire execution flow( from address discovery to signature validation) in a single place without needing to track down external helper scripts.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But if you suggest i can move this recipe to new script file. However, I am open to either approach. Would you prefer:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have a lot of scripts in For CVA6 designers, these scripts are our entry points to run most simulations: they call the relevant tools (
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current implementation is already aligned with the verif/regress/ flow, the wrapper is placed there intentionally and acts as a standard entry point, similar to existing scripts. It handles environment setup and then invokes the existing Makefile targets (gen and certify) under the hood. From a user perspective, this keeps the interface consistent with other regression flows: bash verif/regress/wrapper-cv32a65x-act.sh So users are not expected to interact with the Makefile directly. I’ll add a short README section to make the flow and entry point clearer. |
||
| mkdir -p "$(VERI_LOG_DIR)"; \ | ||
| SUMMARY="$(VERI_LOG_DIR)/certification_summary.txt"; \ | ||
| echo "RESULT TEST" > "$$SUMMARY"; \ | ||
| echo "------ ----" >> "$$SUMMARY"; \ | ||
| ROOT="$(certification_PROGRAM_PATH)"; \ | ||
| ELFS="$$(find -L "$$ROOT" \( -type f -o -type l \) -a \( -iname '*.elf' -o -iname '*.elf32' \) 2>/dev/null | sort)"; \ | ||
| if [ -z "$$ELFS" ]; then \ | ||
| echo "No .elf files found under $$ROOT"; \ | ||
| exit 2; \ | ||
| fi; \ | ||
| PASS=0; FAIL=0; TOTAL=0; \ | ||
| for ELF in $$ELFS; do \ | ||
| TOTAL=$$((TOTAL+1)); \ | ||
| REL="$${ELF#$$ROOT/}"; \ | ||
| LOG="$(VERI_LOG_DIR)/$${REL%.*}.log"; \ | ||
| mkdir -p "$$(dirname "$$LOG")"; \ | ||
| # CVA6 requires the exact tohost address to be passed as a plusarg\ | ||
| TOHOST_ADDR=$$(riscv64-unknown-elf-nm -B $$ELF | grep -w tohost | cut -d' ' -f1); \ | ||
| set +e; \ | ||
| # Using the CVA6 Variane_testharness binary directly \ | ||
| $(CVA6_REPO_DIR)/work-ver/Variane_testharness \ | ||
| $$ELF \ | ||
| +elf_file=$$ELF \ | ||
| +tohost_addr=0x$$TOHOST_ADDR \ | ||
| +signature=$$ELF.signature_output \ | ||
| > "$$LOG" 2>&1; \ | ||
| RC=$$?; \ | ||
| set -e; \ | ||
| # CVA6 testbench signals success with "ALL TESTS PASSED"\ | ||
| if [ $$RC -eq 0 ] && grep -q "PASSED" "$$LOG"; then \ | ||
| echo "PASS $$REL" | tee -a "$$SUMMARY"; \ | ||
| PASS=$$((PASS+1)); \ | ||
| else \ | ||
| echo "FAIL $$REL" | tee -a "$$SUMMARY"; \ | ||
| FAIL=$$((FAIL+1)); \ | ||
| fi; \ | ||
| done; \ | ||
| echo "" | tee -a "$$SUMMARY"; \ | ||
| echo "TOTAL=$$TOTAL PASS=$$PASS FAIL=$$FAIL" | tee -a "$$SUMMARY"; \ | ||
| echo "Summary saved to: $$SUMMARY"; \ | ||
| true | ||
|
|
||
| .PHONY: gen-certify | ||
| gen-certify: gen certify | ||
|
|
||
|
|
||
| ############################################## | ||
| # Waveform configuration | ||
| ############################################## | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.