Skip to content

Pull bitpattern.h from Yosys #24

Pull bitpattern.h from Yosys

Pull bitpattern.h from Yosys #24

Workflow file for this run

name: Build and test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Install Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential libfmt-dev
sudo apt-get install -y gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Initialize submodules
run: |
git submodule init
- name: Find out Yosys revision
run: |
{
echo -n "YOSYS_HASH="
git submodule status --cached tests/third_party/yosys | awk '{print $1}'
} >> $GITHUB_ENV
- name: Cache Yosys build
id: cache-yosys
uses: actions/cache@v3
env:
cache-name: cache-yosys
with:
path: tests/third_party/yosys
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.YOSYS_HASH }}
- if: ${{ steps.cache-yosys.outputs.cache-hit != 'true' }}
name: Pull Yosys
run: |
git submodule update --depth 0 -- tests/third_party/yosys
- if: ${{ steps.cache-yosys.outputs.cache-hit != 'true' }}
name: Build Yosys
shell: bash
run: |
cd tests/third_party/yosys
make config-gcc
echo "ENABLE_ABC := 0" >> Makefile.conf
make -j6
- name: Install Yosys
shell: bash
run: |
cd tests/third_party/yosys
sudo make install
- name: Find out Slang revision
run: |
{
echo -n "SLANG_HASH="
git submodule status --cached third_party/slang | awk '{print $1}'
} >> $GITHUB_ENV
- name: Cache Slang build
id: cache-slang
uses: actions/cache@v3
env:
cache-name: cache-slang
with:
path: build/slang_install
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.SLANG_HASH }}
- if: ${{ steps.cache-slang.outputs.cache-hit != 'true' }}
name: Pull Slang
run: |
git submodule update --depth 0 -- third_party/slang
- if: ${{ steps.cache-slang.outputs.cache-hit != 'true' }}
name: Build Slang
shell: bash
run: |
cmake -S third_party/slang -B build/slang -DCMAKE_INSTALL_PREFIX=build/slang_install -DSLANG_USE_MIMALLOC=OFF \
-DSLANG_INCLUDE_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DSLANG_INCLUDE_TOOLS=OFF \
-DCMAKE_CXX_FLAGS="-fPIC" -DBoost_NO_BOOST_CMAKE=ON
make -C build/slang -j$(nproc)
make -C build/slang install
- name: Build yosys-slang
run: |
yosys-config --build build/slang.so \
slang_frontend.cc initial_eval.cc proc_usage.cc \
-Ibuild/slang_install/include -std=c++20 \
-DSLANG_BOOST_SINGLE_HEADER -Lbuild/slang_install/lib \
-lsvlang -lfmt
- name: Pull submodules for tests
run: |
git submodule update --depth 0 -- tests/third_party/picorv32
- name: Run tests
run: |
tests/run.sh