+/*
+uint64_t ModelHistory::query_last_read(void * location, thread_id_t tid)
+{
+ SnapVector<func_id_list_t> * thrd_func_list = model->get_execution()->get_thrd_func_list();
+ uint32_t id = id_to_int(tid);
+
+ ASSERT( thrd_func_list->size() > id );
+ uint32_t func_id = (*thrd_func_list)[id].back();
+ FuncNode * func_node = func_nodes[func_id];
+
+ uint64_t last_read_val = 0xdeadbeef;
+ if (func_node != NULL) {
+ last_read_val = func_node->query_last_read(location, tid);
+ }
+
+ return last_read_val;
+}
+*/
+
+void ModelHistory::add_to_write_history(void * location, uint64_t write_val)
+{
+ value_set_t * write_set = write_history.get(location);
+
+ if (write_set == NULL) {
+ write_set = new value_set_t();
+ write_history.put(location, write_set);
+ }
+
+ write_set->add(write_val);
+}
+
+void ModelHistory::add_to_loc_func_nodes_map(void * location, FuncNode * node)
+{
+ SnapList<FuncNode *> * func_node_list = loc_func_nodes_map.get(location);
+ if (func_node_list == NULL) {
+ func_node_list = new SnapList<FuncNode *>();
+ loc_func_nodes_map.put(location, func_node_list);
+ }
+
+ func_node_list->push_back(node);
+}
+
+void ModelHistory::set_new_exec_flag()
+{
+ for (uint i = 1; i < func_nodes.size(); i++) {
+ FuncNode * func_node = func_nodes[i];
+ func_node->set_new_exec_flag();
+ }
+}
+
+void ModelHistory::print_write()
+{
+}
+
+void ModelHistory::print_func_node()
+{
+ /* function id starts with 1 */
+ for (uint32_t i = 1; i < func_nodes.size(); i++) {
+ FuncNode * func_node = func_nodes[i];
+
+ func_inst_list_mt * entry_insts = func_node->get_entry_insts();
+ model_print("function %s has entry actions\n", func_node->get_func_name());
+
+ mllnode<FuncInst*>* it;
+ for (it = entry_insts->begin();it != NULL;it=it->getNext()) {
+ FuncInst *inst = it->getVal();