blob: 980969ef3e988d929dd168fb976cc3c5d904aae0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
PROJ=pong3
SRCS=$(wildcard *.vhd *.v *.qsf *.qpf )
SRCS += $(shell find DM9000A -type f -print )
SRCS += $(shell find GPU -type f -print )
#CSRC=${SRC:src/%=%}
#CSDIRS=${SDIRS:src/%=%}
#ELFDIR=../software/pong3
BSPDIR=../software/pong3_bsp
sta.stamp:asm.stamp
tools/wrap quartus_sta pong3 -c pong3
touch $@
asm.stamp:fit.stamp
tools/wrap quartus_asm --read_settings_files=off --write_settings_files=off pong3 -c pong3
touch $@
fit.stamp: ans.stamp
tools/wrap quartus_fit --read_settings_files=off --write_settings_files=off pong3 -c pong3
touch $@
ans.stamp: source.stamp
tools/wrap quartus_map --read_settings_files=on --write_settings_files=off ${PROJ} -c ${PROJ}
touch $@
source.stamp:${SRC}
touch source.stamp
ELF=pong3.elf
SOPCINFO=../my_sys.sopcinfo
SOF=../pong3.sof
run: load_elf.stamp
./wrap.sh nios2-terminal
flash: load_sof.stamp sof.flash elf.flash ${BSPDIR}/system.h
BASE=` grep EPCS_FLASH_CONTROLLER_0_BASE ${BSPDIR}/system.h | awk '{print $$3}' ` && \
./wrap.sh nios2-flash-programmer sof.flash --base=$${BASE} --epcs --accept-bad-sysid --device=1 --instance=0 --program --verbose && \
./wrap.sh nios2-flash-programmer elf.flash --base=$${BASE} --epcs --accept-bad-sysid --device=1 --instance=0 --program --verbose -g
sof.flash: ${SOF}
./wrap.sh sof2flash --input=$< --output=$@ --epcs --verbose
elf.flash: ${ELFDIR}/${ELF} sof.flash
./wrap.sh elf2flash --input=${ELFDIR}/${ELF} --output=$@ --epcs --after=sof.flash --verbose
load_elf.stamp:${ELFDIR}/${ELF} load_sof.stamp
./wrap.sh nios2-download ${ELFDIR}/${ELF} -g
load_sof.stamp: ${SOF}
./wrap.sh quartus_pgm -m JTAG -o 'p;../pong3.sof'
${ELFDIR}/${ELF}: ${BSPDIR}/libhal_bsp.a $(wildcard ${ELFDIR}/*.[chHC])
./wrap.sh ${MAKE} -C ${ELFDIR}
${BSPDIR}/libhal_bsp.a:${BSPDIR}/system.h
./wrap.sh ${MAKE} -C ${BSPDIR}
${BSPDIR}/system.h:${SOPCINFO}
rm -f $@
(cd ${BSPDIR} && ${PWD}/wrap.sh ./create-this-bsp )
clean:
./wrap.sh ${MAKE} -C ${BSPDIR} clean
./wrap.sh ${MAKE} -C ${ELFDIR} clean
/bin/rm -f sof.flash elf.flash
/bin/rm -rf ${BSPDIR}/drivers ${BSPDIR}/HAL ${BSPDIR}/linker.h ${BSPDIR}/linker.x ${BSPDIR}/system.h ${BSPDIR}/summary.html ${BSPDIR}/public.mk ${BSPDIR}/mem_init.mk ${BSPDIR}/memory.gdb ${BSPDIR}/alt_sys_init.c
|