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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.7/] [rtl/] [make_ise/] [generic_xflow.mk] - Blame information for rev 19

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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