CBMC
weak_memory.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Weak Memory Instrumentation for Threaded Goto Programs
4 
5 Author: Daniel Kroening
6 
7 Date: September 2011
8 
9 \*******************************************************************/
10 
13 
14 #ifndef CPROVER_GOTO_INSTRUMENT_WMM_WEAK_MEMORY_H
15 #define CPROVER_GOTO_INSTRUMENT_WMM_WEAK_MEMORY_H
16 
17 #include "wmm.h"
18 
19 #include <util/irep.h>
20 
21 class symbol_tablet;
22 class value_setst;
23 class goto_modelt;
24 class message_handlert;
25 class goto_programt;
26 class messaget;
27 
28 void weak_memory(
29  memory_modelt model,
30  value_setst &,
31  goto_modelt &,
32  bool SCC,
33  instrumentation_strategyt event_stategy,
34  bool no_cfg_kill,
35  bool no_dependencies,
36  loop_strategyt duplicate_body,
37  unsigned max_var,
38  unsigned max_po_trans,
39  bool render_po,
40  bool render_file,
41  bool render_function,
42  bool cav11_option,
43  bool hide_internals,
45  bool ignore_arrays);
46 
48  value_setst &,
49  symbol_tablet &,
50  const irep_idt &function,
51  goto_programt &,
52 #ifdef LOCAL_MAY
53  const goto_functionst::goto_functiont &goto_function,
54 #endif
55  messaget &message);
56 
57 #define OPT_WMM_MEMORY_MODEL "(mm):"
58 
59 #define OPT_WMM_INSTRUMENTATION_STRATEGIES \
60  "(one-event-per-cycle)" \
61  "(minimum-interference)" \
62  "(read-first)" \
63  "(write-first)" \
64  "(my-events)"
65 
66 #define OPT_WMM_LIMITS \
67  "(max-var):" \
68  "(max-po-trans):"
69 
70 #define OPT_WMM_LOOPS \
71  "(force-loop-duplication)" \
72  "(no-loop-duplication)"
73 
74 #define OPT_WMM_MISC \
75  "(scc)" \
76  "(cfg-kill)" \
77  "(no-dependencies)" \
78  "(no-po-rendering)" \
79  "(render-cluster-file)" \
80  "(render-cluster-function)" \
81  "(cav11)" \
82  "(hide-internals)" \
83  "(ignore-arrays)"
84 
85 #define OPT_WMM \
86  OPT_WMM_MEMORY_MODEL \
87  OPT_WMM_INSTRUMENTATION_STRATEGIES \
88  OPT_WMM_LIMITS \
89  OPT_WMM_LOOPS \
90  OPT_WMM_MISC
91 
92 #define HELP_WMM_FULL \
93  " {y--mm} [{ytso}|{ypso}|{yrmo}|{ypower}] \t " \
94  "instruments a weak memory model\n" \
95  " {y--scc} \t detects critical cycles per SCC (one thread per SCC)\n" \
96  " {y--one-event-per-cycle} \t only instruments one event per cycle\n" \
97  " {y--minimum-interference} \t instruments an optimal number of events\n" \
98  " {y--my-events} \t only instruments events whose ids appear in inst.evt\n" \
99  " {y--read-first}, {y--write-first} \t " \
100  "only instrument cycles where a read or write occurs as first event, " \
101  "respectively\n" \
102  " {y--max-var} {uN} \t limit cycles to {uN} variables read/written\n" \
103  " {y--max-po-trans} {uN} \t limit cycles to {uN} program-order edges\n" \
104  " {y--ignore-arrays} \t instrument arrays as a single object\n" \
105  " {y--cav11} \t " \
106  "always instrument shared variables, even when they are not part of " \
107  "any cycle\n" \
108  " {y--force-loop-duplication}, {y--no-loop-duplication} \t " \
109  "optional program transformation to construct cycles in program loops\n" \
110  " {y--cfg-kill} \t enables symbolic execution used to reduce spurious " \
111  "cycles\n" \
112  " {y--no-dependencies} \t no dependency analysis\n" \
113  " {y--no-po-rendering} \t no representation of the threads in the dot\n" \
114  " {y--hide-internals} \t do not include thread-internal (Rfi) events in " \
115  "dot output\n" \
116  " {y--render-cluster-file} \t clusterises the dot by files\n" \
117  " {y--render-cluster-function} \t clusterises the dot by functions\n"
118 
119 #endif // CPROVER_GOTO_INSTRUMENT_WMM_WEAK_MEMORY_H
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:38
::goto_functiont goto_functiont
A generic container class for the GOTO intermediate representation of one function.
Definition: goto_program.h:73
Class that provides messages with a built-in verbosity 'level'.
Definition: message.h:154
The symbol table.
Definition: symbol_table.h:14
void introduce_temporaries(value_setst &, symbol_tablet &, const irep_idt &function, goto_programt &, messaget &message)
all access to shared variables is pushed into assignments
Definition: weak_memory.cpp:38
void weak_memory(memory_modelt model, value_setst &, goto_modelt &, bool SCC, instrumentation_strategyt event_stategy, bool no_cfg_kill, bool no_dependencies, loop_strategyt duplicate_body, unsigned max_var, unsigned max_po_trans, bool render_po, bool render_file, bool render_function, bool cav11_option, bool hide_internals, message_handlert &, bool ignore_arrays)
memory models
memory_modelt
Definition: wmm.h:18
loop_strategyt
Definition: wmm.h:37
instrumentation_strategyt
Definition: wmm.h:27