Skip to content

Commit

Permalink
Merge pull request #176 from antmicro/fkokosinski/59782-riscv-dv-exte…
Browse files Browse the repository at this point in the history
…nsion

tools/riscv-dv: add a separate testlist.yaml
  • Loading branch information
tmichalak authored Jun 7, 2024
2 parents a8a87f3 + 2ad22bb commit 455648f
Show file tree
Hide file tree
Showing 6 changed files with 685 additions and 3 deletions.
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

0 comments on commit 455648f

Please sign in to comment.