update doxygen file
[satcheck.git] / planner.h
1 /*      Copyright (c) 2015 Regents of the University of California
2  *
3  *      Author: Brian Demsky <bdemsky@uci.edu>
4  *
5  *      This program is free software; you can redistribute it and/or
6  *      modify it under the terms of the GNU General Public License
7  *      version 2 as published by the Free Software Foundation.
8  */
9
10 #ifndef PLANNER_H
11 #define PLANNER_H
12 #include "classlist.h"
13 #include "hashset.h"
14 #include "mymemory.h"
15 #include "change.h"
16
17 typedef HashSet<MCChange *, intptr_t, 0, model_malloc, model_calloc, model_free, MCChangeHash, MCChangeEquals> ChangeHashSet;
18 typedef HSIterator<MCChange *, intptr_t, 0, model_malloc, model_calloc, model_free,MCChangeHash, MCChangeEquals> ChangeIterator;
19
20 enum PlanResult {NOSCHEDULE, SCHEDULED};
21
22 class Planner {
23 public:
24         Planner(MCExecution * e);
25         ~Planner();
26         bool is_finished();
27         void plan();
28         void addChange(MCChange *change);
29         void processChanges();
30         void processEquals(MCChange * change);
31         void processFunction(MCChange * change);
32         void processRMW(MCChange * change);
33         void processLoad(MCChange * change);
34         void processStore(MCChange * change);
35         bool checkConstGraph(EPRecord *record, uint64_t val);
36         void registerValue(EPRecord *record, uint64_t val, unsigned int index);
37         ConstGen * getConstGen() {return cgen;}
38
39         MEMALLOC;
40
41 private:
42         void registerBranchValue(EPRecord *record, uint64_t val, unsigned int index);
43         void registerLoadValue(EPRecord *record, uint64_t val, unsigned int index);
44         void registerRMWValue(EPRecord *record, uint64_t val, unsigned int index);
45         void registerStoreValue(EPRecord *record, uint64_t val, unsigned int index);
46         void registerFunctionValue(EPRecord *record, uint64_t val, unsigned int index);
47         void registerEqualsValue(EPRecord *record, uint64_t val, unsigned int index);
48         void doRMWRFChange(EPRecord *record, uint64_t readval);
49         void doRMWBaseChange(EPRecord *record, uint64_t baseval);
50         void doRMWOldValChange(EPRecord *record);
51         void doRMWNewAddrChange(EPRecord *record, uint64_t addr);
52
53
54
55         void processNewStoreAddress(MCChange *change);
56         void processNewStoreValue(MCChange *change);
57         void processNewReturnValue(MCChange *change);
58         void processNewLoadAddress(MCChange *change);
59         MCExecution * e;
60         ChangeHashSet * changeset;
61         ChangeHashSet * completedset;
62         ConstGen *cgen;
63         bool finished;
64 };
65 #endif