bug in fence support fixed
[model-checker.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         unsigned int sccount;
9         unsigned int nonsccount;
10         unsigned long long actions;
11 };
12
13 class SCAnalysis : public TraceAnalysis {
14  public:
15         SCAnalysis();
16         ~SCAnalysis();
17         virtual void setExecution(ModelExecution * execution);
18         virtual void analyze(action_list_t *);
19         virtual const char * name();
20         virtual bool option(char *);
21         virtual void finish();
22
23
24         SNAPSHOTALLOC
25  private:
26         void update_stats();
27         void print_list(action_list_t *list);
28         int buildVectors(action_list_t *);
29         bool updateConstraints(ModelAction *act);
30         void computeCV(action_list_t *);
31         action_list_t * generateSC(action_list_t *);
32         bool processRead(ModelAction *read, ClockVector *cv);
33         int getNextActions(ModelAction **array);
34         bool merge(ClockVector *cv, const ModelAction *act, const ModelAction *act2);
35         void check_rf(action_list_t *list);
36         void reset(action_list_t *list);
37         ModelAction* pruneArray(ModelAction**, int);
38
39         int maxthreads;
40         HashTable<const ModelAction *, ClockVector *, uintptr_t, 4 > cvmap;
41         bool cyclic;
42         HashTable<const ModelAction *, const ModelAction *, uintptr_t, 4 > badrfset;
43         HashTable<void *, const ModelAction *, uintptr_t, 4 > lastwrmap;
44         SnapVector<action_list_t> threadlists;
45         ModelExecution *execution;
46         bool print_always;
47         bool print_buggy;
48         bool print_nonsc;
49         bool time;
50         struct sc_statistics *stats;
51 };
52 #endif