Add comments to dramSylva
This commit is contained in:
@@ -34,21 +34,28 @@
|
||||
|
||||
set -x
|
||||
|
||||
# DRAMSys simulation files
|
||||
simfiles="
|
||||
../../DRAMSys/simulator/resources/simulations/ddr3-example.xml
|
||||
../../DRAMSys/simulator/resources/simulations/ddr3_postpone_test.xml
|
||||
"
|
||||
|
||||
# Input trace files
|
||||
traces="
|
||||
ddr3_example.stl
|
||||
ddr3_postpone_ref_test_1.stl
|
||||
"
|
||||
|
||||
clocks="200 1000"
|
||||
# Trace player frequencies ('clkMhz' in the tracesetup)
|
||||
clocks="
|
||||
200
|
||||
1000
|
||||
"
|
||||
|
||||
out_prefix=output
|
||||
out_ext=txt
|
||||
|
||||
# Test setup (e.g., clone, patch, build)
|
||||
function systole {
|
||||
local current_time=$(date "+%Y.%m.%d-%H.%M.%S")
|
||||
local dir="dram.vp.system_$current_time"
|
||||
@@ -68,18 +75,22 @@ function systole {
|
||||
cd simulator
|
||||
}
|
||||
|
||||
# Run tests
|
||||
function heartbeat {
|
||||
local elf=DRAMSys
|
||||
# for every simulation file
|
||||
for f in $simfiles; do
|
||||
|
||||
sf=$f
|
||||
sfnameext=`basename $f`
|
||||
sfn="${sfnameext%.*}"
|
||||
|
||||
# for every trace file
|
||||
for t in $traces; do
|
||||
replace=">$t</device>"
|
||||
`sed -i.bak 's@>.*<\/device>@'"$replace"'@' $sf`
|
||||
|
||||
# for every trace player clock frequency
|
||||
for c in $clocks; do
|
||||
clk="clkMhz=\"${c}\""
|
||||
`sed -i.bak 's@clkMhz=.*"@'"$clk"'@' $sf`
|
||||
@@ -91,15 +102,23 @@ function heartbeat {
|
||||
|
||||
of="${out_prefix}_${sfn}_$t_${c}MHz.${out_ext}"
|
||||
printf "$t\n" > $of
|
||||
# a new instance of the program is executed
|
||||
./$elf $sf >> $of &
|
||||
sleep 1
|
||||
done
|
||||
done
|
||||
# wait for the programs running to finish. This is a simple
|
||||
# precaution in order to avoid overloading the system with too
|
||||
# many instances of the program running simultaneously.
|
||||
wait
|
||||
done
|
||||
# wait for all the still running programs to finish. This is really
|
||||
# important for the last iteration since we have to wait the output
|
||||
# files to be ready before parsing them.
|
||||
wait
|
||||
}
|
||||
|
||||
# Generate a CSV with contents extracted from output files
|
||||
function washup {
|
||||
local csvoutfile="output.csv"
|
||||
printf "SimulationFile,TotalEnergy[pJ],AveragePower[mW],TotalTime[ps],AverageBandwidth[Gbps],AverageBandwidthWithoutIdle[Gbps],MaximumBandwidth[Gbps]\n" >> $csvoutfile
|
||||
|
||||
Reference in New Issue
Block a user