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

Subversion Repositories plasma

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

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

Line No. Rev Author Line
1 137 rhoads
# The MIPS gcc compiler must use the cygwin1.dll that came with the compiler.
2
# The CC_X86 is for compiling tools on your PC.
3
# The GCC_MIPS is for compiling code on the target.
4 191 rhoads
# Convert_bin changes test.axf into code.txt which is used by the VHDL.
5 126 rhoads
 
6 179 rhoads
# Customize for Linux
7
#CC_X86 = gcc -Wall -O -g
8
#CP = cp
9
#RM = rm -rf
10 182 rhoads
#BIN_MIPS = ../../mips/sde/bin
11
#VHDL_DIR = ../vhdl
12 193 rhoads
#GCC_MIPS  = $(BIN_MIPS)/gcc $(CFLAGS)
13
#AS_MIPS   = $(BIN_MIPS)/as
14
#LD_MIPS   = $(BIN_MIPS)/ld
15
#DUMP_MIPS = $(BIN_MIPS)/objdump
16 179 rhoads
 
17
# Customize for Windows
18 243 rhoads
CC_X86 = cl /O1 /nologo
19 179 rhoads
CP = copy
20
RM = del
21 193 rhoads
BIN_MIPS = ..\gccmips_elf
22 182 rhoads
VHDL_DIR = ..\vhdl
23 193 rhoads
GCC_MIPS  = $(BIN_MIPS)\gcc $(CFLAGS)
24
AS_MIPS   = $(BIN_MIPS)\as
25
LD_MIPS   = $(BIN_MIPS)\ld
26
DUMP_MIPS = $(BIN_MIPS)\objdump
27 2 rhoads
 
28 200 rhoads
CFLAGS = -O2 -Wall -c -s
29 47 rhoads
 
30 179 rhoads
all: convert_bin.exe tracehex.exe bintohex.exe ram_image.exe
31 243 rhoads
        @echo make targets = count, opcodes, pi, test, run, tohex,\
32
        bootldr, toimage, etermip
33 2 rhoads
 
34 137 rhoads
clean:
35 272 rhoads
        -$(RM) *.o *.obj *.map *.lst *.hex *.txt *.exe *.axf
36 137 rhoads
 
37
convert_bin.exe: convert.c
38
        @$(CC_X86) -o convert_bin.exe convert.c
39
 
40 170 rhoads
convert_le.exe: convert.c
41
        @$(CC_X86) -DLITTLE_ENDIAN -o convert_le.exe convert.c
42
 
43 41 rhoads
mlite.exe: mlite.c
44 137 rhoads
        @$(CC_X86) -o mlite.exe mlite.c -DWIN32
45 2 rhoads
 
46 7 rhoads
tracehex.exe: tracehex.c
47 137 rhoads
        @$(CC_X86) -o tracehex.exe tracehex.c
48 2 rhoads
 
49 47 rhoads
bintohex.exe: bintohex.c
50 137 rhoads
        @$(CC_X86) -o bintohex.exe bintohex.c
51 47 rhoads
 
52 137 rhoads
ram_image.exe: ram_image.c
53
        @$(CC_X86) -o ram_image.exe ram_image.c
54 47 rhoads
 
55 243 rhoads
# Terminal program that will download a new image and supports Ethernet
56
# traffic over UART.  Get wpcap.lib from http://www.winpcap.org/.
57
etermip: etermip.c
58
        -@$(CC_X86) -o etermip.exe etermip.c wpcap.lib
59
        @echo Get wpcap.lib from http://www.winpcap.org/
60
 
61
download: etermip
62
        @echo Reset board before downloading code
63
        etermip
64
 
65 179 rhoads
opcodes:
66 137 rhoads
        $(AS_MIPS) -o opcodes.o opcodes.asm
67 191 rhoads
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf opcodes.o
68
        -@$(DUMP_MIPS) --disassemble test.axf > test.lst
69 179 rhoads
        convert_bin.exe
70 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
71 7 rhoads
 
72 179 rhoads
opcodes2:
73 137 rhoads
        $(AS_MIPS) -o opcodes.o opcodes.asm
74 191 rhoads
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf opcodes.o
75
        -@$(DUMP_MIPS) --disassemble test.axf > test.lst
76 179 rhoads
        convert_bin.exe
77 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
78 137 rhoads
 
79 179 rhoads
test:
80 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
81
        $(GCC_MIPS) test.c
82
        $(GCC_MIPS) no_os.c
83 191 rhoads
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
84 137 rhoads
                boot.o test.o no_os.o
85 191 rhoads
        -@$(DUMP_MIPS) --disassemble test.axf > test.lst
86 179 rhoads
        convert_bin.exe
87 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
88 22 rhoads
 
89 179 rhoads
count:
90 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
91
        $(GCC_MIPS) count.c
92
        $(GCC_MIPS) no_os.c
93 191 rhoads
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
94 137 rhoads
                boot.o count.o no_os.o
95 191 rhoads
        -$(DUMP_MIPS) --disassemble test.axf > test.lst
96 179 rhoads
        convert_bin.exe
97 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
98 32 rhoads
 
99 179 rhoads
count2:
100 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
101
        $(GCC_MIPS) count.c
102
        $(GCC_MIPS) no_os.c
103 191 rhoads
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
104 137 rhoads
                boot.o count.o no_os.o
105 191 rhoads
        -$(DUMP_MIPS) --disassemble test.axf > test.lst
106 179 rhoads
        convert_bin.exe
107 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
108 137 rhoads
 
109 272 rhoads
count3:
110
        $(AS_MIPS) -o boot.o boot.asm
111
        $(GCC_MIPS) count.c
112
        $(GCC_MIPS) no_os.c
113
        $(LD_MIPS) -Ttext 0x1000 -eentry -Map test.map -s -N -o test.axf \
114
                boot.o count.o no_os.o
115
        -$(DUMP_MIPS) --disassemble test.axf > test.lst
116
        convert_bin.exe
117
        $(CP) code.txt $(VHDL_DIR)
118
 
119 179 rhoads
pi:
120 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
121
        $(GCC_MIPS) pi.c
122 191 rhoads
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
123 137 rhoads
                boot.o pi.o
124 191 rhoads
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
125 179 rhoads
        convert_bin.exe
126 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
127 32 rhoads
 
128 179 rhoads
pi2:
129 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
130
        $(GCC_MIPS) pi.c
131 191 rhoads
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
132 137 rhoads
                boot.o pi.o
133 191 rhoads
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
134 179 rhoads
        convert_bin.exe
135 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
136 137 rhoads
 
137 272 rhoads
ddr_test:
138
        $(AS_MIPS) -o boot.o boot.asm
139
        $(GCC_MIPS) ddr_init.c -DDDR_TEST_MAIN
140
        $(GCC_MIPS) no_os.c
141
        $(LD_MIPS) -Ttext 0x0 -eentry -Map test.map -s -N -o test.axf \
142
                boot.o ddr_init.o no_os.o
143
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
144
        convert_bin.exe
145
        $(CP) code.txt $(VHDL_DIR)
146
 
147
memtest:
148
        $(AS_MIPS) -o boot.o boot.asm
149
        $(GCC_MIPS) memtest.c
150
        $(LD_MIPS) -Ttext 0x1000 -eentry -o test.axf boot.o memtest.o
151
        convert_bin.exe
152
 
153
memtest2:
154
        $(AS_MIPS) -o boot.o boot.asm
155
        $(GCC_MIPS) -DINIT_DDR memtest.c
156
        $(GCC_MIPS) ddr_init.c
157
        $(LD_MIPS) -Ttext 0x0 -eentry -o test.axf boot.o memtest.o ddr_init.o
158
        convert_bin.exe
159
 
160 179 rhoads
bootldr:
161 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
162
        $(GCC_MIPS) bootldr.c
163
        $(GCC_MIPS) no_os.c
164 272 rhoads
        $(GCC_MIPS) -DDLL_DISABLE ddr_init.c
165 191 rhoads
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
166 272 rhoads
                boot.o bootldr.o no_os.o ddr_init.o
167 191 rhoads
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
168 179 rhoads
        convert_bin.exe
169 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
170 137 rhoads
 
171 179 rhoads
bootldr_little_endian: convert_le.exe
172 170 rhoads
        $(AS_MIPS) -EL -o boot.o boot.asm
173
        $(GCC_MIPS) -EL bootldr.c
174
        $(GCC_MIPS) -EL no_os.c
175 272 rhoads
        $(GCC_MIPS) -EL ddr_init.c
176 191 rhoads
        $(LD_MIPS) -EL -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
177 272 rhoads
                boot.o bootldr.o no_os.o ddr_init.o
178 191 rhoads
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
179 179 rhoads
        convert_le.exe
180 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
181 170 rhoads
 
182 137 rhoads
# Run a MIPS opcode simulator
183 41 rhoads
run: mlite.exe
184 179 rhoads
        @mlite.exe test.bin
185 22 rhoads
 
186 170 rhoads
run_little_endian: mlite.exe
187 179 rhoads
        @mlite.exe test.bin L
188 170 rhoads
 
189 243 rhoads
disassemble: mlite.exe
190
        mlite.exe test.bin BD > test.txt
191 22 rhoads
 
192 137 rhoads
# Used by Altera FPGAs for ram image
193 243 rhoads
tohex: bintohex.exe
194
        bintohex.exe test.bin
195 182 rhoads
        $(CP) code*.hex $(VHDL_DIR)
196 137 rhoads
 
197
# Used by Xilinx FPGAs for ram image
198
toimage:
199 179 rhoads
        ram_image.exe ../vhdl/ram_xilinx.vhd ../vhdl/code.txt ../vhdl/ram_image.vhd
200 137 rhoads
 
201
 

powered by: WebSVN 2.1.0

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