Skip to content

Split transactron core #2486

Split transactron core

Split transactron core #2486

Workflow file for this run

name: CI
on:
push:
branches:
- master
- 'feature/**'
pull_request:
branches:
- master
- 'feature/**'
workflow_dispatch:
jobs:
build-core:
name: Synthesize full core
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Coreblocks dependencies
run: |
python3 -m venv venv
. venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
- name: Generate Verilog
run: |
. venv/bin/activate
PYTHONHASHSEED=0 TRANSACTRON_VERBOSE=1 ./scripts/gen_verilog.py --verbose --config full
- uses: actions/upload-artifact@v3
with:
name: "verilog-full-core"
path: |
core.v
core.v.json
build-riscof-tests:
name: Build regression tests (riscv-arch-test)
runs-on: ubuntu-latest
container: ghcr.io/kuznia-rdzeni/riscv-toolchain:2023.11.19_v
timeout-minutes: 10
env:
PYENV_ROOT: "/root/.pyenv"
LC_ALL: "C.UTF8"
LANG: "C.UTF8"
defaults:
run:
working-directory: test/external/riscof/
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache compiled and reference riscv-arch-test
id: cache-riscv-arch-test
uses: actions/cache@v3
env:
cache-name: cache-riscv-arch-test
with:
path: |
test/external/riscof/riscv-arch-test/**/*.elf
test/external/riscof/riscof_work/**/*.signature
test/external/riscof/**/*Makefile*
key: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles(
'**/test/external/riscof/coreblocks/**',
'**/test/external/riscof/spike_simple/**',
'**/test/external/riscof/config.ini',
'**/.git/modules/test/external/riscof/riscv-arch-test/HEAD',
'**/docker/riscv-toolchain.Dockerfile'
) }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-
- if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }}
name: Setup PATH
run: echo "/.pyenv/bin" >> $GITHUB_PATH
- if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }}
name: Setup pyenv python
run: |
eval "$(pyenv init --path)"
pyenv global 3.6.15
. /venv3.6/bin/activate
- if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }}
name: Setup arch test suite
run: |
. /venv3.6/bin/activate
riscof testlist --config=config.ini --suite=riscv-arch-test/riscv-test-suite/ --env=riscv-arch-test/riscv-test-suite/env
- if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }}
name: Build and run tests on reference and generate Makefiles
run: |
. /venv3.6/bin/activate
riscof run --config=config.ini --suite=riscv-arch-test/riscv-test-suite/ --env=riscv-arch-test/riscv-test-suite/env
- if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }}
name: Build tests for Coreblocks
run: |
MAKEFILE_PATH=riscof_work/Makefile.build-DUT-coreblocks ../../../ci/riscof_run_makefile.sh
- if: ${{ steps.cache-riscv-arch-test.outputs.cache-hit != 'true' }}
uses: actions/upload-artifact@v3
with:
name: "riscof-tests"
path: |
test/external/riscof/riscv-arch-test/**/*.elf
test/external/riscof/riscof_work/**/*.signature
test/external/riscof/**/*Makefile*
run-riscof-tests:
name: Run regression tests (riscv-arch-test)
runs-on: ubuntu-latest
container: ghcr.io/kuznia-rdzeni/verilator:v5.008-2023.11.19_v
needs: [ build-riscof-tests, build-core ]
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Coreblocks dependencies
run: |
python3 -m venv venv
. venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-dev.txt
- uses: actions/download-artifact@v3
with:
name: "verilog-full-core"
path: .
- uses: actions/cache@v3
env:
cache-name: cache-riscv-arch-test
with:
path: |
test/external/riscof/riscv-arch-test/**/*.elf
test/external/riscof/riscof_work/**/*.signature
test/external/riscof/**/*Makefile*
key: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles(
'**/test/external/riscof/coreblocks/**',
'**/test/external/riscof/spike_simple/**',
'**/test/external/riscof/config.ini',
'**/.git/modules/test/external/riscof/riscv-arch-test/HEAD',
'**/docker/riscv-toolchain.Dockerfile'
) }}
fail-on-cache-miss: true
- name: Run tests on Coreblocks
run: |
. venv/bin/activate
MAKEFILE_PATH=test/external/riscof/riscof_work/Makefile.run-DUT-coreblocks NPROC=1 ./ci/riscof_run_makefile.sh
- name: Compare signatures (test results)
run: MAKEFILE_PATH=test/external/riscof/riscof_work/Makefile.run-DUT-coreblocks ./ci/riscof_compare.sh
build-regression-tests:
name: Build regression tests (riscv-tests)
runs-on: ubuntu-latest
container: ghcr.io/kuznia-rdzeni/riscv-toolchain:2023.11.19_v
timeout-minutes: 10
outputs:
cache_hit: ${{ steps.cache-regression.outputs.cache-hit }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache regression-tests
id: cache-regression
uses: actions/cache@v3
env:
cache-name: cache-regression-tests
with:
path: test/external/riscv-tests/test-*
key: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles(
'**/test/external/riscv-tests/environment/**',
'**/test/external/riscv-tests/Makefile',
'**/.git/modules/test/external/riscv-tests/riscv-tests/HEAD',
'**/docker/riscv-toolchain.Dockerfile'
) }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-
- if: ${{ steps.cache-regression.outputs.cache-hit != 'true' }}
run: cd test/external/riscv-tests && make
- if: ${{ steps.cache-regression.outputs.cache-hit != 'true' }}
name: Upload riscv-tests
uses: actions/upload-artifact@v3
with:
path: test/external/riscv-tests
run-regression-tests:
name: Run regression tests (riscv-tests)
runs-on: ubuntu-latest
timeout-minutes: 10
container: ghcr.io/kuznia-rdzeni/verilator:v5.008-2023.11.19_v
needs: [ build-regression-tests, build-core ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python3 -m venv venv
. venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-dev.txt
- uses: actions/download-artifact@v3
with:
name: "verilog-full-core"
path: .
- uses: actions/cache@v3
env:
cache-name: cache-regression-tests
with:
path: test/external/riscv-tests/test-*
key: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles(
'**/test/external/riscv-tests/environment/**',
'**/test/external/riscv-tests/Makefile',
'**/.git/modules/test/external/riscv-tests/riscv-tests/HEAD',
'**/docker/riscv-toolchain.Dockerfile'
) }}
fail-on-cache-miss: true
- name: Run tests
run: |
. venv/bin/activate
scripts/run_tests.py -a regression
- name: Check regression with pysim
run: |
. venv/bin/activate
./scripts/run_tests.py -c 1 -a -b pysim regression
unit-test:
name: Run unit tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: |
requirements.txt
requirements-dev.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip3 install -r requirements-dev.txt
sudo apt-get install -y binutils-riscv64-unknown-elf
- name: Run tests
run: ./scripts/run_tests.py --verbose
- name: Check traces and profiles
run: ./scripts/run_tests.py -t -p -c 1 TestCore
- name: Check listing tests
run: ./scripts/run_tests.py -l
lint:
name: Check code formatting and typing
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: |
requirements.txt
requirements-dev.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip3 install -r requirements-dev.txt
- name: Check format
run: ./scripts/lint.sh check_format
- name: Check types
run: ./scripts/lint.sh check_types