]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/PPC440_Xilinx_Virtex5_GCC/system.make
commit 9f316c246baafa15c542a5aea81a94f26e3d6507
[freertos] / FreeRTOS / Demo / PPC440_Xilinx_Virtex5_GCC / system.make
1 #################################################################\r
2 # Makefile generated by Xilinx Platform Studio \r
3 # Project:C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\PPC440_Xilinx_Virtex5_GCC\system.xmp\r
4 #\r
5 # WARNING : This file will be re-generated every time a command\r
6 # to run a make target is invoked. So, any changes made to this  \r
7 # file manually, will be lost when make is invoked next. \r
8 #################################################################\r
9 \r
10 # Name of the Microprocessor system\r
11 # The hardware specification of the system is in file :\r
12 # C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\PPC440_Xilinx_Virtex5_GCC\system.mhs\r
13 # The software specification of the system is in file :\r
14 # C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\PPC440_Xilinx_Virtex5_GCC\system.mss\r
15 \r
16 include system_incl.make\r
17 \r
18 #################################################################\r
19 # PHONY TARGETS\r
20 #################################################################\r
21 .PHONY: dummy\r
22 .PHONY: netlistclean\r
23 .PHONY: bitsclean\r
24 .PHONY: simclean\r
25 .PHONY: exporttosdk\r
26 \r
27 #################################################################\r
28 # EXTERNAL TARGETS\r
29 #################################################################\r
30 all:\r
31         @echo "Makefile to build a Microprocessor system :"\r
32         @echo "Run make with any of the following targets"\r
33         @echo " "\r
34         @echo "  netlist  : Generates the netlist for the given MHS "\r
35         @echo "  bits     : Runs Implementation tools to generate the bitstream"\r
36         @echo "  exporttosdk: Export files to SDK"\r
37         @echo " "\r
38         @echo "  libs     : Configures the sw libraries for this system"\r
39         @echo "  program  : Compiles the program sources for all the processor instances"\r
40         @echo " "\r
41         @echo "  init_bram: Initializes bitstream with BRAM data"\r
42         @echo "  ace      : Generate ace file from bitstream and elf"\r
43         @echo "  download : Downloads the bitstream onto the board"\r
44         @echo " "\r
45         @echo "  sim      : Generates HDL simulation models and runs simulator for chosen simulation mode"\r
46         @echo "  simmodel : Generates HDL simulation models for chosen simulation mode"\r
47         @echo "  behavioral_model : Generates behavioral HDL models with BRAM initialization"\r
48         @echo "  structural_model : Generates structural simulation HDL models with BRAM initialization"\r
49         @echo "  timing   : Generates timing simulation HDL models with BRAM initialization"\r
50         @echo " "\r
51         @echo "  netlistclean: Deletes netlist"\r
52         @echo "  bitsclean: Deletes bit, ncd, bmm files"\r
53         @echo "  hwclean  : Deletes implementation dir"\r
54         @echo "  libsclean: Deletes sw libraries"\r
55         @echo "  programclean: Deletes compiled ELF files"\r
56         @echo "  swclean  : Deletes sw libraries and ELF files"\r
57         @echo "  simclean : Deletes simulation dir"\r
58         @echo "  clean    : Deletes all generated files/directories"\r
59         @echo " "\r
60         @echo "  make <target> : (Default)"\r
61         @echo "      Creates a Microprocessor system using default initializations"\r
62         @echo "      specified for each processor in MSS file"\r
63 \r
64 \r
65 bits: $(SYSTEM_BIT)\r
66 \r
67 ace: $(SYSTEM_ACE)\r
68 \r
69 exporttosdk: $(SYSTEM_HW_HANDOFF_DEP)\r
70 \r
71 netlist: $(POSTSYN_NETLIST)\r
72 \r
73 libs: $(LIBRARIES)\r
74 \r
75 program: $(ALL_USER_ELF_FILES)\r
76 \r
77 download: $(DOWNLOAD_BIT) dummy\r
78         @echo "*********************************************"\r
79         @echo "Downloading Bitstream onto the target board"\r
80         @echo "*********************************************"\r
81         impact -batch etc/download.cmd\r
82 \r
83 init_bram: $(DOWNLOAD_BIT)\r
84 \r
85 sim: $(DEFAULT_SIM_SCRIPT)\r
86         cd simulation/behavioral; \\r
87         $(SIM_CMD)  &\r
88 \r
89 simmodel: $(DEFAULT_SIM_SCRIPT)\r
90 \r
91 behavioral_model: $(BEHAVIORAL_SIM_SCRIPT)\r
92 \r
93 structural_model: $(STRUCTURAL_SIM_SCRIPT)\r
94 \r
95 clean: hwclean libsclean programclean simclean\r
96         rm -f _impact.cmd\r
97 \r
98 hwclean: netlistclean bitsclean\r
99         rm -rf implementation synthesis xst hdl\r
100         rm -rf xst.srp $(SYSTEM).srp\r
101         rm -f __xps/ise/_xmsgs/bitinit.xmsgs\r
102 \r
103 netlistclean:\r
104         rm -f $(POSTSYN_NETLIST)\r
105         rm -f platgen.log\r
106         rm -f __xps/ise/_xmsgs/platgen.xmsgs\r
107         rm -f $(BMM_FILE)\r
108 \r
109 bitsclean:\r
110         rm -f $(SYSTEM_BIT)\r
111         rm -f implementation/$(SYSTEM).ncd\r
112         rm -f implementation/$(SYSTEM)_bd.bmm \r
113         rm -f implementation/$(SYSTEM)_map.ncd \r
114         rm -f __xps/$(SYSTEM)_routed\r
115 \r
116 simclean: \r
117         rm -rf simulation/behavioral\r
118         rm -f simgen.log\r
119         rm -f __xps/ise/_xmsgs/simgen.xmsgs\r
120 \r
121 swclean: libsclean programclean\r
122         @echo ""\r
123 \r
124 libsclean: $(LIBSCLEAN_TARGETS)\r
125         rm -f libgen.log\r
126         rm -f __xps/ise/_xmsgs/libgen.xmsgs\r
127 \r
128 programclean: $(PROGRAMCLEAN_TARGETS)\r
129 \r
130 #################################################################\r
131 # SOFTWARE PLATFORM FLOW\r
132 #################################################################\r
133 \r
134 \r
135 $(LIBRARIES): $(MHSFILE) $(MSSFILE) __xps/libgen.opt\r
136         @echo "*********************************************"\r
137         @echo "Creating software libraries..."\r
138         @echo "*********************************************"\r
139         libgen $(LIBGEN_OPTIONS) $(MSSFILE)\r
140 \r
141 \r
142 ppc440_0_libsclean:\r
143         rm -rf ppc440_0/\r
144 \r
145 #################################################################\r
146 # SOFTWARE APPLICATION RTOSDEMO\r
147 #################################################################\r
148 \r
149 RTOSDemo_program: $(RTOSDEMO_OUTPUT) \r
150 \r
151 $(RTOSDEMO_OUTPUT) : $(RTOSDEMO_SOURCES) $(RTOSDEMO_HEADERS) $(RTOSDEMO_LINKER_SCRIPT) \\r
152                     $(LIBRARIES) __xps/rtosdemo_compiler.opt\r
153         @mkdir -p $(RTOSDEMO_OUTPUT_DIR) \r
154         $(RTOSDEMO_CC) $(RTOSDEMO_CC_OPT) $(RTOSDEMO_SOURCES) -o $(RTOSDEMO_OUTPUT) \\r
155         $(RTOSDEMO_OTHER_CC_FLAGS) $(RTOSDEMO_INCLUDES) $(RTOSDEMO_LIBPATH) \\r
156         $(RTOSDEMO_CFLAGS) $(RTOSDEMO_LFLAGS) \r
157         $(RTOSDEMO_CC_SIZE) $(RTOSDEMO_OUTPUT) \r
158         @echo ""\r
159 \r
160 RTOSDemo_programclean:\r
161         rm -f $(RTOSDEMO_OUTPUT) \r
162 \r
163 #################################################################\r
164 # BOOTLOOP ELF FILES\r
165 #################################################################\r
166 \r
167 \r
168 \r
169 $(PPC440_0_BOOTLOOP): $(PPC440_BOOTLOOP)\r
170         @mkdir -p $(BOOTLOOP_DIR)\r
171         cp -f $(PPC440_BOOTLOOP) $(PPC440_0_BOOTLOOP)\r
172 \r
173 #################################################################\r
174 # HARDWARE IMPLEMENTATION FLOW\r
175 #################################################################\r
176 \r
177 \r
178 $(BMM_FILE) \\r
179 $(WRAPPER_NGC_FILES): $(MHSFILE) __xps/platgen.opt \\r
180                       $(CORE_STATE_DEVELOPMENT_FILES)\r
181         @echo "****************************************************"\r
182         @echo "Creating system netlist for hardware specification.."\r
183         @echo "****************************************************"\r
184         platgen $(PLATGEN_OPTIONS) $(MHSFILE)\r
185 \r
186 $(POSTSYN_NETLIST): $(WRAPPER_NGC_FILES)\r
187         @echo "Running synthesis..."\r
188         bash -c "cd synthesis; ./synthesis.sh"\r
189 \r
190 __xps/$(SYSTEM)_routed: $(FPGA_IMP_DEPENDENCY)\r
191         @echo "*********************************************"\r
192         @echo "Running Xilinx Implementation tools.."\r
193         @echo "*********************************************"\r
194         @cp -f $(UCF_FILE) implementation/$(SYSTEM).ucf\r
195         @cp -f etc/fast_runtime.opt implementation/xflow.opt\r
196         xflow -wd implementation -p $(DEVICE) -implement xflow.opt -ise ../__xps/ise/$(SYSTEM).ise $(SYSTEM).ngc\r
197         touch __xps/$(SYSTEM)_routed\r
198 \r
199 $(SYSTEM_BIT): __xps/$(SYSTEM)_routed $(BITGEN_UT_FILE)\r
200         xilperl $(NON_CYG_XILINX_EDK_DIR)/data/fpga_impl/observe_par.pl $(OBSERVE_PAR_OPTIONS) implementation/$(SYSTEM).par\r
201         @echo "*********************************************"\r
202         @echo "Running Bitgen.."\r
203         @echo "*********************************************"\r
204         @cp -f $(BITGEN_UT_FILE) implementation/bitgen.ut\r
205         cd implementation; bitgen -w -f bitgen.ut $(SYSTEM); cd ..\r
206 \r
207 $(DOWNLOAD_BIT): $(SYSTEM_BIT) $(BRAMINIT_ELF_FILES) __xps/bitinit.opt\r
208         @cp -f implementation/$(SYSTEM)_bd.bmm .\r
209         @echo "*********************************************"\r
210         @echo "Initializing BRAM contents of the bitstream"\r
211         @echo "*********************************************"\r
212         bitinit -p $(DEVICE) $(MHSFILE) $(SEARCHPATHOPT) $(BRAMINIT_ELF_FILE_ARGS) \\r
213         -bt $(SYSTEM_BIT) -o $(DOWNLOAD_BIT)\r
214         @rm -f $(SYSTEM)_bd.bmm\r
215 \r
216 $(SYSTEM_ACE): $(DOWNLOAD_BIT) $(RTOSDEMO_OUTPUT) \r
217         @echo "*********************************************"\r
218         @echo "Creating system ace file"\r
219         @echo "*********************************************"\r
220         xmd -tcl genace.tcl -jprog -hw $(DOWNLOAD_BIT) -elf $(RTOSDEMO_OUTPUT)  -target ppc_hw  -ace $(SYSTEM_ACE)\r
221 \r
222 #################################################################\r
223 # EXPORT_TO_SDK FLOW\r
224 #################################################################\r
225 \r
226 \r
227 $(SYSTEM_HW_HANDOFF): $(MHSFILE) __xps/platgen.opt\r
228         mkdir -p $(SDK_EXPORT_DIR)\r
229         psf2Edward.exe -inp $(SYSTEM).xmp -xml $(SDK_EXPORT_DIR)/$(SYSTEM).xml $(SEARCHPATHOPT)\r
230         xdsgen.exe -inp $(SYSTEM).xmp -report $(SDK_EXPORT_DIR)/$(SYSTEM).html $(SEARCHPATHOPT) -make_docs_local\r
231 \r
232 $(SYSTEM_HW_HANDOFF_BIT): $(SYSTEM_BIT)\r
233         @rm -rf $(SYSTEM_HW_HANDOFF_BIT)\r
234         @cp -f $(SYSTEM_BIT) $(SDK_EXPORT_DIR)/\r
235 \r
236 $(SYSTEM_HW_HANDOFF_BMM): implementation/$(SYSTEM)_bd.bmm\r
237         @rm -rf $(SYSTEM_HW_HANDOFF_BMM)\r
238         @cp -f implementation/$(SYSTEM)_bd.bmm $(SDK_EXPORT_DIR)/\r
239 \r
240 #################################################################\r
241 # SIMULATION FLOW\r
242 #################################################################\r
243 \r
244 \r
245 ################## BEHAVIORAL SIMULATION ##################\r
246 \r
247 $(BEHAVIORAL_SIM_SCRIPT): $(MHSFILE) __xps/simgen.opt \\r
248                           $(WRAPPER_NGC_FILES) \\r
249                           $(BRAMINIT_ELF_FILES)\r
250         @echo "*********************************************"\r
251         @echo "Creating behavioral simulation models..."\r
252         @echo "*********************************************"\r
253         simgen $(SIMGEN_OPTIONS) -m behavioral $(MHSFILE)\r
254 \r
255 ################## STRUCTURAL SIMULATION ##################\r
256 \r
257 $(STRUCTURAL_SIM_SCRIPT): $(WRAPPER_NGC_FILES) __xps/simgen.opt \\r
258                           $(BRAMINIT_ELF_FILES)\r
259         @echo "*********************************************"\r
260         @echo "Creating structural simulation models..."\r
261         @echo "*********************************************"\r
262         simgen $(SIMGEN_OPTIONS) -sd implementation -m structural $(MHSFILE)\r
263 \r
264 \r
265 ################## TIMING SIMULATION ##################\r
266 \r
267 implementation/$(SYSTEM).ncd: __xps/$(SYSTEM)_routed\r
268 \r
269 $(TIMING_SIM_SCRIPT): implementation/$(SYSTEM).ncd __xps/simgen.opt \\r
270                       $(BRAMINIT_ELF_FILES)\r
271         @echo "*********************************************"\r
272         @echo "Creating timing simulation models..."\r
273         @echo "*********************************************"\r
274         simgen $(SIMGEN_OPTIONS) -sd implementation -m timing $(MHSFILE)\r
275 \r
276 dummy:\r
277         @echo ""\r
278 \r