6 #include "threads-model.h"
10 typedef ModelList<FuncInst *> func_inst_list_mt;
14 FuncInst(ModelAction *act, FuncNode *func_node);
17 const char * get_position() const { return position; }
19 void * get_location() const { return location; }
20 void set_location(void * loc) { location = loc; }
22 action_type get_type() const { return type; }
23 memory_order get_mo() const { return order; }
24 FuncNode * get_func_node() const { return func_node; }
26 bool add_pred(FuncInst * other);
27 bool add_succ(FuncInst * other);
29 FuncInst * search_in_collision(ModelAction *act);
30 void add_to_collision(FuncInst * inst);
32 func_inst_list_mt * get_preds() { return &predecessors; }
33 func_inst_list_mt * get_succs() { return &successors; }
36 bool is_write() const;
37 bool is_single_location() { return single_location; }
38 void not_single_location() { single_location = false; }
40 void set_execution_number(int new_number) { execution_number = new_number; }
41 int get_execution_number() { return execution_number; }
43 void set_associated_read(thread_id_t tid, uint64_t read_val, uint32_t marker);
44 uint64_t get_associated_read(thread_id_t tid, uint32_t marker);
50 const char * position;
52 /* Atomic operations with the same source line number may act at different
53 * memory locations, such as the next field of the head pointer in ms-queue.
54 * location only stores the memory location when this FuncInst was constructed.
58 /* NOTE: for rmw actions, func_inst and act may have different
59 * action types because of action type conversion in ModelExecution */
68 ModelVector<uint64_t> associated_reads;
69 ModelVector<uint32_t> thrd_marker;
72 * Collisions store a list of FuncInsts with the same position
73 * but different action types. For example,
74 * <code>volatile int x; x++;</code> produces read and write
75 * actions with the same position.
77 func_inst_list_mt collisions;
79 func_inst_list_mt predecessors;
80 func_inst_list_mt successors;
83 #endif /* __FUNCINST_H__ */