1
0

Move to a regression Makefile

In order to have the buildbot support various types of failures it needs
to run different commands.  Rather than modifying the regression script
to have a bunch of arguments I've just gone and made a makefile for
regressions instead.

This doesn't run torture right now because that's broken, but I'll add
support soon.
This commit is contained in:
Palmer Dabbelt 2016-01-26 22:27:21 -08:00 committed by Palmer Dabbelt
parent ff79a44eb0
commit 7209c13338
3 changed files with 53 additions and 52 deletions

View File

@ -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

2
regression/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/install
/stamps

51
regression/Makefile Normal file
View File

@ -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 $@