forked from ChampSim/ChampSim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_champsim.sh
executable file
·45 lines (37 loc) · 1.12 KB
/
run_champsim.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
if [ "$#" -lt 4 ]; then
echo "Illegal number of parameters"
echo "Usage: ./run_champsim.sh [BINARY] [N_WARM] [N_SIM] [TRACE] [OPTION]"
exit 1
fi
TRACE_DIR=$PWD/dpc3_traces
BINARY=${1}
N_WARM=${2}
N_SIM=${3}
TRACE=${4}
OPTION=${5}
# Sanity check
if [ -z $TRACE_DIR ] || [ ! -d "$TRACE_DIR" ] ; then
echo "[ERROR] Cannot find a trace directory: $TRACE_DIR"
exit 1
fi
if [ ! -f "bin/$BINARY" ] ; then
echo "[ERROR] Cannot find a ChampSim binary: bin/$BINARY"
exit 1
fi
re='^[0-9]+$'
if ! [[ $N_WARM =~ $re ]] || [ -z $N_WARM ] ; then
echo "[ERROR]: Number of warmup instructions is NOT a number" >&2;
exit 1
fi
re='^[0-9]+$'
if ! [[ $N_SIM =~ $re ]] || [ -z $N_SIM ] ; then
echo "[ERROR]: Number of simulation instructions is NOT a number" >&2;
exit 1
fi
if [ ! -f "$TRACE_DIR/$TRACE" ] ; then
echo "[ERROR] Cannot find a trace file: $TRACE_DIR/$TRACE"
exit 1
fi
mkdir -p results_${N_SIM}M
(./bin/${BINARY} -warmup_instructions ${N_WARM}000000 -simulation_instructions ${N_SIM}000000 ${OPTION} -traces ${TRACE_DIR}/${TRACE}) &> results_${N_SIM}M/${TRACE}-${BINARY}${OPTION}.txt