-
Notifications
You must be signed in to change notification settings - Fork 147
166 lines (148 loc) · 5.32 KB
/
ci.yml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: ci
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 1 * * *'
jobs:
verilator-lint:
runs-on: ubuntu-latest
steps:
# Checkout Repository
- name: Checkout
uses: actions/checkout@v2
# Install OS and Python Tools
- name: Install Tools
run: |
sudo apt-get install verilator
# Run verilator lint
- name: Verilator lint
run: |
verilator --lint-only rtl/verilog/*.v +incdir+rtl/verilog
or1k-tests:
runs-on: ubuntu-latest
env:
LD_LIBRARY_PATH: "/tmp/tools/lib"
EXPECTED_FAILURES: ${{ matrix.env.EXPECTED_FAILURES }}
EXTRA_CORE_ARGS: ${{ matrix.env.EXTRA_CORE_ARGS }}
steps:
# Checkout Repository
- name: Checkout
uses: actions/checkout@v2
# Install OS and Python Tools
- name: Install Tools
run: |
sudo apt-get install build-essential python3 xz-utils git iverilog \
libfl2 libelf-dev
pip3 install setuptools wheel
pip3 install fusesoc
export PATH=$PATH:$HOME/.local/bin
fusesoc --version
# Install Toolchain
- name: Install Toolchain
run: |
mkdir -p /tmp/tools/lib
cd /tmp/tools
curl --remote-name --location \
https://github.com/openrisc/or1k-gcc/releases/download/or1k-12.0.1-20220210-20220304/or1k-elf-12.0.1-20220210-20220304.tar.xz
tar xC /tmp/tools -f or1k-elf-12.0.1-20220210-20220304.tar.xz
export PATH=$PATH:/tmp/tools/or1k-elf/bin/
or1k-elf-gcc --version
# Setup or1k-tests
- name: Setup or1k-tests
run: |
export PATH=$PATH:/tmp/tools/or1k-elf/bin:$HOME/.local/bin
mkdir -p /tmp/tools
cd /tmp/tools
git clone --depth 1 https://github.com/openrisc/or1k-tests.git -b v1.0.5
cd or1k-tests/native
make -j8
fusesoc library add fusesoc_cores https://github.com/fusesoc/fusesoc-cores
fusesoc library add mor1kx-generic https://github.com/openrisc/mor1kx-generic.git
fusesoc library add intgen https://github.com/openrisc/intgen.git
fusesoc library add elf-loader https://github.com/fusesoc/elf-loader.git
fusesoc library add mor1kx $GITHUB_WORKSPACE
# Run tests
- name: Run tests
shell: bash {0}
run: |
export PATH=$PATH:/tmp/tools/or1k-elf/bin:$HOME/.local/bin
mkdir -p /tmp/tools
export TEST_TIMEOUT="10m"
export PIPELINE=CAPPUCCINO
export TARGET=mor1kx_tb
export TARGET_ARGS="--tool=icarus"
export CORE_ARGS="--pipeline=$PIPELINE --vcd --trace_enable $EXTRA_CORE_ARGS"
export ARTIFACT_PATH="build/mor1kx-generic_*/mor1kx_tb-icarus"
cd /tmp/tools/or1k-tests/native
./runtests.sh
result=$?
if [ $result != 0 ] ; then
cat runtests.log
fi
exit $result
# Upload test results
- uses: actions/upload-artifact@v4
if: failure()
with:
name: runtest-results
path: /tmp/tools/or1k-tests/native/artifacts/**/*
strategy:
matrix:
env:
- { EXPECTED_FAILURES: "or1k-cy" }
- { EXPECTED_FAILURES: "or1k-cy", EXTRA_CORE_ARGS: "--feature_dmmu NONE" }
- { EXPECTED_FAILURES: "or1k-cy or1k-dsxinsn", EXTRA_CORE_ARGS: "--feature_immu NONE" }
- { EXPECTED_FAILURES: "or1k-cy", EXTRA_CORE_ARGS: "--feature_datacache NONE" }
- { EXPECTED_FAILURES: "or1k-cy", EXTRA_CORE_ARGS: "--feature_instructioncache NONE" }
- { EXPECTED_FAILURES: "or1k-cy", EXTRA_CORE_ARGS: "--feature_debugunit NONE" }
- { EXPECTED_FAILURES: "or1k-cy or1k-cmov", EXTRA_CORE_ARGS: "--feature_cmov NONE" }
- { EXPECTED_FAILURES: "or1k-cy or1k-ext", EXTRA_CORE_ARGS: "--feature_ext NONE" }
formal-verification:
runs-on: ubuntu-latest
steps:
#Checkout Repository
- name: Checkout
uses: actions/checkout@v2
#Install Yosys-Formal tools
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install g++ gperf build-essential bison flex \
libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot \
pkg-config python2 python3 libboost-system-dev \
libboost-python-dev libboost-filesystem-dev zlib1g-dev
pip3 install dataclasses
- name: Install clang
run: |
sudo apt-get -y install clang
- name: Install yosys
run: |
mkdir -p formal_tools
cd formal_tools
git clone --depth 1 https://github.com/YosysHQ/yosys.git yosys
cd yosys
git submodule update --init
make -j$(nproc)
sudo make install
cd ..
- name: Install Symbiyosys
run: |
git clone --depth 1 https://github.com/YosysHQ/SymbiYosys.git SymbiYosys
cd SymbiYosys
sudo make install
cd ..
- name: Install yices
run: |
git clone --depth 1 https://github.com/SRI-CSL/yices2.git yices2
cd yices2
autoconf
./configure
make -j$(nproc)
sudo make install
#Run tests
- name: Run tests
shell: bash {0}
run: |
make -C bench/formal