1 |
16 |
dgisselq |
############################################################################
|
2 |
|
|
##
|
3 |
|
|
## Filename: Makefile
|
4 |
|
|
##
|
5 |
|
|
## Project: A Doubletime Pipelined FFT
|
6 |
|
|
##
|
7 |
|
|
## Purpose: This programs the build process for the test benches
|
8 |
|
|
## associated with the double clocked FFT project. These
|
9 |
|
|
## test benches are designed for the size and arguments of the
|
10 |
|
|
## FFT as given by the Makefile in the trunk/sw directory,
|
11 |
|
|
## although they shouldn't be too difficult to modify for
|
12 |
|
|
## other FFT parameters.
|
13 |
|
|
##
|
14 |
|
|
## Please note that running these test benches requires access
|
15 |
|
|
## to the *cmem_*.hex files found in trunk/sw/fft-core. I
|
16 |
|
|
## usually soft link them into this directory, but such linking
|
17 |
|
|
## is not currently part of this makefile or the build scripts.
|
18 |
|
|
##
|
19 |
|
|
## Creator: Dan Gisselquist, Ph.D.
|
20 |
|
|
## Gisselquist Tecnology, LLC
|
21 |
|
|
##
|
22 |
|
|
##########################################################################/
|
23 |
|
|
##
|
24 |
|
|
## Copyright (C) 2015, Gisselquist Technology, LLC
|
25 |
|
|
##
|
26 |
|
|
## This program is free software (firmware): you can redistribute it and/or
|
27 |
|
|
## modify it under the terms of the GNU General Public License as published
|
28 |
|
|
## by the Free Software Foundation, either version 3 of the License, or (at
|
29 |
|
|
## your option) any later version.
|
30 |
|
|
##
|
31 |
|
|
## This program is distributed in the hope that it will be useful, but WITHOUT
|
32 |
|
|
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
33 |
|
|
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
34 |
|
|
## for more details.
|
35 |
|
|
##
|
36 |
|
|
## You should have received a copy of the GNU General Public License along
|
37 |
|
|
## with this program. (It's in the $(ROOT)/doc directory, run make with no
|
38 |
|
|
## target there if the PDF file isn't present.) If not, see
|
39 |
|
|
## for a copy.
|
40 |
|
|
##
|
41 |
|
|
## License: GPL, v3, as defined and found on www.gnu.org,
|
42 |
|
|
## http:##www.gnu.org/licenses/gpl.html
|
43 |
|
|
##
|
44 |
|
|
##
|
45 |
|
|
##########################################################################/
|
46 |
6 |
dgisselq |
all: mpy_tb dblrev_tb dblstage_tb qtrstage_tb fft_tb test
|
47 |
3 |
dgisselq |
|
48 |
|
|
OBJDR:= ../../sw/fft-core/obj_dir
|
49 |
16 |
dgisselq |
VSRCD = ../../sw/fft-core
|
50 |
|
|
TBODR:= ../rtl/obj_dir
|
51 |
|
|
VINC := -I/usr/share/verilator/include -I$(OBJDR)/ -I$(TBODR)/
|
52 |
3 |
dgisselq |
MPYLB:= $(OBJDR)/Vshiftaddmpy__ALL.a
|
53 |
|
|
DBLRV:= $(OBJDR)/Vdblreverse__ALL.a
|
54 |
|
|
DBLSG:= $(OBJDR)/Vdblstage__ALL.a
|
55 |
|
|
QTRSG:= $(OBJDR)/Vqtrstage__ALL.a
|
56 |
5 |
dgisselq |
BFLYL:= $(OBJDR)/Vbutterfly__ALL.a
|
57 |
22 |
dgisselq |
HWBFY:= $(OBJDR)/Vhwbfly__ALL.a
|
58 |
6 |
dgisselq |
FFTLB:= $(OBJDR)/Vfftmain__ALL.a
|
59 |
16 |
dgisselq |
IFTLB:= $(TBODR)/Vifft_tb__ALL.a
|
60 |
6 |
dgisselq |
STGLB:= $(OBJDR)/Vfftstage_o2048__ALL.a
|
61 |
3 |
dgisselq |
VERILATOR_ROOT := /usr/share/verilator
|
62 |
|
|
|
63 |
|
|
mpy_tb: mpy_tb.cpp $(MPYLB)
|
64 |
|
|
g++ -g $(VINC) $< $(MPYLB) $(VERILATOR_ROOT)/include/verilated.cpp -o $@
|
65 |
|
|
|
66 |
23 |
dgisselq |
dblrev_tb: dblrev_tb.cpp twoc.cpp twoc.h $(DBLRV)
|
67 |
|
|
g++ -g $(VINC) $< twoc.cpp $(DBLRV) $(VERILATOR_ROOT)/include/verilated.cpp -o $@
|
68 |
3 |
dgisselq |
|
69 |
23 |
dgisselq |
dblstage_tb: dblstage_tb.cpp twoc.cpp twoc.h $(DBLSG)
|
70 |
|
|
g++ -g $(VINC) $< twoc.cpp $(DBLSG) $(VERILATOR_ROOT)/include/verilated.cpp -o $@
|
71 |
3 |
dgisselq |
|
72 |
23 |
dgisselq |
qtrstage_tb: qtrstage_tb.cpp twoc.cpp twoc.h $(QTRSG)
|
73 |
|
|
g++ -g $(VINC) $< twoc.cpp $(QTRSG) $(VERILATOR_ROOT)/include/verilated.cpp -o $@
|
74 |
3 |
dgisselq |
|
75 |
23 |
dgisselq |
butterfly_tb: butterfly_tb.cpp twoc.cpp twoc.h $(BFLYL)
|
76 |
|
|
g++ -g $(VINC) $< twoc.cpp $(BFLYL) $(VERILATOR_ROOT)/include/verilated.cpp -o $@
|
77 |
5 |
dgisselq |
|
78 |
23 |
dgisselq |
hwbfly_tb: hwbfly_tb.cpp twoc.cpp twoc.h $(HWBFY)
|
79 |
|
|
g++ -g $(VINC) $< twoc.cpp $(HWBFY) $(VERILATOR_ROOT)/include/verilated.cpp -o $@
|
80 |
22 |
dgisselq |
|
81 |
23 |
dgisselq |
fftstage_o2048_tb: fftstage_o2048_tb.cpp twoc.cpp twoc.h $(STGLB)
|
82 |
|
|
g++ -g $(VINC) $< twoc.cpp $(STGLB) $(VERILATOR_ROOT)/include/verilated.cpp -o $@
|
83 |
6 |
dgisselq |
|
84 |
23 |
dgisselq |
fft_tb: fft_tb.cpp twoc.cpp twoc.h $(FFTLB)
|
85 |
|
|
g++ -g $(VINC) $< twoc.cpp $(FFTLB) $(VERILATOR_ROOT)/include/verilated.cpp -lfftw3 -o $@
|
86 |
6 |
dgisselq |
|
87 |
23 |
dgisselq |
ifft_tb: ifft_tb.cpp twoc.cpp twoc.h $(IFTLB)
|
88 |
|
|
g++ -g $(VINC) $< twoc.cpp $(IFTLB) $(VERILATOR_ROOT)/include/verilated.cpp -lfftw3 -o $@
|
89 |
|
|
|
90 |
16 |
dgisselq |
.PHONY: HEX
|
91 |
|
|
# HEX: cmem_e2048.hex cmem_e1024.hex cmem_e512.hex cmem_e256.hex
|
92 |
|
|
# HEX: cmem_o2048.hex cmem_o1024.hex cmem_o512.hex cmem_o256.hex
|
93 |
|
|
# HEX: icmem_e2048.hex icmem_e1024.hex icmem_e512.hex icmem_e256.hex
|
94 |
|
|
# HEX: icmem_o2048.hex icmem_o1024.hex icmem_o512.hex icmem_o256.hex
|
95 |
|
|
# HEX: cmem_e128.hex cmem_e64.hex cmem_e32.hex cmem_e16.hex cmem_e8.hex
|
96 |
|
|
# HEX: cmem_o128.hex cmem_o64.hex cmem_o32.hex cmem_o16.hex cmem_o8.hex
|
97 |
|
|
# HEX: icmem_e128.hex icmem_e64.hex icmem_e32.hex icmem_e16.hex icmem_e8.hex
|
98 |
|
|
# HEX: icmem_o128.hex icmem_o64.hex icmem_o32.hex icmem_o16.hex icmem_o8.hex
|
99 |
|
|
# cmem_%.hex: $(VSRCD)/cmem_%.hex
|
100 |
|
|
# echo ln -s $* $<
|
101 |
|
|
HEX:
|
102 |
|
|
ln -s $(VSRCD)/*.hex .
|
103 |
14 |
dgisselq |
|
104 |
5 |
dgisselq |
.PHONY: test
|
105 |
6 |
dgisselq |
test: mpy_tb dblrev_tb dblstage_tb qtrstage_tb butterfly_tb fftstage_o2048_tb
|
106 |
22 |
dgisselq |
test: fft_tb ifft_tb hwbfly_tb
|
107 |
5 |
dgisselq |
./mpy_tb
|
108 |
|
|
./dblrev_tb
|
109 |
|
|
./dblstage_tb
|
110 |
|
|
./qtrstage_tb
|
111 |
|
|
./butterfly_tb
|
112 |
22 |
dgisselq |
./hwbfly_tb
|
113 |
6 |
dgisselq |
./fftstage_o2048_tb
|
114 |
|
|
./fft_tb
|
115 |
14 |
dgisselq |
./ifft_tb
|
116 |
5 |
dgisselq |
|
117 |
|
|
.PHONY: clean
|
118 |
3 |
dgisselq |
clean:
|
119 |
23 |
dgisselq |
rm -f mpy_tb dblrev_tb dblstage_tb qtrstage_tb butterfly_tb
|
120 |
|
|
rm -f fftstage_o2048_tb fft_tb ifft_tb hwbfly_tb
|
121 |
16 |
dgisselq |
rm -rf fft_tb.dbl ifft_tb.dbl
|
122 |
|
|
rm -rf *cmem_*.hex
|
123 |
3 |
dgisselq |
|
124 |
|
|
include $(VERILATOR_ROOT)/include/verilated.mk
|