72 message.get_message_handler());
81 ns.
lookup(function_id).mode,
113 bool no_dependencies,
115 unsigned input_max_var,
116 unsigned input_max_po_trans,
119 bool render_function,
146 gf_entry.second.body,
156 unsigned max_thds = 0;
158 max_thds=instrumenter.
goto2graph_cfg(value_sets, model, no_dependencies,
163 if(input_max_var!=0 || input_max_po_trans!=0)
165 input_max_po_trans, ignore_arrays);
173 unsigned interesting_scc = 0;
174 unsigned total_cycles = 0;
175 for(
unsigned i=0; i<instrumenter.
num_sccs; i++)
178 message.
status()<<
"SCC #"<<i<<
": "
181 total_cycles += instrumenter
186 if(total_cycles == 0)
237 for(std::set<irep_idt>::iterator it=
244 for(std::set<irep_idt>::iterator it=shared_buffers.
cycles.begin();
245 it!=shared_buffers.
cycles.end(); it++)
247 typedef std::multimap<irep_idt, source_locationt>::iterator m_itt;
248 const std::pair<m_itt, m_itt> ran=
250 for(m_itt ran_it=ran.first; ran_it!=ran.second; ran_it++)
251 message.
result() << (it->empty() ?
"fence" : *it) <<
", "
A goto_instruction_codet representing an assignment in the program.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
function_mapt function_map
::goto_functiont goto_functiont
static irep_idt entry_point()
Get the identifier of the entry point to a goto model.
symbol_tablet symbol_table
Symbol table.
goto_functionst goto_functions
GOTO functions.
This class represents an instruction in the GOTO intermediate representation.
const exprt & condition() const
Get the condition of gotos, assume, assert.
exprt & condition_nonconst()
Get the condition of gotos, assume, assert.
const source_locationt & source_location() const
bool is_function_call() const
A generic container class for the GOTO intermediate representation of one function.
void insert_before_swap(targett target)
Insertion that preserves jumps to "target".
static instructiont make_assignment(const code_assignt &_code, const source_locationt &l=source_locationt::nil())
Create an assignment instruction.
std::multimap< irep_idt, source_locationt > id2cycloc
void print_outputs(memory_modelt model, bool hide_internals)
void instrument_my_events(const std::set< event_idt > &events)
void collect_cycles_by_SCCs(memory_modelt model)
Note: can be distributed (#define DISTRIBUTED)
std::set< event_grapht::critical_cyclet > set_of_cycles
void collect_cycles(memory_modelt model)
void instrument_with_strategy(instrumentation_strategyt strategy)
std::set< irep_idt > var_to_instr
std::vector< std::set< event_idt > > egraph_SCCs
void set_parameters_collection(unsigned _max_var=0, unsigned _max_po_trans=0, bool _ignore_arrays=false)
std::multimap< irep_idt, source_locationt > id2loc
std::vector< std::set< event_grapht::critical_cyclet > > set_of_cycles_per_SCC
unsigned goto2graph_cfg(value_setst &value_sets, memory_modelt model, bool no_dependencies, loop_strategyt duplicate_body)
goes through CFG and build a static abstract event graph overapproximating the read/write relations f...
void set_rendering_options(bool aligned, bool file, bool function)
static std::set< event_idt > extract_my_events()
Class that provides messages with a built-in verbosity 'level'.
mstreamt & status() const
mstreamt & result() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
void weak_memory(value_setst &value_sets, const irep_idt &function_id, memory_modelt model)
instruments the program for the pairs detected through the CFG
std::multimap< irep_idt, source_locationt > cycles_loc
void set_cav11(memory_modelt model)
void affected_by_delay(value_setst &value_sets, goto_functionst &goto_functions)
analysis over the goto-program which computes in affected_by_delay_set the variables (non necessarily...
std::set< irep_idt > affected_by_delay_set
std::set< irep_idt > cycles
std::multimap< irep_idt, source_locationt > cycles_r_loc
void add_initialization_code(goto_functionst &goto_functions)
Expression to hold a symbol (variable)
class symbol_exprt symbol_expr() const
Produces a symbol_exprt for a symbol.
exprt value
Initial value of symbol.
symbolt & get_fresh_aux_symbol(const typet &type, const std::string &name_prefix, const std::string &basename_prefix, const source_locationt &source_location, const irep_idt &symbol_mode, const namespacet &ns, symbol_table_baset &symbol_table)
Installs a fresh-named symbol with respect to the given namespace ns with the requested name pattern ...
Fresh auxiliary symbol creation.
#define Forall_goto_program_instructions(it, program)
const std::string & id2string(const irep_idt &d)
void remove_skip(goto_programt &goto_program, goto_programt::targett begin, goto_programt::targett end)
remove unnecessary skip statements
Race Detection for Threaded Goto Programs.
#define INITIALIZE_FUNCTION
void weak_memory(memory_modelt model, value_setst &value_sets, goto_modelt &goto_model, bool SCC, instrumentation_strategyt event_strategy, bool no_cfg_kill, bool no_dependencies, loop_strategyt duplicate_body, unsigned input_max_var, unsigned input_max_po_trans, bool render_po, bool render_file, bool render_function, bool cav11_option, bool hide_internals, message_handlert &message_handler, bool ignore_arrays)
void introduce_temporaries(value_setst &value_sets, symbol_tablet &symbol_table, const irep_idt &function_id, goto_programt &goto_program, messaget &message)
all access to shared variables is pushed into assignments
Weak Memory Instrumentation for Threaded Goto Programs.
instrumentation_strategyt