Commit | Line | Data |
---|---|---|
03c9e0f3 MD |
1 | # This program is free software; you can redistribute it and/or modify |
2 | # it under the terms of the GNU General Public License as published by | |
3 | # the Free Software Foundation; either version 2 of the License, or | |
4 | # (at your option) any later version. | |
5 | # | |
6 | # This program is distributed in the hope that it will be useful, | |
7 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
8 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
9 | # GNU General Public License for more details. | |
10 | # | |
11 | # You should have received a copy of the GNU General Public License | |
12 | # along with this program; if not, write to the Free Software | |
13 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
14 | # | |
15 | # Copyright (C) Mathieu Desnoyers, 2009 | |
16 | # | |
17 | # Authors: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | |
18 | ||
19 | #CFLAGS=-DSAFETY | |
20 | #CFLAGS=-DHASH64 -DREACH | |
21 | CFLAGS=-DHASH64 | |
22 | ||
23 | #try pan -i to get the smallest trace. | |
24 | ||
25 | SPINFILE=mem.spin | |
26 | ||
27 | default: | |
28 | make read_order | tee read_order.log | |
29 | make read_order_no_wmb | tee read_order_no_wmb.log | |
30 | make read_order_no_rmb | tee read_order_no_rmb.log | |
dfa8abef | 31 | make read_order_no_sync | tee read_order_no_sync.log |
03c9e0f3 MD |
32 | make asserts | tee asserts.log |
33 | make summary | |
34 | ||
35 | #show trail : spin -v -t -N pan.ltl input.spin | |
36 | # after each individual make. | |
37 | ||
38 | summary: | |
39 | @echo | |
40 | @echo "Verification summary" | |
41 | @grep error *.log | |
42 | ||
43 | asserts: clean | |
44 | cat DEFINES > .input.spin | |
45 | cat ${SPINFILE} >> .input.spin | |
46 | rm -f .input.spin.trail | |
47 | spin -a -X .input.spin | |
48 | gcc -w ${CFLAGS} -DSAFETY -o pan pan.c | |
49 | ./pan -v -c1 -X -m10000 -w19 | |
50 | cp .input.spin $@.spin.input | |
51 | -cp .input.spin.trail $@.spin.input.trail | |
52 | ||
53 | read_order: clean read_order_ltl run | |
54 | cp .input.spin $@.spin.input | |
55 | -cp .input.spin.trail $@.spin.input.trail | |
56 | ||
dfa8abef MD |
57 | read_order_no_sync: clean read_order_ltl read_order_no_sync_define run |
58 | cp .input.spin $@.spin.input | |
59 | -cp .input.spin.trail $@.spin.input.trail | |
60 | ||
61 | read_order_no_sync_define: | |
62 | cp read_order_no_sync.define .input.define | |
63 | ||
03c9e0f3 MD |
64 | read_order_no_rmb: clean read_order_ltl read_order_no_rmb_define run |
65 | cp .input.spin $@.spin.input | |
66 | -cp .input.spin.trail $@.spin.input.trail | |
67 | ||
68 | read_order_no_rmb_define: | |
69 | cp read_order_no_rmb.define .input.define | |
70 | ||
71 | read_order_no_wmb: clean read_order_ltl read_order_no_wmb_define run | |
72 | cp .input.spin $@.spin.input | |
73 | -cp .input.spin.trail $@.spin.input.trail | |
74 | ||
75 | read_order_no_wmb_define: | |
76 | cp read_order_no_wmb.define .input.define | |
77 | ||
78 | read_order_ltl: | |
79 | touch .input.define | |
80 | cat DEFINES > pan.ltl | |
81 | cat .input.define >> pan.ltl | |
82 | spin -f "!(`cat read_order.ltl | grep -v ^//`)" >> pan.ltl | |
83 | ||
84 | run: pan | |
85 | ./pan -a -v -c1 -X -m10000 -w19 | |
86 | ||
87 | pan: pan.c | |
88 | gcc -w ${CFLAGS} -o pan pan.c | |
89 | ||
90 | pan.c: pan.ltl ${SPINFILE} | |
91 | cat DEFINES > .input.spin | |
92 | cat .input.define >> .input.spin | |
93 | cat ${SPINFILE} >> .input.spin | |
94 | rm -f .input.spin.trail | |
95 | spin -a -X -N pan.ltl .input.spin | |
96 | ||
97 | .PHONY: clean default distclean summary | |
98 | clean: | |
99 | rm -f pan* trail.out .input.spin* *.spin.trail .input.define | |
100 | distclean: | |
101 | rm -f *.trail *.input *.log |