1 |
584 |
jeremybenn |
#################################################################
|
2 |
|
|
# Makefile generated by Xilinx Platform Studio
|
3 |
|
|
# Project:E:\Dev\FreeRTOS\Demo\MicroBlaze\system.xmp
|
4 |
|
|
#################################################################
|
5 |
|
|
|
6 |
|
|
# Name of the Microprocessor system
|
7 |
|
|
# The hardware specification of the system is in file :
|
8 |
|
|
# E:\Dev\FreeRTOS\Demo\MicroBlaze\system.mhs
|
9 |
|
|
# The software specification of the system is in file :
|
10 |
|
|
# E:\Dev\FreeRTOS\Demo\MicroBlaze\system.mss
|
11 |
|
|
|
12 |
|
|
include system_incl.make
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
#################################################################
|
16 |
|
|
# EXTERNAL TARGETS
|
17 |
|
|
#################################################################
|
18 |
|
|
all:
|
19 |
|
|
@echo "Makefile to build a Microprocessor system :"
|
20 |
|
|
@echo "Run make with any of the following targets"
|
21 |
|
|
@echo " "
|
22 |
|
|
@echo " netlist : Generates the netlist for the given MHS "
|
23 |
|
|
@echo " bits : Runs Implementation tools to generate the bitstream"
|
24 |
|
|
@echo " exporttopn:Export to ProjNav"
|
25 |
|
|
@echo " "
|
26 |
|
|
@echo " libs : Configures the sw libraries for this system"
|
27 |
|
|
@echo " program : Compiles the program sources for all the processor instances"
|
28 |
|
|
@echo " "
|
29 |
|
|
@echo " init_bram: Initializes bitstream with BRAM data"
|
30 |
|
|
@echo " ace : Generate ace file from bitstream and elf"
|
31 |
|
|
@echo " download : Downloads the bitstream onto the board"
|
32 |
|
|
@echo " "
|
33 |
|
|
@echo " sim : Generates HDL simulation models and runs simulator for chosen simulation mode"
|
34 |
|
|
@echo " simmodel : Generates HDL simulation models for chosen simulation mode"
|
35 |
|
|
@echo " behavioral_model:Generates behavioral HDL models with BRAM initialization"
|
36 |
|
|
@echo " structural_model:Generates structural simulation HDL models with BRAM initialization"
|
37 |
|
|
@echo " timing_model : Generates timing simulation HDL models with BRAM initialization"
|
38 |
|
|
@echo " vp : Generates virtual platform model"
|
39 |
|
|
@echo " "
|
40 |
|
|
@echo " netlistclean: Deletes netlist"
|
41 |
|
|
@echo " bitsclean: Deletes bit, ncd, bmm files"
|
42 |
|
|
@echo " hwclean : Deletes implementation dir"
|
43 |
|
|
@echo " libsclean: Deletes sw libraries"
|
44 |
|
|
@echo " programclean: Deletes compiled ELF files"
|
45 |
|
|
@echo " swclean : Deletes sw libraries and ELF files"
|
46 |
|
|
@echo " simclean : Deletes simulation dir"
|
47 |
|
|
@echo " vpclean : Deletes virtualplatform dir"
|
48 |
|
|
@echo " clean : Deletes all generated files/directories"
|
49 |
|
|
@echo " "
|
50 |
|
|
@echo " make : (Default)"
|
51 |
|
|
@echo " Creates a Microprocessor system using default initializations"
|
52 |
|
|
@echo " specified for each processor in MSS file"
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
bits: $(SYSTEM_BIT)
|
56 |
|
|
|
57 |
|
|
ace: $(SYSTEM_ACE)
|
58 |
|
|
|
59 |
|
|
netlist: $(POSTSYN_NETLIST)
|
60 |
|
|
|
61 |
|
|
libs: $(LIBRARIES)
|
62 |
|
|
|
63 |
|
|
program: $(ALL_USER_ELF_FILES)
|
64 |
|
|
|
65 |
|
|
download: $(DOWNLOAD_BIT) dummy
|
66 |
|
|
@echo "*********************************************"
|
67 |
|
|
@echo "Downloading Bitstream onto the target board"
|
68 |
|
|
@echo "*********************************************"
|
69 |
|
|
impact -batch etc/download.cmd
|
70 |
|
|
|
71 |
|
|
init_bram: $(DOWNLOAD_BIT)
|
72 |
|
|
|
73 |
|
|
sim: $(DEFAULT_SIM_SCRIPT)
|
74 |
|
|
cd simulation/behavioral; \
|
75 |
|
|
$(SIM_CMD) &
|
76 |
|
|
|
77 |
|
|
simmodel: $(DEFAULT_SIM_SCRIPT)
|
78 |
|
|
|
79 |
|
|
behavioral_model: $(BEHAVIORAL_SIM_SCRIPT)
|
80 |
|
|
|
81 |
|
|
structural_model: $(STRUCTURAL_SIM_SCRIPT)
|
82 |
|
|
|
83 |
|
|
timing_model: $(TIMING_SIM_SCRIPT)
|
84 |
|
|
|
85 |
|
|
vp: $(VPEXEC)
|
86 |
|
|
|
87 |
|
|
clean: hwclean libsclean programclean simclean vpclean
|
88 |
|
|
rm -f _impact.cmd
|
89 |
|
|
|
90 |
|
|
hwclean: netlistclean bitsclean
|
91 |
|
|
rm -rf implementation synthesis xst hdl
|
92 |
|
|
rm -rf xst.srp $(SYSTEM).srp
|
93 |
|
|
|
94 |
|
|
netlistclean:
|
95 |
|
|
rm -f $(POSTSYN_NETLIST)
|
96 |
|
|
rm -f $(BMM_FILE)
|
97 |
|
|
|
98 |
|
|
bitsclean:
|
99 |
|
|
rm -f $(SYSTEM_BIT)
|
100 |
|
|
rm -f implementation/$(SYSTEM).ncd
|
101 |
|
|
rm -f implementation/$(SYSTEM)_bd.bmm
|
102 |
|
|
|
103 |
|
|
bitsclean:
|
104 |
|
|
|
105 |
|
|
simclean:
|
106 |
|
|
rm -rf simulation/behavioral
|
107 |
|
|
|
108 |
|
|
swclean: libsclean programclean
|
109 |
|
|
@echo ""
|
110 |
|
|
|
111 |
|
|
libsclean: $(LIBSCLEAN_TARGETS)
|
112 |
|
|
|
113 |
|
|
programclean: $(PROGRAMCLEAN_TARGETS)
|
114 |
|
|
|
115 |
|
|
vpclean:
|
116 |
|
|
rm -rf virtualplatform
|
117 |
|
|
|
118 |
|
|
#################################################################
|
119 |
|
|
# SOFTWARE PLATFORM FLOW
|
120 |
|
|
#################################################################
|
121 |
|
|
|
122 |
|
|
|
123 |
|
|
$(LIBRARIES): $(MHSFILE) $(MSSFILE) __xps/libgen.opt
|
124 |
|
|
@echo "*********************************************"
|
125 |
|
|
@echo "Creating software libraries..."
|
126 |
|
|
@echo "*********************************************"
|
127 |
|
|
libgen $(LIBGEN_OPTIONS) $(MSSFILE)
|
128 |
|
|
|
129 |
|
|
|
130 |
|
|
microblaze_0_libsclean:
|
131 |
|
|
rm -rf microblaze_0/lib/
|
132 |
|
|
|
133 |
|
|
$(MICROBLAZE_0_XMDSTUB): $(LIBRARIES)
|
134 |
|
|
|
135 |
|
|
#################################################################
|
136 |
|
|
# SOFTWARE APPLICATION RTOSDEMO
|
137 |
|
|
#################################################################
|
138 |
|
|
|
139 |
|
|
RTOSDemo_program: $(RTOSDEMO_OUTPUT)
|
140 |
|
|
|
141 |
|
|
$(RTOSDEMO_OUTPUT) : $(RTOSDEMO_SOURCES) $(RTOSDEMO_HEADERS) $(RTOSDEMO_LINKER_SCRIPT) \
|
142 |
|
|
$(LIBRARIES) __xps/rtosdemo_compiler.opt
|
143 |
|
|
@mkdir -p $(RTOSDEMO_OUTPUT_DIR)
|
144 |
|
|
$(RTOSDEMO_CC) $(RTOSDEMO_CC_OPT) $(RTOSDEMO_SOURCES) -o $(RTOSDEMO_OUTPUT) \
|
145 |
|
|
$(RTOSDEMO_OTHER_CC_FLAGS) $(RTOSDEMO_INCLUDES) $(RTOSDEMO_LIBPATH) \
|
146 |
|
|
-xl-mode-$(RTOSDEMO_MODE) \
|
147 |
|
|
$(RTOSDEMO_CFLAGS) $(RTOSDEMO_LFLAGS)
|
148 |
|
|
$(RTOSDEMO_CC_SIZE) $(RTOSDEMO_OUTPUT)
|
149 |
|
|
|
150 |
|
|
RTOSDemo_programclean:
|
151 |
|
|
rm -f $(RTOSDEMO_OUTPUT)
|
152 |
|
|
|
153 |
|
|
#################################################################
|
154 |
|
|
# BOOTLOOP ELF FILES
|
155 |
|
|
#################################################################
|
156 |
|
|
|
157 |
|
|
|
158 |
|
|
|
159 |
|
|
$(MICROBLAZE_0_BOOTLOOP): $(MICROBLAZE_BOOTLOOP)
|
160 |
|
|
@mkdir -p $(BOOTLOOP_DIR)
|
161 |
|
|
cp -f $(MICROBLAZE_BOOTLOOP) $(MICROBLAZE_0_BOOTLOOP)
|
162 |
|
|
|
163 |
|
|
#################################################################
|
164 |
|
|
# HARDWARE IMPLEMENTATION FLOW
|
165 |
|
|
#################################################################
|
166 |
|
|
|
167 |
|
|
|
168 |
|
|
$(BMM_FILE) \
|
169 |
|
|
$(WRAPPER_NGC_FILES): $(MHSFILE) __xps/platgen.opt \
|
170 |
|
|
$(CORE_STATE_DEVELOPMENT_FILES)
|
171 |
|
|
@echo "****************************************************"
|
172 |
|
|
@echo "Creating system netlist for hardware specification.."
|
173 |
|
|
@echo "****************************************************"
|
174 |
|
|
platgen $(PLATGEN_OPTIONS) -st xst $(MHSFILE)
|
175 |
|
|
|
176 |
|
|
$(POSTSYN_NETLIST): $(WRAPPER_NGC_FILES)
|
177 |
|
|
@echo "Running synthesis..."
|
178 |
|
|
bash -c "cd synthesis; ./synthesis.sh; cd .."
|
179 |
|
|
|
180 |
|
|
$(SYSTEM_BIT): $(BMM_FILE) $(POSTSYN_NETLIST) __xps/xpsxflow.opt \
|
181 |
|
|
$(UCF_FILE) $(BITGEN_UT_FILE) $(FASTRUNTIME_OPT_FILE)
|
182 |
|
|
@echo "Copying Xilinx Implementation tool scripts.."
|
183 |
|
|
@cp -f $(BITGEN_UT_FILE) implementation/bitgen.ut
|
184 |
|
|
@cp -f $(FASTRUNTIME_OPT_FILE) implementation/fast_runtime.opt
|
185 |
|
|
@cp -f $(UCF_FILE) implementation/$(SYSTEM).ucf
|
186 |
|
|
@echo "*********************************************"
|
187 |
|
|
@echo "Running Xilinx Implementation tools.."
|
188 |
|
|
@echo "*********************************************"
|
189 |
|
|
xflow -wd implementation -p $(DEVICE) -implement fast_runtime.opt $(SYSTEM).ngc
|
190 |
|
|
cd implementation; bitgen -w -f bitgen.ut $(SYSTEM)
|
191 |
|
|
|
192 |
|
|
exporttopn:
|
193 |
|
|
@echo "You have chosen XPS for implementation tool flow."
|
194 |
|
|
@echo "Please select ProjNav as your implementation flow in Project Options."
|
195 |
|
|
@echo "In batch mode, use commad xset pnproj ."
|
196 |
|
|
|
197 |
|
|
$(DOWNLOAD_BIT): $(SYSTEM_BIT) $(BRAMINIT_ELF_FILES) __xps/bitinit.opt
|
198 |
|
|
@cp -f implementation/$(SYSTEM)_bd.bmm .
|
199 |
|
|
@echo "*********************************************"
|
200 |
|
|
@echo "Initializing BRAM contents of the bitstream"
|
201 |
|
|
@echo "*********************************************"
|
202 |
|
|
bitinit $(MHSFILE) $(SEARCHPATHOPT) $(BRAMINIT_ELF_FILE_ARGS) \
|
203 |
|
|
-bt $(SYSTEM_BIT) -o $(DOWNLOAD_BIT)
|
204 |
|
|
@rm -f $(SYSTEM)_bd.bmm
|
205 |
|
|
|
206 |
|
|
$(SYSTEM_ACE): $(DOWNLOAD_BIT) $(RTOSDEMO_OUTPUT)
|
207 |
|
|
@echo "*********************************************"
|
208 |
|
|
@echo "Creating system ace file"
|
209 |
|
|
@echo "*********************************************"
|
210 |
|
|
xmd -tcl genace.tcl -jprog -hw $(DOWNLOAD_BIT) -elf $(RTOSDEMO_OUTPUT) -ace $(SYSTEM_ACE)
|
211 |
|
|
|
212 |
|
|
#################################################################
|
213 |
|
|
# SIMULATION FLOW
|
214 |
|
|
#################################################################
|
215 |
|
|
|
216 |
|
|
|
217 |
|
|
################## BEHAVIORAL SIMULATION ##################
|
218 |
|
|
|
219 |
|
|
$(BEHAVIORAL_SIM_SCRIPT): $(MHSFILE) __xps/simgen.opt \
|
220 |
|
|
$(BRAMINIT_ELF_FILES)
|
221 |
|
|
@echo "*********************************************"
|
222 |
|
|
@echo "Creating behavioral simulation models..."
|
223 |
|
|
@echo "*********************************************"
|
224 |
|
|
simgen $(SIMGEN_OPTIONS) -m behavioral $(MHSFILE)
|
225 |
|
|
|
226 |
|
|
################## STRUCTURAL SIMULATION ##################
|
227 |
|
|
|
228 |
|
|
$(STRUCTURAL_SIM_SCRIPT): $(WRAPPER_NGC_FILES) __xps/simgen.opt \
|
229 |
|
|
$(BRAMINIT_ELF_FILES)
|
230 |
|
|
@echo "*********************************************"
|
231 |
|
|
@echo "Creating structural simulation models..."
|
232 |
|
|
@echo "*********************************************"
|
233 |
|
|
simgen $(SIMGEN_OPTIONS) -sd implementation -m structural $(MHSFILE)
|
234 |
|
|
|
235 |
|
|
|
236 |
|
|
################## TIMING SIMULATION ##################
|
237 |
|
|
|
238 |
|
|
$(TIMING_SIM_SCRIPT): $(SYSTEM_BIT) __xps/simgen.opt \
|
239 |
|
|
$(BRAMINIT_ELF_FILES)
|
240 |
|
|
@echo "*********************************************"
|
241 |
|
|
@echo "Creating timing simulation models..."
|
242 |
|
|
@echo "*********************************************"
|
243 |
|
|
simgen $(SIMGEN_OPTIONS) -sd implementation -m timing $(MHSFILE)
|
244 |
|
|
|
245 |
|
|
#################################################################
|
246 |
|
|
# VIRTUAL PLATFORM FLOW
|
247 |
|
|
#################################################################
|
248 |
|
|
|
249 |
|
|
|
250 |
|
|
$(VPEXEC): $(MHSFILE) __xps/vpgen.opt
|
251 |
|
|
@echo "****************************************************"
|
252 |
|
|
@echo "Creating virtual platform for hardware specification.."
|
253 |
|
|
@echo "****************************************************"
|
254 |
|
|
vpgen $(VPGEN_OPTIONS) $(MHSFILE)
|
255 |
|
|
|
256 |
|
|
dummy:
|
257 |
|
|
@echo ""
|
258 |
|
|
|