summaryrefslogtreecommitdiffstats
path: root/lab4/build/precision-xilinx.mk
blob: fafa3bca8b767fd64727d3ccdabb39166dc73a9f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
PRECISION=precision

# FIXME - different directoreis for different synthesis scripts?
# For precision:
$(PROJNAME)-synthdir/synth/precision/design.scr: $(S) | dump_synthsettings
	@echo
	@echo '*** Creating synthesis scripts for Precision ***'
	@echo
	mkdir -p $(@D)
	rm -f $(@D)/design.scr;
	echo set_results_dir . > $(@D)/design.scr
	echo -n 'add_input_file {' >> $(@D)/design.scr
	for i in $(S); do echo -n " \"$$PWD/$$i\"" >> $(@D)/design.scr; done
	echo '}' >> $(@D)/design.scr
	echo "setup_design -design "$$(basename $$(echo $(firstword $(S)) | sed 's/\..*$$//')) >> $(@D)/design.scr
	echo 'setup_design -manufacturer $(PRECISION_MANUFACTURER) -family $(PRECISION_FAMILY)  -part $(PRECISION_PART) -speed $(PRECISION_SPEEDGRADE)' >> $(@D)/design.scr
	echo '$(PRECISION_EXTRA_OPTIONS)'  >> $(@D)/design.scr
	echo 'setup_design -basename design' >> $(@D)/design.scr
	echo 'compile' >> $(@D)/design.scr
	echo 'synthesize' >> $(@D)/design.scr
	echo 'report_area > area.rpt' >> $(@D)/design.scr

$(PROJNAME)-synthdir/synth/precision/design.edf: $(PROJNAME)-synthdir/synth/precision/design.scr
	cd $(@D);$(NICE) $(PRECISION) -shell -file design.scr

$(PROJNAME)-synthdir/synth/design.edf: $(PROJNAME)-synthdir/synth/precision/design.edf
	cp $< $@

dump_synthsettings:
	@echo
	@echo "   *** Important settings for the Synthesis module ***"
	@echo
	@echo "   Synthesis top module: $$(basename $$(echo $(firstword $(S)) | sed 's/\..*$$//'))"
	@echo "   Files to synthesize:  $(S)"
	@echo "   Include directories: $(INCDIRS)"
	@echo "   FPGA part (PRECISION_PART): $(PRECISION_PART)"
	@echo "   FPGA familypart (PRECISION_FAMILY): $(PRECISION_FAMILY)"
	@echo "   FPGA manufacturer (PRECISION_MANUFACTURER): $(PRECISION_MANUFACTURER)"
	@echo "   FPGA speedgrade (PRECISION_SPEEDGRADE): $(PRECISION_SPEEDGRADE)"
	@echo "   Extra options to precision: $(PRECISION_EXTRA_OPTIONS)"
	@echo

export PRECISION_PART
export PRECISION_FAMILY
export PRECISION_MANUFACTURER
export PRECISION_SPEEDGRADE
export PRECISION_EXTRA_OPTIONS

# How to handle EDN files?
# $(PROJNAME)-synthdir/layoutdefault/design.ngd: $(PROJNAME)-synthdir/synth/design.ngc $(U)
#     $(@D)/%.ngd: $(@D)/%.edf %.ucf
#     	rm -rf $(@D)/_ngo
#     	mkdir $(@D)/_ngo
#     	cp *.edn $(@D)
#     	cd $(@D); $(XILINX_INIT) ngdbuild -dd _ngo -nt timestamp -p $(PART) -uc $(PWD)/$*.ucf $*.edf  $*.ngd


%.synth:
	$(NICE) $(MAKE) -f $(firstword $(MAKEFILE_LIST)) $*-synthdir/synth/precision/design.edf  PROJNAME="$*"