10 #ifndef CPROVER_GOTO_INSTRUMENT_WMM_SHARED_BUFFERS_H
11 #define CPROVER_GOTO_INSTRUMENT_WMM_SHARED_BUFFERS_H
46 throw "sorry, CAV11 only available for TSO";
112 const unsigned current_thread);
119 const unsigned current_thread);
127 const unsigned current_thread,
128 const bool tso_pso_rmo);
145 assignment(goto_program, t, source_location, id_lhs,
146 ns.
lookup(id_rhs).symbol_expr());
166 return add(*maybe_symbol,
"_weak_choice" + suffix,
bool_typet());
250 const std::string &suffix,
252 bool added_as_instrumentation);
257 return add(
object, suffix, type,
true);
263 const std::string &suffix,
266 return add(
object, suffix, type,
false);
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
A collection of goto functions.
This class represents an instruction in the GOTO intermediate representation.
A generic container class for the GOTO intermediate representation of one function.
instructionst::iterator targett
Class that provides messages with a built-in verbosity 'level'.
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().
shared_bufferst & shared_buffers
symbol_table_baset & symbol_table
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
cfg_visitort(shared_bufferst &_shared, symbol_table_baset &_symbol_table, goto_functionst &_goto_functions)
std::set< irep_idt > past_writes
goto_functionst & goto_functions
std::vector< irep_idt > r_buff0_thds
irep_idt read_delayed_var
std::vector< irep_idt > r_buff1_thds
std::multimap< irep_idt, source_locationt > cycles_loc
const varst & operator()(const irep_idt &object)
instruments the variable
void set_cav11(memory_modelt model)
void nondet_flush(const irep_idt &function_id, goto_programt &goto_program, goto_programt::targett &t, const source_locationt &source_location, const irep_idt &object, const unsigned current_thread, const bool tso_pso_rmo)
instruments read
std::string unique()
returns a unique id (for fresh variables)
void write(goto_programt &goto_program, goto_programt::targett &t, const source_locationt &source_location, const irep_idt &object, goto_programt::instructiont &original_instruction, const unsigned current_thread)
instruments write
void weak_memory(value_setst &value_sets, symbol_table_baset &symbol_table, goto_programt &goto_program, memory_modelt model, goto_functionst &goto_functions)
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...
shared_bufferst(symbol_table_baset &_symbol_table, unsigned _nb_threads, messaget &_message)
void det_flush(goto_programt &goto_program, goto_programt::targett &t, const source_locationt &source_location, const irep_idt &object, const unsigned current_thread)
flush buffers (instruments fence)
irep_idt add_fresh_var(const symbolt &object, const std::string &suffix, const typet &type)
void add_initialization(goto_programt &goto_program)
bool is_buffered_in_general(const symbol_exprt &, bool is_write)
void assignment(goto_programt &goto_program, goto_programt::targett &t, const source_locationt &source_location, const irep_idt &id_lhs, const exprt &rhs)
add an assignment in the goto-program
irep_idt add(const symbolt &object, const std::string &suffix, const typet &type, bool added_as_instrumentation)
add a new var for instrumenting the input var
std::set< irep_idt > affected_by_delay_set
class symbol_table_baset & symbol_table
std::set< irep_idt > cycles
void delay_read(goto_programt &goto_program, goto_programt::targett &t, const source_locationt &source_location, const irep_idt &read_object, const irep_idt &write_object)
delays a read (POWER)
void flush_read(goto_programt &goto_program, goto_programt::targett &t, const source_locationt &source_location, const irep_idt &write_object)
flushes read (POWER)
std::multimap< irep_idt, source_locationt > cycles_r_loc
std::map< irep_idt, varst > var_mapt
irep_idt choice(const irep_idt &function_id, const std::string &suffix)
void add_initialization_code(goto_functionst &goto_functions)
bool track(const irep_idt &id) const
irep_idt add(const symbolt &object, const std::string &suffix, const typet &type)
bool is_buffered(const namespacet &, const symbol_exprt &, bool is_write)
std::set< irep_idt > instrumentations
void assignment(goto_programt &goto_program, goto_programt::targett &t, const source_locationt &source_location, const irep_idt &id_lhs, const irep_idt &id_rhs)
Expression to hold a symbol (variable)
The symbol table base class interface.
const symbolt * lookup(const irep_idt &name) const
Find a symbol in the symbol table for read-only access.
The type of an expression, extends irept.
#define CHECK_RETURN(CONDITION)