#! /bin/sh -v

# This flag is *necessary* so that Java doesn't run out of memory, but
# at the same time, this flag is *not* cross-platform compatible.
JFLAGS="-Xmx256M"

# Single-precision, combinational
java ${JFLAGS} tb_FPDivide width=32 exp.width=8 pipelevel=0 iterations=6000 || exit 1
# Single-precision, pipelined
java ${JFLAGS} tb_FPDivide width=32 exp.width=8 pipelevel=2 iterations=6000 || exit 1

# Double-precision, combinational
java ${JFLAGS} tb_FPDivide width=64 exp.width=11 pipelevel=0 iterations=6000 || exit 1
# Double-precision, pipelined
java ${JFLAGS} tb_FPDivide width=64 exp.width=11 pipelevel=2 iterations=6000 || exit 1

# Tiny
java ${JFLAGS} tb_FPDivide width=5 exp.width=2 pipelevel=0 iterations=6000 || exit 1
java ${JFLAGS} tb_FPDivide width=5 exp.width=2 pipelevel=2 iterations=6000 || exit 1

# Huge
echo "The 'huge' tests are disabled because the behavioral model is not designed to handle large bit widths.  The assumption is that if the structural model consistently matches the behavioral model at smaller widths, then the structural model will also work at widths too large for the behavioral model."
#java ${JFLAGS} tb_FPDivide width=97 exp.width=16 pipelevel=0 iterations=10 || exit 1
#java ${JFLAGS} tb_FPDivide width=97 exp.width=16 pipelevel=2 iterations=10 || exit 1

