makefile: quartus haut doch hin unter mein linux *freu* ;)
authorBernhard Urban <lewurm@gmail.com>
Fri, 16 Apr 2010 18:31:34 +0000 (20:31 +0200)
committerBernhard Urban <lewurm@gmail.com>
Fri, 16 Apr 2010 18:35:10 +0000 (20:35 +0200)
src/Makefile

index ec0cb565bb55be8a0af74c625df662b3e564685a..730c2722d97a79fd5aa3e6faf478e4a6f549ddd6 100644 (file)
@@ -6,6 +6,11 @@ D_POSTSIM := $(MPWD)/../sim/post
 POST_VHO := $(MPWD)/../quartus/calc/simulation/modelsim/calc.vho
 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
+
+HN := $(shell hostname)
+TILABHOSTS := $(shell echo ti{1..9}) apps1
 
 WORK := work
 
@@ -24,8 +29,7 @@ POST_IFILES := $(strip $(POST_IFILES))
 BEH_VTARGETS := $(foreach n, $(BEH_IFILES), $(D_BEHSIM)/$(WORK)/$(n)/_primary.dat)
 
 #virtuelle targets fuer postsim
-POST_VTARGETS := $(foreach n, $(shell grep ENTITY $(POST_VHO) | awk '{ print $$2 }'), $(D_POSTSIM)/$(WORK)/$(n)/_primary.dbs)
-POST_VTARGETS += $(foreach n, $(POST_IFILES), $(D_POSTSIM)/$(WORK)/$(n)/_primary.dat)
+POST_VTARGETS := $(foreach n, $(POST_IFILES), $(D_POSTSIM)/$(WORK)/$(n)/_primary.dat)
 
 
 all: behsim
@@ -60,11 +64,6 @@ $(D_POSTSIM)/modelsim.ini:
        vlib work > /dev/null ; \
        vmap work work > /dev/null ;
 
-$(D_POSTSIM)/$(WORK)/%/_primary.dbs: $(POST_VHO) $(D_POSTSIM)/modelsim.ini
-       @echo " CC    $<"
-       @cd $(D_POSTSIM); \
-       vcom -work $(WORK) $(POST_VHO)
-
 $(D_POSTSIM)/$(WORK)/%/_primary.dat: %.vhd $(D_POSTSIM)/modelsim.ini
        @echo " CC    $<"
        @cd $(D_POSTSIM); \
@@ -74,21 +73,39 @@ post_%: $(D_POSTSIM)/$(WORK)/post_%_tb/_primary.dat post_%_tb.do postsim $(POST_
        cd $(D_POSTSIM); \
        vsim "work.$@_tb(sim)" -sdftyp /$(POST_SDO_INST)=$(POST_SDO) -f /dev/null -do $(MPWD)/$@_tb.do
 
-$(POST_VHO) $(POST_SDO):
-       @if [ -f $@ ]; \
-       then echo "vho/sdo: passt"; true ; \
-       else echo "Fehler: $@ muss mit quartus erstellt werden"; false; \
-       fi
-
-quartus:
-       @echo "Die angebotene (free) Quartus II Version aka Web Edition funktioniert "
-       @echo "unter Linux leider nicht. (Build endet mit einem Error, auch mit dem debouncing-bsp der LVA)."
-       @echo "Befehl um es trotzdem zu probieren (falls installiert):"
-       @echo "$$ unset LS_COLORS #falls gesetzt..."
-       @echo -n "$$ quartus # bin verzeichnis von quartus muss sich in "; echo -n "$$"; echo "PATH befinden"
-       @echo "in windows (per cygwin?): TODO"
+$(QUARTUS):
+       @echo -n " Quartus  generate project"
+ifeq ($(findstring $(HN), $(TILABHOSTS)),$(HN))
+       @echo "(@tilab)"
+       @cd ../quartus; ./linux_tilab.sh
+else
+       @echo "(not @ tilab)"
+       @cd ../quartus; ./linux_web.sh
+endif
+
+#TODO: more targets plz...
+$(POST_VHO) $(POST_SDO): $(QUARTUS) postsim
+       @echo " Quartus  analysis & synthesis"
+       @unset LS_COLORS; cd $(QUARTUS); \
+       quartus_map $(QUOPT)
+       @echo " Quartus  fitter"
+       @unset LS_COLORS; cd $(QUARTUS); \
+       quartus_fit $(QUOPT)
+       @echo " Quartus  assembler"
+       @unset LS_COLORS; cd $(QUARTUS); \
+       quartus_asm $(QUOPT)
+       @echo " Quartus  timing analyzer"
+       @unset LS_COLORS; cd $(QUARTUS); \
+       quartus_tan $(QUOPT) --timing_analysis_only
+       @echo " Quartus  EDA netlist writer"
+       @unset LS_COLORS; cd $(QUARTUS); \
+       quartus_eda $(QUOPT)
+       #not nice atm :/
+       @echo " CC    $(POST_VHO)"
+       @cd $(D_POSTSIM); \
+       vcom -work $(WORK) $(POST_VHO)
 
 .PHONY: clean
 clean:
-       rm -Rf $(D_BEHSIM) $(D_POSTSIM)
+       rm -Rf $(D_BEHSIM) $(D_POSTSIM) $(QUARTUS)