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 00032 double duration; 00033 double duration1; 00034 00040 explicit Design(int argc, char* argv[]); 00041 ~Design(); 00042 00043 void initialize_definitions(); 00044 void initialize_top_modules(); 00045 void initialize_global_functions(); 00046 00047 void initialize_global_variables(); 00048 00052 Variable* find_global_variable(SgVariableDefinition* var_def); 00053 00054 // TODO No implementation available 00055 void initialize_sc_main_variables(); 00056 00057 // TODO No implementation available 00058 void initialize_sc_main_channels(); 00059 00060 00062 void print_all_class_definitions(); 00063 void print_all_global_functions(); 00064 void print_design(); 00065 00067 InstanceTree get_root(); 00068 00070 ModuleVector module_definitions_; 00071 ModuleInstanceVector top_modules_; 00072 00073 PrimitiveChannelVector primitive_channel_; 00074 HierarchicalChannelVector hierarchical_channel_; 00075 00076 EventVector events_; 00077 VariableVector variables_; // global variables 00078 00079 FunctionVector functions_; 00080 00082 VariableVector global_variables_; 00083 FunctionVector global_functions_; 00084 00086 Module *find_module_definition(SgClassDefinition* cd); 00087 HierarchicalChannel* find_channel_definition(SgClassDefinition* cd); 00088 00090 SgProject *project_; 00091 SgFunctionDeclaration* main_; 00092 00094 00097 risc::tools::SystemCDefinitionFinder *systemc_definitions_; 00098 00102 SgFunctionDeclaration *sc_main_; 00103 00105 int old_argc_; 00106 char **old_argv_; 00107 00108 std::vector<std::string> input_files_; 00109 00110 PathInstanceMapper path_instance_mapper_; 00111 00117 void reset_instance_counter(); 00118 00119 private: 00123 Design(const Design &d); 00124 }; 00125 00126 class GlobalDesign { 00127 public: 00128 static Design *design_static; 00129 }; 00130 Design* get_design(); 00131 SgProject* get_project(); 00132 00133 }; // end namespace risc 00134 00135 #endif /* DESGIN_H_INCLUDED_ */ 00136 00137 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */