97 lines
3.1 KiB
Bash
Executable file
97 lines
3.1 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
toGem5fromStats(){
|
|
cd ../..
|
|
cd wk_gem5_SysXelerator_v2
|
|
}
|
|
|
|
toStatsfromGem5(){
|
|
cd ..
|
|
cd wk_gem5_stats/scripts
|
|
}
|
|
|
|
runSimAndAnaly(){
|
|
local width=$1
|
|
local repetition=$2
|
|
local workload=$3
|
|
local strategy=$4
|
|
local scratchpad_size=$5
|
|
local compression_factor=$6
|
|
local folder_path=$7
|
|
|
|
echo "Changing the repetition!"
|
|
python3 ChangeRepData.py --repetition $repetition --compression_factor $compression_factor --folder_path $folder_path
|
|
|
|
|
|
cd /home/sfischer/Documents/projects/wk_gem5_SysXelerator_v2
|
|
|
|
echo "Starting the simulation!"
|
|
|
|
build/X86_MESI_Two_Level/gem5.opt --debug-flag RubyNetworkReduced,AccelTrafficTraceReduced,SysXeleratorFSM configs/gemmini/Accel4x4NoC.py --ruby --num-cpus 17 --network garnet --l1d_size 8MiB --l1i_size 8MiB --topology Mesh_XY --mesh-rows 3 --mem-type DDR3_1600_8x8 --link-width-bits $width --scratchpad_size $scratchpad_size --folder_path $folder_path >raw_log.txt
|
|
|
|
cd /home/sfischer/Documents/projects/wk_LinProg/simulation/scripts
|
|
|
|
echo "Starting the Analysis!"
|
|
# python3 MESI_Analysis_Gemmini.py \
|
|
# --link_width $width \
|
|
# --repetition $repetition \
|
|
# --workload $workload \
|
|
# --strategy $strategy
|
|
|
|
time_per_rep_microseconds=$(python3 MESI_Analysis_Gemmini.py \
|
|
--link_width $width \
|
|
--repetition $repetition \
|
|
--workload $workload \
|
|
--strategy $strategy | tail -1)
|
|
|
|
# rm -rf /home/sfischer/Documents/projects/wk_LinProg/simulation/results/log_raw/*
|
|
|
|
}
|
|
|
|
|
|
|
|
link_width_bits_list=(576) #max 72B = 576bit must be devisible by 8 (in gem5 used as byte)
|
|
repetitions_list=(50)
|
|
|
|
scratchpad_size_list=(10000)
|
|
compression_factor_list=(1) # 1 = no compression
|
|
|
|
# workload="MobileNetV2_20Layer_1C10A_R100_1GHz_fast3"
|
|
workload="LinProg_opt_test"
|
|
|
|
# strategy_mode="Inception70_NoOpt_1x_fast2"
|
|
strategy_mode="${1:-Inception70_NoOpt_1x_fast3}"
|
|
|
|
|
|
folder_path_2gem5="/home/sfischer/Documents/projects/wk_gem5_SysXelerator_v2"
|
|
# folder_path="/home/sfischer/gem5folder/gem5-accel/src/SysXelerator/MobileNetV2_1A1C/"
|
|
folder_path="${folder_path_2gem5}/src/SysXelerator/LinProg_test/"
|
|
DESTINATION_FILE="${folder_path}map_addition.xml"
|
|
SOURCE_FILE="${folder_path}map_addition_old.xml"
|
|
|
|
if [ -e "$SOURCE_FILE" ]; then
|
|
cp "$SOURCE_FILE" "$DESTINATION_FILE"
|
|
else
|
|
echo "Source file does not exist. Creating an empty file."
|
|
touch "$SOURCE_FILE"
|
|
cp "$DESTINATION_FILE" "$SOURCE_FILE"
|
|
fi
|
|
|
|
# Nested loops to execute the function for all combinations of LINK_WIDTH_BITS and repetitions
|
|
for LINK_WIDTH_BITS in "${link_width_bits_list[@]}"; do
|
|
for repetition in "${repetitions_list[@]}"; do
|
|
for scratchpad_size in "${scratchpad_size_list[@]}"; do
|
|
for compression_factor in "${compression_factor_list[@]}"; do
|
|
strategy="${strategy_mode}_scratch${scratchpad_size}_comp${compression_factor}"
|
|
runSimAndAnaly $LINK_WIDTH_BITS $repetition $workload $strategy $scratchpad_size $compression_factor $folder_path
|
|
cp "$SOURCE_FILE" "$DESTINATION_FILE"
|
|
done
|
|
done
|
|
done
|
|
done
|
|
|
|
echo "$time_per_rep_microseconds"
|
|
|
|
|
|
|
|
|