|
@@ -12,6 +12,7 @@ QPRI = --lower_priority
|
|
|
QCPF = $(QU)_cpf $(QPRI)
|
|
|
QSH = $(QU)_sh $(QPRI)
|
|
|
QSTA = $(QU)_sta $(QPRI)
|
|
|
+QPGM = $(QU)_pgm $(QPRI)
|
|
|
|
|
|
# Common options for Quartus in-flow tools
|
|
|
QOPT = --write_settings_files=off $(QPRI)
|
|
@@ -54,6 +55,19 @@ $(outdir)/%.pow.rpt: $(outdir)/%.sta.rpt
|
|
|
$(outdir)/%.jic: %jic.cof $(outdir)/%.sof
|
|
|
$(QCPF) --convert $<
|
|
|
|
|
|
+# Programming targets. Environment JTAG_CABLE can override the default,
|
|
|
+# which is otherwise the first cable found.
|
|
|
+rpar := )
|
|
|
+JTAG_CABLE ?= $(shell jtagconfig --enum | sed -ne 's/^1$(rpar) //p')
|
|
|
+
|
|
|
+# Transient programming
|
|
|
+program:
|
|
|
+ $(QPGM) -c '$(JTAG_CABLE)' -m JTAG -o 'p;$(outdir)/$(PROJECT).sof'
|
|
|
+
|
|
|
+# Permanent programming in flash
|
|
|
+flash:
|
|
|
+ $(QPGM) -c '$(JTAG_CABLE)' -m JTAG -o 'pvbi;$(outdir)/$(PROJECT).jic'
|
|
|
+
|
|
|
%.deps: %.qsf scripts/qsfdeps.pl
|
|
|
$(PERL) scripts/qsfdeps.pl $< $* > $@
|
|
|
|