Skip to content

Commit 6ef4a5a

Browse files
committed
flag edits
1 parent 249524b commit 6ef4a5a

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

bin/eqmap

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,18 @@
1515
# limitations under the License.
1616

1717
set -eo pipefail
18+
KEEP_TEMPS=0
19+
if [ "$1" = "--save-temps" ]; then
20+
KEEP_TEMPS=1
21+
shift
22+
fi
23+
24+
INPUT="$1"
1825
LIB="$(dirname $0)/../verilog/lutlang.v"
1926
LIB="$(realpath $LIB)"
2027
SIMLIB="$(dirname $0)/../verilog/simlib.v"
2128
SIMLIB="$(realpath $SIMLIB)"
22-
MKFILE=$1.mk
29+
MKFILE=$INPUT.mk
2330
TOOL=eqmap_fpga
2431

2532
# Decide whether to use Vivado or Yosys based on the stem given to Make
@@ -29,9 +36,9 @@ fi
2936

3037
if [ "$1" == "--help" ] || [ "$2" == "--help" ] || [ "$3" == "--help" ]; then
3138
$TOOL --help
32-
elif [ ! -f "$1" ]; then
39+
elif [ ! -f "$INPUT" ]; then
3340
echo "First argument must be the input file."
34-
echo "Usage: $0 <input.v> [$TOOL options]"
41+
echo "Usage: $0 [--save-temps] <input.v> [$TOOL options]"
3542
echo "Check that file exists and it is the first argument"
3643
exit 1
3744
else
@@ -50,7 +57,7 @@ else
5057
echo "" >> $MKFILE
5158
echo ".PHONY: all clean" >> $MKFILE
5259
echo "" >> $MKFILE
53-
echo "all: $1.xil" >> $MKFILE
60+
echo "all: $INPUT.xil" >> $MKFILE
5461
echo "" >> $MKFILE
5562
echo "clean:" >> $MKFILE
5663
echo " rm -f *.xil *.synth *.ys *.dot *.png" >> $MKFILE
@@ -88,7 +95,10 @@ else
8895
echo "" >> $MKFILE
8996

9097

91-
make -f $MKFILE $1.$FSTEM 1>&2
92-
$TOOL $1.$FSTEM $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14} ${15} ${16}
93-
rm -f $1.$FSTEM $MKFILE
98+
make -f $MKFILE $INPUT.$FSTEM 1>&2
99+
$TOOL "$INPUT.$FSTEM" $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14} ${15} ${16}
100+
if [ "$KEEP_TEMPS" != "1" ]; then
101+
rm -f "$INPUT.$FSTEM" "$MKFILE"
102+
fi
103+
94104
fi

0 commit comments

Comments
 (0)