00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2005 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_signal_resolved.h -- The resolved signal class. 00021 00022 Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21 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 #ifndef SC_SIGNAL_RESOLVED_H 00037 #define SC_SIGNAL_RESOLVED_H 00038 00039 00040 #include "sysc/communication/sc_signal.h" 00041 00042 namespace sc_core { 00043 00044 class sc_process_b; 00045 00046 extern const sc_dt::sc_logic_value_t sc_logic_resolution_tbl[4][4]; 00047 00048 00049 // ---------------------------------------------------------------------------- 00050 // CLASS : sc_logic_resolve 00051 // 00052 // Resolution function for sc_dt::sc_logic. 00053 // ---------------------------------------------------------------------------- 00054 00055 class sc_logic_resolve 00056 { 00057 public: 00058 00059 // resolves sc_dt::sc_logic values and returns the resolved value 00060 static void resolve(sc_dt::sc_logic&, const sc_pvector<sc_dt::sc_logic*>&); 00061 }; 00062 00063 00064 // ---------------------------------------------------------------------------- 00065 // CLASS : sc_signal_resolved 00066 // 00067 // The resolved signal class. 00068 // ---------------------------------------------------------------------------- 00069 00070 class sc_signal_resolved 00071 : public sc_signal<sc_dt::sc_logic> 00072 { 00073 public: 00074 00075 // typedefs 00076 00077 typedef sc_signal_resolved this_type; 00078 typedef sc_signal<sc_dt::sc_logic> base_type; 00079 typedef sc_dt::sc_logic data_type; 00080 00081 public: 00082 00083 // constructors 00084 00085 sc_signal_resolved() 00086 : base_type( sc_gen_unique_name( "signal_resolved" ) ) 00087 {} 00088 00089 explicit sc_signal_resolved( const char* name_ ) 00090 : base_type( name_ ) 00091 {} 00092 00093 00094 // destructor 00095 virtual ~sc_signal_resolved(); 00096 00097 00098 // interface methods 00099 00100 virtual void register_port( sc_port_base&, const char* ) 00101 {} 00102 00103 00104 // write the new value 00105 virtual void write( const data_type& ); 00106 00107 00108 // other methods 00109 00110 this_type& operator = ( const data_type& a ) 00111 { write( a ); return *this; } 00112 00113 this_type& operator = ( const this_type& a ) 00114 { write( a.read() ); return *this; } 00115 00116 virtual const char* kind() const 00117 { return "sc_signal_resolved"; } 00118 00119 protected: 00120 00121 virtual void update(); 00122 00123 protected: 00124 00125 sc_pvector<sc_process_b*> m_proc_vec; // processes writing to this signal 00126 sc_pvector<data_type*> m_val_vec; // new values written to this signal 00127 00128 private: 00129 00130 // disabled 00131 sc_signal_resolved( const this_type& ); 00132 }; 00133 00134 } // namespace sc_core 00135 00136 #endif 00137 00138 // Taf!
1.5.1