2020-11-24 08:17:38 -05:00
|
|
|
name: ci
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
2021-10-26 06:15:13 -04:00
|
|
|
build:
|
2022-11-03 02:26:19 -04:00
|
|
|
runs-on: ubuntu-22.04
|
2020-11-24 08:17:38 -05:00
|
|
|
steps:
|
|
|
|
# Checkout Repository
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2022-06-27 11:50:29 -04:00
|
|
|
- name: Setup CCache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1
|
|
|
|
|
2022-11-03 02:26:19 -04:00
|
|
|
- uses: ghdl/setup-ghdl-ci@master
|
2022-10-27 20:11:58 -04:00
|
|
|
with:
|
|
|
|
backend: llvm
|
|
|
|
|
2020-11-24 08:17:38 -05:00
|
|
|
# Install Tools
|
|
|
|
- name: Install Tools
|
|
|
|
run: |
|
2021-10-26 06:15:13 -04:00
|
|
|
sudo apt-get install wget build-essential python3 ninja-build
|
2022-06-27 11:50:29 -04:00
|
|
|
sudo apt-get install libevent-dev libjson-c-dev flex bison
|
2022-11-03 02:26:19 -04:00
|
|
|
sudo apt-get install libfl-dev libfl2 zlib1g-dev
|
2020-11-24 08:17:38 -05:00
|
|
|
pip3 install setuptools
|
|
|
|
pip3 install requests
|
2021-10-26 06:15:13 -04:00
|
|
|
pip3 install pexpect
|
2021-09-27 10:10:01 -04:00
|
|
|
pip3 install meson
|
2020-11-24 08:17:38 -05:00
|
|
|
|
|
|
|
# Install (n)Migen / LiteX / Cores
|
|
|
|
- name: Install LiteX
|
|
|
|
run: |
|
2022-01-05 07:55:38 -05:00
|
|
|
python3 litex_setup.py --config=full --init --install --user
|
2020-11-24 08:17:38 -05:00
|
|
|
|
2021-10-26 09:36:07 -04:00
|
|
|
# Install GCC Toolchains
|
|
|
|
- name: Install GCC Toolchains
|
2020-11-24 08:17:38 -05:00
|
|
|
run: |
|
2021-10-26 09:36:07 -04:00
|
|
|
python3 litex_setup.py --gcc=riscv
|
2021-10-26 06:15:13 -04:00
|
|
|
sudo mkdir /usr/local/riscv
|
|
|
|
sudo cp -r $PWD/../riscv64-*/* /usr/local/riscv
|
2021-10-26 09:36:07 -04:00
|
|
|
python3 litex_setup.py --gcc=openrisc
|
|
|
|
sudo mkdir /usr/local/openrisc
|
|
|
|
sudo cp -r $PWD/../openrisc-*/* /usr/local/openrisc
|
2022-10-27 20:55:32 -04:00
|
|
|
sudo apt install gcc-powerpc64le-linux-gnu binutils-multiarch
|
2020-11-24 08:17:38 -05:00
|
|
|
|
2022-06-27 11:50:29 -04:00
|
|
|
# Build / Install Verilator
|
|
|
|
- name: Build Verilator
|
|
|
|
run: |
|
|
|
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
|
|
|
git clone https://github.com/verilator/verilator
|
|
|
|
cd verilator
|
|
|
|
autoconf
|
|
|
|
./configure
|
|
|
|
make -j$(nproc)
|
|
|
|
sudo make install
|
|
|
|
|
2020-11-24 08:17:38 -05:00
|
|
|
# Install Project
|
|
|
|
- name: Install Project
|
|
|
|
run: python3 setup.py develop --user
|
|
|
|
|
|
|
|
# Test
|
|
|
|
- name: Run Tests
|
|
|
|
run: |
|
2021-10-26 06:15:13 -04:00
|
|
|
export PATH=/usr/local/riscv/bin:$PATH
|
2021-10-26 09:36:07 -04:00
|
|
|
export PATH=/usr/local/openrisc/bin:$PATH
|
2020-11-24 08:17:38 -05:00
|
|
|
python3 setup.py test
|