| 1 |
2 |
csantifort |
# ----------------------------------------------------------------
|
| 2 |
|
|
# //
|
| 3 |
|
|
# Amber 2 core hardware test compilation Makefile //
|
| 4 |
|
|
# //
|
| 5 |
|
|
# This file is part of the Amber project //
|
| 6 |
|
|
# http://www.opencores.org/project,amber //
|
| 7 |
|
|
# //
|
| 8 |
|
|
# Description //
|
| 9 |
|
|
# Compiles a single hardware test and generates a .mem file //
|
| 10 |
|
|
# for use in Verilog simulations //
|
| 11 |
|
|
# //
|
| 12 |
|
|
# Author(s): //
|
| 13 |
|
|
# - Conor Santifort, csantifort.amber@gmail.com //
|
| 14 |
|
|
# //
|
| 15 |
|
|
#/ ///////////////////////////////////////////////////////////////
|
| 16 |
|
|
# //
|
| 17 |
|
|
# Copyright (C) 2010 Authors and OPENCORES.ORG //
|
| 18 |
|
|
# //
|
| 19 |
|
|
# This source file may be used and distributed without //
|
| 20 |
|
|
# restriction provided that this copyright statement is not //
|
| 21 |
|
|
# removed from the file and that any derivative work contains //
|
| 22 |
|
|
# the original copyright notice and the associated disclaimer. //
|
| 23 |
|
|
# //
|
| 24 |
|
|
# This source file is free software; you can redistribute it //
|
| 25 |
|
|
# and/or modify it under the terms of the GNU Lesser General //
|
| 26 |
|
|
# Public License as published by the Free Software Foundation; //
|
| 27 |
|
|
# either version 2.1 of the License, or (at your option) any //
|
| 28 |
|
|
# later version. //
|
| 29 |
|
|
# //
|
| 30 |
|
|
# This source is distributed in the hope that it will be //
|
| 31 |
|
|
# useful, but WITHOUT ANY WARRANTY; without even the implied //
|
| 32 |
|
|
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
|
| 33 |
|
|
# PURPOSE. See the GNU Lesser General Public License for more //
|
| 34 |
|
|
# details. //
|
| 35 |
|
|
# //
|
| 36 |
|
|
# You should have received a copy of the GNU Lesser General //
|
| 37 |
|
|
# Public License along with this source; if not, download it //
|
| 38 |
|
|
# from http://www.opencores.org/lgpl.shtml //
|
| 39 |
|
|
# //
|
| 40 |
|
|
# ----------------------------------------------------------------
|
| 41 |
|
|
|
| 42 |
|
|
# Assembly source files
|
| 43 |
|
|
DEP += ../../sw/include/amber_registers.h
|
| 44 |
|
|
|
| 45 |
|
|
TEST ?= add
|
| 46 |
|
|
AMBER_CROSSTOOL ?= amber-crosstool-not-defined
|
| 47 |
|
|
TOOLSPATH = ../../sw/tools
|
| 48 |
|
|
|
| 49 |
36 |
csantifort |
TGT = $(addsuffix .elf, $(basename $(TEST)))
|
| 50 |
|
|
MMP32 = $(addsuffix _memparams32.v, $(basename $(TGT)))
|
| 51 |
|
|
MMP128 = $(addsuffix _memparams128.v, $(basename $(TGT)))
|
| 52 |
|
|
SRC = $(addsuffix .S, $(basename $(TEST)))
|
| 53 |
|
|
MEM = $(addsuffix .mem, $(basename $(TGT)))
|
| 54 |
|
|
DIS = $(addsuffix .dis, $(basename $(TGT)))
|
| 55 |
|
|
OBJ = $(addsuffix .o, $(basename $(SRC)))
|
| 56 |
|
|
MAP = $(addsuffix .map, $(basename $(TGT)))
|
| 57 |
|
|
LDS = sections.lds
|
| 58 |
2 |
csantifort |
|
| 59 |
36 |
csantifort |
AS = $(AMBER_CROSSTOOL)-as
|
| 60 |
|
|
CC = $(AMBER_CROSSTOOL)-gcc
|
| 61 |
|
|
CXX = $(AMBER_CROSSTOOL)-g++
|
| 62 |
|
|
AR = $(AMBER_CROSSTOOL)-ar
|
| 63 |
|
|
LD = $(AMBER_CROSSTOOL)-ld
|
| 64 |
|
|
DS = $(AMBER_CROSSTOOL)-objdump
|
| 65 |
|
|
OC = $(AMBER_CROSSTOOL)-objcopy
|
| 66 |
|
|
ELF = ../../sw/tools/amber-elfsplitter
|
| 67 |
|
|
BMF32 = ../../sw/tools/amber-memparams32.sh
|
| 68 |
|
|
BMF128 = ../../sw/tools/amber-memparams128.sh
|
| 69 |
2 |
csantifort |
|
| 70 |
|
|
ASFLAGS = -I../../sw/include
|
| 71 |
|
|
CFLAGS = -c -march=armv2a -mno-thumb-interwork -I../../sw/include
|
| 72 |
|
|
DSFLAGS = -C -S -EL
|
| 73 |
|
|
LDFLAGS = -Bstatic -Map $(MAP) --fix-v4bx
|
| 74 |
|
|
|
| 75 |
|
|
|
| 76 |
36 |
csantifort |
all: $(ELF) $(MMP32) $(MMP128) $(DIS)
|
| 77 |
2 |
csantifort |
|
| 78 |
36 |
csantifort |
$(MMP32): $(MEM)
|
| 79 |
|
|
$(BMF32) $(MEM) $(MMP32)
|
| 80 |
2 |
csantifort |
|
| 81 |
36 |
csantifort |
$(MMP128): $(MEM)
|
| 82 |
|
|
$(BMF128) $(MEM) $(MMP128)
|
| 83 |
|
|
|
| 84 |
2 |
csantifort |
$(MEM): $(TGT)
|
| 85 |
|
|
$(ELF) $(TGT) > $(MEM)
|
| 86 |
|
|
|
| 87 |
|
|
$(TGT): $(OBJ)
|
| 88 |
|
|
$(LD) $(LDFLAGS) -o $(TGT) -T $(LDS) $(OBJ)
|
| 89 |
|
|
|
| 90 |
|
|
$(OBJ): $(SRC) $(DEP)
|
| 91 |
|
|
$(CC) $(CFLAGS) -o $(OBJ) $(SRC)
|
| 92 |
|
|
|
| 93 |
|
|
$(DIS): $(TGT)
|
| 94 |
|
|
$(DS) $(DSFLAGS) $^ > $@
|
| 95 |
|
|
|
| 96 |
|
|
$(ELF):
|
| 97 |
|
|
$(MAKE) -C $(TOOLSPATH)
|
| 98 |
|
|
|
| 99 |
|
|
clean:
|
| 100 |
36 |
csantifort |
@rm -rfv *.o *.elf *.dis *.map *.mem *_memparams*.v
|
| 101 |
2 |
csantifort |
|