#!/bin/csh
#  Homework #6 example script -- problem #1

echo compiling...
cc -Wl,-r -non_shared -no_inline -O2 madd.c -o madd.rr

# compile the atomized version as madd.atomd
echo atomizing...
atom madd.rr instr6.c analy6.c -o madd.atomd

# compile the non-instrumented version just for grins
echo making executable...
ld madd.rr -o madd

# execute it once to see if it works
echo doing normal run
madd

# do a dinero run for multi-level cache
echo doing single level cache simulations
madd.atomd | dinero -i8K -d8K -a4 -ww -An -b32 -W8 -B16 
madd.atomd | dinero -i8K -d8K -a4 -wc -Aw -b32 -W8 -B16
madd.atomd | dinero -u512K -a4 -wc -Aw -b32              -W8 -B16

echo 2 level simulation
source 2level

cat L1.out
cat L2.out


