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 17

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

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

powered by: WebSVN 2.1.0

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