00001 #ifndef MODULE_H_INCLUDED_ 00002 #define MODULE_H_INCLUDED_ 00003 00004 #include<iostream> 00005 #include<string> 00006 #include<vector> 00007 00008 #include "module_instance.h" 00009 #include "variable.h" 00010 00011 #include "function.h" 00012 #include "thread.h" 00013 #include "cthread.h" 00014 #include "method.h" 00015 00016 #include "hierarchical_channel.h" 00017 #include "hierarchical_channel_instance.h" 00018 #include "primitive_channel.h" 00019 #include "primitive_channel_instance.h" 00020 00021 #include "event.h" 00022 00023 #include "inport.h" 00024 #include "inoutport.h" 00025 #include "outport.h" 00026 00027 #include "class.h" 00028 00029 00030 namespace risc { 00031 00032 class Module; 00033 typedef std::vector<Module*> ModuleVector; 00034 typedef std::vector<Module*>::iterator ModuleVectorIter; 00035 typedef std::vector<Module*>::const_iterator ModuleVectorConstIter; 00036 00044 class Module: public Class { 00045 00046 public: 00047 00054 explicit Module(SgClassDefinition *ast_node); 00055 00056 ~Module(); 00057 00058 00060 00065 void initialize_variables(); 00066 00072 void initialize_functions(); 00073 00075 00079 void print_module_definition(); 00080 00084 void print_hierarchy(unsigned indent_level = 0); 00085 00089 Event* find_event(SgVariableDefinition* var_def); 00090 00091 00093 00097 VariableVector variables_; 00098 00102 ModuleVector sub_modules_defs_; 00103 00107 ModuleInstanceVector sub_modules_; 00108 00113 PrimitiveChannelInstanceVector sub_prim_channel_; 00114 00119 HierarchicalChannelInstanceVector sub_hier_channel_; 00120 00126 PrimitiveChannelVector sub_prim_channel_defs_; 00127 00133 HierarchicalChannelVector sub_hier_channel_defs_; 00134 00138 ThreadVector threads_; 00139 00143 CThreadVector cthreads_; 00144 00148 MethodVector methods_; 00149 00153 FunctionVector functions_; 00154 00158 InPortVector inports_; 00159 00163 InOutPortVector inoutports_; 00164 00168 OutPortVector outports_; 00169 00173 EventVector events_; 00174 00175 private: 00176 00180 Module(const Module &md); 00181 }; 00182 00183 } // end of namespace risc 00184 00185 #endif /* MODULE_H_INCLUDED_ */ 00186 00187 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */