7 #include "threads-model.h"
9 typedef ModelList<FuncInst *> func_inst_list_mt;
13 FuncInst(ModelAction *act, FuncNode *func_node);
16 const char * get_position() const { return position; }
18 void * get_location() const { return location; }
19 void set_location(void * loc) { location = loc; }
21 action_type get_type() const { return type; }
22 memory_order get_mo() const { return order; }
23 FuncNode * get_func_node() const { return func_node; }
25 bool add_pred(FuncInst * other);
26 bool add_succ(FuncInst * other);
28 FuncInst * search_in_collision(ModelAction *act);
29 void add_to_collision(FuncInst * inst);
31 func_inst_list_mt * get_preds() { return &predecessors; }
32 func_inst_list_mt * get_succs() { return &successors; }
35 bool is_write() const;
36 bool is_single_location() { return single_location; }
37 void not_single_location() { single_location = false; }
39 void set_execution_number(int new_number) { execution_number = new_number; }
40 int get_execution_number() { return execution_number; }
42 void set_associated_read(thread_id_t tid, int index, uint32_t marker, uint64_t read_val);
43 uint64_t get_associated_read(thread_id_t tid, int index, uint32_t marker);
49 const char * position;
51 /* Atomic operations with the same source line number may act at different
52 * memory locations, such as the next field of the head pointer in ms-queue.
53 * location only stores the memory location when this FuncInst was constructed.
57 /* NOTE: for rmw actions, func_inst and act may have different
58 * action types because of action type conversion in ModelExecution */
67 ModelVector< ModelVector<uint64_t> * > associated_reads;
68 ModelVector< ModelVector<uint32_t> * > thrd_markers;
71 * Collisions store a list of FuncInsts with the same position
72 * but different action types. For example,
73 * <code>volatile int x; x++;</code> produces read and write
74 * actions with the same position.
76 func_inst_list_mt collisions;
78 func_inst_list_mt predecessors;
79 func_inst_list_mt successors;
82 #endif /* __FUNCINST_H__ */