Added script to separate branch.log into separate logs for each benchmark.

This commit is contained in:
Ross Thompson 2023-03-12 17:58:36 -05:00
parent 568d0031d2
commit ae42150519
2 changed files with 27 additions and 1 deletions

24
bin/separateBrnach.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
File="$1"
BeginLineNumbers=`cat $File | grep -n "BEGIN" | awk -NF ':' '{print $1}'`
Name=`cat $File | grep -n "BEGIN" | awk -NF '/' '{print $6}'`
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
CurrName=${NameArray[$i]}
CurrStart=$((${BeginLineNumberArray[$i]}+1))
CurrEnd=$((${EndLineNumberArray[$i]}-1))
echo $CurrName, $CurrStart, $CurrEnd
sed -n "${CurrStart},${CurrEnd}p" $File > branch/${CurrName}_branch.log
done

View File

@ -544,9 +544,11 @@ logic [3:0] dummy;
string direction;
int file;
logic PCSrcM;
string LogFile;
flopenrc #(1) PCSrcMReg(clk, reset, dut.core.FlushM, ~dut.core.StallM, dut.core.ifu.bpred.bpred.Predictor.DirPredictor.PCSrcE, PCSrcM);
initial begin
file = $fopen("branch.log", "w");
LogFile = $psprintf("branch_%s%d.log", `BPRED_TYPE, `BPRED_SIZE);
file = $fopen(LogFile, "w");
end
always @(posedge clk) begin
if(StartSample) $fwrite(file, "BEGIN %s\n", memfilename);