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_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 //$Log: sc_signal_resolved.h,v $ 00036 //Revision 1.1.1.1 2006/12/15 20:31:35 acg 00037 //SystemC 2.2 00038 // 00039 //Revision 1.2 2006/01/03 23:18:26 acg 00040 //Changed copyright to include 2006. 00041 // 00042 //Revision 1.1.1.1 2005/12/19 23:16:43 acg 00043 //First check in of SystemC 2.1 into its own archive. 00044 // 00045 //Revision 1.10 2005/09/15 23:01:52 acg 00046 //Added std:: prefix to appropriate methods and types to get around 00047 //issues with the Edison Front End. 00048 // 00049 //Revision 1.9 2005/06/10 22:43:55 acg 00050 //Added CVS change log annotation. 00051 // 00052 00053 #ifndef SC_SIGNAL_RESOLVED_H 00054 #define SC_SIGNAL_RESOLVED_H 00055 00056 00057 #include "sysc/communication/sc_signal.h" 00058 00059 namespace sc_core { 00060 00061 class sc_process_b; 00062 00063 extern const sc_dt::sc_logic_value_t sc_logic_resolution_tbl[4][4]; 00064 00065 00066 // ---------------------------------------------------------------------------- 00067 // CLASS : sc_logic_resolve 00068 // 00069 // Resolution function for sc_dt::sc_logic. 00070 // ---------------------------------------------------------------------------- 00071 00072 class sc_logic_resolve 00073 { 00074 public: 00075 00076 // resolves sc_dt::sc_logic values and returns the resolved value 00077 static void resolve(sc_dt::sc_logic&, const std::vector<sc_dt::sc_logic*>&); 00078 }; 00079 00080 00081 // ---------------------------------------------------------------------------- 00082 // CLASS : sc_signal_resolved 00083 // 00084 // The resolved signal class. 00085 // ---------------------------------------------------------------------------- 00086 00087 class sc_signal_resolved 00088 : public sc_signal<sc_dt::sc_logic> 00089 { 00090 public: 00091 00092 // typedefs 00093 00094 typedef sc_signal_resolved this_type; 00095 typedef sc_signal<sc_dt::sc_logic> base_type; 00096 typedef sc_dt::sc_logic data_type; 00097 00098 public: 00099 00100 // constructors 00101 00102 sc_signal_resolved() 00103 : base_type( sc_gen_unique_name( "signal_resolved" ) ) 00104 {} 00105 00106 explicit sc_signal_resolved( const char* name_ ) 00107 : base_type( name_ ) 00108 {} 00109 00110 00111 // destructor 00112 virtual ~sc_signal_resolved(); 00113 00114 00115 // interface methods 00116 00117 virtual void register_port( sc_port_base&, const char* ) 00118 {} 00119 00120 00121 // write the new value 00122 virtual void write( const data_type& ); 00123 00124 00125 // other methods 00126 00127 this_type& operator = ( const data_type& a ) 00128 { write( a ); return *this; } 00129 00130 this_type& operator = ( const this_type& a ) 00131 { write( a.read() ); return *this; } 00132 00133 virtual const char* kind() const 00134 { return "sc_signal_resolved"; } 00135 00136 protected: 00137 00138 virtual void update(); 00139 00140 protected: 00141 00142 std::vector<sc_process_b*> m_proc_vec; // processes writing this signal 00143 std::vector<data_type*> m_val_vec; // new values written this signal 00144 00145 private: 00146 00147 // disabled 00148 sc_signal_resolved( const this_type& ); 00149 }; 00150 00151 } // namespace sc_core 00152 00153 #endif 00154 00155 // Taf!