Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test plugin with address sanitizer and Valgrind #913

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 54 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
CXX: g++-9
CCACHE_DIR: "/root/yosys-uhdm-plugin-integration/yosys-uhdm-plugin-integration/.cache/"
DEBIAN_FRONTEND: noninteractive
PLUGIN_ASAN: 1

steps:

Expand Down Expand Up @@ -235,6 +236,56 @@ jobs:
path: |
**/plot_*.svg

tests-yosys-valgrind:
runs-on: [self-hosted, Linux, X64]
container: ubuntu:bionic
needs: [build-binaries, generate-matrix-yosys]
strategy:
matrix:
TEST_CASE_YOSYS: ${{ fromJson(needs.generate-matrix-yosys.outputs.matrix) }}
fail-fast:
false
env:
CC: gcc-9
CXX: g++-9
GIT_HTTP_LOW_SPEED_LIMIT: 1
GIT_HTTP_LOW_SPEED_TIME: 600
DEBIAN_FRONTEND: noninteractive
GHA_MACHINE_TYPE: "n2-standard-2"
PARSER: surelog

steps:
- name: Install dependencies
run: |
apt-get update -qq
apt install -y software-properties-common
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get update -qq
apt install -y g++-9 build-essential cmake tclsh ant default-jre swig google-perftools libgoogle-perftools-dev python3 python3-dev uuid uuid-dev tcl-dev flex libfl-dev valgrind

- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 1

- name: Download binaries
uses: actions/download-artifact@v2
with:
name: binaries

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

- name: Build & Test (yosys)
run: |
./UHDM-integration-tests/.github/ci.sh
cat UHDM-integration-tests/build/valgrind.out
env:
TEST_CASE: ${{ matrix.TEST_CASE_YOSYS }}
TARGET: uhdm/yosys/test-ast
USE_VALGRIND: 1

tests-vcddiff:
runs-on: [self-hosted, Linux, X64]
container: ubuntu:bionic
Expand Down Expand Up @@ -314,7 +365,7 @@ jobs:
apt install -y software-properties-common
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get update -qq
apt install -y gcc-9 g++-9 build-essential cmake tclsh ant default-jre swig google-perftools libgoogle-perftools-dev python3 python3-dev uuid uuid-dev tcl-dev flex libfl-dev git python3-pip
apt install -y gcc-9 g++-9 build-essential cmake tclsh ant default-jre swig google-perftools libgoogle-perftools-dev python3 python3-dev uuid uuid-dev tcl-dev flex libfl-dev git python3-pip valgrind
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1

Expand All @@ -338,9 +389,11 @@ jobs:
enable_vivado 2017.2
pip install virtualenv
./UHDM-integration-tests/.github/ci.sh
cat UHDM-integration-tests/build/valgrind.out
env:
TARGET: uhdm/yosys/synth-ibex-build
TEST_CASE: tests/ibex
USE_VALGRIND: 1

- uses: actions/upload-artifact@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion UHDM-integration-tests
5 changes: 4 additions & 1 deletion build_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ make CONFIG=gcc PREFIX=$INSTALL_PATH install -j $(nproc)
cd ..
fi
#UHDM plugin
if [ "$PLUGIN_ASAN" -eq "1" ]; then
PLUGIN_LDFLAGS="-fsanitize=address -fcheck-new -fno-omit-frame-pointer -static-libasan"
fi
export PATH=$INSTALL_PATH/bin:${PATH}
UHDM_INSTALL_DIR=$INSTALL_PATH make -C $PWD/yosys-symbiflow-plugins/ install -j$(nproc)
UHDM_INSTALL_DIR=$INSTALL_PATH LDFLAGS=$PLUGIN_LDFLAGS make -C $PWD/yosys-symbiflow-plugins/ install -j$(nproc)
#sv2v
if [ "$BUILD_SV2V" -eq "1" ]; then
wget -qO- https://get.haskellstack.org/ | sh -s - -f -d $INSTALL_PATH/bin
Expand Down