CBMC
Loading...
Searching...
No Matches
weak_memory.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Weak Memory Instrumentation for Threaded Goto Programs
4
5Author: Daniel Kroening
6
7Date: 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
21class symbol_tablet;
22class value_setst;
23class goto_modelt;
25class goto_programt;
26class messaget;
27
28void weak_memory(
29 memory_modelt model,
32 bool SCC,
34 bool no_cfg_kill,
35 bool no_dependencies,
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
50 const irep_idt &function,
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
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
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.
Class that provides messages with a built-in verbosity 'level'.
Definition message.h:154
The symbol table.
void introduce_temporaries(value_setst &, symbol_tablet &, const irep_idt &function, goto_programt &, messaget &message)
all access to shared variables is pushed into assignments
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