public:
Fuzzer() {}
virtual int selectWrite(ModelAction *read, SnapVector<ModelAction *>* rf_set);
- virtual Predicate * get_selected_child_branch(thread_id_t tid) = 0;
virtual bool has_paused_threads() { return false; }
virtual void notify_paused_thread(Thread * thread) = 0;
virtual Thread * selectThread(int * threadlist, int numthreads);
if (act->is_read()) {
func_node->update_inst_act_map(tid, act);
-
- // Update predicate tree position
- Fuzzer * fuzzer = execution->getFuzzer();
- Predicate * selected_branch = fuzzer->get_selected_child_branch(tid);
- func_node->set_predicate_tree_position(tid, selected_branch);
}
}
for (uint32_t i = 1; i < func_nodes.size(); i++) {
FuncNode * func_node = func_nodes[i];
+ func_node->print_predicate_tree();
+/*
func_inst_list_mt * entry_insts = func_node->get_entry_insts();
model_print("function %s has entry actions\n", func_node->get_func_name());
FuncInst *inst = it->getVal();
model_print("type: %d, at: %s\n", inst->get_type(), inst->get_position());
}
+ */
}
}
if (read != thrd_last_read_act[thread_id]) {
FuncNode * func_node = history->get_curr_func_node(tid);
Predicate * curr_pred = func_node->get_predicate_tree_position(tid);
+
FuncInst * read_inst = func_node->get_inst(read);
Predicate * selected_branch = selectBranch(tid, curr_pred, read_inst);
Predicate * random_branch = branches[ index ];
thrd_selected_child_branch[thread_id] = random_branch;
+ // Update predicate tree position
+ FuncNode * func_node = history->get_curr_func_node(tid);
+ func_node->set_predicate_tree_position(tid, random_branch);
+
return random_branch;
}
SnapVector<double> factors = SnapVector<double>( branches->size() + 1 );
for (uint i = 0; i < branches->size(); i++) {
Predicate * branch = (*branches)[i];
- double factor = (double) numerator / (branch->get_expl_count() + 2 * branch->get_fail_count() + 1);
+ double factor = (double) numerator / (branch->get_expl_count() + 5 * branch->get_fail_count() + 1);
total_factor += factor;
factors.push_back(factor);
}
history->remove_waiting_write(tid);
history->remove_waiting_thread(tid);
- //model_print("thread %d is woken up\n", tid);
threadlist[*numthreads] = tid;
(*numthreads)++;
public:
NewFuzzer();
int selectWrite(ModelAction *read, SnapVector<ModelAction *>* rf_set);
- Predicate * get_selected_child_branch(thread_id_t tid);
bool has_paused_threads();
void notify_paused_thread(Thread * thread);
SnapVector<Predicate *> thrd_selected_child_branch;
SnapVector< SnapVector<ModelAction *> *> thrd_pruned_writes;
+ Predicate * get_selected_child_branch(thread_id_t tid);
bool prune_writes(thread_id_t tid, Predicate * pred, SnapVector<ModelAction *> * rf_set, inst_act_map_t * inst_act_map);
Predicate * selectBranch(thread_id_t tid, Predicate * curr_pred, FuncInst * read_inst);
int choose_index(SnapVector<Predicate *> * branches, uint32_t numerator);
if (does_write) {
model_print("Does write\n");
}
- model_print("Count: %d\n", exploration_count);
+ model_print("Count: %d, failed count: %d\n", exploration_count, failure_count);
model_print("\"];\n");
}