00001 #ifndef DESGIN_H_INCLUDED_ 00002 #define DESGIN_H_INCLUDED_ 00003 00004 #include "rose.h" 00005 00006 #include <vector> 00007 00008 namespace risc { 00009 00010 class Event; 00011 class Function; 00012 class HierarchicalChannel; 00013 class HierarchicalChannel; 00014 class HierarchicalChannelInstance; 00015 class Instance; 00016 class InstanceTree; 00017 class Interface; 00018 class Module; 00019 class PathInstanceMapper; 00020 class PrimitiveChannel; 00021 class PrimitiveChannelInstance; 00022 class Variable; 00023 00024 typedef std::vector<Event*> EventVector; 00025 typedef std::vector<Function*> FunctionVector; 00026 typedef std::vector<HierarchicalChannel*> HierarchicalChannelVector; 00027 typedef std::vector<HierarchicalChannelInstance*> HierarchicalChannelInstanceVector; 00028 typedef std::vector<Instance*> InstanceVector; 00029 typedef std::vector<Interface*> InterfaceVector; 00030 typedef std::vector<Module*> ModuleVector; 00031 typedef std::vector<PrimitiveChannel*> PrimitiveChannelVector; 00032 typedef std::vector<PrimitiveChannelInstance*> PrimitiveChannelInstanceVector; 00033 typedef std::vector<Variable*> VariableVector; 00034 00039 class Design { 00040 00041 public: 00042 00043 double duration; 00044 double duration1; 00045 00051 explicit Design(int argc, char* argv[]); 00052 ~Design(); 00053 00054 void initialize_definitions(); 00055 void initialize_top_modules(); 00056 void initialize_global_functions(); 00057 void initialize_global_variables(); 00058 00059 /* 00060 * Functions to print design properties 00061 */ 00062 void print_all_class_definitions(); 00063 void print_all_global_functions(); 00064 void print_design(); 00065 00066 /* 00067 * Interface for the instance tree 00068 */ 00069 InstanceTree get_root(); 00070 00071 /* 00072 * Containers for the different design elements 00073 */ 00074 ModuleVector module_definitions_; 00075 InstanceVector top_modules_; 00076 PrimitiveChannelVector primitive_channel_; 00077 HierarchicalChannelVector hierarchical_channel_; 00078 InterfaceVector interfaces_; 00079 00080 /* 00081 * global and sc_main related design stuff 00082 */ 00083 VariableVector global_variables_; 00084 FunctionVector global_functions_; 00085 00086 /* 00087 * Functions to search in design 00088 */ 00089 Module *find_module_definition(SgClassDefinition* cd); 00090 HierarchicalChannel* find_channel_definition(SgClassDefinition* cd); 00091 00095 Variable* find_global_variable(SgVariableDefinition* var_def); 00096 00097 /* 00098 * Rose specific elements 00099 */ 00100 SgProject *project_; 00101 00102 /* 00103 * misc 00104 */ 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 00123 std::string dynamic_analysis_filename_; 00124 00129 std::string instrumentor_output_filename_; 00130 00135 bool perform_static_analysis(); 00136 00144 void add_module_to_definition_list(SgClassDefinition *class_def); 00145 00153 void add_hierarchical_channel_to_defintion_list(SgClassDefinition *class_def); 00154 00155 private: 00156 00160 Design(const Design &d); 00161 }; 00162 00163 class GlobalDesign { 00164 public: 00165 static Design *design_static; 00166 }; 00167 Design* get_design(); 00168 SgProject* get_project(); 00169 00170 }; // end namespace risc 00171 00172 #endif /* DESGIN_H_INCLUDED_ */ 00173 00174 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */