Repository navigation
57 lines (45 loc) · 1.77 KB
/
Copy pathwasm.yml
File metadata and controls
57 lines (45 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: WASM Build
on:
push:
paths: ['rtl/**', 'wasm/**', 'web/public/**', '.tools/**', '.github/workflows/wasm.yml']
pull_request:
paths: ['rtl/**', 'wasm/**', 'web/public/**', '.tools/**', '.github/workflows/wasm.yml']
jobs:
wasm-build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
# The harness needs the same Verilator as the RTL suites (cocotb's >= 5.036 rule does not apply
# here, but one version everywhere is simpler). Built from source and cached by version tag.
- name: Cache Verilator build
id: cache-verilator
uses: actions/cache@v4
with:
path: ~/verilator-install
key: verilator-v5.036-ubuntu-24.04
- name: Build Verilator v5.036 from source
if: steps.cache-verilator.outputs.cache-hit != 'true'
run: |
sudo apt-get update -qq
sudo apt-get install -y autoconf flex bison libfl2 libfl-dev help2man perl
git clone --depth 1 --branch v5.036 https://github.com/verilator/verilator.git /tmp/verilator
cd /tmp/verilator
autoconf
./configure --prefix="$HOME/verilator-install"
make -j$(nproc)
make install
- name: Add Verilator to PATH
run: echo "$HOME/verilator-install/bin" >> $GITHUB_PATH
- name: Set up Emscripten
uses: mymindstorm/setup-emsdk@v14
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Build tiny_cpu WASM (both cores, one module)
run: bash wasm/build.sh
- name: Node test against the golden fixtures
run: node wasm/test.mjs
- name: Build spike WASM (toolchain check)
run: bash wasm/spike/build.sh
- name: Run spike headless
run: node wasm/spike/test.mjs