1 #ifndef __NEWFUZZER_H__
2 #define __NEWFUZZER_H__
10 struct node_dist_info {
11 node_dist_info(thread_id_t tid, FuncNode * node, int distance) :
24 class NewFuzzer : public Fuzzer {
27 int selectWrite(ModelAction *read, SnapVector<ModelAction *>* rf_set);
28 bool has_paused_threads();
29 void notify_paused_thread(Thread * thread);
31 Thread * selectThread(int * threadlist, int numthreads);
32 Thread * selectNotify(action_list_t * waiters);
33 bool shouldSleep(const ModelAction * sleep);
34 bool shouldWake(const ModelAction * sleep);
35 bool shouldWait(const ModelAction * wait);
37 void register_engine(ModelChecker * model, ModelExecution * execution);
38 Predicate * get_selected_child_branch(thread_id_t tid);
42 ModelHistory * history;
43 ModelExecution * execution;
45 SnapVector<ModelAction *> thrd_last_read_act;
46 SnapVector<FuncInst *> thrd_last_func_inst;
48 SnapVector<Predicate *> available_branches_tmp_storage;
49 SnapVector<Predicate *> thrd_selected_child_branch;
50 SnapVector< SnapVector<ModelAction *> *> thrd_pruned_writes;
52 bool check_branch_inst(Predicate * curr_pred, FuncInst * read_inst, SnapVector<ModelAction *> * rf_set);
53 Predicate * selectBranch(thread_id_t tid, Predicate * curr_pred, FuncInst * read_inst);
54 bool prune_writes(thread_id_t tid, Predicate * pred, SnapVector<ModelAction *> * rf_set);
55 int choose_branch_index(SnapVector<Predicate *> * branches);
57 /* The set of Threads put to sleep by NewFuzzer because no writes in rf_set satisfies the selected predicate. Only used by selectWrite.
59 SnapVector<Thread *> paused_thread_list; //-- (not in use)
60 HashTable<Thread *, int, uintptr_t, 0> paused_thread_table; //--
62 SnapVector<struct node_dist_info> dist_info_vec; //--
64 void conditional_sleep(Thread * thread); //--
65 void wake_up_paused_threads(int * threadlist, int * numthreads); //--
67 bool find_threads(ModelAction * pending_read); //--
70 #endif /* end of __NEWFUZZER_H__ */