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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.5/] [rtl/] [vlib/] [Makefile.xflow] - Blame information for rev 2

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

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

powered by: WebSVN 2.1.0

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