1 |
2 |
dimamali |
GRLIB=../..
|
2 |
|
|
TOP=leon3hpe
|
3 |
|
|
|
4 |
|
|
BOARD=ge-hpe-midi-ep2s180
|
5 |
|
|
|
6 |
|
|
include $(GRLIB)/boards/$(BOARD)/Makefile.inc
|
7 |
|
|
DEVICE=$(PART)-$(PACKAGE)$(SPEED)
|
8 |
|
|
UCF=$(GRLIB)/boards/$(BOARD)/$(TOP).ucf
|
9 |
|
|
QSF=$(GRLIB)/boards/$(BOARD)/$(TOP).qsf
|
10 |
|
|
EFFORT=1
|
11 |
|
|
XSTOPT=
|
12 |
|
|
VHDLSYNFILES=config.vhd ahbrom.vhd leon3hpe.vhd
|
13 |
|
|
VHDLSIMFILES=testbench.vhd
|
14 |
|
|
VLOGSIMFILES=spi_slave_model.v
|
15 |
|
|
SIMTOP=testbench
|
16 |
|
|
SDCFILE=$(GRLIB)/boards/$(BOARD)/default.sdc
|
17 |
|
|
BITGEN=$(GRLIB)/boards/$(BOARD)/default.ut
|
18 |
|
|
CLEAN=soft-clean quartus-cpf-clean mkprom-clean
|
19 |
|
|
|
20 |
|
|
TECHLIBS = altera altera_mf stratixii
|
21 |
|
|
LIBSKIP = core1553bbc core1553brm core1553brt gr1553 corePCIF \
|
22 |
|
|
tmtc openchip hynix cypress ihp grusbhc ec ecp2
|
23 |
|
|
DIRSKIP = b1553 pcif leon2 leon2ft crypto satcan pci leon3ft ambatest ddr \
|
24 |
|
|
slink ascs haps coremp7 spacewire
|
25 |
|
|
|
26 |
|
|
include $(GRLIB)/bin/Makefile
|
27 |
|
|
|
28 |
|
|
include $(GRLIB)/software/leon3/Makefile
|
29 |
|
|
|
30 |
|
|
# Select your cable type here.
|
31 |
|
|
# Make sure it has been installed via the programmer GUI
|
32 |
|
|
# in Quartus.
|
33 |
|
|
#
|
34 |
|
|
# Examples:
|
35 |
|
|
# USB-Blaster
|
36 |
|
|
# ByteBlasterMV
|
37 |
|
|
CABLE=USB-Blaster
|
38 |
|
|
QUARTUS_PGM=quartus_pgm
|
39 |
|
|
|
40 |
|
|
|
41 |
|
|
# flags for compilation with gcc
|
42 |
|
|
CFLAGS=-O1 -g -msoft-float
|
43 |
|
|
|
44 |
|
|
################## project specific targets ##########################
|
45 |
|
|
|
46 |
|
|
INCLUDEFILES=$(VPATH)/hpi_functions.c
|
47 |
|
|
|
48 |
|
|
# C files needed for building the hpe_test program
|
49 |
|
|
HPE_INCLUDE_FILES=hpe_test MIO memtest spi sdcard hpi_functions flash_functions adcdac adda_func tests
|
50 |
|
|
# testpc testpc_prog
|
51 |
|
|
|
52 |
|
|
# C files needed for building the hpe_test program
|
53 |
|
|
TESTPC_INCLUDE_FILES=MIO memtest flash_functions testpc adcdac adda_func testpc_prog
|
54 |
|
|
|
55 |
|
|
# C header files needed for building the hpe_test program
|
56 |
|
|
HPE_HEADER_FILES=Leon3MHe.h MIO.h memtest.h flash_functions.h tests.h testpc.h spi.h sdcard.h adc_dac.h adda_func.h hpi_functions.h
|
57 |
|
|
|
58 |
|
|
# directory where the hpe_test source files reside in
|
59 |
|
|
HPE_INCLUDE_DIR=../../software/gleichmann
|
60 |
|
|
|
61 |
|
|
# C program files
|
62 |
|
|
# ###############
|
63 |
|
|
|
64 |
|
|
# an object file shall be rebuilt if either the corresponding c file
|
65 |
|
|
# or one of the header files has changed
|
66 |
|
|
%.o: $(HPE_INCLUDE_DIR)/%.c $(foreach elem, $(HPE_HEADER_FILES), $(HPE_INCLUDE_DIR)/$(elem) )
|
67 |
|
|
$(XAS) -DHPE_MIDI -DEXP_CONN_TEST $(CFLAGS) -I. $< -o $@
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
# mkprom targets
|
71 |
|
|
# ##############
|
72 |
|
|
|
73 |
|
|
# change the settings below to reflect your hardware
|
74 |
|
|
# the frequency is set in the Makefile found in the boards directory
|
75 |
|
|
RAMSIZE=1024
|
76 |
|
|
ROMSIZE=32768
|
77 |
|
|
ROMWS=3
|
78 |
|
|
BAUD=38400
|
79 |
|
|
FREQ=40
|
80 |
|
|
|
81 |
|
|
# ROM version of the test program
|
82 |
|
|
hpe_test.mkprom: hpe_test.exe #$(addsuffix .o, $(HPE_INCLUDE_FILES))
|
83 |
|
|
sparc-elf-mkprom -dump -baud $(BAUD) -freq $(FREQ) $^ -msoft-float -romws $(ROMWS) -romsize $(ROMSIZE) -rmw -ramsize $(RAMSIZE) -v -o $@
|
84 |
|
|
|
85 |
|
|
mkprom-clean:
|
86 |
|
|
-rm -f hpe_test.mkprom
|
87 |
|
|
|
88 |
|
|
### HPI TEST PROGRAM ###################################################
|
89 |
|
|
|
90 |
|
|
HPI_INCLUDE_FILES= hpi_test hpi_functions
|
91 |
|
|
HPI_HEADER_FILES= hpi_functions.h hpi_defs.h
|
92 |
|
|
HPI_INCLUDE_DIR=../../software/gleichmann
|
93 |
|
|
|
94 |
|
|
|
95 |
|
|
%.o: $(HPI_INCLUDE_DIR)/%.c $(foreach elem, $(HPI_HEADER_FILES), $(HPI_INCLUDE_DIR)/$(elem) )
|
96 |
|
|
$(XAS) -DHPE_MIDI $(XCFLAGS) -I. $< -o $@
|
97 |
|
|
|
98 |
|
|
hpi_test.exe: $(addsuffix .o, $(HPI_INCLUDE_FILES))
|
99 |
|
|
$(XCC) $(XCFLAGS) -Ttext=0x40000000 -o hpi_test.exe $(addsuffix .o, $(HPI_INCLUDE_FILES))
|
100 |
|
|
|
101 |
|
|
# QUARTUS configuration
|
102 |
|
|
# #####################
|
103 |
|
|
|
104 |
|
|
# FPGA programming
|
105 |
|
|
quartus-pgm:
|
106 |
|
|
$(QUARTUS_PGM) -c $(CABLE) -m JTAG -o p\;$(TOP).sof\;@2
|
107 |
|
|
|
108 |
|
|
# JTAG indirect programming of the serial configuration device
|
109 |
|
|
# use upper connector on the module for that
|
110 |
|
|
quartus-cfg-jic: $(TOP).jic
|
111 |
|
|
$(QUARTUS_PGM) -c $(CABLE) -m JTAG -o pvbi\;$(TOP).jic
|
112 |
|
|
|
113 |
|
|
# Active serial programming of the serial configuration device
|
114 |
|
|
# use lower connector on the module for that
|
115 |
|
|
quartus-cfg-pof: $(TOP).pof
|
116 |
|
|
$(QUARTUS_PGM) -c $(CABLE) -m ASC -o pl\;$(TOP).pof
|
117 |
|
|
|
118 |
|
|
quartus_cpf.opt:
|
119 |
|
|
echo BITSTREAM_COMPRESSION=ON > quartus_cpf.opt
|
120 |
|
|
|
121 |
|
|
$(TOP).jic: quartus_cpf.opt $(TOP).sof
|
122 |
|
|
quartus_cpf -c --option=quartus_cpf.opt -d $(CONFDEVICE) -s $(PART) $(TOP).sof $(TOP).jic
|
123 |
|
|
|
124 |
|
|
$(TOP).pof: quartus_cpf.opt $(TOP).sof
|
125 |
|
|
quartus_cpf -c --option=quartus_cpf.opt -d $(CONFDEVICE) $(TOP).sof $(TOP).pof
|
126 |
|
|
|
127 |
|
|
quartus-cpf: $(TOP).jic $(TOP).pof
|
128 |
|
|
|
129 |
|
|
quartus-cpf-clean:
|
130 |
|
|
-rm -f quartus_cpf.opt $(TOP).jic $(TOP).pof
|
131 |
|
|
|