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

Subversion Repositories ion

[/] [ion/] [trunk/] [src/] [memtest/] [makefile] - Blame information for rev 191

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

Line No. Rev Author Line
1 185 ja_rd
#-- Bring toolchain config parameters from the common makefile -----------------
2 191 ja_rd
include ../common/makefile
3 50 ja_rd
 
4
# We'll run the simulation for long enough to complete the test
5 109 ja_rd
SIM_LENGTH = 400000
6 66 ja_rd
 
7
# FPGA Block RAM parameters
8
BRAM_START = 0xbfc00000
9 50 ja_rd
CODE_BRAM_SIZE = 2048
10 109 ja_rd
FLASH_START = 0xb0000000
11 66 ja_rd
# External RAM parameters (size in words)
12 50 ja_rd
XRAM_SIZE = 1024
13 90 ja_rd
XRAM_START = 0x00000000
14 50 ja_rd
 
15 66 ja_rd
 
16
LFLAGS = -Ttext $(BRAM_START) -Tdata $(XRAM_START) -eentry -I elf32-big
17 109 ja_rd
LFLAGS_FLASH = -Ttext $(FLASH_START) -eflash_test -I elf32-big
18 50 ja_rd
 
19 185 ja_rd
OBJS = memtest.o
20 109 ja_rd
 
21 185 ja_rd
#-- Configuration --------------------------------------------------------------
22 50 ja_rd
 
23 185 ja_rd
# Set to !=0 to test execution from flash
24
# (Set to 0 if running on real HW on which you have no initialized FLASH)
25
EXEC_FLASH = 1
26 50 ja_rd
 
27 185 ja_rd
#-- Targets & rules ------------------------------------------------------------
28 50 ja_rd
 
29 185 ja_rd
#-- Main target -- build code for BRAM and FLASH
30
memtest:  memtest.code memtest.data flash.bin
31
        -@# This comment prevents triggering the default rule. Instead, make will
32
        -@# invoke our rules for the dependencies.
33
 
34
#-- Targets for main code to be run from BRAM
35
 
36
memtest.o: memtest.s
37
        $(AS) -defsym TEST_CACHE=1 -defsym EXEC_FLASH=$(EXEC_FLASH) \
38
    -defsym XRAM_BASE=$(XRAM_START) -o memtest.o memtest.s
39
 
40
memtest.axf: memtest.o
41
        $(LD) $(LFLAGS) -Map memtest.map -s -N -o memtest.axf memtest.o
42
        -@$(DUMP) -I elf32-big --disassemble memtest.axf > memtest.lst
43
 
44
# Dump code and data to separate binaries (data binary will be empty but
45
# TB2 needs it anyway)
46
 
47
memtest.code: memtest.axf
48
        $(COPY) -I elf32-big -j .text -j .rodata -O binary memtest.axf memtest.code
49
memtest.data: memtest.axf
50
        $(COPY) -I elf32-big -j .sbss -j .data -j .bss -O binary memtest.axf memtest.data
51
 
52
#-- Targets for code to be run from FLASH
53
 
54
flash.o: flash.s
55
        $(AS) -defsym TEST_CACHE=1 -defsym FLASH_BASE=$(FLASH_START) -o flash.o flash.s
56
 
57
flash.axf: flash.o
58
        $(LD) $(LFLAGS_FLASH) -Map flash.map -s -N -o flash.axf flash.o
59
        -@$(DUMP) -I elf32-big --disassemble flash.axf > flash.lst
60
 
61
flash.bin: flash.axf
62
        $(COPY) -I elf32-big -j .text -j .rodata -O binary flash.axf flash.bin
63
 
64
 
65
 
66
#-- Targets that build the synthesizable vhdl; meant for direct invocation -----
67
 
68 50 ja_rd
# Create VHDL file for simulation test bench using TB2 template
69 185 ja_rd
sim: memtest
70 109 ja_rd
        $(TO_VHDL) --code memtest.code --data memtest.data --log_trigger=0xbfc00000 \
71 149 ja_rd
                --flash flash.bin --flash_size 4096 \
72 50 ja_rd
                --code_size $(CODE_BRAM_SIZE) --data_size $(XRAM_SIZE) \
73
                -s $(SIM_LENGTH) -v $(SRC_DIR)\\mips_tb2_template.vhdl \
74
                -o $(TB_DIR)\\mips_tb2.vhdl -e mips_tb2
75
 
76
 
77
# Create VHDL file for hardware demo
78 185 ja_rd
demo: memtest
79 149 ja_rd
        $(TO_VHDL) --code memtest.code --data memtest.data --log_trigger=0xb0000000 \
80 50 ja_rd
        --code_size $(CODE_BRAM_SIZE) --data_size $(XRAM_SIZE) \
81 191 ja_rd
        -v $(SRC_DIR)/code_rom_template.vhdl  -n "Memory test" \
82
        -o $(DEMO_DIR)/code_rom_pkg.vhdl
83 185 ja_rd
 
84
 
85
#-- And now the usual housekeeping stuff ---------------------------------------
86
 
87
.PHONY: clean
88
 
89
clean:
90
        -$(RM) *.o *.obj *.map *.lst *.hex *.exe *.axf *.code *.data *.bin

powered by: WebSVN 2.1.0

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