HN := $(shell hostname)
TILABHOSTS := $(shell echo ti{1..9}) apps1
+ifeq ($(findstring $(HN), $(TILABHOSTS)),$(HN))
+# die option 's' geht nicht... :(
+COVERVCOM := -cover bcet
+COVERVSIM := -coverage
+else
+COVERVCOM :=
+COVERVSIM :=
+endif
+
ifeq ($(findstring $(HN), $(TILABHOSTS)),$(HN))
QUMACRO := unset LS_COLORS; cd $(QUARTUS); export LD_LIBRARY_PATH=/opt/quartus/quartus/linux64; export LM_LICENSE_FILE=26888@quartus;
else
# o source files der module
# o reihenfolge ist wichtig
# o keine testbechnes hier angeben
-SRCFILES := alu parser scanner display sp_ram history uart_tx uart_rx
+SRCFILES := alu parser scanner display sp_ram history uart_tx uart_rx pc_communication
# o files der packages
# o keine testbechnes hier angeben
$(D_BEHSIM)/$(WORK)/%/_primary.dat: %.vhd $(D_BEHSIM)/modelsim.ini
@echo " CC $<"
- @cd $(D_BEHSIM); \
- vcom -work $(WORK) $(MPWD)/$<
+ cd $(D_BEHSIM); \
+ vcom $(COVERVCOM) -work $(WORK) $(MPWD)/$<
beh_%: $(D_BEHSIM)/$(WORK)/beh_%_tb/_primary.dat beh_%_tb.do behsim
cd $(D_BEHSIM); \
- vsim "work.$@_tb(sim)" -f /dev/null -do $(MPWD)/$@_tb.do
+ vsim $(COVERVSIM) "work.$@_tb(sim)" -f /dev/null -do $(MPWD)/$@_tb.do
#postsim
-postsim: $(POST_VHO) $(POST_SDO)
+postsim: post_alu
$(D_POSTSIM)/modelsim.ini:
@echo " INIT for post-layout simulation"
@cd $(D_POSTSIM); \
vcom -work $(WORK) $(MPWD)/$<
-post_%: postsim $(D_POSTSIM)/$(WORK)/post_%_tb/_primary.dat post_%_tb.do
+post_%: quartus_gen_% post_%_tb.do $(D_POSTSIM)/$(WORK)/post_%_tb/_primary.dat
cd $(D_POSTSIM); \
vsim "work.$@_tb(sim)" -sdftyp /$(POST_SDO_INST)=$(POST_SDO) -f /dev/null -do $(MPWD)/$@_tb.do
-$(QUARTUS): $(D_POSTSIM)/modelsim.ini
+quartus_gen_%: ../quartus/project_%.tcl $(D_POSTSIM)/modelsim.ini $(POST_VTARGETS) $(POST_SRC_VTARGETS)
@echo -n " Quartus generate project"
ifeq ($(findstring $(HN), $(TILABHOSTS)),$(HN))
- @echo "(@tilab)"
- @cd ../quartus; ./linux_tilab.sh
+ @echo "(@tilab): $<"
+ @cd ../quartus; rm -Rf calc; ./linux_tilab.sh $<
else
- @echo "(not @ tilab)"
- @cd ../quartus; ./linux_web.sh
+ @echo "(not @ tilab): $<"
+ @cd ../quartus; rm -Rf calc; ./linux_web.sh $<
endif
-
-#TODO: more targets plz...
-$(POST_VHO) $(POST_SDO): $(QUARTUS) $(POST_VTARGETS) $(POST_SRC_VTARGETS)
@echo " Quartus analysis & synthesis"
- @$(QUMACRO) quartus_map $(QUOPT) | tee $(MPWD)/quartusmap.tmp
+ @$(QUMACRO) quartus_map $(QUOPT)
@echo " Quartus fitter"
@$(QUMACRO) quartus_fit $(QUOPT)
@echo " Quartus assembler"
@$(QUMACRO) quartus_asm $(QUOPT)
@echo " Quartus timing analyzer"
- @$(QUMACRO) quartus_tan $(QUOPT) --timing_analysis_only | tee $(MPWD)/quartustan.tmp
+ @$(QUMACRO) quartus_tan $(QUOPT) --timing_analysis_only
@echo " Quartus EDA netlist writer"
@$(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:
- rm -Rf $(D_BEHSIM) $(D_POSTSIM) $(QUARTUS)
+ rm -Rf $(D_BEHSIM) $(D_POSTSIM)