Forum Discussion
Altera_Forum
Honored Contributor
8 years agoHere's a Makefile I use to run a full Quartus compile thru programming file generation on a design:
makefile:
DESIGN=MY_DESIGN
generate::
$(QUARTUS_BIN)/quartus_map $(DESIGN) --write_settings_files=off
$(QUARTUS_BIN)/quartus_fit $(DESIGN) --write_settings_files=off --seed=1
$(QUARTUS_BIN)/quartus_asm $(DESIGN) --write_settings_files=off
$(QUARTUS_BIN)/quartus_sta $(DESIGN)
$(QUARTUS_BIN)/quartus_eda $(DESIGN) --write_settings_files=off -c $(DESIGN)
$(QUARTUS_BIN)/quartus_cpf -c $(DESIGN).cof
clean::
-rm -f $(DESIGN).*.rpt $(DESIGN).*.summary $(DESIGN).*.smsg $(DESIGN).map $(DESIGN)_assignment_defaults.qdf $(DESIGN).*.ddb $(DESIGN).sld
-rm -f $(DESIGN).done $(DESIGN).map $(DESIGN).pof $(DESIGN).sof $(DESIGN).jic $(DESIGN).pin $(DESIGN).jdi $(DESIGN).qws
-rm -rf db incremental_db simulation
# the end
Programming is still done by launching the Quartus graphical programming utility. The Makefile does not attempt to do any dependency checking as it is not really meaningful; once you change a source file (.v or .sdc or .qsf) you really need to run the full MAP thru SOF/POF/JBC programming file generation anyway. So really it is not using much of the capability of make (all the dependency checking) and in reality the listed quartus commands could just be embedded into a shell script. And a setup file to configure which installed version of Quartus I want to use (I have several versions installed). I just have to run this setup file once before invoking make, to setup all the required environment variables. quartus_setup.sh:
#!/bin/bash#
export QUARTUS_BASE=/cygdrive/C/Tools/Altera/16.0
export QUARTUS_ROOTDIR=${QUARTUS_BASE}/quartus
if ; then
export QUARTUS_BIN=${QUARTUS_BASE}/quartus/bin64
else
export QUARTUS_BIN=${QUARTUS_BASE}/quartus/bin
fi
export QSYS_ROOTDIR=${QUARTUS_BASE}/quartus/sopc_builder/bin
export SOPC_KIT_NIOS2=${QUARTUS_BASE}/nios2eds#
echo QUARTUS_BASE=${QUARTUS_BASE}
echo QUARTUS_ROOTDIR=${QUARTUS_ROOTDIR}
echo QUARTUS_BIN=${QUARTUS_BIN}
echo QSYS_ROOTDIR=${QSYS_ROOTDIR}
echo SOPC_KIT_NIOS2=${SOPC_KIT_NIOS2}# # the end
I run this on the CYGWIN 32b environment under Windows 7 64b and it works without any issues. In my design directory I have text files: MY_DESIGN.qsf, .cdf, .cof, .qpf, .sdc which I maintain using a text editor (EMACS). I have a separate source directory which has MY_DESIGN.v and all subsidiary verilog files. I rarely have to invoke the graphical Quartus IDE.