Skip to content

Commit 1de80a4

Browse files
committed
Use valgrind during CI + force GCC compilation as clang generates unsupported symbols
1 parent 92e0348 commit 1de80a4

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
mode: ["Release", "Debug"]
15+
compiler: ["gcc"]
1516

1617
runs-on: ubuntu-latest
1718

@@ -22,13 +23,17 @@ jobs:
2223
submodules: recursive
2324

2425
- name: Install dependencies
25-
run: sudo apt-get install tcl-dev libreadline-dev libffi-dev pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev xz-utils
26+
run: sudo apt-get install tcl-dev libreadline-dev libffi-dev pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev xz-utils valgrind
2627

2728
- name: ccache
2829
uses: hendrikmuhs/ccache-action@v1.2
2930

3031
- name: Install yosys
31-
run: git clone https://github.com/YosysHQ/yosys; cd yosys; make -j2 ENABLE_CCACHE=1 ${{ matrix.mode == 'Release' && 'ENABLE_NDEBUG=1' || '' }}; sudo make install; cd ..
32+
run: |
33+
git clone https://github.com/YosysHQ/yosys; \
34+
cd yosys; make config-${{ matrix.compiler }}; \
35+
make -j2 ENABLE_CCACHE=1 ${{ matrix.mode == 'Release' && 'ENABLE_NDEBUG=1' || '' }}; \
36+
sudo make install; cd ..
3237
3338
- name: Build
3439
run: make -j2 ENABLE_WERROR=1; sudo make install
@@ -37,7 +42,7 @@ jobs:
3742
run: bash test/download_benchmarks.sh
3843

3944
- name: Test
40-
run: bash test/test_commands.sh
45+
run: ${{ matrix.compiler == 'gcc' && 'ENABLE_VALGRIND=1' || '' }} bash test/test_commands.sh
4146

4247
- name: Run
4348
if: ${{ matrix.mode == 'Release' }}

test/test_commands.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,38 @@
22

33
set -e
44

5+
cmd=""
6+
if [ "$ENABLE_VALGRIND" == "1" ]
7+
then
8+
cmd="valgrind --error-exitcode=11 "
9+
fi
10+
511
# Basic corruption
6-
yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -target corruption"
12+
$cmd yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -target corruption"
713

814
# Basic pairwise
9-
yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -target pairwise"
15+
$cmd yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -target pairwise"
1016

1117
# Basic hybrid
12-
yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -target hybrid"
18+
$cmd yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -target hybrid"
1319

1420
# Basic pairwise without deduplication
15-
yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -target pairwise-no-dedup"
21+
$cmd yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -target pairwise-no-dedup"
1622

1723
# Set key percent and key
18-
yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -key-percent 5 -key 0a239e"
24+
$cmd yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -key-percent 5 -key 0a239e"
1925

2026
# Set key bits and key
21-
yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -key-bits 10 -key 0a239e"
27+
$cmd yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -key-bits 10 -key 0a239e"
2228

2329
# Set number of test vectors and keys
24-
yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -nb-test-vectors 99 -nb-analysis-keys 95 -nb-analysis-vectors 1079"
30+
$cmd yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -nb-test-vectors 99 -nb-analysis-keys 95 -nb-analysis-vectors 1079"
2531

2632
# Explore
27-
yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -explore -output-dir logs"
33+
$cmd yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -explore -output-dir logs"
2834

2935
# No analysis
30-
yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -nb-analysis-keys 0"
36+
$cmd yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -nb-analysis-keys 0"
3137

3238
# Change port name
33-
yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -port-name test_port"
39+
$cmd yosys -m moosic -p "read_blif benchmarks/blif/c1355.blif; flatten; synth; logic_locking -port-name test_port"

0 commit comments

Comments
 (0)