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

Subversion Repositories spacewire_light

[/] [spacewire_light/] [trunk/] [syn/] [spwstream_gr-xc3s1500/] [Makefile] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 jorisvr
 
2
###############################################################################
3
##                                                                           ##
4
##                        project-dependent variables                        ##
5
##                                                                           ##
6
###############################################################################
7
 
8
# The project name. The bit-file that is generated in the end will be named
9
# "$(PROJ).bit"
10
 
11
PROJ = spwstream
12
 
13
# The top-level entity to be instantiated
14
 
15
TOPLEVEL = spwstream_top
16
 
17
# The VHDL sources that need to be compiled during synthesis
18
 
19
RTLDIR = ../../rtl/vhdl
20
VHDL_SOURCES = spwstream_top.vhd \
21
               $(RTLDIR)/spwpkg.vhd \
22
               $(RTLDIR)/spwstream.vhd \
23
               $(RTLDIR)/spwlink.vhd \
24
               $(RTLDIR)/spwram.vhd \
25
               $(RTLDIR)/spwrecv.vhd \
26
               $(RTLDIR)/spwxmit.vhd \
27
               $(RTLDIR)/spwxmit_fast.vhd \
28
               $(RTLDIR)/spwrecvfront_generic.vhd \
29
               $(RTLDIR)/spwrecvfront_fast.vhd
30
 
31
# Device type: Spartan-3 on Pender XC3S1500 board
32
 
33
FPGA_TYPE       = xc3s1500-fg456-4
34
 
35
# The default target; recommended targets: "bitfile" or "upload"
36
 
37
default : bitfile
38
 
39
UCFFILE = spwstream.ucf
40
 
41
###############################################################################
42
##                                                                           ##
43
##            miscellaneous project-independent variables & rules            ##
44
##                                                                           ##
45
###############################################################################
46
 
47
# use this to make most tools quieter
48
OPT_INTSTYLE = -intstyle ise
49
 
50
# Phony (non file creating) targets
51
 
52
.PHONY : default clean bitfile
53
 
54
clean :
55
        $(RM) -rf *~ work dump.xst _ngo 'file graph' xlnx_auto_0_xdb
56
        $(RM) $(PROJ).xst-script
57
        $(RM) $(PROJ).lso $(PROJ).prj
58
        $(RM) $(PROJ).ngc $(PROJ).xst.log $(PROJ).syr $(PROJ).srp $(PROJ).ngr
59
        $(RM) $(PROJ).ngd $(PROJ).bld
60
        $(RM) $(PROJ).twx $(PROJ).twr
61
        $(RM) $(PROJ).pcf $(PROJ)_map.mrp $(PROJ)_map.ncd $(PROJ)_map.ngm
62
        $(RM) $(PROJ).ncd $(PROJ).pad $(PROJ).par $(PROJ).xpi $(PROJ)_pad.csv $(PROJ)_pad.txt
63
        $(RM) $(PROJ).bit $(PROJ).bgn $(PROJ).drca
64
        $(RM) $(PROJ).ptwx $(PROJ).unroutes *.xrpt $(PROJ)_summary.xml $(PROJ)_usage.xml $(PROJ)_map.map
65
 
66
bitfile : $(PROJ).bit
67
 
68
###############################################################################
69
#                                                                             #
70
#                    STAGE 1: "xst" (Xilinx Synthesis Tool)                   #
71
#  needs:                                                                     #
72
#                                                                             #
73
#    $(PROJ).vhdl                                                             #
74
#    $(PROJ).prj - Project file (created below)                               #
75
#    $(PROJ).lso - Library Search Order file (created below)                  #
76
#                                                                             #
77
#  created files:                                                             #
78
#                                                                             #
79
#    $(PROJ).ngc     - netlist                                                #
80
#    $(PROJ).ngr     - XILINX-XDB 0.1 STUB 0.1 ASCII / XILINX-XDM V1.2e       #
81
#                      (optional, depending on the '-rtlview' option)         #
82
#    $(PROJ).xst.log - human-readable synthesis report                        #
83
#                      (AKA .syr, .srp)                                       #
84
#                                                                             #
85
#  created directories:                                                       #
86
#                                                                             #
87
#    work                                                                     #
88
#    dump.xst                                                                 #
89
#                                                                             #
90
###############################################################################
91
 
92
# Generate a "Library Search Order" file, containing just "work" for now.
93
 
94
$(PROJ).lso :
95
        @echo "work" > $@
96
 
97
# Generate a "Project" file, consisting of lines containing each of the
98
# VHDL_SOURCES, preceded by "vhdl work".
99
 
100
$(PROJ).prj :
101
        $(shell echo -n $(VHDL_SOURCES) | \
102
        sed 's/\([^ ]\+\) */vhdl work \1\n/g' > $@)
103
 
104
$(PROJ).xst-script :
105
        @echo "set -tmpdir /tmp"                                        > $@
106
        @echo "set -xsthdpdir ."                                       >> $@
107
        @echo "run"                                                    >> $@
108
        @echo "-ifn                                  $(PROJ).prj"      >> $@
109
        @echo "-ifmt                                 mixed"            >> $@
110
        @echo "-ofn                                  $(PROJ)"          >> $@
111
        @echo "-ofmt                                 ngc"              >> $@
112
        @echo "-p                                    $(FPGA_TYPE)"     >> $@
113
        @echo "-top                                  $(TOPLEVEL)"      >> $@
114
        @echo "-opt_mode                             speed"            >> $@
115
        @echo "-opt_level                            1"                >> $@
116
        @echo "-iuc                                  no"               >> $@
117
        @echo "-lso                                  $(PROJ).lso"      >> $@
118
        @echo "-keep_hierarchy                       no"               >> $@
119
        @echo "-glob_opt                             AllClockNets"     >> $@
120
        @echo "-rtlview                              no"               >> $@
121
        @echo "-read_cores                           yes"              >> $@
122
        @echo "-write_timing_constraints             yes"              >> $@
123
        @echo "-cross_clock_analysis                 no"               >> $@
124
#       @echo "-hierarchy_separator                  _"                >> $@
125
        @echo "-bus_delimiter                        <>"               >> $@
126
        @echo "-case                                 maintain"         >> $@
127
        @echo "-slice_utilization_ratio              100"              >> $@
128
#       @echo "-verilog2001                          yes"              >> $@
129
#       @echo "-vlgincdir"                                             >> $@
130
        @echo "-fsm_extract                          yes"              >> $@
131
        @echo "-fsm_encoding                         auto"             >> $@
132
        @echo "-fsm_style                            lut"              >> $@
133
        @echo "-ram_extract                          yes"              >> $@
134
        @echo "-ram_style                            auto"             >> $@
135
        @echo "-rom_extract                          yes"              >> $@
136
        @echo "-rom_style                            auto"             >> $@
137
        @echo "-mux_extract                          yes"              >> $@
138
        @echo "-mux_style                            auto"             >> $@
139
        @echo "-decoder_extract                      yes"              >> $@
140
        @echo "-priority_extract                     yes"              >> $@
141
        @echo "-shreg_extract                        yes"              >> $@
142
        @echo "-shift_extract                        yes"              >> $@
143
        @echo "-xor_collapse                         yes"              >> $@
144
        @echo "-resource_sharing                     yes"              >> $@
145
        @echo "-mult_style                           auto"             >> $@
146
        @echo "-iobuf                                yes"              >> $@
147
        @echo "-max_fanout                           500"              >> $@
148
        @echo "-bufg                                 8"                >> $@
149
        @echo "-register_duplication                 yes"              >> $@
150
        @echo "-equivalent_register_removal          yes"              >> $@
151
        @echo "-register_balancing                   no"               >> $@
152
        @echo "-slice_packing                        yes"              >> $@
153
        @echo "-optimize_primitives                  no"               >> $@
154
        @echo "-iob                                  auto"             >> $@
155
 
156
$(PROJ).ngc $(PROJ).xst.log : $(VHDL_SOURCES) $(PROJ).prj $(PROJ).lso $(PROJ).xst-script
157
        rm -rf work dump.xst
158
        xst $(OPT_INTSTYLE) -ifn $(PROJ).xst-script -ofn $(PROJ).xst.log
159
        rm -rf work dump.xst
160
 
161
###############################################################################
162
#                                                                             #
163
#                               STAGE 2: ngdbuild                             #
164
#  needs:                                                                     #
165
#                                                                             #
166
#    $(PROJ).ngc                                                              #
167
#                                                                             #
168
#  created files:                                                             #
169
#                                                                             #
170
#    $(PROJ).bld - human-readable build log                                   #
171
#    $(PROJ).ngd - XILINX-XDB 0.1 STUB 0.1 ASCII / XILINX-XDM V1.2e           #
172
#                                                                             #
173
#  created dir:                                                               #
174
#    _ngo                                                                     #
175
#                                                                             #
176
###############################################################################
177
 
178
$(PROJ).ngd $(PROJ).bld: $(PROJ).ngc $(UCFFILE)
179
        rm -rf _ngo
180
        ngdbuild $(OPT_INTSTYLE) -dd _ngo -aul -p $(FPGA_TYPE) $(if $(UCFFILE),-uc $(UCFFILE)) $(PROJ).ngc $(PROJ).ngd
181
        rm -rf _ngo
182
 
183
###############################################################################
184
#                                                                             #
185
#                                STAGE 3: Mapper                              #
186
#  needs:                                                                     #
187
#                                                                             #
188
#    $(PROJ).ngd                                                              #
189
#                                                                             #
190
#  created files:                                                             #
191
#                                                                             #
192
#    $(PROJ).pcf     - ASCII file                                             #
193
#    $(PROJ)_map.mrp - human-readable mapping report                          #
194
#    $(PROJ)_map.ncd - binary format                                          #
195
#    $(PROJ)_map.ngm - XILINX-XDB 0.1 STUB 0.1 ASCII / XILINX-XDM V1.2e       #
196
#                                                                             #
197
#  NOTE:                                                                      #
198
#                                                                             #
199
#    In order to prevent the make process from terminating on these spurious  #
200
#    problems, we precede the "map" invocation with a hyphen, instructing     #
201
#    make to ignore the return code from "map".                               #
202
#                                                                             #
203
###############################################################################
204
 
205
$(PROJ).pcf $(PROJ)_map.mrp $(PROJ)_map.ncd $(PROJ)_map.ngm: $(PROJ).ngd
206
        map $(OPT_INTSTYLE) -p $(FPGA_TYPE) -cm area -pr b -c 100 -o $(PROJ)_map.ncd $(PROJ).ngd $(PROJ).pcf
207
 
208
###############################################################################
209
#                                                                             #
210
#                          STAGE 4: Place-and-Route                           #
211
#  needs:                                                                     #
212
#                                                                             #
213
#    $(PROJ).pcf                                                              #
214
#    $(PROJ)_map.ncd                                                          #
215
#                                                                             #
216
#  created files:                                                             #
217
#                                                                             #
218
#    $(PROJ).ncd     - binary file                                            #
219
#    $(PROJ).pad     - ASCII file for import in spreadsheet                   #
220
#    $(PROJ).par     - human-readable place-and-route report                  #
221
#    $(PROJ).xpi     - ASCII file                                             #
222
#    $(PROJ)_pad.csv - human-readable CVS file                                #
223
#    $(PROJ)_pad.txt - human-readable file                                    #
224
#                                                                             #
225
###############################################################################
226
 
227
$(PROJ).ncd $(PROJ).pad $(PROJ).par $(PROJ).xpi $(PROJ)_pad.csv $(PROJ)_pad.txt: $(PROJ).pcf $(PROJ)_map.ncd
228
        par -w $(OPT_INTSTYLE) -t 1 $(PROJ)_map.ncd $(PROJ).ncd $(PROJ).pcf
229
 
230
###############################################################################
231
#                                                                             #
232
#                         STAGE 4.5 (optional): trace                         #
233
#  needs:                                                                     #
234
#                                                                             #
235
#  created files:                                                             #
236
#                                                                             #
237
###############################################################################
238
 
239
$(PROJ).twr $(PROJ).twx : $(PROJ).ncd $(PROJ).pcf
240
        trce $(OPT_INTSTYLE) -e 5 -l 5 -u 5 -xml $(PROJ) $(PROJ).ncd -o $(PROJ).twr $(PROJ).pcf
241
 
242
###############################################################################
243
#                                                                             #
244
#                          STAGE 5: Generate BIT-file                         #
245
#  needs:                                                                     #
246
#                                                                             #
247
#    $(PROJ).ncd                                                              #
248
#                                                                             #
249
#  created files: $(PROJ).bgn $(PROJ).bit $(PROJ).drc                         #
250
#                                                                             #
251
#    $(PROJ).bgn - human-readable BitGen report                               #
252
#    $(PROJ).drc - human readable DRC report                                  #
253
#    $(PROJ).bit - binary image file                                          #
254
#                                                                             #
255
###############################################################################
256
 
257
# We omit "-g StartUpClk:JtagClk" ; this doesn't work if the image is loaded
258
# from a PROM.
259
 
260
OPT_BITGEN = -w                     \
261
             -g DebugBitstream:No   \
262
             -g Binary:no           \
263
             -g CRC:Enable          \
264
             -g ConfigRate:6        \
265
             -g CclkPin:PullUp      \
266
             -g M0Pin:PullUp        \
267
             -g M1Pin:PullUp        \
268
             -g M2Pin:PullUp        \
269
             -g ProgPin:PullUp      \
270
             -g DonePin:PullUp      \
271
             -g TckPin:PullUp       \
272
             -g TdiPin:PullUp       \
273
             -g TdoPin:PullUp       \
274
             -g TmsPin:PullUp       \
275
             -g UnusedPin:PullDown  \
276
             -g UserID:0xFFFFFFFF   \
277
             -g DCMShutDown:Disable \
278
             -g DONE_cycle:4        \
279
             -g GTS_cycle:5         \
280
             -g GWE_cycle:6         \
281
             -g LCK_cycle:NoWait    \
282
             -g Match_cycle:Auto    \
283
             -g Security:None       \
284
             -g DonePipe:No         \
285
             -g DriveDone:No
286
 
287
$(PROJ).bit $(PROJ).bgn $(PROJ).drc: $(PROJ).ncd
288
        bitgen $(OPT_INTSTYLE) $(OPT_BITGEN) $(PROJ).ncd
289
 
290
###############################################################################

powered by: WebSVN 2.1.0

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