X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=newfuzzer.h;h=45a7e8bbe91f44f867e22958502491ffb64b4fa6;hp=e94de3387f471a981cb0e5a02fad59171919bbb7;hb=7719c6dc7e1a6dade8dfa022f3c9e19853f3e89f;hpb=064db08aed92a31adbf00497f4dc4608f5b99857 diff --git a/newfuzzer.h b/newfuzzer.h index e94de338..45a7e8bb 100644 --- a/newfuzzer.h +++ b/newfuzzer.h @@ -5,6 +5,21 @@ #include "classlist.h" #include "mymemory.h" #include "stl-model.h" +#include "predicate.h" + +struct node_dist_info { + node_dist_info(thread_id_t tid, FuncNode * node, int distance) : + tid(tid), + target(node), + dist(distance) + {} + + thread_id_t tid; + FuncNode * target; + int dist; + + SNAPSHOTALLOC +}; class NewFuzzer : public Fuzzer { public: @@ -19,7 +34,8 @@ public: bool shouldWake(const ModelAction * sleep); bool shouldWait(const ModelAction * wait); - void register_engine(ModelHistory * history, ModelExecution * execution); + void register_engine(ModelChecker * model, ModelExecution * execution); + Predicate * get_selected_child_branch(thread_id_t tid); SNAPSHOTALLOC private: @@ -29,25 +45,26 @@ private: SnapVector thrd_last_read_act; SnapVector thrd_last_func_inst; + SnapVector available_branches_tmp_storage; SnapVector thrd_selected_child_branch; SnapVector< SnapVector *> thrd_pruned_writes; - Predicate * get_selected_child_branch(thread_id_t tid); - bool prune_writes(thread_id_t tid, Predicate * pred, SnapVector * rf_set, inst_act_map_t * inst_act_map); + bool check_branch_inst(Predicate * curr_pred, FuncInst * read_inst, SnapVector * rf_set); Predicate * selectBranch(thread_id_t tid, Predicate * curr_pred, FuncInst * read_inst); - int choose_index(SnapVector * branches, uint32_t numerator); + bool prune_writes(thread_id_t tid, Predicate * pred, SnapVector * rf_set); + int choose_branch_index(SnapVector * branches); /* The set of Threads put to sleep by NewFuzzer because no writes in rf_set satisfies the selected predicate. Only used by selectWrite. */ - SnapVector paused_thread_list; - HashTable paused_thread_table; - HashTable failed_predicates; + SnapVector paused_thread_list; //-- (not in use) + HashTable paused_thread_table; //-- + + SnapVector dist_info_vec; //-- - void conditional_sleep(Thread * thread); - void wake_up_paused_threads(int * threadlist, int * numthreads); + void conditional_sleep(Thread * thread); //-- + void wake_up_paused_threads(int * threadlist, int * numthreads); //-- - bool find_threads(ModelAction * pending_read); - void update_predicate_score(Predicate * predicate, int type); + bool find_threads(ModelAction * pending_read); //-- }; -#endif /* end of __NEWFUZZER_H__ */ +#endif /* end of __NEWFUZZER_H__ */