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

Subversion Repositories plasma

[/] [plasma/] [trunk/] [tools/] [makefile] - Blame information for rev 388

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

Line No. Rev Author Line
1 363 rhoads
# The CC_X86 is for compiling tools on your PC.
2
# The GCC_MIPS is for compiling code on the target.
3
# Convert_bin changes test.axf into code.txt which is used by the VHDL.
4
# Convert_bin == "objcopy -I elf32-big -O binary test.axf test.bin"
5
 
6
 
7
ifeq ($(LANG),)
8
 
9
# Customize for Windows
10
# The MIPS gcc compiler must use the cygwin1.dll that came with the compiler.
11
CC_X86 = cl /O1 /nologo
12
CP = copy
13
RM = del
14
DWIN32 = -DWIN32
15
BIN_MIPS = ..\gccmips_elf
16
VHDL_DIR = ..\vhdl
17
LINUX_PWD =
18
GCC_MIPS  = $(BIN_MIPS)\gcc $(CFLAGS)
19
AS_MIPS   = $(BIN_MIPS)\as
20
LD_MIPS   = $(BIN_MIPS)\ld
21
DUMP_MIPS = $(BIN_MIPS)\objdump
22
CONVERT_BIN = $(LINUX_PWD)convert_bin.exe
23
 
24
else
25
 
26
# Customized for Linux
27
# See http://www.opencores.com/projects.cgi/web/mips/linux_tools.htm
28
CC_X86 = gcc -Wall -O -g
29
CP = cp
30
RM = rm -rf
31
DWIN32 =
32
BIN_MIPS =
33
VHDL_DIR = ../vhdl
34
LINUX_PWD = ./
35
GCC_MIPS  = $(BIN_MIPS)mips-elf-gcc $(CFLAGS)
36
AS_MIPS   = $(BIN_MIPS)mips-elf-as
37
LD_MIPS   = $(BIN_MIPS)mips-elf-ld
38
DUMP_MIPS = $(BIN_MIPS)mips-elf-objdump
39
CONVERT_BIN = $(LINUX_PWD)convert_bin.exe
40
#CONVERT_BIN = $(BIN_MIPS)mips-elf-objcopy -I elf32-big -O binary test.axf test.bin
41
 
42
endif
43
 
44
CFLAGS = -O2 -Wall -c -s
45
 
46
all: convert_bin.exe tracehex.exe bintohex.exe ram_image.exe
47 388 rhoads
        @echo make targets = count, opcodes, pi, test, run, tohex,\
48 363 rhoads
        bootldr, toimage, etermip
49
 
50
clean:
51
        -$(RM) *.o *.obj *.map *.lst *.hex *.txt *.exe *.axf
52
 
53
#Same as "objcopy -I elf32-big -O binary test.axf test.bin"
54
convert_bin.exe: convert.c
55
        @$(CC_X86) -o convert_bin.exe convert.c
56
 
57
convert_le.exe: convert.c
58
        @$(CC_X86) -DLITTLE_ENDIAN -o convert_le.exe convert.c
59
 
60
mlite.exe: mlite.c
61
        @$(CC_X86) -o mlite.exe mlite.c $(DWIN32)
62
 
63
tracehex.exe: tracehex.c
64
        @$(CC_X86) -o tracehex.exe tracehex.c
65
 
66
bintohex.exe: bintohex.c
67
        @$(CC_X86) -o bintohex.exe bintohex.c
68
 
69
ram_image.exe: ram_image.c
70
        @$(CC_X86) -o ram_image.exe ram_image.c
71
 
72
# Terminal program that will download a new image and supports Ethernet
73
# traffic over UART.  Get wpcap.lib from http://www.winpcap.org/.
74
# Requires Windows OS
75
# For Linux, use any serial port program at 57600 baud 8-bits;1-stop bit
76 386 rhoads
# This version does not support Ethernet packet transfers
77 363 rhoads
etermip: etermip.c
78
        -@$(CC_X86) -o etermip.exe etermip.c wpcap.lib
79 386 rhoads
 
80
# Uses wpcap.lib for receiving and transmitting raw Ethernet packets
81
# Get wpcap.lib from http://www.winpcap.org/.
82
etermip2: etermip.c
83 363 rhoads
        @echo Get wpcap.lib from http://www.winpcap.org/
84 386 rhoads
        -@$(CC_X86) -DUSE_WPCAP -o etermip.exe etermip.c wpcap.lib
85 363 rhoads
 
86
nomult.exe: nomult.c
87
        -@$(CC_X86) -o nomult.exe nomult.c
88
 
89
download: etermip
90
        @echo Reset board before downloading code
91
        etermip
92
 
93
opcodes:
94
        $(AS_MIPS) -o opcodes.o opcodes.asm
95
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf opcodes.o
96
        -@$(DUMP_MIPS) --disassemble test.axf > test.lst
97
        $(CONVERT_BIN)
98
        $(CP) code.txt $(VHDL_DIR)
99
 
100
opcodes2:
101
        $(AS_MIPS) -o opcodes.o opcodes.asm
102
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf opcodes.o
103
        -@$(DUMP_MIPS) --disassemble test.axf > test.lst
104
        $(CONVERT_BIN)
105
        $(CP) code.txt $(VHDL_DIR)
106
 
107
test:
108
        $(AS_MIPS) -o boot.o boot.asm
109
        $(GCC_MIPS) test.c
110
        $(GCC_MIPS) no_os.c
111
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
112
                boot.o test.o no_os.o
113
        -@$(DUMP_MIPS) --disassemble test.axf > test.lst
114
        $(CONVERT_BIN)
115
        $(CP) code.txt $(VHDL_DIR)
116
 
117
count:
118
        $(AS_MIPS) -o boot.o boot.asm
119
        $(GCC_MIPS) count.c
120
        $(GCC_MIPS) no_os.c
121
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
122
                boot.o count.o no_os.o
123
        -$(DUMP_MIPS) --disassemble test.axf > test.lst
124
        $(CONVERT_BIN)
125
        $(CP) code.txt $(VHDL_DIR)
126
 
127
count_le:
128
        $(AS_MIPS) -EL -o boot.o boot.asm
129
        $(GCC_MIPS) -EL count.c
130
        $(GCC_MIPS) -EL no_os.c
131
        $(LD_MIPS) -EL -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
132
                boot.o count.o no_os.o
133
        -$(DUMP_MIPS) --disassemble test.axf > test.lst
134
        $(CONVERT_BIN)
135
        $(CP) code.txt $(VHDL_DIR)
136
 
137
count2:
138
        $(AS_MIPS) -o boot.o boot.asm
139
        $(GCC_MIPS) count.c
140
        $(GCC_MIPS) no_os.c
141
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
142
                boot.o count.o no_os.o
143
        -$(DUMP_MIPS) --disassemble test.axf > test.lst
144
        $(CONVERT_BIN)
145
        $(CP) code.txt $(VHDL_DIR)
146
 
147
count3:
148
        $(AS_MIPS) -o boot.o boot.asm
149
        $(GCC_MIPS) count.c
150
        $(GCC_MIPS) no_os.c
151 386 rhoads
        $(LD_MIPS) -Ttext 0x2000 -eentry -Map test.map -s -N -o test.axf \
152 363 rhoads
                boot.o count.o no_os.o
153
        -$(DUMP_MIPS) --disassemble test.axf > test.lst
154
        $(CONVERT_BIN)
155
        $(CP) code.txt $(VHDL_DIR)
156
 
157
count5: nomult.exe
158
        $(AS_MIPS) -o boot.o boot.asm
159
        $(AS_MIPS) -o mult_sim.o mult_sim.asm
160
        $(GCC_MIPS) count.c
161
        $(GCC_MIPS) no_os.c
162
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
163
                boot.o mult_sim.o count.o no_os.o
164
        -$(DUMP_MIPS) --disassemble test.axf > test.lst
165
        $(CP) test.axf test_old.axf
166
        nomult test.axf test.lst test.map
167
        -$(DUMP_MIPS) --disassemble test.axf > test2.lst
168
        $(CONVERT_BIN)
169
        $(CP) code.txt $(VHDL_DIR)
170
 
171
pi:
172
        $(AS_MIPS) -o boot.o boot.asm
173
        $(GCC_MIPS) pi.c
174
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
175
                boot.o pi.o
176
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
177
        $(CONVERT_BIN)
178
        $(CP) code.txt $(VHDL_DIR)
179
 
180
pi2:
181
        $(AS_MIPS) -o boot.o boot.asm
182
        $(GCC_MIPS) pi.c
183
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
184
                boot.o pi.o
185
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
186
        $(CONVERT_BIN)
187
        $(CP) code.txt $(VHDL_DIR)
188
 
189
pi5: nomult.exe
190
        $(AS_MIPS) -o boot.o boot.asm
191
        $(AS_MIPS) -o mult_sim.o mult_sim.asm
192
        $(GCC_MIPS) pi.c
193
        $(LD_MIPS) -Ttext 0x0 -eentry -Map test.map -s -N -o test.axf \
194
                boot.o mult_sim.o pi.o
195
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
196
        nomult test.axf test.lst test.map
197
        @$(DUMP_MIPS) --disassemble test.axf > test2.lst
198
        $(CONVERT_BIN)
199
        $(CP) code.txt $(VHDL_DIR)
200
 
201
ddr_test:
202
        $(AS_MIPS) -o boot.o boot.asm
203
        $(GCC_MIPS) ddr_init.c -DDDR_TEST_MAIN
204
        $(GCC_MIPS) no_os.c
205
        $(LD_MIPS) -Ttext 0x0 -eentry -Map test.map -s -N -o test.axf \
206
                boot.o ddr_init.o no_os.o
207
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
208
        $(CONVERT_BIN)
209
        $(CP) code.txt $(VHDL_DIR)
210
 
211
memtest:
212
        $(AS_MIPS) -o boot.o boot.asm
213
        $(GCC_MIPS) memtest.c
214 386 rhoads
        $(LD_MIPS) -Ttext 0x2000 -eentry -o test.axf boot.o memtest.o
215 363 rhoads
        $(CONVERT_BIN)
216
 
217
memtest2:
218
        $(AS_MIPS) -o boot.o boot.asm
219
        $(GCC_MIPS) -DINIT_DDR memtest.c
220
        $(GCC_MIPS) ddr_init.c
221
        $(LD_MIPS) -Ttext 0x0 -eentry -o test.axf boot.o memtest.o ddr_init.o
222
        $(CONVERT_BIN)
223
 
224
memtest3:
225
        $(AS_MIPS) -o boot.o boot.asm
226
        $(GCC_MIPS) memtest.c
227
        $(LD_MIPS) -Ttext 0x10000000 -eentry -o test.axf boot.o memtest.o
228
        $(CONVERT_BIN)
229
 
230
bootldr:
231
        $(AS_MIPS) -o boot.o boot.asm
232
        $(GCC_MIPS) bootldr.c
233
        $(GCC_MIPS) no_os.c
234
        $(GCC_MIPS) -DDLL_DISABLE ddr_init.c
235
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
236
                boot.o bootldr.o no_os.o ddr_init.o
237
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
238
        $(CONVERT_BIN)
239
        $(CP) code.txt $(VHDL_DIR)
240
        @echo Next do "make toimage" for Xilinx or "make tohex" for Altera.
241
 
242
bootldr2:
243
        $(AS_MIPS) -o boot.o boot.asm
244
        $(GCC_MIPS) bootldr.c
245
        $(GCC_MIPS) no_os.c
246
        $(GCC_MIPS) -DDLL_DISABLE ddr_init.c
247
        $(LD_MIPS) -Ttext 0x1000 -eentry -Map test.map -s -N -o test.axf \
248
                boot.o bootldr.o no_os.o ddr_init.o
249
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
250
        $(CONVERT_BIN)
251
        $(CP) code.txt $(VHDL_DIR)
252
 
253
bootldr_little_endian: convert_le.exe
254
        $(AS_MIPS) -EL -o boot.o boot.asm
255
        $(GCC_MIPS) -EL bootldr.c
256
        $(GCC_MIPS) -EL no_os.c
257
        $(GCC_MIPS) -EL ddr_init.c
258
        $(LD_MIPS) -EL -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
259
                boot.o bootldr.o no_os.o ddr_init.o
260
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
261
        $(LINUX_PWD)convert_le.exe
262
        $(CP) code.txt $(VHDL_DIR)
263
 
264
# Run a MIPS opcode simulator
265
run: mlite.exe
266
        @$(LINUX_PWD)mlite.exe test.bin
267
 
268
run_little_endian: mlite.exe
269
        @$(LINUX_PWD)mlite.exe test.bin L
270
 
271
disassemble: mlite.exe
272
        $(LINUX_PWD)mlite.exe test.bin BD > test.txt
273
 
274
# Used by Altera FPGAs for ram image
275
tohex: bintohex.exe
276
        $(LINUX_PWD)bintohex.exe test.bin
277
        $(CP) code*.hex $(VHDL_DIR)
278
 
279
# Used by Xilinx FPGAs for ram image
280
toimage:
281
        $(LINUX_PWD)ram_image.exe ../vhdl/ram_xilinx.vhd ../vhdl/code.txt ../vhdl/ram_image.vhd
282
 
283
 

powered by: WebSVN 2.1.0

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