-
Notifications
You must be signed in to change notification settings - Fork 2
204 lines (190 loc) · 7.98 KB
/
test.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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
name: Rust
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
BITWUZLA_VERSION: 0.6.1
YICES_VERSION: 2.6.5
jobs:
tests:
name: Unit Tests
runs-on: ubuntu-24.04
timeout-minutes: 5
strategy:
matrix:
toolchain:
- stable
steps:
- name: Update Rust to ${{ matrix.toolchain }}
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- uses: actions/checkout@v4
- name: Set Up Bitwuzla
uses: ./.github/workflows/setup-bitwuzla
with:
version: ${{ env.BITWUZLA_VERSION }}
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
bmc:
name: Test BMC Tool
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
matrix:
toolchain:
- stable
solver:
- bitwuzla
- yices2
steps:
- uses: actions/checkout@v4
- name: Set Up Yices
if: ${{ matrix.solver == 'yices2' }}
uses: ./.github/workflows/setup-yices
with:
version: ${{ env.YICES_VERSION }}
- name: Set Up Bitwuzla
if: ${{ matrix.solver == 'bitwuzla' }}
uses: ./.github/workflows/setup-bitwuzla
with:
version: ${{ env.BITWUZLA_VERSION }}
- name: Install btor sim
run: |
mkdir /tmp/btor
cd /tmp/btor
git clone https://github.com/hwmcc/btor2tools.git
cd btor2tools
./configure.sh
cd build
make
echo "/tmp/btor/btor2tools/build/bin/" >> "$GITHUB_PATH"
- name: Update Rust to ${{ matrix.toolchain }}
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- name: Build
run: cargo build --verbose --release -p bmc
- name: bmc Quiz1
run: |
cargo run --release -p bmc -- --solver=${{ matrix.solver }} inputs/chiseltest/Quiz1.btor > Quiz1.wit
btorsim inputs/chiseltest/Quiz1.btor Quiz1.wit
- name: bmc Quiz1 (with additional assumption)
run: |
cargo run --release -p bmc -- --solver=${{ matrix.solver }} inputs/chiseltest/Quiz1.unsat.btor
- name: bmc const array example
if: ${{ matrix.solver != 'yices2' }} # yices2 returns memory values that cannot be parsed
run: |
cargo run --release -p bmc -- --solver=${{ matrix.solver }} inputs/chiseltest/const_array_example.btor > const_array_example.wit
btorsim inputs/chiseltest/const_array_example.btor const_array_example.wit
- name: bmc Quiz2
run: |
cargo run --release -p bmc -- --solver=${{ matrix.solver }} inputs/chiseltest/Quiz2.sat.btor > Quiz2.sat.wit
btorsim inputs/chiseltest/Quiz2.sat.btor Quiz2.sat.wit
- name: bmc Quiz2 (with counter reset value)
run: |
cargo run --release -p bmc -- --solver=${{ matrix.solver }} inputs/chiseltest/Quiz2.unsat.btor
- name: bmc Quiz4
run: |
cargo run --release -p bmc -- --solver=${{ matrix.solver }} inputs/chiseltest/Quiz4.sat.btor > Quiz4.sat.wit
btorsim inputs/chiseltest/Quiz4.sat.btor Quiz4.sat.wit
- name: bmc Quiz4 (with counter reset value)
run: |
cargo run --release -p bmc -- --solver=${{ matrix.solver }} inputs/chiseltest/Quiz4.unsat.btor
sim:
name: Test Simulator Tool
runs-on: ubuntu-24.04
timeout-minutes: 5
strategy:
matrix:
toolchain:
- stable
steps:
- name: Update Rust to ${{ matrix.toolchain }}
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose --release -p sim
- name: simulate mux
run: |
cargo run --release -p sim -- --testbench=inputs/repair/mux_4_1.original.tb.csv inputs/repair/mux_4_1.original.btor
# TODO: re-enable once we can parse large decimal input number
#- name: simulate sha3 (keccak)
# run: |
# cargo run --release -p sim -- --testbench=inputs/repair/keccak.original.tb.csv inputs/repair/keccak.original.btor
- name: simulate sdram controller
run: |
cargo run --release -p sim -- --testbench=inputs/repair/sdram_controller.original.tb.csv inputs/repair/sdram_controller.original.btor
- name: simulate i2c controller
run: |
cargo run --release -p sim -- --init=zero --testbench=inputs/repair/i2c_m.tb.csv inputs/repair/i2c_m.original.replace_literals.btor
- name: simulate axis fifo (d4)
run: |
cargo run --release -p sim -- --init=zero --testbench=inputs/repair/axis-fifo-wrapper.original.tb.csv inputs/repair/axis-fifo-wrapper.original.btor
- name: simulate axis adapter (s3)
run: |
cargo run --release -p sim -- --init=zero --testbench=inputs/repair/axis-adapter.original.tb.csv inputs/repair/axis-adapter.original.btor
- name: simulate axis frame len (d13)
run: |
cargo run --release -p sim -- --init=zero --testbench=inputs/repair/axis_frame_len.original.tb.csv inputs/repair/axis_frame_len.original.btor
- name: simulate axis fifo (d12)
run: |
cargo run --release -p sim -- --init=zero --testbench=inputs/repair/axis-fifo.original.tb.csv inputs/repair/axis-fifo.original.btor
- name: simulate sd spi (c1, c3, d9)
run: |
cargo run --release -p sim -- --init=zero --testbench=inputs/repair/zipcpu_sdspi.original.tb.csv inputs/repair/zipcpu_sdspi.original.btor
- name: simulate axis frame fifo (d11)
run: |
cargo run --release -p sim -- --init=zero --testbench=inputs/repair/axis-frame-fifo.original.tb.csv inputs/repair/axis-frame-fifo.original.btor
- name: simulate axis switch (d8)
run: |
cargo run --release -p sim -- --init=zero --testbench=inputs/repair/axis-switch.original.tb.csv inputs/repair/axis-switch.original.btor
- name: simulate axis async fifo (c4)
run: |
cargo run --release -p sim -- --init=zero --testbench=inputs/repair/axis-async-fifo-wrapper.original.tb.csv inputs/repair/axis-async-fifo-wrapper.original.btor
- name: simulate axi lite (s1)
run: |
cargo run --release -p sim -- --init=zero --testbench=inputs/repair/axi-lite-xlnx.original.tb0.csv inputs/repair/axi-lite-xlnx.original.btor
cargo run --release -p sim -- --init=zero --testbench=inputs/repair/axi-lite-xlnx.original.tb1.csv inputs/repair/axi-lite-xlnx.original.btor
- name: simulate axis stream (s2)
run: |
cargo run --release -p sim -- --init=zero --testbench=inputs/repair/axi-stream-xlnx.original.tb.csv inputs/repair/axi-stream-xlnx.original.btor
rewrite-condition:
name: Test E-Graph Rewrite Condition Synthesizer
runs-on: ubuntu-24.04
timeout-minutes: 5
strategy:
matrix:
toolchain:
- stable
steps:
- name: Update Rust to ${{ matrix.toolchain }}
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- uses: actions/checkout@v4
- name: Set Up Bitwuzla
uses: ./.github/workflows/setup-bitwuzla
with:
version: ${{ env.BITWUZLA_VERSION }}
- name: Build
run: cargo build --verbose --release -p patronus-egraphs-cond-synth
- name: synthesize commute-add condition
run: |
cargo run --release -p patronus-egraphs-cond-synth -- --bdd-formula commute-add
- name: check mult-to-add condition
run: |
cargo run --release -p patronus-egraphs-cond-synth -- --check-cond mult-to-add
semver:
name: Check Semantic Versioning of Patronus
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: obi1kenobi/cargo-semver-checks-action@v2
with:
package: patronus
format:
name: Check Formatting
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- run: cargo fmt --check