From 179a6ca839a61c781936f6264a86cb30886caa2d Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Fri, 16 Apr 2010 22:03:27 +0200 Subject: [PATCH] makefile: more fun with quartus --- .gitignore | 1 + src/Makefile | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 42d40cc..9dc857a 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ src/transcript #quartus quartus/calc/ +src/quartus*.tmp diff --git a/src/Makefile b/src/Makefile index 730c272..289101a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -8,6 +8,7 @@ POST_SDO := $(MPWD)/../quartus/calc/simulation/modelsim/calc_vhd.sdo POST_SDO_INST := inst QUARTUS := $(MPWD)/../quartus/calc QUOPT := --read_settings_files=on --write_settings_files=off calc -c calc +QUMACRO := unset LS_COLORS; cd $(QUARTUS); HN := $(shell hostname) TILABHOSTS := $(shell echo ti{1..9}) apps1 @@ -55,7 +56,7 @@ beh_%: $(D_BEHSIM)/$(WORK)/beh_%_tb/_primary.dat beh_%_tb.do behsim vsim "work.$@_tb(sim)" -f /dev/null -do $(MPWD)/$@_tb.do #postsim -postsim: $(POST_VHO) $(D_POSTSIM)/modelsim.ini $(POST_VTARGETS) +postsim: $(POST_VHO) $(POST_SDO) $(D_POSTSIM)/modelsim.ini: @echo " INIT for post-layout simulation" @@ -64,16 +65,16 @@ $(D_POSTSIM)/modelsim.ini: vlib work > /dev/null ; \ vmap work work > /dev/null ; -$(D_POSTSIM)/$(WORK)/%/_primary.dat: %.vhd $(D_POSTSIM)/modelsim.ini +$(D_POSTSIM)/$(WORK)/%/_primary.dat: %.vhd @echo " CC $<" @cd $(D_POSTSIM); \ vcom -work $(WORK) $(MPWD)/$< -post_%: $(D_POSTSIM)/$(WORK)/post_%_tb/_primary.dat post_%_tb.do postsim $(POST_SDO) +post_%: postsim $(D_POSTSIM)/$(WORK)/post_%_tb/_primary.dat post_%_tb.do cd $(D_POSTSIM); \ vsim "work.$@_tb(sim)" -sdftyp /$(POST_SDO_INST)=$(POST_SDO) -f /dev/null -do $(MPWD)/$@_tb.do -$(QUARTUS): +$(QUARTUS): $(D_POSTSIM)/modelsim.ini @echo -n " Quartus generate project" ifeq ($(findstring $(HN), $(TILABHOSTS)),$(HN)) @echo "(@tilab)" @@ -84,26 +85,25 @@ else endif #TODO: more targets plz... -$(POST_VHO) $(POST_SDO): $(QUARTUS) postsim +$(POST_VHO) $(POST_SDO): $(QUARTUS) $(POST_VTARGETS) @echo " Quartus analysis & synthesis" - @unset LS_COLORS; cd $(QUARTUS); \ - quartus_map $(QUOPT) + @$(QUMACRO) quartus_map $(QUOPT) | tee $(MPWD)/quartusmap.tmp @echo " Quartus fitter" - @unset LS_COLORS; cd $(QUARTUS); \ - quartus_fit $(QUOPT) + @$(QUMACRO) quartus_fit $(QUOPT) @echo " Quartus assembler" - @unset LS_COLORS; cd $(QUARTUS); \ - quartus_asm $(QUOPT) + @$(QUMACRO) quartus_asm $(QUOPT) @echo " Quartus timing analyzer" - @unset LS_COLORS; cd $(QUARTUS); \ - quartus_tan $(QUOPT) --timing_analysis_only + @$(QUMACRO) quartus_tan $(QUOPT) --timing_analysis_only | tee $(MPWD)/quartustan.tmp @echo " Quartus EDA netlist writer" - @unset LS_COLORS; cd $(QUARTUS); \ - quartus_eda $(QUOPT) + @$(QUMACRO) quartus_eda $(QUOPT) #not nice atm :/ @echo " CC $(POST_VHO)" @cd $(D_POSTSIM); \ vcom -work $(WORK) $(POST_VHO) + @echo -n " INFO logic cells: " + @grep 'logic cells' quartusmap.tmp | awk ' { print $$3 } ' + @grep 'Fmax ' quartustan.tmp | sed -e 's/ / /g' -e 's/Info/INFO/g' -e 's/:/ /g' + @rm quartus*.tmp .PHONY: clean clean: -- 2.25.1