00001 #ifndef DESGIN_H_INCLUDED_ 00002 #define DESGIN_H_INCLUDED_ 00003 00004 #include "rose.h" 00005 00006 #include "module.h" 00007 #include "primitive_channel.h" 00008 #include "hierarchical_channel.h" 00009 00010 #include "event.h" 00011 00012 #include "thread.h" 00013 #include "cthread.h" 00014 #include "method.h" 00015 #include "function.h" 00016 00017 #include "instance_tree.h" 00018 #include "path_instance_mapper.h" 00019 00020 #include "../tools/systemc_definition_finder.h" 00021 00022 namespace risc { 00023 00028 class Design { 00029 00030 public: 00031 00037 explicit Design(int argc, char* argv[]); 00038 ~Design(); 00039 00040 void initialize_defintions(); 00041 void initialize_top_modules(); 00042 void initialize_global_functions(); 00043 00044 void initialize_global_variables(); 00045 00049 Variable* find_global_variable(SgVariableDefinition* var_def); 00050 00051 // TODO No implementation available 00052 void initialize_sc_main_variables(); 00053 00054 // TODO No implementation available 00055 void initialize_sc_main_channels(); 00056 00057 00059 void print_all_class_definitions(); 00060 void print_all_global_functions(); 00061 void print_design(); 00062 00064 InstanceTree get_root(); 00065 00067 ModuleVector module_definitions_; 00068 ModuleInstanceVector top_modules_; 00069 00070 PrimitiveChannelVector primitive_channel_; 00071 HierarchicalChannelVector hierarchical_channel_; 00072 00073 EventVector events_; 00074 VariableVector variables_; // global variables 00075 00076 FunctionVector functions_; 00077 00079 VariableVector global_variables_; 00080 FunctionVector global_functions_; 00081 00083 Module *find_module_definition(SgClassDefinition* cd); 00084 00086 SgProject *project_; 00087 SgFunctionDeclaration* main_; 00088 00090 00093 risc::tools::SystemCDefinitionFinder *systemc_definitions_; 00094 00098 SgFunctionDeclaration *sc_main_; 00099 00101 int old_argc_; 00102 char **old_argv_; 00103 00104 std::vector<std::string> input_files_; 00105 00106 PathInstanceMapper path_instance_mapper_; 00107 00113 void reset_instance_counter(); 00114 00115 private: 00119 Design(const Design &d); 00120 }; 00121 00122 class GlobalDesign { 00123 public: 00124 static Design *design_static; 00125 }; 00126 Design* get_design(); 00127 SgProject* get_project(); 00128 00129 }; // end namespace risc 00130 00131 #endif /* DESGIN_H_INCLUDED_ */ 00132 00133 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */