00001 #ifndef MODULE_H_INCLUDED_ 00002 #define MODULE_H_INCLUDED_ 00003 00004 #include<iostream> 00005 #include<string> 00006 #include<vector> 00007 00008 #include"rose.h" 00009 #include "class.h" 00010 00011 namespace risc { 00012 00013 class CThread; 00014 class Function; 00015 class HierarchicalChannelInstance; 00016 class Method; 00017 class Module; 00018 class ModuleInstance; 00019 class Port; 00020 class PrimitiveChannel; 00021 class PrimitiveChannelInstance; 00022 class Thread; 00023 class VariableInstance; 00024 00025 typedef std::pair<Port*, SgBoolValExp*> ResetSignal; 00026 00027 typedef std::vector<CThread*> CThreadVector; 00028 typedef std::vector<Function*> FunctionVector; 00029 typedef std::vector<HierarchicalChannelInstance*> HierarchicalChannelInstanceVector; 00030 typedef std::vector<Method*> MethodVector; 00031 typedef std::vector<Module*> ModuleVector; 00032 typedef std::vector<Module*>::const_iterator ModuleVectorConstIter; 00033 typedef std::vector<Module*>::iterator ModuleVectorIter; 00034 typedef std::vector<ModuleInstance*> ModuleInstanceVector; 00035 typedef std::vector<PrimitiveChannel*> PrimitiveChannelVector; 00036 typedef std::vector<PrimitiveChannelInstance*> PrimitiveChannelInstanceVector; 00037 typedef std::vector<ResetSignal*> ResetSignalVector; 00038 typedef std::vector<Thread*> ThreadVector; 00039 typedef std::vector<VariableInstance*> VariableInstanceVector; 00040 00048 class Module: public Class { 00049 00050 public: 00051 00058 explicit Module(SgClassDefinition *ast_node); 00059 00066 explicit Module(SgClassDefinition *ast_node, Type type); 00067 00068 ~Module(); 00069 00070 /* 00071 * initialization functions 00072 */ 00073 00079 virtual void initialize_functions(); 00080 00081 /* 00082 * helper functions 00083 */ 00084 00088 void print_module_definition(); 00089 00093 void print_hierarchy(unsigned indent_level = 0); 00094 00095 /* 00096 * Vectors module definition elements 00097 */ 00098 00102 ThreadVector threads_; 00103 00107 CThreadVector cthreads_; 00108 00112 MethodVector methods_; 00113 00117 ResetSignalVector reset_signals_; 00118 00122 ResetSignalVector async_reset_signals_; 00123 00128 int instance_counter_; 00129 00134 std::string get_mangled_type_name(); 00135 00136 private: 00137 00141 Module(const Module &md); 00142 }; 00143 00144 } // end of namespace risc 00145 00146 #endif /* MODULE_H_INCLUDED_ */ 00147 00148 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */