1 |
2 |
ja_rd |
#-------------------------------------------------------------------------------
|
2 |
|
|
# This makefile does not contain any targets, only definitions used by the
|
3 |
|
|
# makefiles of all the code samples.
|
4 |
|
|
# It is meant to be included and not used standalone.
|
5 |
|
|
#-------------------------------------------------------------------------------
|
6 |
34 |
ja_rd |
# SYSTEM PARAMETERS
|
7 |
|
|
#
|
8 |
66 |
ja_rd |
# You can define here the default size and address of the memory blocks of the
|
9 |
|
|
# system as seen by the linker, though you can't change the number and type of
|
10 |
|
|
# blocks here (see /vhdl/mips_cache_*.vhdl and /vhdl/mips_pkg.vhdl).
|
11 |
34 |
ja_rd |
#
|
12 |
66 |
ja_rd |
# The samples' makefiles will probably redefine the values, anyway.
|
13 |
2 |
ja_rd |
#
|
14 |
|
|
#-------------------------------------------------------------------------------
|
15 |
66 |
ja_rd |
# NOTE:
|
16 |
|
|
# A link script '/src/ion_noxram.lds' was used in previous versions of the
|
17 |
|
|
# project. It is no longer used. It is known to be buggy and will be removed.
|
18 |
184 |
ja_rd |
#
|
19 |
|
|
# See info on flag -G0 in ion_noxram.lds
|
20 |
66 |
ja_rd |
#-------------------------------------------------------------------------------
|
21 |
2 |
ja_rd |
|
22 |
|
|
|
23 |
|
|
### Toolchain config ###########################################################
|
24 |
|
|
|
25 |
|
|
ifeq ($(LANG),)
|
26 |
|
|
#**** Customize for Windows/Cygwin
|
27 |
|
|
|
28 |
|
|
# Some common file commands (Cygwin/sh version, use your own)
|
29 |
|
|
CP = cp
|
30 |
|
|
RM = RM
|
31 |
|
|
DWIN32 = -DWIN32
|
32 |
|
|
LINUX_PWD =
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
# MIPS GCC cross-toolchain: CodeSourcery -- replace with your own
|
36 |
|
|
|
37 |
131 |
ja_rd |
BIN_MIPS = C:/dev/embedded/SourceryGpp/mips-elf-11-03.52/bin
|
38 |
184 |
ja_rd |
CC = $(BIN_MIPS)/mips-sde-elf-gcc.exe $(CFLAGS)
|
39 |
|
|
AS = $(BIN_MIPS)/mips-sde-elf-as
|
40 |
|
|
LD = $(BIN_MIPS)/mips-sde-elf-ld
|
41 |
|
|
DUMP = $(BIN_MIPS)/mips-sde-elf-objdump
|
42 |
|
|
COPY = $(BIN_MIPS)/mips-sde-elf-objcopy
|
43 |
2 |
ja_rd |
|
44 |
|
|
else
|
45 |
|
|
#**** Customize for Linux
|
46 |
|
|
|
47 |
|
|
# MIPS GCC cross-toolchain: BuildRoot toolchain in my home directory -- replace with your own
|
48 |
|
|
# NOTE: we will not use gcc builtin functions or libc
|
49 |
|
|
|
50 |
|
|
BIN_MIPS = /home/jaruiz/desarrollo/uClinux/MIPS/buildroot/buildroot-2010.11/output/staging/usr/bin
|
51 |
184 |
ja_rd |
CC = $(BIN_MIPS)/mips-unknown-linux-uclibc-gcc $(CFLAGS)
|
52 |
|
|
AS = $(BIN_MIPS)/mips-unknown-linux-uclibc-as
|
53 |
|
|
LD = $(BIN_MIPS)/mips-unknown-linux-uclibc-ld
|
54 |
|
|
DUMP = $(BIN_MIPS)/mips-unknown-linux-uclibc-objdump
|
55 |
|
|
COPY = $(BIN_MIPS)/mips-unknown-linux-uclibc-objcopy
|
56 |
2 |
ja_rd |
|
57 |
|
|
endif
|
58 |
|
|
|
59 |
229 |
ja_rd |
### VHDL source file manipulation tools ########################################
|
60 |
|
|
ION_TOOLS = ../../tools
|
61 |
|
|
TO_VHDL = python $(ION_TOOLS)/bin2hdl/bin2hdl.py
|
62 |
|
|
VHDL_OBJ_PKG = python $(ION_TOOLS)/build_pkg/build_pkg.py -t $(ION_TOOLS)/build_pkg/templates
|
63 |
|
|
|
64 |
184 |
ja_rd |
### Default system parameters -- to be replaced in application makefile ########
|
65 |
2 |
ja_rd |
|
66 |
34 |
ja_rd |
# 'CODE_BRAM' is meant to be a small BRAM (2 to 4KB) used for bootstrapping.
|
67 |
|
|
# 'DATA_BRAM' is a small BRAM connected to the data ports, used for debugging.
|
68 |
229 |
ja_rd |
# 'XRAM' is meant to be external SRAM
|
69 |
34 |
ja_rd |
|
70 |
|
|
|
71 |
|
|
# Default location of code BRAM is on the reset vector address
|
72 |
|
|
CODE_BRAM_ADDRESS = 0
|
73 |
2 |
ja_rd |
# Default size of code BRAM in 32-bit words
|
74 |
34 |
ja_rd |
CODE_BRAM_SIZE = 1024
|
75 |
184 |
ja_rd |
# Default size of data BRAM in 32-bit words (meant for simulation only)
|
76 |
34 |
ja_rd |
DATA_BRAM_SIZE = 256
|
77 |
|
|
# Default address of BRAM -- used in some simulation-only tests, see makefiles
|
78 |
|
|
DATA_BRAM_ADDRESS = 0x10000
|
79 |
229 |
ja_rd |
# Default size of data external SRAM (XRAM) in 16-bit words (for simulation)
|
80 |
34 |
ja_rd |
XRAM_SIZE = 2048
|
81 |
|
|
# Default address of XRAM
|
82 |
|
|
XRAM_ADDRESS = 0x80000000
|
83 |
2 |
ja_rd |
|
84 |
184 |
ja_rd |
### Project directories -- to be replaced in application makefile ##############
|
85 |
34 |
ja_rd |
|
86 |
184 |
ja_rd |
# Root test code source directory, where python script and vhdl templates are
|
87 |
|
|
SRC_DIR = ..
|
88 |
|
|
# VHDL test bench directory, where VHDL output files will be created
|
89 |
|
|
TB_DIR = ../../vhdl/tb
|
90 |
|
|
# VHDL DE-1 board demo root directory, for vhdl output
|
91 |
|
|
DEMO_DIR = ../../vhdl/demo
|
92 |
|
|
# Path to local libraries
|
93 |
|
|
LIB_PATH = $(SRC_DIR)/common/libsoc
|
94 |
|
|
# Link script to be used
|
95 |
|
|
LINK_SCRIPT = $(SRC_DIR)/common/flash.lds
|
96 |
2 |
ja_rd |
|
97 |
184 |
ja_rd |
### Build options -- to be replaced in application makefile ####################
|
98 |
|
|
|
99 |
229 |
ja_rd |
# Don't use gcc builtin functions, and try to target MIPS-I architecture.
|
100 |
34 |
ja_rd |
# This will prevent usage of unimplemented opcodes but will insert nops after
|
101 |
|
|
# load instructions, which Ion does not need.
|
102 |
2 |
ja_rd |
# (See comment above about -G0 flag)
|
103 |
184 |
ja_rd |
CFLAGS = -O2 -Wall -c -s -fno-builtin -mips1 -G0 -nodefaultlibs -nostdlib
|
104 |
2 |
ja_rd |
|
105 |
66 |
ja_rd |
# LFLAGS: linker options are in the respective makefiles
|