00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2006 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 Version 2.4 (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.systemc.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_reset.h -- Process reset support. 00021 00022 Original Author: Andy Goodrich, Forte Design Systems, 17 June 2003 00023 00024 *****************************************************************************/ 00025 00026 /***************************************************************************** 00027 00028 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 00029 changes you are making here. 00030 00031 Name, Affiliation, Date: 00032 Description of Modification: 00033 00034 *****************************************************************************/ 00035 00036 00037 // $Log: sc_reset.h,v $ 00038 // Revision 1.1.1.1 2006/12/15 20:31:37 acg 00039 // SystemC 2.2 00040 // 00041 // Revision 1.4 2006/04/11 23:13:21 acg 00042 // Andy Goodrich: Changes for reduced reset support that only includes 00043 // sc_cthread, but has preliminary hooks for expanding to method and thread 00044 // processes also. 00045 // 00046 // Revision 1.3 2006/01/13 18:44:30 acg 00047 // Added $Log to record CVS changes into the source. 00048 // 00049 00050 #if !defined(sc_reset_h_INCLUDED) 00051 #define sc_reset_h_INCLUDED 00052 00053 namespace sc_core { 00054 00055 template<typename DATA> class sc_signal_in_if; 00056 template<typename IF> class sc_signal; 00057 template<typename DATA> class sc_in; 00058 class sc_process_b; 00059 00060 class sc_reset { 00061 friend class sc_cthread_process; 00062 friend class sc_method_process; 00063 friend class sc_module; 00064 friend class sc_process_b; 00065 friend class sc_signal<bool>; 00066 friend class sc_simcontext; 00067 friend class sc_thread_process; 00068 00069 protected: 00070 static void reconcile_resets(); 00071 static void reset_signal_is(const sc_signal_in_if<bool>& iface, bool level); 00072 static void reset_signal_is(const sc_in<bool>& iface, bool level); 00073 00074 protected: 00075 sc_reset( const sc_signal_in_if<bool>* iface_p ) : 00076 m_iface_p(iface_p) {} 00077 void notify_processes(); 00078 bool read(); 00079 void remove_process( sc_process_b* ); 00080 00081 protected: 00082 const sc_signal_in_if<bool>* m_iface_p; // Interface to read. 00083 std::vector<sc_process_b*> m_processes; // List of processes to reset. 00084 00085 private: // disabled 00086 sc_reset( const sc_reset& ); 00087 const sc_reset& operator = ( const sc_reset& ); 00088 }; 00089 00090 00091 00092 } // namespace sc_core 00093 00094 #endif // !defined(sc_reset_h_INCLUDED)