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;
198 std::set<goto_programt::const_targett, goto_programt::target_less_than>
204 #define add_all_pos(it, target, source) \
205 for(std::set<nodet>::const_iterator \
206 it=(source).begin(); \
207 it!=(source).end(); ++it) \
208 (target).insert(*it);
210 #ifdef CONTEXT_INSENSITIVE
212 std::stack<irep_idt> stack_fun;
214 std::map<irep_idt, std::set<nodet> > in_nodes, out_nodes;
248 throw "sorry, doesn't handle recursive function for the moment";
260 bool no_dependencies,
269 std::set<nodet> end_out;
279 catch(
const std::string &s)
296 bool no_dependencies,
299 std::set<nodet> &ending_vertex);
323 typedef std::map<irep_idt, std::pair<std::set<event_idt>,
335 for(std::set<event_idt>::const_iterator in_it=it->second.first.begin();
336 in_it!=it->second.first.end();
341 for(std::set<event_idt>::const_iterator in_it=it->second.second.begin();
342 in_it!=it->second.second.end();
354 std::multimap<irep_idt, source_locationt>
id2loc;
360 ns(_goto_model.symbol_table),
376 bool no_dependencies,
395 unsigned _max_var = 0,
396 unsigned _max_po_trans = 0,
397 bool _ignore_arrays =
false)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
void set_parameters_collection(unsigned _max_var=0, unsigned _max_po_trans=0, bool _ignore_arrays=false)
void collect_cycles(std::set< critical_cyclet > &set_of_cycles, memory_modelt model, const std::set< event_idt > &filter)
A collection of goto functions.
A generic container class for the GOTO intermediate representation of one function.
instructionst::const_iterator const_targett
void visit_cfg_backedge(goto_programt::const_targett targ, goto_programt::const_targett i_it)
strategy: fwd/bwd alternation
void visit_cfg_reference_function(irep_idt id_function)
references the first and last edges of the function
std::set< irep_idt > functions_met
std::set< event_idt > unknown_read_nodes
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
std::set< event_idt > unknown_write_nodes
instrumentert & instrumenter
void leave_function(const irep_idt &function_id)
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.
std::pair< irep_idt, event_idt > id2node_pairt
bool local(const irep_idt &i)
void visit_cfg_fence(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)
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::map< goto_programt::const_targett, std::set< nodet >, goto_programt::target_less_than > incoming_post
void visit_cfg_lwfence(goto_programt::instructionst::iterator i_it, const irep_idt &function_id)
std::vector< std::set< event_idt > > & egraph_SCCs
void visit_cfg_propagate(goto_programt::instructionst::iterator i_it)
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(value_setst &value_sets, memory_modelt model, bool no_dependencies, loop_strategyt duplicate_body, const irep_idt &function_id)
void visit_cfg_duplicate(const goto_programt &goto_program, goto_programt::const_targett targ, goto_programt::const_targett i_it)
void enter_function(const irep_idt &function_id)
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
std::pair< event_idt, event_idt > nodet
void visit_cfg_thread() const
cfg_visitort(namespacet &_ns, instrumentert &_instrumenter)
std::set< goto_programt::const_targett, goto_programt::target_less_than > updated
void visit_cfg_skip(goto_programt::instructionst::iterator i_it)
void visit_cfg_asm_fence(goto_programt::instructionst::iterator i_it, const irep_idt &function_id)
std::multimap< irep_idt, source_locationt > id2cycloc
void print_outputs(memory_modelt model, bool hide_internals)
void instrument_one_event_per_cycle_inserter(const set_of_cyclest &set)
instrumentert(goto_modelt &_goto_model, messaget &_message)
void instrument_my_events(const std::set< event_idt > &events)
void instrument_all_inserter(const set_of_cyclest &set)
void collect_cycles_by_SCCs(memory_modelt model)
Note: can be distributed (#define DISTRIBUTED)
void instrument_one_read_per_cycle_inserter(const set_of_cyclest &set)
std::set< event_grapht::critical_cyclet > set_of_cyclest
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::map< irep_idt, std::pair< std::set< event_idt >, std::set< event_idt > > > map_function_nodest
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)
void instrument_one_write_per_cycle_inserter(const set_of_cyclest &set)
std::multimap< irep_idt, source_locationt > id2loc
bool is_cfg_spurious(const event_grapht::critical_cyclet &cyc)
map_function_nodest map_function_graph
goto_functionst & goto_functions
std::map< event_idt, event_idt > map_vertex_gnode
void instrument_my_events_inserter(const set_of_cyclest &set, const std::set< event_idt > &events)
std::set< goto_programt::instructiont::targett > target_sett
void instrument_minimum_interference_inserter(const set_of_cyclest &set)
std::vector< std::set< event_grapht::critical_cyclet > > set_of_cycles_per_SCC
void add_instr_to_interleaving(goto_programt::instructionst::iterator it, goto_programt &interleaving)
bool local(const irep_idt &id)
is local variable?
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...
unsigned cost(const event_grapht::critical_cyclet::delayt &e)
cost function
void set_rendering_options(bool aligned, bool file, bool function)
static std::set< event_idt > extract_my_events()
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 print_map_function_graph() const
Class that provides messages with a built-in verbosity 'level'.
mstreamt & warning() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
void dot(const goto_modelt &src, std::ostream &out)
#define PRECONDITION(CONDITION)
A total order over targett and const_targett.
instrumentation_strategyt