Go to the documentation of this file.
14 #ifndef CPROVER_GOTO_INSTRUMENT_WMM_GOTO2GRAPH_H
15 #define CPROVER_GOTO_INSTRUMENT_WMM_GOTO2GRAPH_H
52 goto_programt::instructionst::iterator it,
75 const std::set<event_grapht::critical_cyclet> &set,
78 std::ofstream &output,
84 typedef std::set<goto_programt::instructiont::targett>
target_sett;
135 goto_programt::instructionst::iterator &i_it,
143 goto_programt::instructionst::iterator i_it,
147 goto_programt::instructionst::iterator i_it,
150 goto_programt::instructionst::iterator i_it,
153 goto_programt::instructionst::iterator i_it,
155 bool no_dependenciess,
160 goto_programt::instructionst::iterator i_it,
180 typedef std::multimap<irep_idt, event_idt>
id2nodet;
190 typedef std::pair<event_idt, event_idt>
nodet;
191 typedef std::map<goto_programt::const_targett, std::set<nodet> >
195 std::set<goto_programt::const_targett>
updated;
200 #define add_all_pos(it, target, source) \
201 for(std::set<nodet>::const_iterator \
202 it=(source).begin(); \
203 it!=(source).end(); ++it) \
204 (target).insert(*it);
206 #ifdef CONTEXT_INSENSITIVE
208 std::stack<irep_idt> stack_fun;
210 std::map<irep_idt, std::set<nodet> > in_nodes, out_nodes;
244 throw "sorry, doesn't handle recursive function for the moment";
256 bool no_dependencies,
265 std::set<nodet> end_out;
275 catch(
const std::string &s)
292 bool no_dependencies,
295 std::set<nodet> &ending_vertex);
319 typedef std::map<irep_idt, std::pair<std::set<event_idt>,
331 for(std::set<event_idt>::const_iterator in_it=it->second.first.begin();
332 in_it!=it->second.first.end();
337 for(std::set<event_idt>::const_iterator in_it=it->second.second.begin();
338 in_it!=it->second.second.end();
350 std::multimap<irep_idt, source_locationt>
id2loc;
356 ns(_goto_model.symbol_table),
372 bool no_dependencies,
391 unsigned _max_var = 0,
392 unsigned _max_po_trans = 0,
393 bool _ignore_arrays =
false)
426 #endif // CPROVER_GOTO_INSTRUMENT_WMM_GOTO2GRAPH_H
std::vector< std::set< event_idt > > egraph_SCCs
Class that provides messages with a built-in verbosity 'level'.
void visit_cfg_fence(goto_programt::instructionst::iterator i_it, const irep_idt &function_id)
void enter_function(const irep_idt &function_id)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
void print_map_function_graph() const
void collect_cycles(memory_modelt model)
std::vector< std::set< event_grapht::critical_cyclet > > set_of_cycles_per_SCC
virtual void visit_cfg_function(value_setst &value_sets, memory_modelt model, bool no_dependencies, loop_strategyt duplicate_body, const irep_idt &function_id, std::set< nodet > &ending_vertex)
TODO: move the visitor outside, and inherit.
void visit_cfg_backedge(goto_programt::const_targett targ, goto_programt::const_targett i_it)
strategy: fwd/bwd alternation
void instrument_my_events_inserter(const set_of_cyclest &set, const std::set< event_idt > &events)
void instrument_my_events(const std::set< event_idt > &events)
void print_outputs(memory_modelt model, bool hide_internals)
void set_parameters_collection(unsigned _max_var=0, unsigned _max_po_trans=0, bool _ignore_arrays=false)
void dot(const goto_modelt &src, std::ostream &out)
std::set< goto_programt::instructiont::targett > target_sett
std::vector< std::set< event_idt > > & egraph_SCCs
std::map< irep_idt, std::pair< std::set< event_idt >, std::set< event_idt > > > map_function_nodest
void visit_cfg_body(const irep_idt &function_id, const goto_programt &goto_program, goto_programt::const_targett i_it, loop_strategyt replicate_body, value_setst &value_sets)
strategy: fwd/bwd alternation
void visit_cfg_assign(value_setst &value_sets, const irep_idt &function_id, goto_programt::instructionst::iterator &i_it, bool no_dependencies)
void visit_cfg_reference_function(irep_idt id_function)
references the first and last edges of the function
std::map< goto_programt::const_targett, std::set< nodet > > incoming_post
std::pair< irep_idt, event_idt > id2node_pairt
void visit_cfg_thread() const
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...
std::multimap< irep_idt, source_locationt > id2loc
std::multimap< irep_idt, source_locationt > id2cycloc
std::set< goto_programt::const_targett > updated
std::set< event_grapht::critical_cyclet > set_of_cyclest
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
std::set< event_idt > unknown_write_nodes
void instrument_one_write_per_cycle_inserter(const set_of_cyclest &set)
void collect_cycles_by_SCCs(memory_modelt model)
Note: can be distributed (#define DISTRIBUTED)
bool contains_shared_array(const irep_idt &function_id, goto_programt::const_targett targ, goto_programt::const_targett i_it, value_setst &value_sets) const
void set_rendering_options(bool aligned, bool file, bool function)
void leave_function(const irep_idt &function_id)
void instrument_one_event_per_cycle_inserter(const set_of_cyclest &set)
void collect_cycles(std::set< critical_cyclet > &set_of_cycles, memory_modelt model, const std::set< event_idt > &filter)
unsigned cost(const event_grapht::critical_cyclet::delayt &e)
cost function
bool local(const irep_idt &id)
is local variable?
void visit_cfg_asm_fence(goto_programt::instructionst::iterator i_it, const irep_idt &function_id)
map_function_nodest map_function_graph
instrumentert & instrumenter
instrumentert(goto_modelt &_goto_model, messaget &_message)
void visit_cfg_duplicate(const goto_programt &goto_program, goto_programt::const_targett targ, goto_programt::const_targett i_it)
bool is_cfg_spurious(const event_grapht::critical_cyclet &cyc)
void add_instr_to_interleaving(goto_programt::instructionst::iterator it, goto_programt &interleaving)
A collection of goto functions.
void instrument_with_strategy(instrumentation_strategyt strategy)
std::map< event_idt, event_idt > map_vertex_gnode
void instrument_minimum_interference_inserter(const set_of_cyclest &set)
void set_parameters_collection(unsigned _max_var=0, unsigned _max_po_trans=0, bool _ignore_arrays=false)
void visit_cfg(value_setst &value_sets, memory_modelt model, bool no_dependencies, loop_strategyt duplicate_body, const irep_idt &function_id)
A generic container class for the GOTO intermediate representation of one function.
std::pair< event_idt, event_idt > nodet
instructionst::const_iterator const_targett
instrumentation_strategyt
void instrument_all_inserter(const set_of_cyclest &set)
static std::set< event_idt > extract_my_events()
std::set< irep_idt > functions_met
void visit_cfg_propagate(goto_programt::instructionst::iterator i_it)
mstreamt & warning() const
void print_outputs_local(const std::set< event_grapht::critical_cyclet > &set, std::ofstream &dot, std::ofstream &ref, std::ofstream &output, std::ofstream &all, std::ofstream &table, memory_modelt model, bool hide_internals)
void instrument_one_read_per_cycle_inserter(const set_of_cyclest &set)
cfg_visitort(namespacet &_ns, instrumentert &_instrumenter)
std::set< irep_idt > var_to_instr
goto_functionst & goto_functions
std::set< event_grapht::critical_cyclet > set_of_cycles
void visit_cfg_lwfence(goto_programt::instructionst::iterator i_it, const irep_idt &function_id)
void visit_cfg_goto(const irep_idt &function_id, const goto_programt &goto_program, goto_programt::instructionst::iterator i_it, loop_strategyt replicate_body, value_setst &value_sets)
bool local(const irep_idt &i)
void visit_cfg_function_call(value_setst &value_sets, goto_programt::instructionst::iterator i_it, memory_modelt model, bool no_dependenciess, loop_strategyt duplicate_body)
std::multimap< irep_idt, event_idt > id2nodet
std::set< event_idt > unknown_read_nodes
void visit_cfg_skip(goto_programt::instructionst::iterator i_it)