forked from zj040045/herdtools7
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
568 lines (502 loc) · 14.5 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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
.PHONY: check-deps
OS := $(shell uname)
PREFIX=$$HOME
D=dune
#Limit parallelism of some expensive operations
ifeq ($(OS),Darwin)
J=$(shell sysctl -n hw.logicalcpu)
else
J=$(shell nproc)
endif
REGRESSION_TEST_MODE = test
# REGRESSION_TEST_MODE = promote
# REGRESSION_TEST_MODE = show
DUNE_PROFILE = release
DIYCROSS = _build/install/default/bin/diycross7
HERD = _build/install/default/bin/herd7
HERD_REGRESSION_TEST = _build/default/internal/herd_regression_test.exe
HERD_DIYCROSS_REGRESSION_TEST = _build/default/internal/herd_diycross_regression_test.exe
HERD_CATALOGUE_REGRESSION_TEST = _build/default/internal/herd_catalogue_regression_test.exe
all: build
.PHONY: Version.ml
Version.ml:
sh ./version-gen.sh $(PREFIX)
build: Version.ml | check-deps
dune build -j $(J) --profile $(DUNE_PROFILE)
install:
sh ./dune-install.sh $(PREFIX)
uninstall:
sh ./dune-uninstall.sh $(PREFIX)
clean: dune-clean clean-asl-pseudocode
rm -f Version.ml
dune-clean:
dune clean
versions: Version.ml
@ dune build -j $(J) --workspace dune-workspace.versions
# Dependencies.
check-deps::
$(if $(shell which ocaml),,$(error "Could not find ocaml in PATH"))
$(if $(shell which menhir),,$(error "Could not find menhir in PATH; it can be installed with `opam install menhir`."))
check-deps::
$(if $(shell which dune),,$(error "Could not find dune in PATH; it can be installed with `opam install dune`."))
# Tests.
TIMEOUT=16.0
test:: | build
test:: dune-test
@ echo "OCaml unit tests: OK"
dune-test:
@ echo
dune runtest --profile=$(DUNE_PROFILE)
test:: test.aarch64
test.aarch64:
@ echo
$(HERD_REGRESSION_TEST) \
-j $(J) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/AArch64 \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64 instructions tests: OK"
test:: test.riscv
test.riscv:
@ echo
$(HERD_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/RISCV \
$(REGRESSION_TEST_MODE)
@ echo "herd7 RISCV instructions tests: OK"
test:: test.x86_64
test.x86_64:
@ echo
$(HERD_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/X86_64 \
$(REGRESSION_TEST_MODE)
@ echo "herd7 X86_64 instructions tests: OK"
test:: test.mixed
test.mixed:
@ echo
$(HERD_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/AArch64.mixed \
-conf ./herd/tests/instructions/AArch64.mixed/mixed.cfg \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64 mixed instructions tests: OK"
test:: test.mips
test.mips:
@ echo
$(HERD_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/MIPS \
$(REGRESSION_TEST_MODE)
@ echo "herd7 RISCV instructions tests: OK"
test:: test.neon
test.neon::
@ echo
$(HERD_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/AArch64.neon \
-variant neon \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64 NEON instructions tests: OK"
test:: test.mte
test.mte::
@ echo
$(HERD_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/AArch64.MTE \
-conf ./herd/tests/instructions/AArch64.MTE/mte.cfg \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64 MTE instructions tests: OK"
test:: test.self
test.self:
@ echo
$(HERD_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/AArch64.self \
-conf ./herd/tests/instructions/AArch64.self/self.cfg \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64 variant -self instructions tests: OK"
test:: test.kvm
test.kvm:
@ echo
$(HERD_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/AArch64.kvm \
-conf ./herd/tests/instructions/AArch64.kvm/kvm.cfg \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64 KVM instructions tests: OK"
test::
@ echo
$(HERD_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/C \
-conf ./herd/tests/instructions/C/c.cfg \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64 C instructions tests: OK"
test:: test-ppc
test-ppc:
@ echo
$(HERD_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/PPC \
$(REGRESSION_TEST_MODE)
@ echo "herd7 PPC instructions tests: OK"
test:: test-asl
test-asl:
@ echo
$(HERD_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/ASL \
$(REGRESSION_TEST_MODE)
@ echo "herd7 ASL instructions tests: OK"
test:: test-pseudo-asl
test-pseudo-asl:
@ echo
$(HERD_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/ASL-pseudo-arch \
-conf ./herd/tests/instructions/ASL-pseudo-arch/pseudo-conf.cfg \
$(REGRESSION_TEST_MODE)
@ echo "herd7 ASL instructions tests on pseudo-architecture: OK"
test-aarch64-asl: asl-pseudocode
@echo
$(HERD_REGRESSION_TEST) \
-j $(J) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/AArch64.ASL \
-conf ./herd/tests/instructions/AArch64.ASL/asl.cfg \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64+ASL instructions tests: OK"
test:: arm-test
arm-test::
@ echo
$(HERD_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/ARM \
$(REGRESSION_TEST_MODE)
@ echo "herd7 ARM instructions tests: OK"
aarch32-test::
@ echo
$(HERD_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/AArch32 \
-conf ./herd/tests/instructions/AArch32/aarch32.cfg \
$(REGRESSION_TEST_MODE)
@ echo "herd7 ARM instructions tests: OK"
test::aarch32-test
test::
diy-test:: diy-test-aarch64
diy-test-aarch64:
@ echo
$(HERD_DIYCROSS_REGRESSION_TEST) \
-herd-path $(HERD) \
-diycross-path $(DIYCROSS) \
-libdir-path ./herd/libdir \
-expected-dir ./herd/tests/diycross/AArch64 \
-diycross-arg -arch \
-diycross-arg AArch64 \
-diycross-arg 'Pod**,Fenced**' \
-diycross-arg 'Rfe,Fre,Coe' \
-diycross-arg 'Pod**,Fenced**,DpAddrdR,DpAddrdW,DpDatadW,CtrldR,CtrldW' \
-diycross-arg 'Rfe,Fre,Coe' \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64 diycross7 tests: OK"
test:: cata-test more-test
cata-test:: cata-aarch64-test
cata-aarch64-test:
@ echo
$(HERD_CATALOGUE_REGRESSION_TEST) \
-j $(J) \
-herd-timeout $(TIMEOUT) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-kinds-path catalogue/aarch64/tests/kinds.txt \
-shelf-path catalogue/aarch64/shelf.py \
$(REGRESSION_TEST_MODE)
@ echo "herd7 catalogue aarch64 tests: OK"
more-test:: aarch64-test-mixed
aarch64-test-mixed:
@ echo
$(HERD_CATALOGUE_REGRESSION_TEST) \
-j $(J) \
-herd-timeout $(TIMEOUT) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-kinds-path catalogue/aarch64/tests/kinds.txt \
-shelf-path catalogue/aarch64/shelf.py \
-variant mixed \
$(REGRESSION_TEST_MODE)
@ echo "herd7 catalogue aarch64 tests (mixed mode): OK"
cata-test:: mixed-test
mixed-test:
@ echo
$(HERD_CATALOGUE_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-kinds-path catalogue/aarch64-mixed/tests/kinds.txt \
-shelf-path catalogue/aarch64-mixed/shelf.py \
$(REGRESSION_TEST_MODE)
@ echo "herd7 catalogue aarch64-mixed tests: OK"
cata-test:: pick-test
pick-test:
@ echo
$(HERD_CATALOGUE_REGRESSION_TEST) \
-j $(J) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-kinds-path catalogue/aarch64-pick/tests/desired-kinds.txt \
-shelf-path catalogue/aarch64-pick/shelf.py \
$(REGRESSION_TEST_MODE)
@ echo "herd7 catalogue aarch64-pick tests: OK"
cata-test:: faults-test
faults-test:
@ echo
$(HERD_CATALOGUE_REGRESSION_TEST) \
-j $(J) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-kinds-path catalogue/aarch64-faults/tests/kinds.txt \
-shelf-path catalogue/aarch64-faults/shelf.py \
$(REGRESSION_TEST_MODE)
@ echo "herd7 catalogue aarch64-faults tests: OK"
more-test:: pick-test-mixed
pick-test-mixed:
@ echo
$(HERD_CATALOGUE_REGRESSION_TEST) \
-j $(J) \
-herd-path $(HERD) \
-herd-timeout $(TIMEOUT) \
-libdir-path ./herd/libdir \
-kinds-path catalogue/aarch64-pick/tests/desired-kinds.txt \
-shelf-path catalogue/aarch64-pick/shelf.py \
-variant mixed \
$(REGRESSION_TEST_MODE)
@ echo "herd7 catalogue aarch64-pick tests (mixed mode): OK"
more-test:: mte-test
mte-test:
@ echo
$(HERD_CATALOGUE_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-kinds-path catalogue/aarch64-MTE/tests/kinds.txt \
-shelf-path catalogue/aarch64-MTE/shelf.py \
$(REGRESSION_TEST_MODE)
@ echo "herd7 catalogue aarch64-MTE tests: OK"
vmsa-test:
@ echo
$(HERD_CATALOGUE_REGRESSION_TEST) \
-j $(J) \
-herd-path $(HERD) \
-herd-timeout $(TIMEOUT) \
-libdir-path ./herd/libdir \
-kinds-path catalogue/aarch64-VMSA/tests/VMSA-kinds.txt \
-shelf-path catalogue/aarch64-VMSA/shelf.py \
$(REGRESSION_TEST_MODE)
@ echo "herd7 catalogue aarch64-VMSA tests: OK"
ets2-test:
@ echo
$(HERD_CATALOGUE_REGRESSION_TEST) \
-j $(J) \
-herd-path $(HERD) \
-herd-timeout $(TIMEOUT) \
-libdir-path ./herd/libdir \
-kinds-path catalogue/aarch64-ETS2/tests/VMSA-ETS2-kinds.txt \
-shelf-path catalogue/aarch64-ETS2/shelf.py \
$(REGRESSION_TEST_MODE)
@ echo "herd7 catalogue aarch64-ETS2 tests: OK"
test.vmsa+mte:
@ echo
$(HERD_REGRESSION_TEST) \
-herd-path $(HERD) \
-libdir-path ./herd/libdir \
-litmus-dir ./herd/tests/instructions/AArch64.vmsa+mte \
-conf ./herd/tests/instructions/AArch64.vmsa+mte/vmsa+mte.cfg \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64 VMSA+MTE instructions tests: OK"
test:: diy-test
LDS:="Amo.Cas,Amo.LdAdd,Amo.LdClr,Amo.LdEor,Amo.LdSet"
LDSPLUS:="LxSx",$(LDS)
diy-test:: diy-test-mixed
diy-test-mixed::
@ echo
$(HERD_DIYCROSS_REGRESSION_TEST) \
-j $(J) \
-herd-path $(HERD) \
-diycross-path $(DIYCROSS) \
-libdir-path ./herd/libdir \
-expected-dir ./herd/tests/diycross/AArch64.mixed \
-conf ./herd/tests/diycross/AArch64.mixed/mixed.cfg \
-diycross-arg -ua \
-diycross-arg 0 \
-diycross-arg -obs \
-diycross-arg oo \
-diycross-arg -arch \
-diycross-arg AArch64 \
-diycross-arg -variant \
-diycross-arg mixed \
-diycross-arg -hexa \
-diycross-arg Hat \
-diycross-arg h0 \
-diycross-arg $(LDSPLUS) \
-diycross-arg h0 \
-diycross-arg Rfi \
-diycross-arg w0 \
-diycross-arg Amo.StAdd \
-diycross-arg w0 \
-diycross-arg Rfi \
-diycross-arg h2 \
-diycross-arg $(LDS) \
-diycross-arg h2 \
-diycross-arg PodWR \
-diycross-arg Hat \
-diycross-arg w0 \
-diycross-arg Amo.LdSet \
-diycross-arg w0 \
-diycross-arg PodWR \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64.mixed diycross7 tests: OK"
diy-test-mixed::
@ echo
$(HERD_DIYCROSS_REGRESSION_TEST) \
-j $(J) \
-herd-path $(HERD) \
-diycross-path $(DIYCROSS) \
-libdir-path ./herd/libdir \
-expected-dir ./herd/tests/diycross/AArch64.mixed.strict \
-conf ./herd/tests/diycross/AArch64.mixed.strict/mixed.cfg \
-diycross-arg -arch \
-diycross-arg AArch64 \
-diycross-arg -ua \
-diycross-arg 0 \
-diycross-arg -variant \
-diycross-arg mixed,MixedStrictOverlap \
-diycross-arg -hexa \
-diycross-arg h0,h2,w0 \
-diycross-arg Amo.CasAP,LxSxAP \
-diycross-arg h0,h2,w0 \
-diycross-arg PodWR \
-diycross-arg w0,h0 \
-diycross-arg Fre \
-diycross-arg w0,h2 \
-diycross-arg FencedWW \
-diycross-arg w0,h0,h2 \
-diycross-arg Rfe \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64.mixed.strict diycross7 tests: OK"
diy-test-mixed:: v32 v64
v32:
@ echo
$(HERD_DIYCROSS_REGRESSION_TEST) \
-j $(J) \
-herd-path $(HERD) \
-diycross-path $(DIYCROSS) \
-libdir-path ./herd/libdir \
-expected-dir ./herd/tests/diycross/AArch64.mixed.v32 \
-conf ./herd/tests/diycross/AArch64.mixed.strict/mixed.cfg \
-diycross-arg -arch \
-diycross-arg AArch64 \
-diycross-arg -variant \
-diycross-arg mixed \
-diycross-arg -hexa \
-diycross-arg PodWW \
-diycross-arg RfeLA \
-diycross-arg h0,h2,w0 \
-diycross-arg DpDatadW,DpAddrdR,DpAddrdW \
-diycross-arg A,P,L \
-diycross-arg h0,h2,w0 \
-diycross-arg Coe,Fre \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64.mixed.v32 diycross7 tests: OK"
v64:
@ echo
$(HERD_DIYCROSS_REGRESSION_TEST) \
-j $(J) \
-herd-path $(HERD) \
-diycross-path $(DIYCROSS) \
-libdir-path ./herd/libdir \
-expected-dir ./herd/tests/diycross/AArch64.mixed.v64 \
-conf ./herd/tests/diycross/AArch64.mixed.strict/mixed.cfg \
-diycross-arg -arch \
-diycross-arg AArch64 \
-diycross-arg -variant \
-diycross-arg mixed \
-diycross-arg -hexa \
-diycross-arg -type \
-diycross-arg uint64_t \
-diycross-arg PodWW \
-diycross-arg RfeLA \
-diycross-arg w0,w4,q0 \
-diycross-arg DpDatadW,DpAddrdR,DpAddrdW \
-diycross-arg A,P,L \
-diycross-arg w0,w4,q0 \
-diycross-arg Coe,Fre \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64.mixed.v64 diycross7 tests: OK"
diy-test:: diy-store-test
diy-store-test:
@ echo
$(HERD_DIYCROSS_REGRESSION_TEST) \
-herd-path $(HERD) \
-diycross-path $(DIYCROSS) \
-libdir-path ./herd/libdir \
-expected-dir ./herd/tests/diycross/AArch64.store \
-diycross-arg -obs \
-diycross-arg four \
-diycross-arg -arch \
-diycross-arg AArch64 \
-diycross-arg 'Fenced**' \
-diycross-arg 'Rfe,Fre,Coe' \
-diycross-arg 'DpAddrdR,DpDatadW' \
-diycross-arg 'Pos**' \
-diycross-arg 'Store' \
-diycross-arg 'Rfe,Fre,Coe' \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64 diycross7.store tests: OK"
diy-test:: diy-test-mte
diy-test-mte::
@ echo
$(HERD_DIYCROSS_REGRESSION_TEST) \
-j $(J) \
-herd-path $(HERD) \
-diycross-path $(DIYCROSS) \
-libdir-path ./herd/libdir \
-expected-dir ./herd/tests/diycross/AArch64.MTE \
-conf ./herd/tests/diycross/AArch64.MTE/MTE.cfg \
-diycross-arg -arch \
-diycross-arg AArch64 \
-diycross-arg -variant \
-diycross-arg memtag \
-diycross-arg DMB.SYd*W \
-diycross-arg T,P \
-diycross-arg Rfe \
-diycross-arg A \
-diycross-arg Amo.LdAdd \
-diycross-arg L \
-diycross-arg PodW* \
-diycross-arg T,P \
-diycross-arg Coe,Rfe,Fre \
-diycross-arg T,P \
$(REGRESSION_TEST_MODE)
@ echo "herd7 AArch64.MTE diycross7 tests: OK"
.PHONY: asl-pseudocode clean-asl-pseudocode
asl-pseudocode: herd/libdir/asl-pseudocode/shared_pseudocode.asl
herd/libdir/asl-pseudocode/shared_pseudocode.asl:
@ $(MAKE) -C $(@D) a64 clean-tmp
clean-asl-pseudocode:
@ $(MAKE) -C $(@D)/herd/libdir/asl-pseudocode clean