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_fifo_ifs.h -- The sc_fifo<T> interface classes. 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 #ifndef SC_FIFO_IFS_H 00028 #define SC_FIFO_IFS_H 00029 00030 00031 #include "sysc/communication/sc_interface.h" 00032 00033 namespace sc_core { 00034 00035 /**************************************************************************/ 00041 template <class T> 00042 class sc_fifo_nonblocking_in_if 00043 : virtual public sc_interface 00044 { 00045 public: 00046 00047 // non-blocking read 00048 virtual bool nb_read( T& ) = 0; 00049 00050 // get the data written event 00051 virtual const sc_event& data_written_event() const = 0; 00052 }; 00053 00054 /**************************************************************************/ 00060 template <class T> 00061 class sc_fifo_blocking_in_if 00062 : virtual public sc_interface 00063 { 00064 public: 00065 00066 // blocking read 00067 00072 // 08/19/2015 GL: modified for the OoO simulation 00073 virtual void read( T&, int ) = 0; 00074 00079 // 08/19/2015 GL: modified for the OoO simulation 00080 virtual T read( int ) = 0; 00081 }; 00082 00083 /**************************************************************************/ 00089 template <class T> 00090 class sc_fifo_in_if 00091 : public sc_fifo_nonblocking_in_if<T>, 00092 public sc_fifo_blocking_in_if<T> 00093 { 00094 public: 00095 00096 // get the number of available samples 00097 virtual int num_available() const = 0; 00098 00099 protected: 00100 00101 // constructor 00102 00103 sc_fifo_in_if() 00104 {} 00105 00106 private: 00107 00108 // disabled 00109 sc_fifo_in_if( const sc_fifo_in_if<T>& ); 00110 sc_fifo_in_if<T>& operator = ( const sc_fifo_in_if<T>& ); 00111 }; 00112 00113 00114 /**************************************************************************/ 00120 template <class T> 00121 class sc_fifo_nonblocking_out_if 00122 : virtual public sc_interface 00123 { 00124 public: 00125 00126 // non-blocking write 00127 virtual bool nb_write( const T& ) = 0; 00128 00129 // get the data read event 00130 virtual const sc_event& data_read_event() const = 0; 00131 }; 00132 00133 /**************************************************************************/ 00139 template <class T> 00140 class sc_fifo_blocking_out_if 00141 : virtual public sc_interface 00142 { 00143 public: 00144 00145 // blocking write 00146 00151 // 08/19/2015 GL: modified for the OoO simulation 00152 virtual void write( const T&, int ) = 0; 00153 00154 }; 00155 00156 /**************************************************************************/ 00162 template <class T> 00163 class sc_fifo_out_if 00164 : public sc_fifo_nonblocking_out_if<T>, 00165 public sc_fifo_blocking_out_if<T> 00166 { 00167 public: 00168 00169 // get the number of free spaces 00170 virtual int num_free() const = 0; 00171 00172 protected: 00173 00174 // constructor 00175 00176 sc_fifo_out_if() 00177 {} 00178 00179 private: 00180 00181 // disabled 00182 sc_fifo_out_if( const sc_fifo_out_if<T>& ); 00183 sc_fifo_out_if<T>& operator = ( const sc_fifo_out_if<T>& ); 00184 }; 00185 00186 /***************************************************************************** 00187 00188 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 00189 changes you are making here. 00190 00191 Name, Affiliation, Date: Bishnupriya Bhattacharye, Cadence Design Systems, 00192 30 Jan, 2004 00193 Description of Modification: Split up the interfaces into blocking and 00194 non blocking parts 00195 00196 Name, Affiliation, Date: 00197 Description of Modification: 00198 00199 *****************************************************************************/ 00200 //$Log: sc_fifo_ifs.h,v $ 00201 //Revision 1.3 2011/08/26 20:45:40 acg 00202 // Andy Goodrich: moved the modification log to the end of the file to 00203 // eliminate source line number skew when check-ins are done. 00204 // 00205 //Revision 1.2 2011/02/18 20:23:45 acg 00206 // Andy Goodrich: Copyright update. 00207 // 00208 //Revision 1.1.1.1 2006/12/15 20:20:04 acg 00209 //SystemC 2.3 00210 // 00211 //Revision 1.2 2006/01/03 23:18:26 acg 00212 //Changed copyright to include 2006. 00213 // 00214 //Revision 1.1.1.1 2005/12/19 23:16:43 acg 00215 //First check in of SystemC 2.1 into its own archive. 00216 // 00217 //Revision 1.10 2005/06/10 22:43:55 acg 00218 //Added CVS change log annotation. 00219 // 00220 00221 } // namespace sc_core 00222 00223 #endif 00224 00225 // Taf!