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

Subversion Repositories plasma

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

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
 
31
all: convert_bin.exe tracehex.exe bintohex.exe ram_image.exe
32 243 rhoads
        @echo make targets = count, opcodes, pi, test, run, tohex,\
33
        bootldr, toimage, etermip
34 2 rhoads
 
35 137 rhoads
clean:
36 243 rhoads
        -$(RM) *.o *.obj *.map *.lst *.hex *.txt *.exe
37 137 rhoads
 
38
convert_bin.exe: convert.c
39
        @$(CC_X86) -o convert_bin.exe convert.c
40
 
41 170 rhoads
convert_le.exe: convert.c
42
        @$(CC_X86) -DLITTLE_ENDIAN -o convert_le.exe convert.c
43
 
44 41 rhoads
mlite.exe: mlite.c
45 137 rhoads
        @$(CC_X86) -o mlite.exe mlite.c -DWIN32
46 2 rhoads
 
47 7 rhoads
tracehex.exe: tracehex.c
48 137 rhoads
        @$(CC_X86) -o tracehex.exe tracehex.c
49 2 rhoads
 
50 47 rhoads
bintohex.exe: bintohex.c
51 137 rhoads
        @$(CC_X86) -o bintohex.exe bintohex.c
52 47 rhoads
 
53 137 rhoads
ram_image.exe: ram_image.c
54
        @$(CC_X86) -o ram_image.exe ram_image.c
55 47 rhoads
 
56 243 rhoads
# Terminal program that will download a new image and supports Ethernet
57
# traffic over UART.  Get wpcap.lib from http://www.winpcap.org/.
58
etermip: etermip.c
59
        -@$(CC_X86) -o etermip.exe etermip.c wpcap.lib
60
        @echo Get wpcap.lib from http://www.winpcap.org/
61
 
62
download: etermip
63
        @echo Reset board before downloading code
64
        etermip
65
 
66 179 rhoads
opcodes:
67 137 rhoads
        $(AS_MIPS) -o opcodes.o opcodes.asm
68 191 rhoads
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf opcodes.o
69
        -@$(DUMP_MIPS) --disassemble test.axf > test.lst
70 179 rhoads
        convert_bin.exe
71 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
72 7 rhoads
 
73 179 rhoads
opcodes2:
74 137 rhoads
        $(AS_MIPS) -o opcodes.o opcodes.asm
75 191 rhoads
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf opcodes.o
76
        -@$(DUMP_MIPS) --disassemble test.axf > test.lst
77 179 rhoads
        convert_bin.exe
78 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
79 137 rhoads
 
80 179 rhoads
test:
81 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
82
        $(GCC_MIPS) test.c
83
        $(GCC_MIPS) no_os.c
84 191 rhoads
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
85 137 rhoads
                boot.o test.o no_os.o
86 191 rhoads
        -@$(DUMP_MIPS) --disassemble test.axf > test.lst
87 179 rhoads
        convert_bin.exe
88 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
89 22 rhoads
 
90 179 rhoads
count:
91 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
92
        $(GCC_MIPS) count.c
93
        $(GCC_MIPS) no_os.c
94 191 rhoads
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
95 137 rhoads
                boot.o count.o no_os.o
96 191 rhoads
        -$(DUMP_MIPS) --disassemble test.axf > test.lst
97 179 rhoads
        convert_bin.exe
98 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
99 32 rhoads
 
100 179 rhoads
count2:
101 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
102
        $(GCC_MIPS) count.c
103
        $(GCC_MIPS) no_os.c
104 191 rhoads
        $(LD_MIPS) -Ttext 0x10000000 -eentry -Map test.map -s -N -o test.axf \
105 137 rhoads
                boot.o count.o no_os.o
106 191 rhoads
        -$(DUMP_MIPS) --disassemble test.axf > test.lst
107 179 rhoads
        convert_bin.exe
108 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
109 137 rhoads
 
110 179 rhoads
pi:
111 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
112
        $(GCC_MIPS) pi.c
113 191 rhoads
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
114 137 rhoads
                boot.o pi.o
115 191 rhoads
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
116 179 rhoads
        convert_bin.exe
117 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
118 32 rhoads
 
119 179 rhoads
pi2:
120 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
121
        $(GCC_MIPS) pi.c
122 191 rhoads
        $(LD_MIPS) -Ttext 0x10000000 -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 137 rhoads
 
128 179 rhoads
bootldr:
129 137 rhoads
        $(AS_MIPS) -o boot.o boot.asm
130
        $(GCC_MIPS) bootldr.c
131
        $(GCC_MIPS) no_os.c
132 191 rhoads
        $(LD_MIPS) -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
133 137 rhoads
                boot.o bootldr.o no_os.o
134 191 rhoads
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
135 179 rhoads
        convert_bin.exe
136 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
137 137 rhoads
 
138 179 rhoads
bootldr_little_endian: convert_le.exe
139 170 rhoads
        $(AS_MIPS) -EL -o boot.o boot.asm
140
        $(GCC_MIPS) -EL bootldr.c
141
        $(GCC_MIPS) -EL no_os.c
142 191 rhoads
        $(LD_MIPS) -EL -Ttext 0 -eentry -Map test.map -s -N -o test.axf \
143 170 rhoads
                boot.o bootldr.o no_os.o
144 191 rhoads
        @$(DUMP_MIPS) --disassemble test.axf > test.lst
145 179 rhoads
        convert_le.exe
146 182 rhoads
        $(CP) code.txt $(VHDL_DIR)
147 170 rhoads
 
148 137 rhoads
# Run a MIPS opcode simulator
149 41 rhoads
run: mlite.exe
150 179 rhoads
        @mlite.exe test.bin
151 22 rhoads
 
152 170 rhoads
run_little_endian: mlite.exe
153 179 rhoads
        @mlite.exe test.bin L
154 170 rhoads
 
155 243 rhoads
disassemble: mlite.exe
156
        mlite.exe test.bin BD > test.txt
157 22 rhoads
 
158 137 rhoads
# Used by Altera FPGAs for ram image
159 243 rhoads
tohex: bintohex.exe
160
        bintohex.exe test.bin
161 182 rhoads
        $(CP) code*.hex $(VHDL_DIR)
162 137 rhoads
 
163
# Used by Xilinx FPGAs for ram image
164
toimage:
165 179 rhoads
        ram_image.exe ../vhdl/ram_xilinx.vhd ../vhdl/code.txt ../vhdl/ram_image.vhd
166 137 rhoads
 
167
 

powered by: WebSVN 2.1.0

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