Skip to content
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

tools/riscv-dv: add a separate testlist.yaml #176

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/scripts/riscv_dv_parse_testlist.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
import os
from json import dumps
from yaml import load, Loader
from typing import Generator
Expand All @@ -19,8 +20,15 @@ def parse_yaml(path: str) -> Generator[str, None, None]:

if __name__ == "__main__":
if len(sys.argv) == 2:
testlist = parse_yaml(
RISCV_DV_HOME + f'target/{sys.argv[1]}/testlist.yaml')
testlist = RISCV_DV_HOME + f'target/{sys.argv[1]}/testlist.yaml'

# check if testlist.yaml is provided by RISCV-DV; if not - it's a
# custom testlist file not provided by RISCV-DV by default; treat the
# script argument as full a path
if not os.path.isdir(testlist):
testlist = sys.argv[1]

testlist = parse_yaml(testlist)
else:
testlist = parse_yaml(RISCV_DV_HOME + 'yaml/base_testlist.yaml')
testlist = list(testlist)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-riscv-dv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
- id: test-types
run: |
python3 -m pip install pyyaml
echo "tests=$(python3 .github/scripts/riscv_dv_parse_testlist.py rv32imc)" | tee -a $GITHUB_OUTPUT
echo "tests=$(python3 .github/scripts/riscv_dv_parse_testlist.py tools/riscv-dv/testlist.yaml)" | tee -a $GITHUB_OUTPUT
echo "include-generate=$(python3 .github/scripts/riscv_dv_matrix_include.py generate)" | tee -a $GITHUB_OUTPUT
echo "include-run=$(python3 .github/scripts/riscv_dv_matrix_include.py run)" | tee -a $GITHUB_OUTPUT
- id: hash
Expand Down
8 changes: 8 additions & 0 deletions tools/riscv-dv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ RISCV_DV_ARGS = \
--iterations $(RISCV_DV_ITER) \
--batch_size $(RISCV_DV_BATCH) \
--isa rv32imc --mabi ilp32 \
--custom_target $(PWD) \
--testlist $(PWD)/testlist.yaml \
-v -o $(TEST_DIR)

MAKEFILE = $(abspath $(MAKEFILE_LIST))
Expand Down Expand Up @@ -141,7 +143,13 @@ $(WORK_DIR)/coverage.dat:
touch $@ ; \
fi

%.sv: %.py
./$< $(RISCV_DV_PATH) $(RV_ROOT) > $@

generate:
# Generate *.sv configuration
#$(MAKE) -f $(MAKEFILE) riscv_core_setting.sv

# Run RISC-V DV code generation
$(MAKE) -f $(MAKEFILE) $(TEST_DIR)/generate.log

Expand Down
Loading
Loading