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_ifs.h -- The sc_signal<T> interface classes. 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_IFS_H 00037 #define SC_SIGNAL_IFS_H 00038 00039 00040 #include "sysc/communication/sc_interface.h" 00041 00042 00043 namespace sc_dt 00044 { 00045 class sc_logic; 00046 } 00047 00048 namespace sc_core { 00049 00050 class sc_signal_bool_deval; 00051 class sc_signal_logic_deval; 00052 00053 00054 // ---------------------------------------------------------------------------- 00055 // CLASS : sc_signal_in_if<T> 00056 // 00057 // The sc_signal<T> input interface class. 00058 // ---------------------------------------------------------------------------- 00059 00060 template <class T> 00061 class sc_signal_in_if 00062 : virtual public sc_interface 00063 { 00064 public: 00065 00066 // get the value changed event 00067 virtual const sc_event& value_changed_event() const = 0; 00068 00069 00070 // read the current value 00071 virtual const T& read() const = 0; 00072 00073 // get a reference to the current value (for tracing) 00074 virtual const T& get_data_ref() const = 0; 00075 00076 00077 // was there a value changed event? 00078 virtual bool event() const = 0; 00079 00080 protected: 00081 00082 // constructor 00083 00084 sc_signal_in_if() 00085 {} 00086 00087 private: 00088 00089 // disabled 00090 sc_signal_in_if( const sc_signal_in_if<T>& ); 00091 sc_signal_in_if<T>& operator = ( const sc_signal_in_if<T>& ); 00092 }; 00093 00094 00095 // ---------------------------------------------------------------------------- 00096 // CLASS : sc_signal_in_if<bool> 00097 // 00098 // Specialization of sc_signal_in_if<T> for type bool. 00099 // ---------------------------------------------------------------------------- 00100 00101 template <> 00102 class sc_signal_in_if<bool> 00103 : virtual public sc_interface 00104 { 00105 public: 00106 00107 // get the value changed event 00108 virtual const sc_event& value_changed_event() const = 0; 00109 00110 // get the positive edge event 00111 virtual const sc_event& posedge_event() const = 0; 00112 00113 // get the negative edge event 00114 virtual const sc_event& negedge_event() const = 0; 00115 00116 00117 // read the current value 00118 virtual const bool& read() const = 0; 00119 00120 // get a reference to the current value (for tracing) 00121 virtual const bool& get_data_ref() const = 0; 00122 00123 00124 // was there a value changed event? 00125 virtual bool event() const = 0; 00126 00127 // was there a positive edge event? 00128 virtual bool posedge() const = 0; 00129 00130 // was there a negative edge event? 00131 virtual bool negedge() const = 0; 00132 00133 00134 // delayed evaluation 00135 virtual const sc_signal_bool_deval& delayed() const = 0; 00136 00137 protected: 00138 00139 // constructor 00140 00141 sc_signal_in_if() 00142 {} 00143 00144 private: 00145 00146 // disabled 00147 sc_signal_in_if( const sc_signal_in_if<bool>& ); 00148 sc_signal_in_if<bool>& operator = ( const sc_signal_in_if<bool>& ); 00149 }; 00150 00151 00152 // ---------------------------------------------------------------------------- 00153 // CLASS : sc_signal_in_if<sc_dt::sc_logic> 00154 // 00155 // Specialization of sc_signal_in_if<T> for type sc_dt::sc_logic. 00156 // ---------------------------------------------------------------------------- 00157 00158 template <> 00159 class sc_signal_in_if<sc_dt::sc_logic> 00160 : virtual public sc_interface 00161 { 00162 public: 00163 00164 // get the value changed event 00165 virtual const sc_event& value_changed_event() const = 0; 00166 00167 // get the positive edge event 00168 virtual const sc_event& posedge_event() const = 0; 00169 00170 // get the negative edge event 00171 virtual const sc_event& negedge_event() const = 0; 00172 00173 00174 // read the current value 00175 virtual const sc_dt::sc_logic& read() const = 0; 00176 00177 // get a reference to the current value (for tracing) 00178 virtual const sc_dt::sc_logic& get_data_ref() const = 0; 00179 00180 00181 // was there a value changed event? 00182 virtual bool event() const = 0; 00183 00184 // was there a positive edge event? 00185 virtual bool posedge() const = 0; 00186 00187 // was there a negative edge event? 00188 virtual bool negedge() const = 0; 00189 00190 00191 // delayed evaluation 00192 virtual const sc_signal_logic_deval& delayed() const = 0; 00193 00194 protected: 00195 00196 // constructor 00197 00198 sc_signal_in_if() 00199 {} 00200 00201 private: 00202 00203 // disabled 00204 sc_signal_in_if( const sc_signal_in_if<sc_dt::sc_logic>& ); 00205 sc_signal_in_if<sc_dt::sc_logic>& operator = ( 00206 const sc_signal_in_if<sc_dt::sc_logic>& ); 00207 }; 00208 00209 00210 // ---------------------------------------------------------------------------- 00211 // CLASS : sc_signal_inout_if<T> 00212 // 00213 // The sc_signal<T> input/output interface class. 00214 // ---------------------------------------------------------------------------- 00215 00216 template <class T> 00217 class sc_signal_inout_if 00218 : public sc_signal_in_if<T> 00219 { 00220 public: 00221 00222 // write the new value 00223 virtual void write( const T& ) = 0; 00224 00225 protected: 00226 00227 // constructor 00228 00229 sc_signal_inout_if() 00230 {} 00231 00232 private: 00233 00234 // disabled 00235 sc_signal_inout_if( const sc_signal_inout_if<T>& ); 00236 sc_signal_inout_if<T>& operator = ( const sc_signal_inout_if<T>& ); 00237 }; 00238 00239 00240 // ---------------------------------------------------------------------------- 00241 // CLASS : sc_signal_out_if<T> 00242 // 00243 // The sc_signal<T> output interface class. 00244 // ---------------------------------------------------------------------------- 00245 00246 // sc_signal_out_if can also be read from, hence no difference with 00247 // sc_signal_inout_if. 00248 00249 #define sc_signal_out_if sc_signal_inout_if 00250 00251 } // namespace sc_core 00252 00253 #endif 00254 00255 // Taf!
1.5.1