Skip to content

Commit be5bfe6

Browse files
author
ah744
committed
Small script changes
1 parent d32a20f commit be5bfe6

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

scripts/gen-lpfs.sh

+40-40
Original file line numberDiff line numberDiff line change
@@ -29,46 +29,46 @@ for f in $*; do
2929
done
3030

3131
# Generate .ll file if not done already
32-
#for f in $*; do
33-
# b=$(basename $f .scaffold)
34-
# echo "[gen-lpfs.sh] $b: Compiling ..."
35-
# if [ ! -e ${b}/${b}.ll ]; then
36-
# # Generate compiled files
37-
# $ROOT/scaffold.sh -r $f
38-
# mv ${b}11.ll ${b}11.ll.keep_me
39-
# # clean intermediary compilation files (comment out for speed)
40-
# #$ROOT/scaffold.sh -c $f
41-
# # Keep the final output for the compilation
42-
# mv ${b}11.ll.keep_me ${b}/${b}.ll
43-
# fi
44-
#done
45-
#
46-
## Module flattening pass with different thresholds
47-
#for f in $*; do
48-
# b=$(basename $f .scaffold)
49-
# echo "[gen-lpfs.sh] $b: Computing module gate counts ..."
50-
# $OPT -S -load $SCAF -ResourceCount2 ${b}/${b}.ll > /dev/null 2> ${b}.out
51-
# python $DIR/flattening_thresh.py ${b}
52-
# for th in ${THRESHOLDS[@]}; do
53-
# if [ ! -e ${b}/${b}.flat${th}.ll ]; then
54-
# echo "[gen-lpfs.sh] $b_flat${th}: Flattening ..."
55-
# mv ${b}.flat${th}.txt flat_info.txt
56-
# $OPT -S -load $SCAF -FlattenModule -dce -internalize -globaldce ${b}/${b}.ll -o ${b}/${b}.flat${th}.ll
57-
# fi
58-
# done
59-
# rm -f *flat*.txt ${b}.out
60-
#done
61-
#
62-
## Perform resource estimation
63-
#for f in $*; do
64-
# b=$(basename $f .scaffold)
65-
# for th in ${THRESHOLDS[@]}; do
66-
# echo "[gen-lpfs.sh] $b.flat${th}: Resource count ..."
67-
# if [ -n ${b}/${b}.flat${th}.resources ]; then
68-
# $OPT -S -load $SCAF -ResourceCount ${b}/${b}.flat${th}.ll > /dev/null 2> ${b}/${b}.flat${th}.resources
69-
# fi
70-
# done
71-
#done
32+
for f in $*; do
33+
b=$(basename $f .scaffold)
34+
echo "[gen-lpfs.sh] $b: Compiling ..."
35+
if [ ! -e ${b}/${b}.ll ]; then
36+
# Generate compiled files
37+
$ROOT/scaffold.sh -r $f
38+
mv ${b}11.ll ${b}11.ll.keep_me
39+
# clean intermediary compilation files (comment out for speed)
40+
#$ROOT/scaffold.sh -c $f
41+
# Keep the final output for the compilation
42+
mv ${b}11.ll.keep_me ${b}/${b}.ll
43+
fi
44+
done
45+
46+
# Module flattening pass with different thresholds
47+
for f in $*; do
48+
b=$(basename $f .scaffold)
49+
echo "[gen-lpfs.sh] $b: Computing module gate counts ..."
50+
$OPT -S -load $SCAF -ResourceCount2 ${b}/${b}.ll > /dev/null 2> ${b}.out
51+
python $DIR/flattening_thresh.py ${b}
52+
for th in ${THRESHOLDS[@]}; do
53+
if [ ! -e ${b}/${b}.flat${th}.ll ]; then
54+
echo "[gen-lpfs.sh] $b_flat${th}: Flattening ..."
55+
mv ${b}.flat${th}.txt flat_info.txt
56+
$OPT -S -load $SCAF -FlattenModule -dce -internalize -globaldce ${b}/${b}.ll -o ${b}/${b}.flat${th}.ll
57+
fi
58+
done
59+
rm -f *flat*.txt ${b}.out
60+
done
61+
62+
# Perform resource estimation
63+
for f in $*; do
64+
b=$(basename $f .scaffold)
65+
for th in ${THRESHOLDS[@]}; do
66+
echo "[gen-lpfs.sh] $b.flat${th}: Resource count ..."
67+
if [ -n ${b}/${b}.flat${th}.resources ]; then
68+
$OPT -S -load $SCAF -ResourceCount ${b}/${b}.flat${th}.ll > /dev/null 2> ${b}/${b}.flat${th}.resources
69+
fi
70+
done
71+
done
7272

7373
# For different K and D values specified above, generate MultiSIMD schedules
7474
for f in $*; do

0 commit comments

Comments
 (0)