#!/bin/bash # this script's license is LGPLv2.1+ dir="$(mktemp -d)" cd "$dir" git clone ~/projects/nmigen git clone ~/projects/nmigen-soc git clone ~/projects/libreriscv/ieee754fpu git clone ~/projects/libreriscv/nmutil git clone ~/projects/libreriscv/soc pushd soc git submodule init git config submodule.libreriscv.url ~/projects/libreriscv/soc/libreriscv git config submodule.nmigen-type-annotations.url ~/projects/libreriscv/soc/nmigen-type-annotations git submodule update popd python3 -m venv "$dir/venv" ( set -e . "$dir/venv/bin/activate" pushd nmigen python setup.py develop popd pushd nmigen-soc python setup.py develop popd pushd nmutil python setup.py develop popd pushd ieee754fpu python setup.py develop popd pushd soc make install python <<<"from nmigen.back.pysim import Simulator, Delay, Settle" popd ) status=$? echo "status: $status" if ((status != 0)); then status=125 else ( . "$dir/venv/bin/activate" pushd soc timeout --kill-after=5s 30s python src/soc/fu/div/test/test_pipe_caller.py DIVTestCase.test_6_regression -f ) if [[ -s soc/div_simulator.vcd ]]; then state="$(~/projects/vcdump/target/debug/vcdump --strings soc/div_simulator.vcd | jq '.top.alu.pipe_start.setup_stage.ra')" echo "state: $state" if [[ "$state" == "" || "$state" == "null" ]]; then status=125 elif [[ "$state" =~ ^([^\"]*'"'[^\"]*'"'[^\"]*)*'"''0'*[^0\"][^\"]*'"' ]]; then status=0 else status=1 fi else status=125 fi fi echo "status: $status" cd ~ rm -rf "$dir" exit $status