File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change 1515# limitations under the License.
1616
1717set -eo pipefail
18+ KEEP_TEMPS=0
19+ if [ " $1 " = " --save-temps" ]; then
20+ KEEP_TEMPS=1
21+ shift
22+ fi
23+
24+ INPUT=" $1 "
1825LIB=" $( dirname $0 ) /../verilog/lutlang.v"
1926LIB=" $( realpath $LIB ) "
2027SIMLIB=" $( dirname $0 ) /../verilog/simlib.v"
2128SIMLIB=" $( realpath $SIMLIB ) "
22- MKFILE=$1 .mk
29+ MKFILE=$INPUT .mk
2330TOOL=eqmap_fpga
2431
2532# Decide whether to use Vivado or Yosys based on the stem given to Make
2936
3037if [ " $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
3744else
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
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+
94104fi
You can’t perform that action at this time.
0 commit comments