Skip to content

bolden

bolden #266

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@v4
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@v4
env:
cache-name: cache-yosys
with:
path: tests/third_party/yosys
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.YOSYS_HASH }}-patched
- 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
patch -p1 < ../cxxrtl-work-around-issue-3549.patch
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: Find out Makefile revision
run: |
{
echo -n "MAKEFILE_HASH="
git log -n 1 --pretty=format:%H -- Makefile
} >> $GITHUB_ENV
- name: Cache Slang build
id: cache-slang
uses: actions/cache@v4
env:
cache-name: cache-slang
with:
path: build/slang_install
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.SLANG_HASH }}-${{ env.MAKEFILE_HASH }}
- if: ${{ steps.cache-slang.outputs.cache-hit != 'true' }}
name: Pull Slang
run: |
git submodule update --depth 0 -- third_party/slang
- name: Build yosys-slang
run: |
make -j$(nproc)
- name: Pack build
shell: bash
run: |
tar -cvf build.tar build/slang.so tests/third_party/yosys/
- name: Store build artifact
uses: actions/upload-artifact@v4
with:
name: build.tar
path: build.tar
retention-days: 1
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
needs: [build]
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: Download build artifact
uses: actions/download-artifact@v4
with:
name: build.tar
- name: Unpack build
shell: bash
run:
tar -xvf build.tar
- name: Install Yosys
shell: bash
run: |
cd tests/third_party/yosys
sudo make install
- name: Run tests
run: |
tests/run.sh
test-croc-boot:
runs-on: ubuntu-latest
strategy:
fail-fast: false
needs: [build]
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: Download build artifact
uses: actions/download-artifact@v4
with:
name: build.tar
- name: Unpack build
shell: bash
run:
tar -xvf build.tar
- name: Install Yosys
shell: bash
run: |
cd tests/third_party/yosys
sudo make install
- name: Pull submodules for tests
run: |
git submodule update --depth 0 -- tests/third_party/croc
- name: Install Bender
run: |
curl --proto '=https' --tlsv1.2 https://pulp-platform.github.io/bender/init -sSf | sh
sudo mv bender /usr/bin/bender
- name: Checkout Croc
run: |
cd tests/third_party/croc
make checkout
- name: Install OpenOCD
run: |
wget https://github.com/xpack-dev-tools/openocd-xpack/releases/download/v0.12.0-4/xpack-openocd-0.12.0-4-linux-x64.tar.gz
sudo tar xvf xpack-openocd-0.12.0-4-linux-x64.tar.gz -C /opt
echo "/opt/xpack-openocd-0.12.0-4/bin" >> $GITHUB_PATH
- name: Run OpenOCD once
run: |
openocd -v
- name: Run tests
run: |
tests/croc_boot/run.sh
test-compat:
runs-on: ubuntu-latest
strategy:
matrix:
ip: [black-parrot, bsc-core_tile, cv32e40p, ibex, opentitan, rsd]
fail-fast: false
needs: [build]
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: Download build artifact
uses: actions/download-artifact@v4
with:
name: build.tar
- name: Unpack build
shell: bash
run:
tar -xvf build.tar
- name: Install Yosys
shell: bash
run: |
cd tests/third_party/yosys
sudo make install
- name: Pull IP sources
run: |
git clone https://github.com/povik/yosys-slang-compat-suite/ compat-suite --depth 1
cd compat-suite
git submodule init ${{ matrix.ip }}
git submodule update --init --recursive --depth 1 ${{ matrix.ip }}
- if: ${{ matrix.ip == 'opentitan' }}
run: |
pip3 install --user -r compat-suite/opentitan/python-requirements.txt --require-hashes
- name: Run script
run: |
cd compat-suite
yosys -m ../build/slang.so ${{ matrix.ip }}.tcl