[mips]- added sim stuff and lto

git-svn-id: http://moon:8086/svn/mips@136 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
2017-02-04 10:59:49 +00:00
parent 1acf88ea01
commit 1530cab6de
6 changed files with 23 additions and 9 deletions
+15 -3
View File
@@ -16,7 +16,7 @@ endif
BUILD_DIR=build/$(BOARD)/$(ENDIANESS)
LSYS_BUILD_DIR=libsys/build/$(BOARD)/$(ENDIANESS)
CFLAGS:=$(ENDIAN_FLAGS) -Tlink/link.ld -g -msoft-float -O2 -march=r3000 -I. -Ilibsys -Ilibsys/boards/$(BOARD) -L$(LSYS_BUILD_DIR) -Wl,-M
CFLAGS:=$(ENDIAN_FLAGS) -G 0 -Tlink/link.ld -g -msoft-float -O2 -march=r3000 -I. -Ilibsys -Ilibsys/boards/$(BOARD) -L$(LSYS_BUILD_DIR) -Wl,-M
ifeq ($(TLB),yes)
CFLAGS+=-DSYS_IO_BASE=0xAC000000 -DSDRAM_BASE=0x80000000 -DFLASH_BASE_IO=0xA4000000 -DFLASH_BASE_MEM=0x88000000
else
@@ -40,9 +40,12 @@ OBJDUMP=mips-elf-objdump
OBJCOPY=mips-elf-objcopy
PROG-ml402 = $(addprefix $(BUILD_DIR)/, hello.elf testbench.elf test_irq.elf dhry.elf queens.elf stanford.elf paranoia.elf rmd160_test.elf Bessel.elf whet.elf phrasen.elf dttl.elf richards_benchmark.elf test_exception.elf life.elf r3.elf gunzip.elf basic_math.elf jman_patches.elf jman_patchmeshes.elf jman_polys.elf test_hpi.elf test_vga.elf test_fft.elf)
PROG-denano = $(addprefix $(BUILD_DIR)/, hello.elf dhry.elf queens.elf stanford.elf paranoia.elf rmd160_test.elf Bessel.elf whet.elf phrasen.elf dttl.elf richards_benchmark.elf test_exception.elf testbench_denano.elf)
PROG-sim = $(addprefix $(BUILD_DIR)/, hello.elf ICacheTest.elf)
CFLAGS-sim := -flto -O0
CFLAGS += $(CFLAGS-$(BOARD))
all: $(PROG-$(BOARD))
$(BUILD_DIR):
@@ -66,6 +69,15 @@ $(BUILD_DIR)/hello.elf: $(BUILD_DIR) hello.c
cat $@.srec | $(PACKHEX) > $@.pack
$(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex
$(BUILD_DIR)/ICacheTest.elf: $(BUILD_DIR) ICacheTest.c
$(CC) -O0 $(CFLAGS) -o $@ ICacheTest.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec
$(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
cat $@.srec | $(PACKHEX) > $@.pack
$(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex
$(BUILD_DIR)/blittertest.elf: $(BUILD_DIR) blittertest.c
$(CC) $(CFLAGS) -o $@ -Os blittertest.c $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis
+3 -2
View File
@@ -1,5 +1,5 @@
# environment vaiables read:
# BOARD = {ml402, denano}
# BOARD = {ml402, denano, sim}
# TLB = {no, yes}
# ENDIANESS = {eb, el}
BOARD ?= ml402
@@ -50,7 +50,8 @@ all: $(BUILD_DIR) $(BUILD_DIR)/bootloader.elf $(BUILD_DIR)/bootloader_with_flash
OBJS-ml402=$(addprefix $(BUILD_DIR)/, startup.o kernel.o cop0.o libsys.o srec.o board.o uart.o $(DBG_OBJ))
OBJS-denano=$(addprefix $(BUILD_DIR)/, startup.o kernel.o cop0.o libsys.o srec.o board.o uart.o $(DBG_OBJ))
OBJS-sim=$(addprefix $(BUILD_DIR)/, startup.o kernel.o cop0.o libsys.o srec.o board.o uart.o $(DBG_OBJ))
$(BUILD_DIR)/cop0.o : ../libsys/cop0.c
$(CC) $(CFLAGS) -c -o $@ $<
+1 -1
View File
@@ -5,7 +5,7 @@
#define MAGIC_EB 0x4A464931 // "JFI1" in big-endian;
#define MAGIC_EL 0x3149464A // "JFI1" in little-endian;
extern uint32_t getBootOffset(uint32_t sel);
extern uint32_t getBootOffset(uint32_t sel) __attribute__ ((used));
typedef struct _sflash_img_hdr_t
{
+1
View File
@@ -49,6 +49,7 @@ FLASHGEN=flashgen
OBJS-ml402=$(addprefix $(BUILD_DIR)/, libsys.o xcpt.o syscalls.o cop0.o irq.o $(DBG_OBJ) console.o uart.o board.o gpio.o mips_ps2.o mips_gfx.o screen.o)
OBJS-denano=$(addprefix $(BUILD_DIR)/, libsys.o xcpt.o syscalls.o cop0.o irq.o $(DBG_OBJ) console.o uart.o board.o gpio.o)
OBJS-sim=$(addprefix $(BUILD_DIR)/, libsys.o xcpt.o syscalls.o cop0.o irq.o $(DBG_OBJ) console.o uart.o board.o gpio.o)
all: $(BUILD_DIR) $(BUILD_DIR)/libsys.a
+1 -1
View File
@@ -20,7 +20,7 @@
extern int paranoia(int argc, char **argv);
gpio_if_t gpio_if;
uint32_t test_icache_instr[] =
const uint32_t test_icache_instr[] =
{
0x27bdfff8, // addiu sp,sp,-8
0xafbe0004, // sw s8,4(sp)
+2 -2
View File
@@ -31,7 +31,7 @@ if [ ! -e ./$SRC_BINUTILS-build ]; then
echo Building $SRC_BINUTILS
mkdir -p $SRC_BINUTILS-build
cd $SRC_BINUTILS-build
../$SRC_BINUTILS/configure --target=$TARGET --prefix=$PREFIX || exit 1
../$SRC_BINUTILS/configure --target=$TARGET --prefix=$PREFIX --enable-plugins --enable-lto || exit 1
make -j4 || exit 1
make install || exit 1
cd ..
@@ -171,7 +171,7 @@ if [ ! -e ./$SRC_GCC-build ]; then
echo Building $SRC_GCC
mkdir -p $SRC_GCC-build
cd $SRC_GCC-build
../$SRC_GCC/configure --target=$TARGET --prefix=$PREFIX --with-gmp=$PREFIX --with-mpfr=$PREFIX --with-mpc=$PREFIX --with-float=soft --with-newlib --verbose --enable-languages="c,c++" --with-gnu-as --with-gnu-ld || exit 1
../$SRC_GCC/configure --target=$TARGET --prefix=$PREFIX --with-gmp=$PREFIX --with-mpfr=$PREFIX --with-mpc=$PREFIX --with-float=soft --with-newlib --verbose --enable-languages="c,c++" --with-gnu-as --with-gnu-ld --enable-lto || exit 1
make -j4 all || exit 1
make info || exit 1
make install || exit 1