-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
283 lines (205 loc) · 9.07 KB
/
Makefile
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
THREADS_BUILD ?= 1
CMAKE_CXX_COMPILER :=
ifneq ($(origin CXX_COMPILER), undefined)
CMAKE_CXX_COMPILER := -DCMAKE_CXX_COMPILER=$(CXX_COMPILER)
endif
init:
git submodule update --init --recursive
$(MAKE) -C ./dut/CoupledL2 init
$(MAKE) -C ./dut/OpenLLC init
FORCE:
tltest-prepare-all:
cmake ./main -B ./main/build -DBUILD_DPI=ON -DBUILD_V3=ON $(CMAKE_CXX_COMPILER)
tltest-prepare-dpi:
cmake ./main -B ./main/build -DBUILD_DPI=ON -DBUILD_V3=OFF $(CMAKE_CXX_COMPILER)
tltest-prepare-v3:
cmake ./main -B ./main/build -DBUILD_V3=ON -DBUILD_DPI=OFF $(CMAKE_CXX_COMPILER)
tltest-prepare-all-coupledL2:
cmake ./main -B ./main/build -DBUILD_DPI=ON -DBUILD_V3=ON $(CMAKE_CXX_COMPILER) \
-DDUT_PATH="${PWD}/dut/CoupledL2"
tltest-prepare-dpi-coupledL2:
cmake ./main -B ./main/build -DBUILD_DPI=ON -DBUILD_V3=OFF $(CMAKE_CXX_COMPILER) \
-DDUT_PATH="${PWD}/dut/CoupledL2"
tltest-prepare-v3-coupledL2:
cmake ./main -B ./main/build -DBUILD_V3=ON -DBUILD_DPI=OFF $(CMAKE_CXX_COMPILER) \
-DDUT_PATH="${PWD}/dut/CoupledL2"
tltest-prepare-all-openLLC:
cmake ./main -B ./main/build -DBUILD_DPI=ON -DBUILD_V3=ON $(CMAKE_CXX_COMPILER) \
-DDUT_PATH="${PWD}/dut/OpenLLC"
tltest-prepare-dpi-openLLC:
cmake ./main -B ./main/build -DBUILD_DPI=ON -DBUILD_V3=OFF $(CMAKE_CXX_COMPILER) \
-DDUT_PATH="${PWD}/dut/OpenLLC"
tltest-prepare-v3-openLLC:
cmake ./main -B ./main/build -DBUILD_V3=ON -DBUILD_DPI=OFF $(CMAKE_CXX_COMPILER) \
-DDUT_PATH="${PWD}/dut/OpenLLC"
tltest-portgen:
$(MAKE) -C ./main/build portgen -j$(THREADS_BUILD) -s --always-make
tltest-clean:
$(MAKE) -C ./main/build clean -s
tltest-config-user:
@test -d ./main/build || mkdir -p ./main/build
@cat ./configs/user.tltest.ini
@echo ""
@cat ./configs/user.tltest.ini > ./main/build/tltest.ini
@echo "" >> ./main/build/tltest.ini
tltest-config-coupledL2-test-l2l3: tltest-config-user
@cat ./configs/coupledL2-test-l2l3.tltest.ini
@echo ""
@cat ./configs/coupledL2-test-l2l3.tltest.ini >> ./main/build/tltest.ini
@echo "tltest-config-postbuild: tltest-config-coupledL2-test-l2l3" > ./main/build/Makefile.config
tltest-config-coupledL2-test-l2l3l2: tltest-config-user
@cat ./configs/coupledL2-test-l2l3l2.tltest.ini
@echo ""
@cat ./configs/coupledL2-test-l2l3l2.tltest.ini >> ./main/build/tltest.ini
@echo "tltest-config-postbuild: tltest-config-coupledL2-test-l2l3l2" > ./main/build/Makefile.config
tltest-config-openLLC-test-l2l3: tltest-config-user
@cat ./configs/openLLC-test-l2l3.tltest.ini
@echo ""
@cat ./configs/openLLC-test-l2l3.tltest.ini >> ./main/build/tltest.ini
@echo "tltest-config-postbuild: tltest-config-openLLC-test-l2l3" > ./main/build/Makefile.config
tltest-config-openLLC-test-l2l3l2: tltest-config-user
@cat ./configs/openLLC-test-l2l3l2.tltest.ini
@echo ""
@cat ./configs/openLLC-test-l2l3l2.tltest.ini >> ./main/build/tltest.ini
@echo "tltest-config-postbuild: tltest-config-openLLC-test-l2l3l2" > ./main/build/Makefile.config
tltest-config-postbuild:
tltest-build:
$(MAKE) -C ./main/build -j$(THREADS_BUILD) -s
$(MAKE) -C ./main/build portgen -j$(THREADS_BUILD) -s --always-make
tltest-build-all-coupledL2: tltest-prepare-all-coupledL2 tltest-build
tltest-build-dpi-coupledL2: tltest-prepare-dpi-coupledL2 tltest-build
tltest-build-v3-coupledL2: tltest-prepare-v3-coupledL2 tltest-build
tltest-build-all-openLLC: tltest-prepare-all-openLLC tltest-build
tltest-build-dpi-openLLC: tltest-prepare-dpi-openLLC tltest-build
tltest-build-v3-openLLC: tltest-prepare-v3-openLLC tltest-build
coupledL2-compile:
$(MAKE) -C ./dut/CoupledL2 compile
coupledL2-verilog-test-top-l2l3:
$(MAKE) -C ./dut/CoupledL2 test-top-l2l3
coupledL2-verilog-test-top-l2l3l2:
$(MAKE) -C ./dut/CoupledL2 test-top-l2l3l2
coupledL2-verilog-clean:
$(MAKE) -C ./dut/CoupledL2 clean
openLLC-compile:
$(MAKE) -C ./dut/OpenLLC compile
openLLC-verilog-test-top-l2l3:
$(MAKE) -C ./dut/OpenLLC test-top-l2l3
openLLC-verilog-test-top-l2l3l2:
$(MAKE) -C ./dut/OpenLLC test-top-l2l3l2
openLLC-verilog-clean:
$(MAKE) -C ./dut/OpenLLC clean
VERILATOR := verilator
VERILATOR_COMMON_ARGS_COUPLEDL2 := ./dut/CoupledL2/build/*.v \
--Mdir ./verilated \
-O3 \
--trace-fst \
--top TestTop \
--build-jobs $(THREADS_BUILD) --verilate-jobs $(THREADS_BUILD) \
-DSIM_TOP_MODULE_NAME=TestTop \
-Wno-fatal
VERILATOR_COMMON_ARGS_OPENLLC := ./dut/OpenLLC/build/*.v \
--Mdir ./verilated \
-O3 \
--trace-fst \
--top TestTop \
--build-jobs $(THREADS_BUILD) --verilate-jobs $(THREADS_BUILD) \
-DSIM_TOP_MODULE_NAME=TestTop \
-Wno-fatal
coupledL2-verilate-cc:
rm -rf verilated
mkdir verilated
$(VERILATOR) $(VERILATOR_COMMON_ARGS_COUPLEDL2) --cc
coupledL2-verilate-build:
$(VERILATOR) $(VERILATOR_COMMON_ARGS_COUPLEDL2) --cc --exe --build -o tltest_v3lt \
libtltest_v3lt.a \
-LDFLAGS "-lsqlite3 -ldl" -CFLAGS "-rdynamic"
coupledL2-verilate:
rm -rf verilated
mkdir verilated
verilator --trace-fst --cc --build --lib-create vltdut --Mdir ./verilated ./dut/CoupledL2/build/*.v -Wno-fatal \
--top TestTop --build-jobs $(THREADS_BUILD) --verilate-jobs $(THREADS_BUILD) -DSIM_TOP_MODULE_NAME=TestTop
coupledL2-verilate-clean:
rm -rf verilated
openLLC-verilate-cc:
rm -rf verilated
mkdir verilated
$(VERILATOR) $(VERILATOR_COMMON_ARGS_OPENLLC) --cc
openLLC-verilate-build:
$(VERILATOR) $(VERILATOR_COMMON_ARGS_OPENLLC) --cc --exe --build -o tltest_v3lt \
lbtltest_v3lt.a \
-LDFLAGS "-lsqlite3 -ldl" -CFLAGS "-rdynamic"
openLLC-verilate:
rm -rf verilated
mkdir verilated
verilator --trace-fst --cc --build --lib-create vltdut --Mdir ./verilated ./dut/OpenLLC/build/*.v -Wno-fatal \
--top TestTop --build-jobs $(THREADS_BUILD) --verilate-jobs $(THREADS_BUILD) -DSIM_TOP_MODULE_NAME=TestTop
openLLC-verilate-clean:
rm -rf verilated
coupledL2-test-l2l3: coupledL2-compile coupledL2-verilog-test-top-l2l3 coupledL2-verilate \
tltest-config-coupledL2-test-l2l3 tltest-build-all-coupledL2
coupledL2-test-l2l3-v3: coupledL2-compile coupledL2-verilog-test-top-l2l3 coupledL2-verilate \
tltest-config-coupledL2-test-l2l3 tltest-build-v3-coupledL2
coupledL2-test-l2l3-dpi: coupledL2-compile coupledL2-verilog-test-top-l2l3 coupledL2-verilate \
tltest-config-coupledL2-test-l2l3 tltest-build-dpi-coupledL2
coupledL2-test-l2l3l2: coupledL2-compile coupledL2-verilog-test-top-l2l3l2 coupledL2-verilate \
tltest-config-coupledL2-test-l2l3l2 tltest-build-all-coupledL2
coupledL2-test-l2l3l2-v3: coupledL2-compile coupledL2-verilog-test-top-l2l3l2 coupledL2-verilate \
tltest-config-coupledL2-test-l2l3l2 tltest-build-v3-coupledL2
coupledL2-test-l2l3l2-dpi: coupledL2-compile coupledL2-verilog-test-top-l2l3l2 coupledL2-verilate \
tltest-config-coupledL2-test-l2l3l2 tltest-build-dpi-coupledL2
openLLC-test-l2l3: openLLC-compile openLLC-verilog-test-top-l2l3 openLLC-verilate \
tltest-config-openLLC-test-l2l3 tltest-build-all-openLLC
openLLC-test-l2l3-v3: openLLC-compile openLLC-verilog-test-top-l2l3 openLLC-verilate \
tltest-config-openLLC-test-l2l3 tltest-build-v3-openLLC
openLLC-test-l2l3-dpi: openLLC-compile openLLC-verilog-test-top-l2l3 openLLC-verilate \
tltest-config-openLLC-test-l2l3 tltest-build-dpi-openLLC
openLLC-test-l2l3l2: openLLC-compile openLLC-verilog-test-top-l2l3l2 openLLC-verilate \
tltest-config-openLLC-test-l2l3l2 tltest-build-all-openLLC
openLLC-test-l2l3l2-v3: openLLC-compile openLLC-verilog-test-top-l2l3l2 openLLC-verilate \
tltest-config-openLLC-test-l2l3l2 tltest-build-v3-openLLC
openLLC-test-l2l3l2-dpi: openLLC-compile openLLC-verilog-test-top-l2l3l2 openLLC-verilate \
tltest-config-openLLC-test-l2l3l2 tltest-build-dpi-openLLC
-include ./main/build/Makefile.config
run: FORCE tltest-config-postbuild
@rm -rf ./run
@mkdir ./run
@cp ./main/build/tltest_v3lt ./run/
@cp ./main/build/tltest_portgen.so ./run/
@cp ./main/build/tltest.ini ./run/
@bash ./scripts/run_v3lt.sh
run_coupledL2-test-l2l3: FORCE tltest-config-coupledL2-test-l2l3
@rm -rf ./run
@mkdir ./run
@cp ./main/build/tltest_v3lt ./run/
@cp ./main/build/tltest_portgen.so ./run/
@cp ./main/build/tltest.ini ./run/
@bash ./scripts/run_v3lt.sh
run_coupledL2-test-l2l3l2: FORCE tltest-config-coupledL2-test-l2l3l2
@rm -rf ./run
@mkdir ./run
@cp ./main/build/tltest_v3lt ./run/
@cp ./main/build/tltest_portgen.so ./run/
@cp ./main/build/tltest.ini ./run/
@bash ./scripts/run_v3lt.sh
run_openLLC-test-l2l3: FORCE tltest-config-openLLC-test-l2l3
@rm -rf ./run
@mkdir ./run
@cp ./main/build/tltest_v3lt ./run/
@cp ./main/build/tltest_portgen.so ./run/
@cp ./main/build/tltest.ini ./run/
@bash ./scripts/run_v3lt.sh
run_openLLC-test-l2l3l2: FORCE tltest-config-openLLC-test-l2l3l2
@rm -rf ./run
@mkdir ./run
@cp ./main/build/tltest_v3lt ./run/
@cp ./main/build/tltest_portgen.so ./run/
@cp ./main/build/tltest.ini ./run/
@bash ./scripts/run_v3lt.sh
run-with-portgen: FORCE tltest-config-postbuild tltest-portgen
@rm -rf ./run
@mkdir ./run
@cp ./main/build/tltest_v3lt ./run/
@cp ./main/build/tltest_portgen.so ./run/
@cp ./main/build/tltest.ini ./run/
@bash ./scripts/run_v3lt.sh
clean: coupledL2-verilate-clean coupledL2-verilog-clean openLLC-verilate-clean openLLC-verilog-clean tltest-clean