OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [rtl/] [make/] [generic_xflow.mk] - Blame information for rev 24

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 22 wfjm
# $Id: generic_xflow.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.9    use xtwi; support trce tsi file; use -C for cpp
6 19 wfjm
# 2013-01-27   477   1.8    remove defaults for ISE_(BOARD|PATH) and XFLOWOPT_*
7
#                           use dontincdep.mk to suppress .dep include on clean
8 18 wfjm
# 2013-01-05   470   1.7.6  remove '-r' from all non-dir clean rm's
9 17 wfjm
# 2012-02-05   456   1.7.5  use vbomvonv --get_top for xflow calls
10
# 2012-01-08   451   1.7.4  use xilinx_ghdl_sdf_filter
11
# 2012-01-04   450   1.7.3  display isemsg_filter for ncd and bit targets too
12
# 2011-12-29   446   1.7.2  add fx2load_wrapper in jconfig target
13 12 wfjm
# 2011-08-14   406   1.7.1  use isemsg_filter; new %.mfsum target
14
# 2011-08-13   405   1.7    renamed, moved to rtl/make;
15
# 2011-07-17   394   1.6.2  add rm *.svf to ise_clean rule
16
# 2011-07-11   392   1.6.1  use config_wrapper, support jtag via svf generation
17
# 2011-06-26   385   1.6    use ISE_PATH for vbomconv -xst_prj
18 8 wfjm
# 2010-11-26   340   1.5.8  fix path for .opt defaults (now rtl/vlib)
19 2 wfjm
# 2010-05-06   289   1.5.7  add xilinx_tsim_xon support
20
# 2010-04-24   282   1.5.6  add %.impact rule to run impact_wrapper
21
# 2010-04-17   278   1.4.5  add '|| true' after grep in diag summary to prevent
22
#                           a make abort in case no diags are seen
23
# 2010-04-02   273   1.4.4  add -I{RETROBASE} to ucf_cpp processing rules
24
# 2010-03-14   268   1.4.3  add XFLOWOPT_SYN and XFLOWOPT_IMP
25
# 2009-11-21   252   1.4.2  use bitgen directly, use ISE_USERID
26
# 2007-12-17   102   1.4.1  fix %.dep_ucf_cpp : %.ucf_cpp rule
27
# 2007-12-16   101   1.4    add ucf_cpp rules
28
# 2007-12-09   100   1.3.7  ifndef define ISE_PATH to xc3s1000-ft256-4
29
# 2007-11-02    94   1.3.6  use .SECONDARY to keep intermediate files
30
# 2007-10-28    93   1.3.5  call xst_count_bels -xsts when _ssim is generated
31
# 2007-10-12    88   1.3.4  support .xcf files, if provided
32
# 2007-10-06    87   1.3.3  remove *_twr.log in clean
33
# 2007-07-20    67   1.3.2  handle local/global xst_vhdl.opt
34
# 2007-07-15    66   1.3.1  add rule "%.ngc: ../%.vbom" to support _*sim in ./tb
35
#                           add XST diagnostics summary at end of listing
36
# 2007-07-06    64   1.3    all vbom based now
37
# 2007-06-16    57   1.2.1  cleanup ghdl_clean handling (rm _[sft]sim)
38
# 2007-06-10    52   1.2    reorganized svn directory structure
39
# 2007-06-10    51   1.1    consolidate test bench generation
40
# 2007-06-03    45   1.0    Initial version
41
#---
42
#
43
# setup default board (for impact), device and userid (for bitgen)
44
#
45
ifndef ISE_BOARD
46 19 wfjm
$(error ISE_BOARD is not defined)
47 2 wfjm
endif
48
#
49
ifndef ISE_PATH
50 19 wfjm
$(error ISE_PATH is not defined)
51 2 wfjm
endif
52
#
53
ifndef ISE_USERID
54
ISE_USERID = 0xffffffff
55
endif
56
#
57
# setup defaults for xflow option files for synthesis and implementation
58
#
59
ifndef XFLOWOPT_SYN
60 19 wfjm
$(error XFLOWOPT_SYN is not defined)
61 2 wfjm
endif
62
#
63
ifndef XFLOWOPT_IMP
64 19 wfjm
$(error XFLOWOPT_IMP is not defined)
65 2 wfjm
endif
66
#
67
XFLOW    = xflow -p ${ISE_PATH}
68
#
69
# $@ first target
70
# $< first dependency
71
# $* stem in rule match
72
#
73
# when chaining, don't delete 'expensive' intermediate files:
74
.SECONDARY :
75
#
76
# Synthesize (xst)
77
#   input:   %.vbom     vbom project description
78
#   output:  %.ngc
79
#            %_xst.log  xst log file
80
#
81
%.ngc: %.vbom
82
        if [ ! -d ./ise ]; then mkdir ./ise; fi
83 12 wfjm
        (cd ./ise; vbomconv --ise_path=${ISE_PATH} --xst_prj ../$< > $*.prj)
84 2 wfjm
        (cd ./ise; touch $*.xcf)
85
        if [ -r  $*.xcf ]; then cp $*.xcf ./ise; fi
86 12 wfjm
        if [ -r ${RETROBASE}/rtl/make/${XFLOWOPT_SYN} ]; then \
87
                cp ${RETROBASE}/rtl/make/${XFLOWOPT_SYN} ./ise; fi
88 2 wfjm
        if [ -r ${XFLOWOPT_SYN} ]; then cp ${XFLOWOPT_SYN} ./ise; fi
89 22 wfjm
        xtwi ${XFLOW} -wd ise -synth ${XFLOWOPT_SYN} \
90 17 wfjm
          -g top_entity:`vbomconv --get_top $<` $*.prj
91 2 wfjm
        (cd ./ise; chmod -x *.* )
92
        if [ -r ./ise/$*.ngc ]; then cp -p ./ise/$*.ngc .; fi
93
        if [ -r ./ise/$*_xst.log ]; then cp -p ./ise/$*_xst.log .; fi
94
        @ echo "==============================================================="
95 12 wfjm
        @ echo "*     XST Diagnostic Summary                                  *"
96 2 wfjm
        @ echo "==============================================================="
97 12 wfjm
        @ if [ -r $*.mfset ]; then isemsg_filter xst $*.mfset $*_xst.log; fi
98
        @ if [ ! -r $*.mfset ]; then grep -i -A 1 ":.*:" $*_xst.log || true; fi
99 2 wfjm
        @ echo "==============================================================="
100
#
101
# the following rule needed to generate an %_*sim.vhd in a ./tb sub-directory
102
# it will look for a matching vbom in the parent directory
103
%.ngc: ../%.vbom
104
        if [ ! -d ./ise ]; then mkdir ./ise; fi
105
        (cd ./ise; vbomconv --xst_prj ../$< > $*.prj)
106
        (cd ./ise; touch $*.xcf)
107
        if [ -r  $*.xcf ]; then cp $*.xcf ./ise; fi
108 12 wfjm
        if [ -r ${RETROBASE}/rtl/make/${XFLOWOPT_SYN} ]; then \
109
                cp ${RETROBASE}/rtl/make/${XFLOWOPT_SYN} ./ise; fi
110 2 wfjm
        if [ -r ${XFLOWOPT_SYN} ]; then cp ${XFLOWOPT_SYN} ./ise; fi
111 22 wfjm
        xtwi ${XFLOW} -wd ise -synth ${XFLOWOPT_SYN} \
112 17 wfjm
          -g top_entity:`vbomconv --get_top $<` $*.prj
113 2 wfjm
        (cd ./ise; chmod -x *.* )
114
        if [ -r ./ise/$*.ngc ]; then cp -p ./ise/$*.ngc .; fi
115
        if [ -r ./ise/$*_xst.log ]; then cp -p ./ise/$*_xst.log .; fi
116
        @ echo "==============================================================="
117 12 wfjm
        @ echo "*     XST Diagnostic Summary                                  *"
118 2 wfjm
        @ echo "==============================================================="
119 12 wfjm
        @ if [ -r $*.mfset ]; then isemsg_filter xst $*.mfset $*_xst.log; fi
120
        @ if [ ! -r $*.mfset ]; then grep -i -A 1 ":.*:" $*_xst.log || true; fi
121 2 wfjm
        @ echo "==============================================================="
122
#
123 12 wfjm
# Implement 1 (map+par)
124 2 wfjm
#   input:   %.ngc
125
#            %.ucf      constraint file (if available)
126
#   output:  %.ncd
127
#            %.pcf
128
#            %_tra.log  translate (ngdbuild) log file (renamed %.bld)
129
#            %_map.log  map log file                  (renamed %_map.mrp)
130
#            %_par.log  par log file                  (renamed %.par)
131
#            %_pad.log  pad file                      (renamed %_pad.txt)
132 22 wfjm
#            %_tsi.log  trce tsi file                 (renamed %.tsi)
133 5 wfjm
#            %_twr.log  trce log file                 (renamed %.twr)
134 2 wfjm
#
135
%.ncd %.pcf: %.ngc
136
        if [ ! -d ./ise ]; then mkdir ./ise; fi
137
        if [ -r $*.ngc ]; then cp -p $*.ngc ./ise; fi
138
        if [ -r $*.ucf ]; then cp -p $*.ucf ./ise; fi
139 12 wfjm
        if [ -r ${RETROBASE}/rtl/make/${XFLOWOPT_IMP} ]; then \
140
                cp ${RETROBASE}/rtl/make/${XFLOWOPT_IMP} ./ise; fi
141 2 wfjm
        if [ -r ${XFLOWOPT_IMP} ]; then cp -p ${XFLOWOPT_IMP} ./ise; fi
142 22 wfjm
        xtwi ${XFLOW} -wd ise -implement ${XFLOWOPT_IMP} $<
143 2 wfjm
        (cd ./ise; chmod -x *.* )
144
        if [ -r ./ise/$*.ncd ]; then cp -p ./ise/$*.ncd .; fi
145
        if [ -r ./ise/$*.pcf ]; then cp -p ./ise/$*.pcf .; fi
146
        if [ -r ./ise/$*.bld ]; then cp -p ./ise/$*.bld ./$*_tra.log; fi
147
        if [ -r ./ise/$*_map.mrp ]; then cp -p ./ise/$*_map.mrp ./$*_map.log; fi
148
        if [ -r ./ise/$*.par ]; then cp -p ./ise/$*.par ./$*_par.log; fi
149
        if [ -r ./ise/$*_pad.txt ]; then cp -p ./ise/$*_pad.txt ./$*_pad.log; fi
150
        if [ -r ./ise/$*.twr ]; then cp -p ./ise/$*.twr ./$*_twr.log; fi
151 22 wfjm
        if [ -r ./ise/$*.tsi ]; then cp -p ./ise/$*.tsi ./$*_tsi.log; fi
152 17 wfjm
        @ if [ -r $*.mfset ]; then \
153
          echo "=============================================================";\
154
          echo "*     Translate Diagnostic Summary                          *";\
155
          echo "=============================================================";\
156
          isemsg_filter tra $*.mfset $*_tra.log;\
157
          echo "=============================================================";\
158
          echo "*     MAP Diagnostic Summary                                *";\
159
          echo "=============================================================";\
160
          isemsg_filter map $*.mfset $*_map.log;\
161
          echo "=============================================================";\
162
          echo "*     PAR Diagnostic Summary                                *";\
163
          echo "=============================================================";\
164
          isemsg_filter par $*.mfset $*_par.log;\
165
          echo "=============================================================";\
166
          fi
167 2 wfjm
#
168 12 wfjm
# Implement 2 (bitgen)
169 2 wfjm
#   input:   %.ncd
170
#   output:  %.bit
171
#            %.msk
172
#            %_bgn.log  bitgen log file    (renamed %.bgn)
173
#
174
%.bit: %.ncd
175
        if [ ! -d ./ise ]; then mkdir ./ise; fi
176
        if [ -r $*.ncd ]; then cp -p $*.ncd ./ise; fi
177 22 wfjm
        (cd ./ise; xtwi bitgen -l -w -m -g ReadBack -g UserId:${ISE_USERID} -intstyle xflow $*.ncd)
178 2 wfjm
        (cd ./ise; chmod -x *.* )
179
        if [ -r ./ise/$*.bit ]; then cp -p ./ise/$*.bit .; fi
180
        if [ -r ./ise/$*.msk ]; then cp -p ./ise/$*.msk .; fi
181
        if [ -r ./ise/$*.bgn ]; then cp -p ./ise/$*.bgn ./$*_bgn.log; fi
182 17 wfjm
        @ if [ -r $*.mfset ]; then \
183
          echo "=============================================================";\
184
          echo "*     Bitgen Diagnostic Summary                             *";\
185
          echo "=============================================================";\
186
          isemsg_filter bgn $*.mfset $*_bgn.log;\
187
          echo "=============================================================";\
188
          fi
189 2 wfjm
#
190 12 wfjm
# Create svf from bitstream
191 2 wfjm
#   input:   %.bit
192 12 wfjm
#   output:  %.svf
193 2 wfjm
#
194 12 wfjm
%.svf: %.bit
195 22 wfjm
        xtwi config_wrapper --board=${ISE_BOARD} --path=${ISE_PATH} bit2svf $*.bit
196 2 wfjm
 
197
#
198 12 wfjm
# Configure FPGA with impact
199
#   input:   %.bit
200
#   output:  .PHONY
201
#
202
%.iconfig: %.bit
203 22 wfjm
        xtwi config_wrapper --board=${ISE_BOARD} --path=${ISE_PATH} iconfig $*.bit
204 12 wfjm
 
205
#
206
# Configure FPGA with jtag
207
#   input:   %.svf
208
#   output:  .PHONY
209
#
210 17 wfjm
ifneq "$(origin FX2_FILE)" "undefined"
211
FX2LOAD_OPT = --file=${FX2_FILE}
212
endif
213
#
214 12 wfjm
%.jconfig: %.svf
215 17 wfjm
        fx2load_wrapper --board=${ISE_BOARD} ${FX2LOAD_OPT}
216 22 wfjm
        xtwi config_wrapper --board=${ISE_BOARD} --path=${ISE_PATH} jconfig $*.svf
217 12 wfjm
 
218
#
219
# Print log file summary
220
#   input:   %_*.log (not depended)
221
#   output:  .PHONY
222
%.mfsum: %.mfset
223
        @ echo "=== XST summary ============================================="
224
        @ if [ -r $*_xst.log ]; then isemsg_filter xst $*.mfset $*_xst.log; fi
225
        @ echo "=== Translate summary ======================================="
226
        @ if [ -r $*_tra.log ]; then isemsg_filter tra $*.mfset $*_tra.log; fi
227
        @ echo "=== MAP summary ============================================="
228
        @ if [ -r $*_map.log ]; then isemsg_filter map $*.mfset $*_map.log; fi
229
        @ echo "=== PAR summary ============================================="
230
        @ if [ -r $*_par.log ]; then isemsg_filter par $*.mfset $*_par.log; fi
231
        @ echo "=== Bitgen summary =========================================="
232
        @ if [ -r $*_bgn.log ]; then isemsg_filter bgn $*.mfset $*_bgn.log; fi
233
 
234
#
235
#
236
#
237 2 wfjm
# Post-XST simulation model (netgen -sim; UNISIM based)
238
#   input:   %.ngc
239
#   output:  %_ssim.vhd
240
#            %_ngn_ssim.log  netgen log file    (renamed %.nlf)
241
#
242
%_ssim.vhd: %.ngc
243
        if [ ! -d ./ise ]; then mkdir ./ise; fi
244
        if [ -r $*.ngc ]; then cp -p $*.ngc ./ise; fi
245 22 wfjm
        (cd ise; xtwi netgen -sim  -intstyle xflow -ofmt vhdl -w $*.ngc)
246 2 wfjm
        (cd ./ise; chmod -x *.* )
247
        if [ -r ./ise/$*.vhd ]; then cp -p ./ise/$*.vhd ./$*_ssim.vhd; fi
248
        if [ -r ./ise/$*.nlf ]; then cp -p ./ise/$*.nlf ./$*_ngn_ssim.log; fi
249
        if [ -r $*_ssim.vhd ]; then xst_count_bels -xsts $*_ssim.vhd; fi
250
#
251
# Post-XST simulation model (netgen -sim; SIMPRIM based)
252
#   input:   %.ngc
253
#   output:  %_fsim.vhd
254
#            %_ngn_fsim.log  netgen log file    (renamed %.nlf)
255
#
256
%_fsim.vhd: %.ngc
257
        if [ ! -d ./ise ]; then mkdir ./ise; fi
258
        if [ -r $*.ngc ]; then cp -p $*.ngc ./ise; fi
259 22 wfjm
        (cd ise; xtwi ngdbuild -p ${ISE_PATH} -nt timestamp -intstyle xflow \
260 2 wfjm
        $*.ngc $*.ngd)
261
        (cd ise; netgen -sim -intstyle xflow -ofmt vhdl -w $*.ngd)
262
        (cd ./ise; chmod -x *.* )
263
        if [ -r ./ise/$*.vhd ]; then cp -p ./ise/$*.vhd ./$*_fsim.vhd; fi
264
        if [ -r ./ise/$*.nlf ]; then cp -p ./ise/$*.nlf ./$*_ngn_fsim.log; fi
265
#
266
# Post-par timing simulation model (netgen -sim)
267 17 wfjm
#   input:   %.ncd
268
#            %.tsim_xon_dat     xon disable descriptor file (optional)
269 2 wfjm
#   output:  %_tsim.vhd
270 17 wfjm
#            %_ngn_tsim.log     netgen log file    (renamed time_sim.nlf)
271
#            %_tsim.sdf         delay annotation
272
#            %_tsim.sdf_ghdl    delay annotation with ghdl patches
273 2 wfjm
#
274
#!! use netgen directly because xflow 8.1 goes mad when -tsim used a 2nd time
275
#!! see blog_xilinx_webpack.txt 2007-06-10
276
#
277
%_tsim.vhd %_tsim.sdf: %.ncd
278
        if [ ! -d ./ise ]; then mkdir ./ise; fi
279
        if [ -r $*.ncd ]; then cp -p $*.ncd ./ise; fi
280
        if [ -r $*.pcf ]; then cp -p $*.pcf ./ise; fi
281 22 wfjm
        (cd ise; xtwi netgen -ofmt vhdl -sim -w -intstyle xflow -pcf \
282 2 wfjm
        $*.pcf $*.ncd $*_tsim.vhd )
283
        (cd ./ise; chmod -x *.* )
284
        if [ -r ./ise/$*_tsim.vhd ]; then cp -p ./ise/$*_tsim.vhd .; fi
285
        if [ -r ./ise/$*_tsim.sdf ]; then cp -p ./ise/$*_tsim.sdf .; fi
286
        if [ -r ./ise/$*_tsim.nlf ]; then cp -p ./ise/$*_tsim.nlf ./$*_ngn_tsim.log; fi
287
        if [ -r $*_tsim.vhd -a -r $*.tsim_xon_dat ]; then xilinx_tsim_xon $*; fi
288 17 wfjm
        if [ -r $*_tsim.sdf ]; then xilinx_ghdl_sdf_filter $*_tsim.sdf > $*_tsim.sdf_ghdl ; fi
289 2 wfjm
#
290
# generate dep_xst files from vbom
291
#
292
%.dep_xst: %.vbom
293
        vbomconv --dep_xst $< > $@
294
#
295
# generate cpp'ed ucf files from ucf_cpp
296
#
297
%.ucf : %.ucf_cpp
298 22 wfjm
        cpp -C -I${RETROBASE}/rtl $*.ucf_cpp $*.ucf
299 2 wfjm
#
300
# generate nested dependency rules for cpp'ed ucf files from ucf_cpp
301
#
302
%.dep_ucf_cpp : %.ucf_cpp
303 22 wfjm
        cpp -C -I${RETROBASE}/rtl -MM $*.ucf_cpp |\
304 2 wfjm
            sed 's/\.o:/\.ucf:/' > $*.dep_ucf_cpp
305
#
306 19 wfjm
include $(RETROBASE)/rtl/make/dontincdep.mk
307
#
308 12 wfjm
.PHONY : ise_clean ise_tmp_clean
309 2 wfjm
#
310
ise_clean: ise_tmp_clean
311 18 wfjm
        rm -f *.ngc
312
        rm -f *.ncd
313
        rm -f *.pcf
314
        rm -f *.bit
315
        rm -f *.msk
316
        rm -f *.svf
317
        rm -f *_[sft]sim.vhd
318
        rm -f *_tsim.sdf
319
        rm -f *_tsim.sdf_ghdl
320
        rm -f *_xst.log
321
        rm -f *_tra.log
322
        rm -f *_map.log
323
        rm -f *_par.log
324
        rm -f *_pad.log
325
        rm -f *_twr.log
326 22 wfjm
        rm -f *_tsi.log
327 18 wfjm
        rm -f *_bgn.log
328
        rm -f *_ngn_[sft]sim.log
329
        rm -f *_svn.log
330
        rm -f *_sum.log
331 2 wfjm
#
332
ise_tmp_clean:
333
        rm -rf ./ise
334
#

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.