forked from russdill/bch_verilog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.xilinx
181 lines (148 loc) · 3.73 KB
/
Makefile.xilinx
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
PART=xc6vlx240t-3-ff784
UCF=xilinx.ucf
M_MP=2
P_MP=4
XFLAGS=\
-p $(firstword $($*_PART) $(PART)) \
-generics {$(GENERICS) $($*_GENERICS)} \
-define {$(DEFINES) $($*_DEFINES)} \
-loop_iteration_limit 10000000 \
-opt_level 2 \
-reduce_control_sets no \
-ifmt mixed \
-ofmt NGC
NFLAGS=\
-p $(firstword $($*_PART) $(PART)) \
$(patsubst %,-uc %,$($*_UCF) $(UCF))
MFLAGS=\
-pr b \
-mt $(M_MP) \
-global_opt speed \
-logic_opt on \
-lc auto \
-detail
PFLAGS=\
-mt $(P_MP)
core_VERILOG=\
bch_math.v \
util.v \
matrix.v
syndrome_VERILOG=\
bch_syndrome.v \
bch_syndrome_method1.v \
bch_syndrome_method2.v
xilinx_inverter_VERILOG=\
$(core_VERILOG) \
benchmark/xilinx_inverter.v
xilinx_encode_VERILOG=\
$(core_VERILOG) \
benchmark/xilinx_encode.v \
bch_encode.v
xilinx_syndrome_VERILOG=\
$(core_VERILOG) \
$(syndrome_VERILOG) \
benchmark/xilinx_syndrome.v
xilinx_parallel_VERILOG=\
$(core_VERILOG) \
$(syndrome_VERILOG) \
benchmark/xilinx_parallel.v \
bch_sigma_bma_parallel.v
xilinx_noinv_VERILOG=\
$(core_VERILOG) \
$(syndrome_VERILOG) \
benchmark/xilinx_noinv.v \
bch_sigma_bma_noinv.v
xilinx_serial_VERILOG=\
$(core_VERILOG) \
$(syndrome_VERILOG) \
benchmark/xilinx_serial.v \
bch_sigma_bma_serial.v
xilinx_error_dec_VERILOG=\
$(core_VERILOG) \
benchmark/xilinx_error_dec.v \
bch_error_dec.v \
bch_chien.v
xilinx_error_tmec_VERILOG=\
$(core_VERILOG) \
compare_cla.v \
benchmark/xilinx_error_tmec.v \
bch_error_tmec.v \
bch_chien.v
xilinx_error_one_VERILOG=\
$(core_VERILOG) \
benchmark/xilinx_error_one.v \
bch_error_one.v \
bch_chien.v
xilinx_decoder_VERILOG=\
$(core_VERILOG) \
$(syndrome_VERILOG) \
compare_cla.v \
benchmark/xilinx_decoder.v \
bch_error_tmec.v \
bch_chien.v \
bch_sigma_bma_serial.v
xilinx_mdecoder_VERILOG=\
$(core_VERILOG) \
$(syndrome_VERILOG) \
compare_cla.v \
benchmark/xilinx_mdecoder.v \
bch_decoder.v \
bch_error_tmec.v \
bch_error_one.v \
bch_chien.v \
bch_sigma_bma_serial.v
.SECONDEXPANSION:
all:
-include $(wildcard .*.d)
CLEAN_FILES += .*.d
.%.prj: FORCE
@echo '$(patsubst %,verilog work "%",$($*_VERILOG))' | sed 's/" /"\n/g'> [email protected]
.PRECIOUS: .%.prj
CLEAN_FILES += .*.prj
.%.xopt: FORCE
@echo run $($*_XFLAGS) $(XFLAGS) -top $(firstword $($*_TOP) $*) -ifn .$*.prj -ofn $*.ngc > [email protected]
.PRECIOUS: .%.xopt
CLEAN_FILES += .*.xopt
.%.nopt: FORCE
@echo $($*_NFLAGS) $(NFLAGS) > [email protected]
.PRECIOUS: .%.nopt
CLEAN_FILES += .*.nopt
.%.mopt: FORCE
@echo $($*_MFLAGS) $(MFLAGS) > [email protected]
.PRECIOUS: .%.mopt
CLEAN_FILES += .*.mopt
.%.popt: FORCE
@echo $($*_PFLAGS) $(PFLAGS) > [email protected]
.PRECIOUS: .%.popt
CLEAN_FILES += .*.popt
%.ngc: .%.prj .%.xopt
@scripts/makedeps.sh $* $($*_VERILOG) > [email protected]
xst -ifn .$*.xopt
.PRECIOUS: .%.ngc
CLEAN_FILES += *.ngc
%.ngd: %.ngc .%.nopt $$($$*_UCF) $(UCF)
ngdbuild -f .$*.nopt $<
.PRECIOUS: %.ngd
CLEAN_FILES += *.ngd
%.ncd: %.ngd .%.mopt
map -w -f .$*.mopt $<
.PRECIOUS: %.ncd
CLEAN_FILES += *.ncd
# FIXME: Make < 4.0 has trouble with this
%_par.ncd: %.ncd .%.popt
par -w -f .$*.popt $< $@
.PRECIOUS: %_par.ncd
%.twr %.twx: %_par.ncd
trce -v $< $*.pcf -o $*.twr -xml $*.twx
CLEAN_FILES += *.twr *.twx
CLEAN_FILES += *.xpi *_par_pad.csv *_par_pad.txt *.ptwx *.unroutes *.xrpt *.pcf *_summary.xml *_usage.xml *.bld *.lso *.map
CLEAN_FILES += *.mrp *.ngm *_par.pad *_par.par *.srp .*.srp
CLEAN_FILES += _xmsgs/ netlist.lst xlnx_auto_0_xdb/ xst/
clean:
-rm -rf $(CLEAN_FILES)
FORCE: