Skip to content

Commit

Permalink
Scripts: Add/Adapt batch scripts acc. refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Weiss committed Jun 20, 2023
1 parent 3599d66 commit 1256541
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 1 deletion.
134 changes: 134 additions & 0 deletions scripts/batch_objdump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
#!/bin/bash

function_array=(
acos
asin
atan
atan2
cos
sin
tan
acosh
atanh
cosh
sinh
tanh
exp
exp2
expm1
frexp
ilogb
ldexp
log
log10
log1p
log2
logb
modf
scalbn
scalbln
cbrt
fabs
hypot
pow
sqrt
erf
erfc
lgamma
tgamma
ceil
floor
nearbyint
rint
lrint
llrint
round
lround
llround
trunc
fmod
remainder
remquo
copysign
nan
nextafter
fdim
fmax
fmin
fma

acosf
asinf
atanf
atan2f
cosf
sinf
tanf
acoshf
asinhf
atanhf
coshf
sinhf
tanhf
expf
exp2f
expm1f
frexpf
ilogbf
ldexpf
logf
log10f
log1pf
log2f
logbf
modff
scalbnf
scalblnf
cbrtf
fabsf
hypotf
powf
sqrtf
erff
erfcf
lgammaf
tgammaf
ceilf
floorf
nearbyintf
rintf
lrintf
llrintf
roundf
lroundf
llroundf
truncf
fmodf
remainderf
remquof
copysignf
nanf
nextafterf
fdimf
fmaxf
fminf
fmaf
)

objdump=../rtems-6-sparc-gr740-smp-4/bin/sparc-rtems6-objdump
application=../examples/gr740/smp/libmcs/b-gr740-qual-only/app.exe
asm_folder=../qualification/asm
pdf_folder=../qualification/pdf
coverage_file=../coverage-tracer/ExecuteTestRun.csv

mkdir -p $asm_folder
mkdir -p $pdf_folder

for i in ${function_array[@]}
do
$objdump -d $application | sed -ne '/<'$i'>:/,/^$/p' > $asm_folder/$i.asm
./asm2cfg -c $coverage_file --preset 'sparc OBJDUMP' $asm_folder/$i.asm
done

mv *.pdf $pdf_folder/
rm -f *.gv
2 changes: 1 addition & 1 deletion scripts/update_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ for asm in examples/*.asm; do
if echo $asm | grep -q 'arm.asm'; then
flags="$flags --target arm"
fi
pdf=$(python3 -m src.asm2cfg $flags -c $asm | awk '/Saved CFG/{print $NF}')
pdf=$(python3 -m ocgraph $flags -c $asm | awk '/Saved CFG/{print $NF}')
mv $pdf $(echo $asm | sed 's/\.asm/\.pdf/')
done

0 comments on commit 1256541

Please sign in to comment.