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 12

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

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

powered by: WebSVN 2.1.0

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