@@ -22,18 +22,30 @@ jobs:
2222 - name : Ensure pre-commit checks pass
2323 run : uvx pre-commit run --all-files --show-diff-on-failure --color=always
2424
25+ discover-sail-configs :
26+ name : Discover Sail Configs
27+ runs-on : ubuntu-latest
28+ outputs :
29+ configs : ${{ steps.find.outputs.configs }}
30+ steps :
31+ - name : Checkout code
32+ uses : actions/checkout@v6
33+
34+ - name : Find all sail configs
35+ id : find
36+ env :
37+ EXCLUDE : " sail-rv32e sail-rv32-max-clang sail-rv64-max-clang" # TODO: UDB does not support E yet, not all tests work with clang
38+ run : |
39+ configs=$(ls -d config/sail/*/ | xargs -n1 basename | grep -vxFf <(tr ' ' '\n' <<< "$EXCLUDE") | sort | jq -R -s -c 'split("\n") | map(select(length > 0)) | map("sail/" + .)')
40+ echo "configs=$configs" >> "$GITHUB_OUTPUT"
41+
2542 regress :
26- name : ACT Regression (${{ matrix.config }})
43+ name : Sail Regression (${{ matrix.config }})
44+ needs : discover-sail-configs
2745 runs-on : ubuntu-latest
2846 strategy :
2947 matrix :
30- config :
31- [
32- sail/sail-RVI20U32,
33- sail/sail-RVI20U64,
34- sail/sail-rv32-max,
35- sail/sail-rv64-max,
36- ]
48+ config : ${{ fromJson(needs.discover-sail-configs.outputs.configs) }}
3749
3850 steps :
3951 - name : Checkout code
4557 - name : Install sail-riscv model
4658 run : |
4759 sudo mkdir -p /usr/local
48- curl --location https://github.com/riscv/sail-riscv/releases/download/0.9 /sail-riscv-$(uname)-$(arch).tar.gz | sudo tar xvz --directory=/usr/local --strip-components=1
60+ curl --location https://github.com/riscv/sail-riscv/releases/download/0.10 /sail-riscv-$(uname)-$(arch).tar.gz | sudo tar xvz --directory=/usr/local --strip-components=1
4961
5062 - name : Install RISC-V GCC toolchain
5163 run : curl --location https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2025.07.16/riscv64-elf-ubuntu-22.04-gcc-nightly-2025.07.16-nightly.tar.xz | sudo tar xvJ --directory=/usr/local --strip-components=1
@@ -57,27 +69,51 @@ jobs:
5769 run : DOCKER=1 CONFIG_FILES="config/${{ matrix.config }}/test_config.yaml" EXTENSIONS="" make --jobs $(nproc)
5870
5971 spike :
60- name : Spike Regression (${{ matrix.target }})
72+ name : Spike Regression (${{ matrix.name }})
6173 runs-on : ubuntu-latest
74+
6275 strategy :
6376 matrix :
64- target : [spike-rv64, spike-rv32]
77+ include :
78+ - name : rv64-max
79+ config_file : config/spike/spike-rv64-max/test_config.yaml
80+ config_name : spike-rv64-max
81+ run_cmd : spike --isa=rv64imafdcbv_zicbom_zicboz_zicbop_zicfilp_zicond_zicsr_zicclsm_zifencei_zihintntl_zihintpause_zihpm_zimop_zabha_zacas_zawrs_zfa_zfbfmin_zfh_zcb_zcmop_zbc_zkn_zks_zkr_zvfbfmin_zvfbfwma_zvfh_zvbb_zvbc_zvkg_zvkned_zvknha_zvknhb_zvksed_zvksh_zvkt_sscofpmf_smcntrpmf_sstc_svinval
82+
83+ - name : rv32-max
84+ config_file : config/spike/spike-rv32-max/test_config.yaml
85+ config_name : spike-rv32-max
86+ run_cmd : spike --isa=rv32imafdcbv_zicbom_zicboz_zicbop_zicfilp_zicond_zicsr_zicclsm_zifencei_zihintntl_zihintpause_zihpm_zimop_zabha_zacas_zawrs_zfa_zfbfmin_zfh_zcb_zcmop_zbc_zkn_zks_zkr_zvfbfmin_zvfbfwma_zvfh_zvbb_zvbc_zvkg_zvkned_zvknha_zvknhb_zvksed_zvksh_zvkt_sscofpmf_smcntrpmf_sstc_svinval
87+
88+ - name : RVI20U64
89+ config_file : config/spike/spike-RVI20U64/test_config.yaml
90+ config_name : spike-RVI20U64
91+ run_cmd : spike --isa=rv64imafdc_zicsr_zifencei_zicntr_zca_zcd_zaamo_zalrsc
92+
93+ - name : RVI20U32
94+ config_file : config/spike/spike-RVI20U32/test_config.yaml
95+ config_name : spike-RVI20U32
96+ run_cmd : spike --isa=rv32imafdc_zicsr_zifencei_zicntr_zca_zcd_zaamo_zalrsc
97+
6598 steps :
6699 - name : Checkout code
67100 uses : actions/checkout@v6
68101
69102 - name : Install Dependencies
70103 run : |
71104 sudo apt-get update
72- sudo apt-get install -y device-tree-compiler libboost-regex-dev libboost-system-dev
105+ sudo apt-get install -y device-tree-compiler \
106+ libboost-regex-dev \
107+ libboost-system-dev
73108
74109 - name : Install the latest version of uv
75110 uses : astral-sh/setup-uv@v7
76111
77112 - name : Install sail-riscv model
78113 run : |
79114 sudo mkdir -p /usr/local
80- curl --location https://github.com/riscv/sail-riscv/releases/download/0.9/sail-riscv-$(uname)-$(arch).tar.gz | sudo tar xvz --directory=/usr/local --strip-components=1
115+ curl --location https://github.com/riscv/sail-riscv/releases/download/0.10/sail-riscv-$(uname)-$(arch).tar.gz \
116+ | sudo tar xvz --directory=/usr/local --strip-components=1
81117
82118 - name : Get Latest Spike Commit
83119 run : |
89125 uses : actions/cache/restore@v4
90126 with :
91127 path : ${{ github.workspace }}/spike
92- key : spike-${{ env.SPIKE_HASH }}-RV${{ matrix.xlen }}
128+ key : spike-${{ env.SPIKE_HASH }}
93129
94130 - name : Install Spike
95131 if : steps.cache-spike-restore.outputs.cache-hit != 'true'
@@ -104,27 +140,37 @@ jobs:
104140
105141 - name : Save cached Spike
106142 if : steps.cache-spike-restore.outputs.cache-hit != 'true'
107- id : cache-spike-save
108143 uses : actions/cache/save@v4
109144 with :
110145 path : ${{ github.workspace }}/spike
111- key : ${{ steps.cache-spike-restore.outputs.cache-primary-key }}
146+ key : spike- ${{ env.SPIKE_HASH }}
112147
113148 - name : Add Spike to PATH
114- run : echo $GITHUB_WORKSPACE/spike/bin >> $GITHUB_PATH
149+ run : echo " $GITHUB_WORKSPACE/spike/bin" >> $GITHUB_PATH
115150
116151 - name : Install RISC-V GCC toolchain
117- run : curl --location https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2025.07.16/riscv64-elf-ubuntu-22.04-gcc-nightly-2025.07.16-nightly.tar.xz | sudo tar xvJ --directory=/usr/local --strip-components=1
152+ run : |
153+ curl --location https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2025.07.16/riscv64-elf-ubuntu-22.04-gcc-nightly-2025.07.16-nightly.tar.xz \
154+ | sudo tar xvJ --directory=/usr/local --strip-components=1
118155
119- - name : Compile and run tests on Sail
120- run : DOCKER=1 EXTENSIONS=I,M,F,D,Zca,Zcf,Zcd,Zaamo,Zalrsc,Zifencei make ${{ matrix.target }} --jobs $(nproc)
156+ - name : Build ELFs
157+ run : |
158+ DOCKER=1 \
159+ EXTENSIONS=I,M,F,D,Zca,Zcf,Zcd,Zaamo,Zalrsc,Zifencei \
160+ CONFIG_FILES=${{ matrix.config_file }} \
161+ make elfs --jobs $(nproc)
162+
163+ - name : Run Spike Tests
164+ run : |
165+ ./run_tests.py "${{ matrix.run_cmd }}" \
166+ work/${{ matrix.config_name }}/elfs
121167
122168 - name : Upload logs
123169 if : always()
124170 uses : actions/upload-artifact@v4
125171 with :
126- name : ${{ matrix.target }}-logs
127- path : work/${{ matrix.target }}-max /logs
172+ name : ${{ matrix.name }}-logs
173+ path : work/${{ matrix.config_name }}/logs
128174
129175 vector-testgen :
130176 name : Vector Testgen
0 commit comments