diff --git a/regression.sh b/regression.sh deleted file mode 100755 index b2d01061..00000000 --- a/regression.sh +++ /dev/null @@ -1,52 +0,0 @@ -#! /bin/bash -# -# See LICENSE for license details. - -# Script to setup submodules, build rocket-chip, and run asm tests, and optionally run torture - -set -ex - -echo "Starting Rocket-chip regression test" -if [ $# -lt 1 ] -then - echo "Usage: ./regression.sh [options] config [torture_config] [torture_output_dir]" - echo " --master: A comma-seperated list of repositories to use the master of" - exit -fi - -git submodule update --init --recursive riscv-tools - -if [[ "$1" == "--master" ]] -then - echo $2 | sed 's/,/\n/g' | while read repo - do - ( - cd $repo - git fetch - git checkout master - git log --oneline | head -n5 - ) - done - - shift - shift -fi - -export RISCV="$(pwd)/install"; export PATH=$PATH:$RISCV/bin -cd riscv-tools; ./build.sh; cd .. -git submodule update --init -git submodule status --recursive -cd emulator; make CONFIG=$1; make CONFIG=$1 run-asm-tests; cd .. -if [ $# -ge 2 ] -then - cd emulator; make CONFIG=$1 debug; cd .. - git clone git@github.com:ucb-bar/riscv-torture.git - cd riscv-torture; git submodule update --init; - if [ $# -eq 3 ] - then - make cnight RTL_CONFIG=$1 OPTIONS="-C $2 -p $3 -m 30 -t 10" - else - make cnight RTL_CONFIG=$1 OPTIONS="-C $2 -m 30 -t 10" - fi -fi - diff --git a/regression/.gitignore b/regression/.gitignore new file mode 100644 index 00000000..0df50ec2 --- /dev/null +++ b/regression/.gitignore @@ -0,0 +1,2 @@ +/install +/stamps diff --git a/regression/Makefile b/regression/Makefile new file mode 100644 index 00000000..a22012c5 --- /dev/null +++ b/regression/Makefile @@ -0,0 +1,51 @@ +# The default target +regression: vsim-asm-tests vsim-bmark-tests torture + +ifeq ($(CONFIG),) +$(error Set CONFIG to the configuration to build) +endif + +# The top-level directory that contains rocket-chip +TOP ?= .. + +# The directory that the tools get built into. +RISCV ?= install + +# These are the named regression targets. While it's expected you run them in +# this order, since there's dependencies for everything it doesn't actually +# matter. +submodules: stamps/submodules.stamp +tools: stamps/tools.stamp +vsim: stamps/vsim.stamp +vsim-asm-tests: stamps/vsim-asm-tests.stamp +vsim-bmark-tests: stamps/vsim-bmark-tests.stamp +torture: stamps/torture.stamp + +# Checks out all the rocket-chip submodules +stamps/submodules.stamp: + mkdir -p $(dir $@) + git -C $(abspath $(TOP)) submodule update --init --recursive + touch $@ + +# Builds the RISC-V toolchain +stamps/tools.stamp: stamps/submodules.stamp + mkdir -p $(dir $@) + +cd $(abspath $(TOP))/riscv-tools; RISCV=$(abspath $(RISCV)) ./build.sh + touch $@ + +# Builds the verilog RTL simulator +stamps/vsim.stamp: stamps/submodules.stamp + mkdir -p $(dir $@) + $(MAKE) -C $(abspath $(TOP))/vsim CONFIG=$(CONFIG) RISCV=$(abspath $(RISCV)) + touch $@ + +# Runs some tests using the verilog RTL simulator +stamps/vsim-asm-tests.stamp: stamps/vsim.stamp stamps/tools.stamp stamps/submodules.stamp + mkdir -p $(dir $@) + $(MAKE) -C $(abspath $(TOP))/vsim CONFIG=$(CONFIG) RISCV=$(abspath $(RISCV)) run-asm-tests + touch $@ + +stamps/vsim-bmark-tests.stamp: stamps/vsim.stamp stamps/tools.stamp stamps/submodules.stamp + mkdir -p $(dir $@) + $(MAKE) -C $(abspath $(TOP))/vsim CONFIG=$(CONFIG) RISCV=$(abspath $(RISCV)) run-bmark-tests + touch $@