Merge demsky's SC analysis fixup
[cdsspec-compiler.git] / scanalysis.h
1 #ifndef SCANALYSIS_H
2 #define SCANALYSIS_H
3 #include "traceanalysis.h"
4 #include "hashtable.h"
5
6 class SCAnalysis : public TraceAnalysis {
7  public:
8         SCAnalysis(const ModelExecution *execution);
9         ~SCAnalysis();
10         virtual void analyze(action_list_t *);
11
12         SNAPSHOTALLOC
13  private:
14         void print_list(action_list_t *list);
15         int buildVectors(action_list_t *);
16         bool updateConstraints(ModelAction *act);
17         void computeCV(action_list_t *);
18         action_list_t * generateSC(action_list_t *);
19         bool processRead(ModelAction *read, ClockVector *cv);
20         int getNextActions(ModelAction **array);
21         bool merge(ClockVector *cv, const ModelAction *act, const ModelAction *act2);
22         void check_rf(action_list_t *list);
23         void reset(action_list_t *list);
24         ModelAction* pruneArray(ModelAction**, int);
25
26         int maxthreads;
27         HashTable<const ModelAction *, ClockVector *, uintptr_t, 4 > cvmap;
28         bool cyclic;
29         HashTable<const ModelAction *, const ModelAction *, uintptr_t, 4 > badrfset;
30         HashTable<void *, const ModelAction *, uintptr_t, 4 > lastwrmap;
31         SnapVector<action_list_t> threadlists;
32         const ModelExecution *execution;
33 };
34 #endif