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

Subversion Repositories ion

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

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 213 ja_rd
# Set to > 0 to initialize and enable the cache before running the tests
15
TEST_CACHE = 1
16 50 ja_rd
 
17 66 ja_rd
LFLAGS = -Ttext $(BRAM_START) -Tdata $(XRAM_START) -eentry -I elf32-big
18 109 ja_rd
LFLAGS_FLASH = -Ttext $(FLASH_START) -eflash_test -I elf32-big
19 50 ja_rd
 
20 185 ja_rd
OBJS = memtest.o
21 109 ja_rd
 
22 185 ja_rd
#-- Configuration --------------------------------------------------------------
23 50 ja_rd
 
24 185 ja_rd
# Set to !=0 to test execution from flash
25
# (Set to 0 if running on real HW on which you have no initialized FLASH)
26
EXEC_FLASH = 1
27 50 ja_rd
 
28 185 ja_rd
#-- Targets & rules ------------------------------------------------------------
29 50 ja_rd
 
30 185 ja_rd
#-- Main target -- build code for BRAM and FLASH
31
memtest:  memtest.code memtest.data flash.bin
32
        -@# This comment prevents triggering the default rule. Instead, make will
33
        -@# invoke our rules for the dependencies.
34
 
35
#-- Targets for main code to be run from BRAM
36
 
37
memtest.o: memtest.s
38 213 ja_rd
        $(AS) -defsym TEST_CACHE=$(TEST_CACHE) -defsym EXEC_FLASH=$(EXEC_FLASH) \
39 185 ja_rd
    -defsym XRAM_BASE=$(XRAM_START) -o memtest.o memtest.s
40
 
41
memtest.axf: memtest.o
42
        $(LD) $(LFLAGS) -Map memtest.map -s -N -o memtest.axf memtest.o
43
        -@$(DUMP) -I elf32-big --disassemble memtest.axf > memtest.lst
44
 
45
# Dump code and data to separate binaries (data binary will be empty but
46
# TB2 needs it anyway)
47
 
48
memtest.code: memtest.axf
49
        $(COPY) -I elf32-big -j .text -j .rodata -O binary memtest.axf memtest.code
50
memtest.data: memtest.axf
51
        $(COPY) -I elf32-big -j .sbss -j .data -j .bss -O binary memtest.axf memtest.data
52
 
53
#-- Targets for code to be run from FLASH
54
 
55
flash.o: flash.s
56 213 ja_rd
        $(AS) -defsym TEST_CACHE=$(TEST_CACHE) -defsym FLASH_BASE=$(FLASH_START) -o flash.o flash.s
57 185 ja_rd
 
58
flash.axf: flash.o
59
        $(LD) $(LFLAGS_FLASH) -Map flash.map -s -N -o flash.axf flash.o
60
        -@$(DUMP) -I elf32-big --disassemble flash.axf > flash.lst
61
 
62
flash.bin: flash.axf
63
        $(COPY) -I elf32-big -j .text -j .rodata -O binary flash.axf flash.bin
64
 
65
 
66
 
67
#-- Targets that build the synthesizable vhdl; meant for direct invocation -----
68
 
69 50 ja_rd
# Create VHDL file for simulation test bench using TB2 template
70 193 ja_rd
sim: memtest demo
71 109 ja_rd
        $(TO_VHDL) --code memtest.code --data memtest.data --log_trigger=0xbfc00000 \
72 149 ja_rd
                --flash flash.bin --flash_size 4096 \
73 50 ja_rd
                --code_size $(CODE_BRAM_SIZE) --data_size $(XRAM_SIZE) \
74
                -s $(SIM_LENGTH) -v $(SRC_DIR)\\mips_tb2_template.vhdl \
75
                -o $(TB_DIR)\\mips_tb2.vhdl -e mips_tb2
76 193 ja_rd
        $(TO_VHDL) --code memtest.code --data memtest.data --log_trigger=0xbfc00000 \
77
                --flash flash.bin --flash_size 4096 \
78
                --code_size $(CODE_BRAM_SIZE) --data_size $(XRAM_SIZE) \
79
                -s $(SIM_LENGTH) -v $(SRC_DIR)/sim_params_template.vhdl \
80
                -o $(TB_DIR)/sim_params_pkg.vhdl -e mips_tb2
81 50 ja_rd
 
82
 
83
# Create VHDL file for hardware demo
84 185 ja_rd
demo: memtest
85 149 ja_rd
        $(TO_VHDL) --code memtest.code --data memtest.data --log_trigger=0xb0000000 \
86 50 ja_rd
        --code_size $(CODE_BRAM_SIZE) --data_size $(XRAM_SIZE) \
87 191 ja_rd
        -v $(SRC_DIR)/code_rom_template.vhdl  -n "Memory test" \
88
        -o $(DEMO_DIR)/code_rom_pkg.vhdl
89 185 ja_rd
 
90
 
91
#-- And now the usual housekeeping stuff ---------------------------------------
92
 
93
.PHONY: clean
94
 
95
clean:
96
        -$(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.