Skip to content

Commit

Permalink
Build Synlig as standalone binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Szelwiga committed Sep 4, 2024
1 parent f5cd191 commit 65962ff
Show file tree
Hide file tree
Showing 57 changed files with 1,904 additions and 1,169 deletions.
297 changes: 136 additions & 161 deletions .ci.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/scripts/format_sources.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash

find frontends third_party/yosys_mod \
find third_party/yosys_mod src/ \
-name "*.h" -o -name "*.cc" \
| xargs clang-format -i
20 changes: 11 additions & 9 deletions .github/scripts/run_group_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,28 @@ for test_case in "${test_cases[@]}"; do
# Used only for current test
ASAN_OPTIONS+=":log_path=${test_out_dir}/asan"

# libfakedlclose.so has to be used with yosys to prevent
# systemverilog.so from being unloaded by yosys as part of cleanup
# before termination. ASAN needs it to be in memory to correctly
# symbolize function addresses.
if [ "$BUILD_TYPE" == "'plugin'" ]; then
BINARY="${REPO_DIR}/out/current/bin/yosys -Q"
else
BINARY="${REPO_DIR}/out/current/bin/synlig -Q"
fi
make -C $REPO_DIR/tests \
-j $(nproc) \
--no-print-directory \
YOSYS_BIN:="LD_PRELOAD=${REPO_DIR}/out/current/lib/libfakedlclose.so ${REPO_DIR}/out/current/bin/yosys -Q" \
SYNLIG_BIN:="$BINARY" \
BUILD_TYPE=$BUILD_TYPE \
ENABLE_READLINE=0 \
PRETTY=0 \
PARSER=$PARSER \
TEST=$test_case \
$TARGET > "${test_out_dir}/yosys.log"
$TARGET > "${test_out_dir}/synlig.log"
)
(( $? == 0 )) && test_ok=1 || test_ok=0

sed -i -n \
-e "s#${REPO_DIR}/##g" \
-E -e '/1. Executing (Verilog with )?UHDM frontend./,$ {/^End of script/d; /^Time spent/d; p}' \
"${test_out_dir}/yosys.log"
"${test_out_dir}/synlig.log"

# ASAN log contains PID in the name. There should be only one log, but even
# assuming more processes were spawned, we can quite safely concatenate
Expand Down Expand Up @@ -119,8 +121,8 @@ for test_case in "${test_cases[@]}"; do
fi

if (( $test_ok == 0 )); then
printf '\x1b[0;39;1;3mUp to last 50 lines of yosys log:\x1b[0m\n'
tail -n 50 ${test_out_dir}/yosys.log
printf '\x1b[0;39;1;3mUp to last 50 lines of synlig log:\x1b[0m\n'
tail -n 50 ${test_out_dir}/synlig.log
global_status=1
fi

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bsg-test-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ jobs:
- name: Download binaries
uses: actions/download-artifact@v2
with:
name: binaries
name: binaries-plugin

# See https://github.com/actions/upload-artifact/issues/38
- name: Extract
run: tar -xf binaries.tar
run: tar -xf binaries-plugin.tar

- name: Generate and diff tests
run: |
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@ jobs:
third_party/{surelog,yosys} \
;
- name: Apply Debian patch
if: ${{ matrix.debian-patch }}
run: |
git -C third_party/yosys apply ../yosys_mod/yosys_debian.patch
- name: Setup cache
uses: actions/cache@v2
with:
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/formal-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,26 @@ jobs:
- name: Download binaries
uses: actions/download-artifact@v2
with:
name: binaries
name: binaries-release

# See https://github.com/actions/upload-artifact/issues/38
- name: Extract
run: tar -xf binaries.tar
- name: Extract binaries
run: tar -xf binaries-release.tar

- name: Download sv2v
- name: Download tools
uses: actions/download-artifact@v2
with:
name: sv2v
path: out/current/bin/
name: tools

- name: Extract tools
run: tar -xf tools.tar

- name: Build eqy and sby
run: |
./tests/scripts/run_formal.sh --name $TEST_SUITE_NAME build_dependencies
- name: Test
run: |
chmod +x out/current/bin/sv2v
source .github/scripts/common.sh
./tests/scripts/run_formal.sh --name $TEST_SUITE_NAME run
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/large-designs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
- name: Download binaries
uses: actions/download-artifact@v2
with:
name: binaries
name: binaries-release

# See https://github.com/actions/upload-artifact/issues/38
- name: Extract
run: tar -xf binaries.tar
run: tar -xf binaries-release.tar

- name: Build & Test
run: |
Expand Down Expand Up @@ -89,11 +89,11 @@ jobs:
- name: Download binaries
uses: actions/download-artifact@v2
with:
name: binaries
name: binaries-plugin

# See https://github.com/actions/upload-artifact/issues/38
- name: Extract
run: tar -xf binaries.tar
run: tar -xf binaries-plugin.tar

- name: Setup build environment & Build & Test
run: |
Expand Down Expand Up @@ -143,11 +143,11 @@ jobs:
- name: Download binaries
uses: actions/download-artifact@v2
with:
name: binaries
name: binaries-release

# See https://github.com/actions/upload-artifact/issues/38
- name: Extract
run: tar -xf binaries.tar
run: tar -xf binaries-release.tar

- name: Build & Test
run: |
Expand Down Expand Up @@ -227,11 +227,11 @@ jobs:
- name: Download binaries
uses: actions/download-artifact@v2
with:
name: binaries
name: binaries-release

# See https://github.com/actions/upload-artifact/issues/38
- name: Extract
run: tar -xf binaries.tar
run: tar -xf binaries-release.tar

- name: Build & Test
run: |
Expand Down Expand Up @@ -295,11 +295,11 @@ jobs:
- name: Download binaries
uses: actions/download-artifact@v2
with:
name: binaries
name: binaries-release

# See https://github.com/actions/upload-artifact/issues/38
- name: Extract
run: tar -xf binaries.tar
run: tar -xf binaries-release.tar

- name: Create venv & Parse OpenTitan components & Make summary
run: |
Expand Down Expand Up @@ -354,11 +354,11 @@ jobs:
- name: Download binaries
uses: actions/download-artifact@v2
with:
name: binaries
name: binaries-release

# See https://github.com/actions/upload-artifact/issues/38
- name: Extract
run: tar -xf binaries.tar
run: tar -xf binaries-release.tar

- name: Build & Test
run: |
Expand Down Expand Up @@ -408,11 +408,11 @@ jobs:
- name: Download binaries
uses: actions/download-artifact@v2
with:
name: binaries
name: binaries-release

# See https://github.com/actions/upload-artifact/issues/38
- name: Extract
run: tar -xf binaries.tar
run: tar -xf binaries-release.tar

- name: Build & Test
run: |
Expand Down Expand Up @@ -462,11 +462,11 @@ jobs:
- name: Download binaries
uses: actions/download-artifact@v2
with:
name: binaries
name: binaries-release

# See https://github.com/actions/upload-artifact/issues/38
- name: Extract
run: tar -xf binaries.tar
run: tar -xf binaries-release.tar

- name: Build & Test
run: |
Expand Down
Loading

0 comments on commit 65962ff

Please sign in to comment.