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