00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2014 by all Contributors. 00005 All Rights reserved. 00006 00007 The contents of this file are subject to the restrictions and limitations 00008 set forth in the SystemC Open Source License (the "License"); 00009 You may not use this file except in compliance with such restrictions and 00010 limitations. You may obtain instructions on how to receive a copy of the 00011 License at http://www.accellera.org/. Software distributed by Contributors 00012 under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 00013 ANY KIND, either express or implied. See the License for the specific 00014 language governing rights and limitations under the License. 00015 00016 *****************************************************************************/ 00017 00018 /***************************************************************************** 00019 00020 sc_module_registry.h -- Registry for all modules. 00021 FOR INTERNAL USE ONLY. 00022 00023 Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21 00024 00025 CHANGE LOG AT THE END OF THE FILE 00026 *****************************************************************************/ 00027 00028 00029 #ifndef SC_MODULE_REGISTRY_H 00030 #define SC_MODULE_REGISTRY_H 00031 00032 00033 namespace sc_core { 00034 00035 class sc_module; 00036 class sc_simcontext; 00037 00038 00039 /**************************************************************************/ 00047 class sc_module_registry 00048 { 00049 friend class sc_simcontext; 00050 00051 public: 00052 00053 void insert( sc_module& ); 00054 void remove( sc_module& ); 00055 00056 int size() const 00057 { return m_module_vec.size(); } 00058 00059 private: 00060 00061 // constructor 00062 explicit sc_module_registry( sc_simcontext& simc_ ); 00063 00064 // destructor 00065 ~sc_module_registry(); 00066 00067 // called when construction is done 00068 bool construction_done(); 00069 00070 // called when elaboration is done 00071 void elaboration_done(); 00072 00073 // called before simulation begins 00074 void start_simulation(); 00075 00076 // called after simulation ends 00077 void simulation_done(); 00078 00079 00080 private: 00081 00082 int m_construction_done; 00083 std::vector<sc_module*> m_module_vec; 00084 sc_simcontext* m_simc; 00085 00086 private: 00087 00088 // disabled 00089 sc_module_registry(); 00090 sc_module_registry( const sc_module_registry& ); 00091 sc_module_registry& operator = ( const sc_module_registry& ); 00092 }; 00093 00094 } // namespace sc_core 00095 00096 #endif 00097 00098 // $Log: sc_module_registry.h,v $ 00099 // Revision 1.6 2011/08/26 20:46:10 acg 00100 // Andy Goodrich: moved the modification log to the end of the file to 00101 // eliminate source line number skew when check-ins are done. 00102 // 00103 // Revision 1.5 2011/05/09 04:07:49 acg 00104 // Philipp A. Hartmann: 00105 // (1) Restore hierarchy in all phase callbacks. 00106 // (2) Ensure calls to before_end_of_elaboration. 00107 // 00108 // Revision 1.4 2011/02/18 20:27:14 acg 00109 // Andy Goodrich: Updated Copyrights. 00110 // 00111 // Revision 1.3 2011/02/13 21:47:37 acg 00112 // Andy Goodrich: update copyright notice. 00113 // 00114 // Revision 1.2 2008/05/22 17:06:26 acg 00115 // Andy Goodrich: updated copyright notice to include 2008. 00116 // 00117 // Revision 1.1.1.1 2006/12/15 20:20:05 acg 00118 // SystemC 2.3 00119 // 00120 // Revision 1.3 2006/01/13 18:44:30 acg 00121 // Added $Log to record CVS changes into the source. 00122 00123 // Taf!