X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=newfuzzer.h;h=02c3fc0102d5e4b359fa43acb4b3737f85010078;hb=f820ef3caa1dc1a5bd935f901d7bc9c1f653e423;hp=d1037a61f5481378c46d5f317d0c071ba7afdb82;hpb=bf2121ac2a964022f09c30ebb904bef7ceb2df8d;p=c11tester.git diff --git a/newfuzzer.h b/newfuzzer.h index d1037a61..02c3fc01 100644 --- a/newfuzzer.h +++ b/newfuzzer.h @@ -5,12 +5,26 @@ #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: NewFuzzer(); int selectWrite(ModelAction *read, SnapVector* rf_set); - Predicate * get_selected_child_branch(thread_id_t tid); bool has_paused_threads(); void notify_paused_thread(Thread * thread); @@ -20,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: @@ -30,22 +45,29 @@ 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; - 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, inst_act_map_t * inst_act_map, SnapVector * rf_set); Predicate * selectBranch(thread_id_t tid, Predicate * curr_pred, FuncInst * read_inst); + bool prune_writes(thread_id_t tid, Predicate * pred, SnapVector * rf_set, inst_act_map_t * inst_act_map); + 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; + SnapVector paused_thread_list; //-- (not in use) + HashTable paused_thread_table; //-- HashTable failed_predicates; - void conditional_sleep(Thread * thread); - void wake_up_paused_threads(int * threadlist, int * numthreads); + SnapVector dist_info_vec; //-- + + void conditional_sleep(Thread * thread); //-- + void wake_up_paused_threads(int * threadlist, int * numthreads); //-- + + bool find_threads(ModelAction * pending_read); //-- - bool find_threads(ModelAction * pending_read); + bool check_predicate_expressions(PredExprSet * pred_expressions, inst_act_map_t * inst_act_map, uint64_t write_val, bool * no_predicate); }; -#endif /* end of __NEWFUZZER_H__ */ +#endif /* end of __NEWFUZZER_H__ */