cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
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,
44
message_handlert
&,
45
bool
ignore_arrays);
46
47
void
introduce_temporaries
(
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
goto_functionst::goto_functiont
::goto_functiont goto_functiont
Definition
goto_functions.h:27
goto_modelt
Definition
goto_model.h:27
goto_programt
A generic container class for the GOTO intermediate representation of one function.
Definition
goto_program.h:72
message_handlert
Definition
message.h:27
messaget
Class that provides messages with a built-in verbosity 'level'.
Definition
message.h:154
symbol_tablet
The symbol table.
Definition
symbol_table.h:14
value_setst
Definition
value_sets.h:22
irep.h
irep_idt
dstringt irep_idt
Definition
verification_result.h:16
introduce_temporaries
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
weak_memory
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)
Definition
weak_memory.cpp:106
wmm.h
memory models
memory_modelt
memory_modelt
Definition
wmm.h:18
loop_strategyt
loop_strategyt
Definition
wmm.h:37
instrumentation_strategyt
instrumentation_strategyt
Definition
wmm.h:27
goto-instrument
wmm
weak_memory.h
Generated by
1.17.0