All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
module.h
Go to the documentation of this file.
1 #ifndef MODULE_H_INCLUDED_
2 #define MODULE_H_INCLUDED_
3 
4 #include<iostream>
5 #include<string>
6 #include<vector>
7 
8 #include"rose.h"
9 #include "class.h"
10 
11 namespace risc {
12 
13 class CThread;
14 class Function;
15 class HierarchicalChannelInstance;
16 class Instance;
17 class Method;
18 class Module;
19 class ModuleInstance;
20 class Port;
21 class PrimitiveChannel;
22 class PrimitiveChannelInstance;
23 class Thread;
24 class VariableInstance;
25 
26 typedef std::pair<Port*, SgBoolValExp*> ResetSignal;
27 
28 typedef std::vector<CThread*> CThreadVector;
29 typedef std::vector<Function*> FunctionVector;
30 typedef std::vector<HierarchicalChannelInstance*> HierarchicalChannelInstanceVector;
31 typedef std::vector<Method*> MethodVector;
32 typedef std::vector<Module*> ModuleVector;
33 typedef std::vector<Module*>::const_iterator ModuleVectorConstIter;
34 typedef std::vector<Module*>::iterator ModuleVectorIter;
35 typedef std::vector<ModuleInstance*> ModuleInstanceVector;
36 typedef std::vector<PrimitiveChannel*> PrimitiveChannelVector;
37 typedef std::vector<PrimitiveChannelInstance*> PrimitiveChannelInstanceVector;
38 typedef std::vector<ResetSignal*> ResetSignalVector;
39 typedef std::vector<Thread*> ThreadVector;
40 typedef std::vector<VariableInstance*> VariableInstanceVector;
41 
49 class Module: public Class {
50 
51 public:
52 
59  explicit Module(SgClassDefinition *ast_node);
60 
67  explicit Module(SgClassDefinition *ast_node, Type type);
68 
69  ~Module();
70 
71  /*
72  * initialization functions
73  */
74 
80  virtual void initialize_functions();
81 
89 
90  /*
91  * helper functions
92  */
93 
98 
102  void print_hierarchy(unsigned indent_level = 0);
103 
104  /*
105  * Vectors module definition elements
106  */
107 
112 
117 
122 
127 
132 
138 
143  std::string get_qualified_type_name();
144 
149  std::string get_mangled_type_name();
150 
155  std::list<Instance*> instances_;
156 
157 private:
158 
162  Module(const Module &md);
163 };
164 
165 } // end of namespace risc
166 
167 #endif /* MODULE_H_INCLUDED_ */
168 
169 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */
std::pair< Port *, SgBoolValExp * > ResetSignal
Definition: cthread.h:15
std::vector< PrimitiveChannel * > PrimitiveChannelVector
Definition: design.h:44
std::vector< Module * > ModuleVector
Definition: design.h:42
ThreadVector threads_
Vector of threads which are defined in this module.
Definition: module.h:111
Module(SgClassDefinition *ast_node)
Creates an empty module definition. All the lists of instances and sub definitions are empty...
Definition: module.cpp:47
ResetSignalVector async_reset_signals_
Vector of async reset signals which are registered in this module.
Definition: module.h:131
CThreadVector cthreads_
Vector of cthreads which are defined in this module.
Definition: module.h:116
std::string get_mangled_type_name()
This function returns the manged type name of the module.
Definition: module.cpp:1276
Definition: class.h:53
std::vector< Function * > FunctionVector
Definition: class.h:37
std::vector< ModuleInstance * > ModuleInstanceVector
Definition: class.h:42
std::vector< Module * >::const_iterator ModuleVectorConstIter
Definition: module.h:33
MethodVector methods_
Vector of methods which are defined in this module.
Definition: module.h:121
std::vector< CThread * > CThreadVector
Definition: cthread.h:54
std::list< Instance * > instances_
Definition: module.h:155
virtual void initialize_functions()
This function searches for all functions, SC_THREADS, SC_CTHREADS, and SC_METHODS in the module defin...
Definition: module.cpp:290
std::vector< Thread * > ThreadVector
Definition: module.h:39
std::vector< Method * > MethodVector
Definition: method.h:43
std::vector< PrimitiveChannelInstance * > PrimitiveChannelInstanceVector
Definition: class.h:45
void print_module_definition()
Prints the complete module design into the terminal.
Definition: module.cpp:809
This class represents instances.
Definition: module.h:49
~Module()
Definition: module.cpp:66
std::vector< ResetSignal * > ResetSignalVector
Definition: cthread.h:22
std::vector< Module * >::iterator ModuleVectorIter
Definition: module.h:34
int instance_counter_
This variable counts how many instances of this given type exists in the design.
Definition: module.h:137
ResetSignalVector reset_signals_
Vector of reset signals which are registered in this module.
Definition: module.h:126
std::vector< HierarchicalChannelInstance * > HierarchicalChannelInstanceVector
Definition: class.h:39
std::string get_qualified_type_name()
This function returns the qualified type name of the module.
Definition: module.cpp:1268
Type
We are using these enums to identify type type of and instance or definition during traversal...
Definition: definition.h:20
std::vector< VariableInstance * > VariableInstanceVector
Definition: module.h:40
void initialize_socket_registration()
This function searches for b_transport registration or dmi registration in the module definition...
Definition: module.cpp:111
void print_hierarchy(unsigned indent_level=0)
Prints the hierarchy. Roots is this definition.
Definition: module.cpp:1190