blob: 946d5785238b7d97908fb4bdf4c7236d1a8a8954 [file] [log] [blame]
#!/bin/bash
# Test runner for SystemC simulator. Note the input should be the .bin file.
function print_usage {
echo "Usage: core_sim_test_runner.sh <bin location> [extra flags]"
}
if [[ $1 == "--help" ]]; then
print_usage
fi
if [[ -z ${ROOTDIR} ]]; then
echo "Please run \"source build/setup.sh\" first"
exit 1
fi
CORE_SIM="${ROOTDIR}/out/kelvin/hw/bazel_out/core_sim"
if [[ ! -f ${CORE_SIM} ]]; then
echo "Please run \"m kelvin_hw_sim\" first"
exit 1
fi
if (( $# != 1 )); then
print_usage
exit 1
fi
BIN_FILE=$(realpath $1)
shift 1
SIM_OUT=$(${CORE_SIM} "${BIN_FILE}" $@)
RESULT=$?
echo "${SIM_OUT}"
exit ${RESULT}