forked from Github_Repos/cvw
Created script to batch processes all the embench branch outcomes into C model branch prediction rate.
This commit is contained in:
parent
755b1bfe53
commit
0441e3b736
49
bin/CModelBranchAccuracy.sh
Normal file → Executable file
49
bin/CModelBranchAccuracy.sh
Normal file → Executable file
@ -27,30 +27,31 @@
|
|||||||
################################################################################################
|
################################################################################################
|
||||||
|
|
||||||
|
|
||||||
irectory="$1"
|
Directory="$1"
|
||||||
Predictor="$2"
|
Files="$1/*.log"
|
||||||
Size="$3"
|
|
||||||
|
|
||||||
|
for Pred in "bimodal" "gshare"
|
||||||
File="$1"
|
|
||||||
BeginLineNumbers=`cat $File | grep -n "BEGIN" | awk -NF ':' '{print $1}'`
|
|
||||||
Name=`cat $File | grep -n "BEGIN" | awk -NF '/' '{print $6_$4}'`
|
|
||||||
EndLineNumbers=`cat $File | grep -n "END" | awk -NF ':' '{print $1}'`
|
|
||||||
echo $Name
|
|
||||||
echo $BeginLineNumbers
|
|
||||||
echo $EndLineNumbers
|
|
||||||
|
|
||||||
NameArray=($Name)
|
|
||||||
BeginLineNumberArray=($BeginLineNumbers)
|
|
||||||
EndLineNumberArray=($EndLineNumbers)
|
|
||||||
|
|
||||||
mkdir -p branch
|
|
||||||
Length=${#EndLineNumberArray[@]}
|
|
||||||
for i in $(seq 0 1 $((Length-1)))
|
|
||||||
do
|
do
|
||||||
CurrName=${NameArray[$i]}
|
for Size in $(seq 6 2 16)
|
||||||
CurrStart=$((${BeginLineNumberArray[$i]}+1))
|
do
|
||||||
CurrEnd=$((${EndLineNumberArray[$i]}-1))
|
if [ $Pred = "gshare" ]; then
|
||||||
echo $CurrName, $CurrStart, $CurrEnd
|
SizeString="$Size $Size 18 1"
|
||||||
sed -n "${CurrStart},${CurrEnd}p" $File > branch/${CurrName}_branch.log
|
elif [ $Pred = "bimodal" ]; then
|
||||||
|
SizeString="$Size 18 1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
Product=1.0
|
||||||
|
Count=0
|
||||||
|
for File in $Files
|
||||||
|
do
|
||||||
|
#echo "sim_bp $Pred $Size $Size 18 1 $File | tail -1 | awk '{print $4}'"
|
||||||
|
#echo "sim_bp $Pred $SizeString $File | tail -1 | awk '{print $4}'"
|
||||||
|
BMDR=`sim_bp $Pred $SizeString $File | tail -1 | awk '{print $4}'`
|
||||||
|
Product=`echo "$Product * $BMDR" | bc`
|
||||||
|
Count=$((Count+1))
|
||||||
|
done
|
||||||
|
|
||||||
|
GeoMean=`perl -E "say $Product**(1/$Count)"`
|
||||||
|
echo "$Pred$Size $GeoMean"
|
||||||
|
done
|
||||||
done
|
done
|
||||||
|
1
bin/sim_bp
Symbolic link
1
bin/sim_bp
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../addins/branch-predictor-simulator/src/sim_bp
|
Loading…
Reference in New Issue
Block a user