5 #include "memoryorder.h"
7 #include "scanalysis.h"
10 #include "threads-model.h"
11 #include "clockvector.h"
12 #include "sc_annotation.h"
16 typedef struct SCGeneratorOption {
30 SnapVector<action_list_t>* getDupThreadLists();
32 struct sc_statistics* getStats();
34 void setExecution(ModelExecution *execution);
35 void setActions(action_list_t *actions);
36 void setPrintAlways(bool val);
37 bool getPrintAlways();
40 void setAnnotationMode(bool val);
42 void setPrintBuggy(bool val);
44 void setPrintNonSC(bool val);
46 action_list_t * getSCList();
48 HashTable<const ModelAction *, const ModelAction *, uintptr_t, 4> *getBadrfset();
50 HashTable<const ModelAction *, const ModelAction *, uintptr_t, 4 > *getAnnotatedReadSet();
52 void print_list(action_list_t *list);
56 /********************** SC-related stuff (beginning) **********************/
57 ModelExecution *execution;
59 action_list_t *actions;
64 action_list_t * generateSC(action_list_t *list);
68 int buildVectors(SnapVector<action_list_t> *threadlist, int *maxthread,
71 bool updateConstraints(ModelAction *act);
73 void computeCV(action_list_t *list);
75 bool processReadFast(ModelAction *read, ClockVector *cv);
77 bool processReadSlow(ModelAction *read, ClockVector *cv, bool *updateFuture);
79 bool processAnnotatedReadSlow(ModelAction *read, ClockVector *cv, bool *updateFuture);
81 int getNextActions(ModelAction **array);
83 bool merge(ClockVector *cv, const ModelAction *act, const ModelAction *act2);
85 void check_rf(action_list_t *list);
86 void check_rf1(action_list_t *list);
88 void reset(action_list_t *list);
90 ModelAction* pruneArray(ModelAction **array, int count);
92 /** This routine is operated based on the built threadlists */
93 void collectAnnotatedReads();
96 HashTable<const ModelAction *, ClockVector *, uintptr_t, 4 > cvmap;
98 HashTable<const ModelAction *, const ModelAction *, uintptr_t, 4 > badrfset;
99 HashTable<void *, const ModelAction *, uintptr_t, 4 > lastwrmap;
100 SnapVector<action_list_t> threadlists;
101 SnapVector<action_list_t> dup_threadlists;
107 struct sc_statistics *stats;
109 /** The set of read actions that are annotated to be special and will
110 * receive special treatment */
111 HashTable<const ModelAction *, const ModelAction *, uintptr_t, 4 > annotatedReadSet;
112 int annotatedReadSetSize;
114 bool annotationError;
116 /** A set of actions that should be ignored in the partially SC analysis */
117 HashTable<const ModelAction*, const ModelAction*, uintptr_t, 4> ignoredActions;