Skip to content

ci

ci #574

Workflow file for this run

name: ci
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 1 * * *'
jobs:
verilator-lint:
runs-on: ubuntu-latest
steps:
# Checkout Repository
- name: Checkout
uses: actions/checkout@v2
# Install OS and Python Tools
- name: Install Tools
run: |
sudo apt-get install verilator
# Run verilator lint
- name: Verilator lint
run: |
verilator --lint-only rtl/verilog/*.v +incdir+rtl/verilog
or1k-tests:
runs-on: ubuntu-latest
env:
LD_LIBRARY_PATH: "/tmp/tools/lib"
EXPECTED_FAILURES: ${{ matrix.env.EXPECTED_FAILURES }}
EXTRA_CORE_ARGS: ${{ matrix.env.EXTRA_CORE_ARGS }}
steps:
# Checkout Repository
- name: Checkout
uses: actions/checkout@v2
# Install OS and Python Tools
- name: Install Tools
run: |
sudo apt-get install build-essential python3 xz-utils git iverilog \
libfl2 libelf-dev
pip3 install setuptools wheel
pip3 install fusesoc
export PATH=$PATH:$HOME/.local/bin
fusesoc --version
# Install Toolchain
- name: Install Toolchain
run: |
mkdir -p /tmp/tools/lib
cd /tmp/tools
curl --remote-name --location \
https://github.com/openrisc/or1k-gcc/releases/download/or1k-12.0.1-20220210-20220304/or1k-elf-12.0.1-20220210-20220304.tar.xz
tar xC /tmp/tools -f or1k-elf-12.0.1-20220210-20220304.tar.xz
export PATH=$PATH:/tmp/tools/or1k-elf/bin/
or1k-elf-gcc --version
# Setup or1k-tests
- name: Setup or1k-tests
run: |
export PATH=$PATH:/tmp/tools/or1k-elf/bin:$HOME/.local/bin
mkdir -p /tmp/tools
cd /tmp/tools
git clone --depth 1 https://github.com/openrisc/or1k-tests.git -b v1.0.5
cd or1k-tests/native
make -j8
fusesoc library add fusesoc_cores https://github.com/fusesoc/fusesoc-cores
fusesoc library add mor1kx-generic https://github.com/openrisc/mor1kx-generic.git
fusesoc library add intgen https://github.com/openrisc/intgen.git
fusesoc library add elf-loader https://github.com/fusesoc/elf-loader.git
fusesoc library add mor1kx $GITHUB_WORKSPACE
# Run tests
- name: Run tests
shell: bash {0}
run: |
export PATH=$PATH:/tmp/tools/or1k-elf/bin:$HOME/.local/bin
mkdir -p /tmp/tools
export TEST_TIMEOUT="10m"
export PIPELINE=CAPPUCCINO
export TARGET=mor1kx_tb
export TARGET_ARGS="--tool=icarus"
export CORE_ARGS="--pipeline=$PIPELINE --vcd --trace_enable $EXTRA_CORE_ARGS"
export ARTIFACT_PATH="build/mor1kx-generic_*/mor1kx_tb-icarus"
cd /tmp/tools/or1k-tests/native
./runtests.sh
result=$?
if [ $result != 0 ] ; then
cat runtests.log
fi
exit $result
# Upload test results
- uses: actions/upload-artifact@v4
if: failure()
with:
name: runtest-results
path: /tmp/tools/or1k-tests/native/artifacts/**/*
strategy:
matrix:
env:
- { EXPECTED_FAILURES: "or1k-cy" }
- { EXPECTED_FAILURES: "or1k-cy", EXTRA_CORE_ARGS: "--feature_dmmu NONE" }
- { EXPECTED_FAILURES: "or1k-cy or1k-dsxinsn", EXTRA_CORE_ARGS: "--feature_immu NONE" }
- { EXPECTED_FAILURES: "or1k-cy", EXTRA_CORE_ARGS: "--feature_datacache NONE" }
- { EXPECTED_FAILURES: "or1k-cy", EXTRA_CORE_ARGS: "--feature_instructioncache NONE" }
- { EXPECTED_FAILURES: "or1k-cy", EXTRA_CORE_ARGS: "--feature_debugunit NONE" }
- { EXPECTED_FAILURES: "or1k-cy or1k-cmov", EXTRA_CORE_ARGS: "--feature_cmov NONE" }
- { EXPECTED_FAILURES: "or1k-cy or1k-ext", EXTRA_CORE_ARGS: "--feature_ext NONE" }
formal-verification:
runs-on: ubuntu-latest
steps:
#Checkout Repository
- name: Checkout
uses: actions/checkout@v2
#Install Yosys-Formal tools
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install g++ gperf build-essential bison flex \
libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot \
pkg-config python2 python3 libboost-system-dev \
libboost-python-dev libboost-filesystem-dev zlib1g-dev
pip3 install dataclasses
- name: Install clang
run: |
sudo apt-get -y install clang
- name: Install yosys
run: |
mkdir -p formal_tools
cd formal_tools
git clone --depth 1 https://github.com/YosysHQ/yosys.git yosys
cd yosys
git submodule update --init
make -j$(nproc)
sudo make install
cd ..
- name: Install Symbiyosys
run: |
git clone --depth 1 https://github.com/YosysHQ/SymbiYosys.git SymbiYosys
cd SymbiYosys
sudo make install
cd ..
- name: Install yices
run: |
git clone --depth 1 https://github.com/SRI-CSL/yices2.git yices2
cd yices2
autoconf
./configure
make -j$(nproc)
sudo make install
#Run tests
- name: Run tests
shell: bash {0}
run: |
make -C bench/formal