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_signal_resolved.h -- The resolved signal class. 00021 00022 Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21 00023 00024 CHANGE LOG IS AT THE END OF THE FILE 00025 *****************************************************************************/ 00026 00027 00028 #ifndef SC_SIGNAL_RESOLVED_H 00029 #define SC_SIGNAL_RESOLVED_H 00030 00031 00032 #include "sysc/communication/sc_signal.h" 00033 00034 namespace sc_core { 00035 00036 class sc_process_b; 00037 00038 extern const sc_dt::sc_logic_value_t sc_logic_resolution_tbl[4][4]; 00039 00040 00041 /**************************************************************************/ 00047 class sc_signal_resolved 00048 : public sc_signal<sc_dt::sc_logic,SC_MANY_WRITERS> 00049 { 00050 public: 00051 00052 // typedefs 00053 00054 typedef sc_signal_resolved this_type; 00055 typedef sc_signal<sc_dt::sc_logic,SC_MANY_WRITERS> base_type; 00056 typedef sc_dt::sc_logic data_type; 00057 00058 public: 00059 00060 // constructors 00061 00062 sc_signal_resolved() : 00063 base_type( sc_gen_unique_name( "signal_resolved" ) ), m_proc_vec(), 00064 m_val_vec() 00065 {} 00066 00067 explicit sc_signal_resolved( const char* name_ ): 00068 base_type( name_ ), m_proc_vec(), m_val_vec() 00069 {} 00070 00071 sc_signal_resolved( const char* name_, const data_type & initial_value_ ) 00072 : base_type( name_, initial_value_ ) 00073 , m_proc_vec() 00074 , m_val_vec() 00075 {} 00076 00077 // interface methods 00078 00079 virtual void register_port( sc_port_base&, const char* ) 00080 {} 00081 00082 00083 // write the new value 00084 virtual void write( const data_type& ); 00085 00086 00087 // other methods 00088 00089 this_type& operator = ( const data_type& a ) 00090 { write( a ); return *this; } 00091 00092 this_type& operator = ( const this_type& a ) 00093 { write( a.read() ); return *this; } 00094 00095 virtual const char* kind() const 00096 { return "sc_signal_resolved"; } 00097 00098 protected: 00099 00100 virtual void update(); 00101 00102 protected: 00103 00104 std::vector<sc_process_b*> m_proc_vec; // processes writing this signal 00105 std::vector<data_type> m_val_vec; // new values written this signal 00106 00107 private: 00108 00109 // disabled 00110 sc_signal_resolved( const this_type& ); 00111 }; 00112 00113 } // namespace sc_core 00114 00115 //$Log: sc_signal_resolved.h,v $ 00116 //Revision 1.6 2011/08/26 20:45:44 acg 00117 // Andy Goodrich: moved the modification log to the end of the file to 00118 // eliminate source line number skew when check-ins are done. 00119 // 00120 //Revision 1.5 2011/08/24 22:05:36 acg 00121 // Torsten Maehne: initialization changes to remove warnings. 00122 // 00123 //Revision 1.4 2011/04/19 02:36:26 acg 00124 // Philipp A. Hartmann: new aysnc_update and mutex support. 00125 // 00126 //Revision 1.3 2011/02/18 20:23:45 acg 00127 // Andy Goodrich: Copyright update. 00128 // 00129 //Revision 1.2 2011/01/20 16:52:15 acg 00130 // Andy Goodrich: changes for IEEE 1666 2011. 00131 // 00132 //Revision 1.1.1.1 2006/12/15 20:20:04 acg 00133 //SystemC 2.3 00134 // 00135 //Revision 1.2 2006/01/03 23:18:26 acg 00136 //Changed copyright to include 2006. 00137 // 00138 //Revision 1.1.1.1 2005/12/19 23:16:43 acg 00139 //First check in of SystemC 2.1 into its own archive. 00140 // 00141 //Revision 1.10 2005/09/15 23:01:52 acg 00142 //Added std:: prefix to appropriate methods and types to get around 00143 //issues with the Edison Front End. 00144 // 00145 //Revision 1.9 2005/06/10 22:43:55 acg 00146 //Added CVS change log annotation. 00147 // 00148 00149 #endif 00150 00151 // Taf!