Skip to content

ci: add tests for generating verilog #388

ci: add tests for generating verilog

ci: add tests for generating verilog #388

Workflow file for this run

name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
test-difftest-main:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Generate Verilog
run: |
make difftest_verilog NOOP_HOME=$GITHUB_WORKSPACE
test-difftest:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Prepare environment
run: |
cd $GITHUB_WORKSPACE/..
git config --global url."https://github.com/".insteadOf [email protected]:
git config --global url."https://".insteadOf git://
git clone https://github.com/OpenXiangShan/xs-env
cd $GITHUB_WORKSPACE/../xs-env
sudo -s ./setup-tools.sh
source ./setup.sh
rm -r $GITHUB_WORKSPACE/../xs-env/NutShell/difftest
rm -r $GITHUB_WORKSPACE/../xs-env/XiangShan/difftest
cp -r $GITHUB_WORKSPACE $GITHUB_WORKSPACE/../xs-env/NutShell
cp -r $GITHUB_WORKSPACE $GITHUB_WORKSPACE/../xs-env/XiangShan
- name: Basic Difftest (NutShell)
run: |
cd $GITHUB_WORKSPACE/../xs-env
source ./env.sh
rm -r ./NEMU
git clone https://github.com/OpenXiangShan/NEMU
cd NEMU
make riscv64-xs-ref_defconfig
make
cd $GITHUB_WORKSPACE/../xs-env/NutShell
source ./env.sh
make clean
make emu EMU_CXX_EXTRA_FLAGS="-DFIRST_INST_ADDRESS=0x80000000" WITH_CHISELDB=0 WITH_CONSTANTIN=0
./build/emu -b 0 -e 0 -i ./ready-to-run/microbench.bin
- name: Difftest with Snapshot
run: |
cd $GITHUB_WORKSPACE/../xs-env
source ./env.sh
cd $GITHUB_WORKSPACE/../xs-env/NutShell
source ./env.sh
make clean
make emu EMU_SNAPSHOT=1 EMU_CXX_EXTRA_FLAGS="-DFIRST_INST_ADDRESS=0x80000000" WITH_CHISELDB=0 WITH_CONSTANTIN=0
./build/emu -b 0 -e 0 -i ./ready-to-run/microbench.bin
- name: Difftest with Trace
run: |
cd $GITHUB_WORKSPACE/../xs-env
source ./env.sh
cd $GITHUB_WORKSPACE/../xs-env/NutShell
source ./env.sh
make clean
make emu EMU_TRACE=1 EMU_CXX_EXTRA_FLAGS="-DFIRST_INST_ADDRESS=0x80000000" WITH_CHISELDB=0 WITH_CONSTANTIN=0
./build/emu -b 10 -e 12 -i ./ready-to-run/microbench.bin --dump-wave
- name: Difftest with two threads
run: |
cd $GITHUB_WORKSPACE/../xs-env
source ./env.sh
cd $GITHUB_WORKSPACE/../xs-env/NutShell
source ./env.sh
make clean
make emu EMU_THREADS=2 EMU_CXX_EXTRA_FLAGS="-DFIRST_INST_ADDRESS=0x80000000" WITH_CHISELDB=0 WITH_CONSTANTIN=0
./build/emu -b 0 -e 0 -i ./ready-to-run/microbench.bin