systemc-clang 2.0.0
Parsing SystemC constructs
Loading...
Searching...
No Matches
EntryFunctionContainer.h
Go to the documentation of this file.
1//===-- src/EntryFunctionContainer.h - systec-clang class definition -------*-
2// C++ -*-===//
3//
4// systemc-clang: SystemC Parser
5//
6// This file is distributed under the University of Illinois License.
7// See LICENSE.mkd for details.
8//
9//===----------------------------------------------------------------------===//
14//===----------------------------------------------------------------------===//
15#ifndef _ENTRY_FUNCTION_CONTAINER_H_
16#define _ENTRY_FUNCTION_CONTAINER_H_
17
18#include <map>
19#include <string>
20#include "FindNotify.h"
21#include "SensitivityMatcher.h"
22#include "FindWait.h"
23//#include "NotifyContainer.h"
24#include "SuspensionAutomata.h"
25#include "Utility.h"
26//#include "WaitContainer.h"
27//#include "clang/AST/DeclCXX.h"
28
29namespace clang {
30 class ValueDecl;
31 class MemberExpr;
32 class VarDecl;
33 class ArraySubscriptExpr;
34 class Stmt;
35 class CXXMethodDecl;
36 class Expr;
37};
38
39
40namespace systemc_clang {
41
43 //
44 //
45 class WaitContainer;
46 class NotifyContainer;
47
48enum class ASTSTATE {
49 EMPTY,
54}; // End enum ASTSTATE
55
56enum class ReadWrite { RWINIT, READ, WRITE }; // End enum ReadWrite
57
58enum class PROCESS_TYPE {
59 NONE,
60 THREAD,
61 CTHREAD,
62 METHOD
63}; // End enum PROCESS_TYPE
64
66 public:
68 typedef std::vector<WaitContainer *> waitContainerListType;
69 typedef std::vector<NotifyContainer *> notifyContainerListType;
70
71 typedef std::pair<int, SuspensionAutomata::transitionVectorType>
73 typedef std::map<int, SuspensionAutomata::transitionVectorType>
75
76 typedef std::pair<int, SuspensionAutomata::susCFGVectorType>
78 typedef std::map<int, SuspensionAutomata::susCFGVectorType>
80
81 // Sensitivity information
82 typedef std::tuple<std::string, clang::ValueDecl *, clang::MemberExpr *,
83 clang::VarDecl*, clang::ArraySubscriptExpr *, clang::ForStmt *>
85 typedef std::pair<std::string, std::vector<SensitivityTupleType>>
87
88 typedef std::map<std::string, std::vector<SensitivityTupleType>> SenseMapType;
89
91 EntryFunctionContainer(std::string, PROCESS_TYPE, clang::CXXMethodDecl *,
92 clang::Stmt *);
94
97
98 // Accessors.
99 std::string getName();
100 clang::CXXMethodDecl *getEntryMethod();
101 // Stmt *getConstructorStmt ();
103
111
112 // Add waits.
113 // void addSensitivityInfo(FindSensitivity &);
115 void addWaits(FindWait &);
116 void addNotifys(FindNotify &);
118 // void setConstructorStmt (Stmt *);
119 void setName(std::string);
121 void setEntryMethod(clang::CXXMethodDecl *);
122 void dumpSusCFG(llvm::raw_ostream &);
123 void dumpSauto(llvm::raw_ostream &);
124 void dump(llvm::raw_ostream &);
125
126
127 // Reset signal handling
128 void addResetSignal(std::pair<std::string, const clang::Expr*> reset_signal);
129 void addResetEdge(std::pair<std::string, const clang::Expr*> reset_edge);
130 void addResetType(bool reset_type);
131
132 const std::pair<std::string, const clang::Expr*> getResetSignal() const;
133 const std::pair<std::string, const clang::Expr*> getResetEdge() const;
134 bool isResetAsync() const;
135
136
137 // private:
138 std::string entry_name_;
140 clang::CXXMethodDecl *entry_method_decl_;
141
142 // Hold all the waits.
145
146 // Sensitivity information
148
149 std::vector<Transition *> _susAuto;
150 std::vector<SusCFG *> _susCFG;
151
153 std::pair<std::string, const clang::Expr*> reset_signal_;
154 std::pair<std::string, const clang::Expr*> reset_edge_;
156
157
158};
159} // namespace systemc_clang
160#endif
A set of utility functions in the Utility class.
std::vector< NotifyContainer * > notifyContainerListType
std::map< int, SuspensionAutomata::transitionVectorType > instanceSautoMapType
const std::pair< std::string, const clang::Expr * > getResetSignal() const
std::tuple< std::string, clang::ValueDecl *, clang::MemberExpr *, clang::VarDecl *, clang::ArraySubscriptExpr *, clang::ForStmt * > SensitivityTupleType
std::map< std::string, std::vector< SensitivityTupleType > > SenseMapType
std::pair< int, SuspensionAutomata::transitionVectorType > instanceSautoPairType
instanceSautoMapType getInstanceSautoMap()
instanceSusCFGMapType getInstanceSusCFGMap()
std::map< int, SuspensionAutomata::susCFGVectorType > instanceSusCFGMapType
std::pair< std::string, const clang::Expr * > reset_signal_
Reset information.
const std::pair< std::string, const clang::Expr * > getResetEdge() const
std::pair< int, SuspensionAutomata::susCFGVectorType > instanceSusCFGPairType
EntryFunctionContainer(std::string, PROCESS_TYPE, clang::CXXMethodDecl *, clang::Stmt *)
SuspensionAutomata::transitionVectorType getSusAuto()
std::vector< WaitContainer * > waitContainerListType
typedefs
void addResetEdge(std::pair< std::string, const clang::Expr * > reset_edge)
std::pair< std::string, const clang::Expr * > reset_edge_
void addResetSignal(std::pair< std::string, const clang::Expr * > reset_signal)
std::pair< std::string, std::vector< SensitivityTupleType > > SensitivityPairType
SuspensionAutomata::susCFGVectorType getSusCFG()
vector< Transition * > transitionVectorType
Clang forward declarations.
Definition FindArgument.h:6