document and extend trace analysis interface
[c11tester.git] / scanalysis.h
1 #ifndef SCANALYSIS_H
2 #define SCANALYSIS_H
3 #include "traceanalysis.h"
4 #include "hashtable.h"
5
6 struct sc_statistics {
7         unsigned long long elapsedtime;
8 };
9
10 class SCAnalysis : public TraceAnalysis {
11  public:
12         SCAnalysis();
13         ~SCAnalysis();
14         virtual void setExecution(ModelExecution * execution);
15         virtual void analyze(action_list_t *);
16         virtual const char * name();
17         virtual bool option(char *);
18         virtual void finish();
19
20
21         SNAPSHOTALLOC
22  private:
23         void print_list(action_list_t *list);
24         int buildVectors(action_list_t *);
25         bool updateConstraints(ModelAction *act);
26         void computeCV(action_list_t *);
27         action_list_t * generateSC(action_list_t *);
28         bool processRead(ModelAction *read, ClockVector *cv);
29         int getNextActions(ModelAction **array);
30         bool merge(ClockVector *cv, const ModelAction *act, const ModelAction *act2);
31         void check_rf(action_list_t *list);
32         void reset(action_list_t *list);
33         ModelAction* pruneArray(ModelAction**, int);
34
35         int maxthreads;
36         HashTable<const ModelAction *, ClockVector *, uintptr_t, 4 > cvmap;
37         bool cyclic;
38         HashTable<const ModelAction *, const ModelAction *, uintptr_t, 4 > badrfset;
39         HashTable<void *, const ModelAction *, uintptr_t, 4 > lastwrmap;
40         SnapVector<action_list_t> threadlists;
41         ModelExecution *execution;
42         bool print_always;
43         bool print_buggy;
44         bool time;
45         struct sc_statistics *stats;
46 };
47 #endif