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 18

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

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

powered by: WebSVN 2.1.0

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