1 |
22 |
wfjm |
# $Id: generic_xflow_cpld.mk 539 2013-10-13 17:06:35Z mueller $
|
2 |
2 |
wfjm |
#
|
3 |
|
|
# Revision History:
|
4 |
|
|
# Date Rev Version Comment
|
5 |
22 |
wfjm |
# 2013-10-12 539 1.2 use xtwi
|
6 |
18 |
wfjm |
# 2013-01-05 470 1.1.1 remove '-r' from all non-dir clean rm's
|
7 |
12 |
wfjm |
# 2011-08-13 405 1.1 renamed, moved to rtl/make;
|
8 |
2 |
wfjm |
# 2010-03-13 268 1.0 Initial version, cloned from .xflow Rev 252
|
9 |
|
|
#---
|
10 |
|
|
#
|
11 |
|
|
# setup default device
|
12 |
|
|
#
|
13 |
|
|
ifndef ISE_PATH
|
14 |
|
|
ISE_PATH = xc2c64a-7-vq44
|
15 |
|
|
endif
|
16 |
|
|
#
|
17 |
|
|
# setup defaults for xflow option files for synthesis and implementation
|
18 |
|
|
#
|
19 |
|
|
ifndef XFLOWOPT_SYN
|
20 |
|
|
XFLOWOPT_SYN = xst_vhdl.opt
|
21 |
|
|
endif
|
22 |
|
|
#
|
23 |
|
|
ifndef XFLOWOPT_IMP
|
24 |
|
|
XFLOWOPT_IMP = balanced.opt
|
25 |
|
|
endif
|
26 |
|
|
#
|
27 |
|
|
XFLOW = xflow -p ${ISE_PATH}
|
28 |
|
|
#
|
29 |
|
|
# $@ first target
|
30 |
|
|
# $< first dependency
|
31 |
|
|
# $* stem in rule match
|
32 |
|
|
#
|
33 |
|
|
# when chaining, don't delete 'expensive' intermediate files:
|
34 |
|
|
.SECONDARY :
|
35 |
|
|
#
|
36 |
|
|
# Synthesize (xst)
|
37 |
|
|
# input: %.prj project file
|
38 |
|
|
# output: %.ngc
|
39 |
|
|
# %_xst.log xst log file
|
40 |
|
|
#
|
41 |
|
|
# Note: removed "cp ${RETROBASE}/vlib/${XFLOWOPT_SYN} ./ise" option
|
42 |
|
|
#
|
43 |
|
|
%.ngc: %.vbom
|
44 |
|
|
if [ ! -d ./ise ]; then mkdir ./ise; fi
|
45 |
|
|
(cd ./ise; vbomconv --xst_prj ../$< > $*.prj)
|
46 |
|
|
(cd ./ise; touch $*.xcf)
|
47 |
|
|
if [ -r $*.xcf ]; then cp $*.xcf ./ise; fi
|
48 |
|
|
if [ -r ${XFLOWOPT_SYN} ]; then cp ${XFLOWOPT_SYN} ./ise; fi
|
49 |
22 |
wfjm |
xtwi ${XFLOW} -wd ise -synth ${XFLOWOPT_SYN} $*.prj
|
50 |
2 |
wfjm |
(cd ./ise; chmod -x *.* )
|
51 |
|
|
if [ -r ./ise/$*.ngc ]; then cp -p ./ise/$*.ngc .; fi
|
52 |
|
|
if [ -r ./ise/$*_xst.log ]; then cp -p ./ise/$*_xst.log .; fi
|
53 |
|
|
@ echo "==============================================================="
|
54 |
|
|
@ echo "* Makefile.xflow: XST Diagnostic Summary *"
|
55 |
|
|
@ echo "==============================================================="
|
56 |
|
|
@ grep -i -A 1 ":.*:" $*_xst.log
|
57 |
|
|
@ echo "==============================================================="
|
58 |
|
|
#
|
59 |
|
|
# the following rule needed to generate an %_*sim.vhd in a ./tb sub-directory
|
60 |
|
|
# it will look for a matching vbom in the parent directory
|
61 |
|
|
%.ngc: ../%.vbom
|
62 |
|
|
if [ ! -d ./ise ]; then mkdir ./ise; fi
|
63 |
|
|
(cd ./ise; vbomconv --xst_prj ../$< > $*.prj)
|
64 |
|
|
(cd ./ise; touch $*.xcf)
|
65 |
|
|
if [ -r $*.xcf ]; then cp $*.xcf ./ise; fi
|
66 |
|
|
if [ -r ${XFLOWOPT_SYN} ]; then cp ${XFLOWOPT_SYN} ./ise; fi
|
67 |
22 |
wfjm |
xtwi ${XFLOW} -wd ise -synth ${XFLOWOPT_SYN} $*.prj
|
68 |
2 |
wfjm |
(cd ./ise; chmod -x *.* )
|
69 |
|
|
if [ -r ./ise/$*.ngc ]; then cp -p ./ise/$*.ngc .; fi
|
70 |
|
|
if [ -r ./ise/$*_xst.log ]; then cp -p ./ise/$*_xst.log .; fi
|
71 |
|
|
@ echo "==============================================================="
|
72 |
|
|
@ echo "* Makefile.xflow: XST Diagnostic Summary *"
|
73 |
|
|
@ echo "==============================================================="
|
74 |
|
|
@ grep -i -A 1 ":.*:" $*_xst.log
|
75 |
|
|
@ echo "==============================================================="
|
76 |
|
|
#
|
77 |
|
|
# Fit (map + cpldfit +
|
78 |
|
|
# input: %.ngc project file
|
79 |
|
|
# output: %.ncd
|
80 |
|
|
# %.jed
|
81 |
|
|
# %_tra.log translate (ngdbuild) log file (renamed %.bld)
|
82 |
|
|
# %_fit.log cpldfit log file (renamed %.rpt)
|
83 |
|
|
# %_tim.log timing analyser log file (renamed %.tim)
|
84 |
|
|
# %_pad.log pad file (renamed %.pad)
|
85 |
|
|
#
|
86 |
|
|
# Note: removed "cp ${RETROBASE}/vlib/balanced.opt" option
|
87 |
|
|
# currently ise 'density.opt' as steering file
|
88 |
|
|
#
|
89 |
|
|
%.ncd %.jed: %.ngc
|
90 |
|
|
if [ ! -d ./ise ]; then mkdir ./ise; fi
|
91 |
|
|
if [ -r $*.ngc ]; then cp -p $*.ngc ./ise; fi
|
92 |
|
|
if [ -r $*.ucf ]; then cp -p $*.ucf ./ise; fi
|
93 |
|
|
if [ -r ${XFLOWOPT_IMP} ]; then cp -p ${XFLOWOPT_IMP} ./ise; fi
|
94 |
22 |
wfjm |
xtwi ${XFLOW} -wd ise -fit ${XFLOWOPT_IMP} $<
|
95 |
2 |
wfjm |
(cd ./ise; chmod -x *.* )
|
96 |
|
|
if [ -r ./ise/$*.ncd ]; then cp -p ./ise/$*.ncd .; fi
|
97 |
|
|
if [ -r ./ise/$*.jed ]; then cp -p ./ise/$*.jed .; fi
|
98 |
|
|
if [ -r ./ise/$*.bld ]; then cp -p ./ise/$*.bld ./$*_tra.log; fi
|
99 |
|
|
if [ -r ./ise/$*.rpt ]; then cp -p ./ise/$*.rpt ./$*_fit.log; fi
|
100 |
|
|
if [ -r ./ise/$*.tim ]; then cp -p ./ise/$*.tim ./$*_tim.log; fi
|
101 |
|
|
if [ -r ./ise/$*.pad ]; then cp -p ./ise/$*.pad ./$*_pad.log; fi
|
102 |
|
|
#
|
103 |
|
|
# generate dep_xst files from vbom
|
104 |
|
|
#
|
105 |
|
|
%.dep_xst: %.vbom
|
106 |
|
|
vbomconv --dep_xst $< > $@
|
107 |
|
|
#
|
108 |
|
|
# generate cpp'ed ucf files from ucf_cpp
|
109 |
|
|
#
|
110 |
|
|
%.ucf : %.ucf_cpp
|
111 |
|
|
cpp $*.ucf_cpp $*.ucf
|
112 |
|
|
#
|
113 |
|
|
# generate nested dependency rules for cpp'ed ucf files from ucf_cpp
|
114 |
|
|
#
|
115 |
|
|
%.dep_ucf_cpp : %.ucf_cpp
|
116 |
|
|
cpp -MM $*.ucf_cpp | sed 's/\.o:/\.ucf:/' > $*.dep_ucf_cpp
|
117 |
|
|
#
|
118 |
12 |
wfjm |
.PHONY : ise_clean ise_tmp_clean
|
119 |
2 |
wfjm |
#
|
120 |
|
|
ise_clean: ise_tmp_clean
|
121 |
18 |
wfjm |
rm -f *.ngc
|
122 |
|
|
rm -f *.ncd
|
123 |
|
|
rm -f *.jed
|
124 |
|
|
rm -f *_xst.log
|
125 |
|
|
rm -f *_tra.log
|
126 |
|
|
rm -f *_fit.log
|
127 |
|
|
rm -f *_tim.log
|
128 |
|
|
rm -f *_pad.log
|
129 |
2 |
wfjm |
#
|
130 |
|
|
ise_tmp_clean:
|
131 |
|
|
rm -rf ./ise
|
132 |
|
|
#
|