Commit | Line | Data |
---|---|---|
551ac1a3 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 | #for multi-core verif, 15.5GB shared mem, use files if full | |
21 | #CFLAGS=-DHASH64 -DMEMLIM=15500 -DNCORE=2 | |
22 | #CFLAGS=-DHASH64 -DCOLLAPSE -DMA=88 -DMEMLIM=15500 -DNCORE=8 | |
23 | ||
24 | #liveness | |
25 | #CFLAGS=-DHASH64 -DCOLLAPSE -DMA=88 | |
26 | CFLAGS=-DHASH64 | |
27 | ||
28 | SPINFILE=urcu.spin | |
29 | ||
30 | default: | |
31 | make urcu_free | tee urcu_free.log | |
32 | make urcu_free_no_mb | tee urcu_free_no_mb.log | |
33 | make urcu_free_single_flip | tee urcu_free_single_flip.log | |
34 | make urcu_progress_writer | tee urcu_progress_writer.log | |
35 | make urcu_progress_reader | tee urcu_progress_reader.log | |
36 | make urcu_progress_writer_error | tee urcu_progress_writer_error.log | |
37 | make asserts | tee asserts.log | |
38 | make summary | |
39 | ||
40 | #show trail : spin -v -t -N pan.ltl input.spin | |
41 | # after each individual make. | |
42 | ||
43 | summary: | |
44 | @echo | |
45 | @echo "Verification summary" | |
46 | @grep errors: *.log | |
47 | ||
48 | asserts: clean | |
49 | cat DEFINES > .input.spin | |
50 | cat ${SPINFILE} >> .input.spin | |
51 | rm -f .input.spin.trail | |
52 | spin -a -X .input.spin | |
53 | gcc -O2 -w ${CFLAGS} -DSAFETY -o pan pan.c | |
54 | ./pan -v -c1 -X -m10000000 -w20 | |
55 | cp .input.spin $@.spin.input | |
56 | -cp .input.spin.trail $@.spin.input.trail | |
57 | ||
58 | urcu_free: clean urcu_free_ltl run | |
59 | cp .input.spin $@.spin.input | |
60 | -cp .input.spin.trail $@.spin.input.trail | |
61 | ||
62 | urcu_free_nested: clean urcu_free_ltl urcu_free_nested_define run | |
63 | cp .input.spin $@.spin.input | |
64 | -cp .input.spin.trail $@.spin.input.trail | |
65 | ||
66 | urcu_free_nested_define: | |
67 | cp urcu_free_nested.define .input.define | |
68 | ||
69 | urcu_free_no_rmb: clean urcu_free_ltl urcu_free_no_rmb_define run | |
70 | cp .input.spin $@.spin.input | |
71 | -cp .input.spin.trail $@.spin.input.trail | |
72 | ||
73 | urcu_free_no_rmb_define: | |
74 | cp urcu_free_no_rmb.define .input.define | |
75 | ||
76 | urcu_free_no_wmb: clean urcu_free_ltl urcu_free_no_wmb_define run | |
77 | cp .input.spin $@.spin.input | |
78 | -cp .input.spin.trail $@.spin.input.trail | |
79 | ||
80 | urcu_free_no_wmb_define: | |
81 | cp urcu_free_no_wmb.define .input.define | |
82 | ||
83 | urcu_free_no_mb: clean urcu_free_ltl urcu_free_no_mb_define run | |
84 | cp .input.spin $@.spin.input | |
85 | -cp .input.spin.trail $@.spin.input.trail | |
86 | ||
87 | urcu_free_no_mb_define: | |
88 | cp urcu_free_no_mb.define .input.define | |
89 | ||
90 | urcu_free_single_flip: clean urcu_free_ltl urcu_free_single_flip_define run | |
91 | cp .input.spin $@.spin.input | |
92 | -cp .input.spin.trail $@.spin.input.trail | |
93 | ||
94 | urcu_free_single_flip_define: | |
95 | cp urcu_free_single_flip.define .input.define | |
96 | ||
97 | urcu_free_ltl: | |
98 | touch .input.define | |
99 | cat .input.define >> pan.ltl | |
100 | cat DEFINES >> pan.ltl | |
101 | spin -f "!(`cat urcu_free.ltl | grep -v ^//`)" >> pan.ltl | |
102 | ||
103 | # Progress checks | |
104 | ||
105 | urcu_progress_writer: clean urcu_progress_writer_ltl \ | |
106 | urcu_progress_writer_define run_weak_fair | |
107 | cp .input.spin $@.spin.input | |
108 | -cp .input.spin.trail $@.spin.input.trail | |
109 | ||
110 | urcu_progress_writer_define: | |
111 | cp urcu_progress_writer.define .input.define | |
112 | ||
113 | urcu_progress_writer_ltl: | |
114 | touch .input.define | |
115 | cat .input.define > pan.ltl | |
116 | cat DEFINES >> pan.ltl | |
117 | spin -f "!(`cat urcu_progress.ltl | grep -v ^//`)" >> pan.ltl | |
118 | ||
119 | urcu_progress_reader: clean urcu_progress_reader_ltl \ | |
120 | urcu_progress_reader_define run_weak_fair | |
121 | cp .input.spin $@.spin.input | |
122 | -cp .input.spin.trail $@.spin.input.trail | |
123 | ||
124 | urcu_progress_reader_define: | |
125 | cp urcu_progress_reader.define .input.define | |
126 | ||
127 | urcu_progress_reader_ltl: | |
128 | touch .input.define | |
129 | cat .input.define > pan.ltl | |
130 | cat DEFINES >> pan.ltl | |
131 | spin -f "!(`cat urcu_progress.ltl | grep -v ^//`)" >> pan.ltl | |
132 | ||
133 | urcu_progress_writer_error: clean urcu_progress_writer_error_ltl \ | |
134 | urcu_progress_writer_error_define run_weak_fair | |
135 | cp .input.spin $@.spin.input | |
136 | -cp .input.spin.trail $@.spin.input.trail | |
137 | ||
138 | urcu_progress_writer_error_define: | |
139 | cp urcu_progress_writer_error.define .input.define | |
140 | ||
141 | urcu_progress_writer_error_ltl: | |
142 | touch .input.define | |
143 | cat .input.define > pan.ltl | |
144 | cat DEFINES >> pan.ltl | |
145 | spin -f "!(`cat urcu_progress.ltl | grep -v ^//`)" >> pan.ltl | |
146 | ||
147 | ||
148 | run_weak_fair: pan | |
149 | ./pan -a -f -v -c1 -X -m10000000 -w20 | |
150 | ||
151 | run: pan | |
152 | ./pan -a -v -c1 -X -m10000000 -w20 | |
153 | ||
154 | pan: pan.c | |
155 | gcc -O2 -w ${CFLAGS} -o pan pan.c | |
156 | ||
157 | pan.c: pan.ltl ${SPINFILE} | |
158 | cat .input.define > .input.spin | |
159 | cat DEFINES >> .input.spin | |
160 | cat ${SPINFILE} >> .input.spin | |
161 | rm -f .input.spin.trail | |
162 | spin -a -X -N pan.ltl .input.spin | |
163 | ||
164 | .PHONY: clean default distclean summary | |
165 | clean: | |
166 | rm -f pan* trail.out .input.spin* *.spin.trail .input.define | |
167 | distclean: | |
168 | rm -f *.trail *.input *.log |