#! /bin/bash

set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd "$DIR"

./setup
cd build
make
cd "$DIR/../build"

BENCHMARKS="ubmark-bsearch ubmark-cmult ubmark-mfilt ubmark-quicksort ubmark-vvadd"
CACHE_FLAG=
for BENCHMARK in $BENCHMARKS; do
  echo $BENCHMARK
  ../lizard/sim.py --verilate $CACHE_FLAG ../app/build/$BENCHMARK
  CACHE_FLAG=--use-cached
done
