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 #include "sysc/kernel/sc_simcontext.h" 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&, sc_segid ) = 0; 00074 virtual void read( T&) = 0; 00075 00080 // 08/19/2015 GL: modified for the OoO simulation 00081 virtual T read( sc_segid ) = 0; 00082 virtual T read( ) = 0; 00083 }; 00084 00085 /**************************************************************************/ 00091 template <class T> 00092 class sc_fifo_in_if 00093 : public sc_fifo_nonblocking_in_if<T>, 00094 public sc_fifo_blocking_in_if<T> 00095 { 00096 public: 00097 00098 // get the number of available samples 00099 virtual int num_available() const = 0; 00100 00101 protected: 00102 00103 // constructor 00104 00105 sc_fifo_in_if() 00106 {} 00107 00108 private: 00109 00110 // disabled 00111 sc_fifo_in_if( const sc_fifo_in_if<T>& ); 00112 sc_fifo_in_if<T>& operator = ( const sc_fifo_in_if<T>& ); 00113 }; 00114 00115 00116 /**************************************************************************/ 00122 template <class T> 00123 class sc_fifo_nonblocking_out_if 00124 : virtual public sc_interface 00125 { 00126 public: 00127 00128 // non-blocking write 00129 virtual bool nb_write( const T& ) = 0; 00130 00131 // get the data read event 00132 virtual const sc_event& data_read_event() const = 0; 00133 }; 00134 00135 /**************************************************************************/ 00141 template <class T> 00142 class sc_fifo_blocking_out_if 00143 : virtual public sc_interface 00144 { 00145 public: 00146 00147 // blocking write 00148 00153 // 08/19/2015 GL: modified for the OoO simulation 00154 virtual void write( const T&, int ) = 0; 00155 virtual void write( const T&) = 0; 00156 00157 }; 00158 00159 /**************************************************************************/ 00165 template <class T> 00166 class sc_fifo_out_if 00167 : public sc_fifo_nonblocking_out_if<T>, 00168 public sc_fifo_blocking_out_if<T> 00169 { 00170 public: 00171 00172 // get the number of free spaces 00173 virtual int num_free() const = 0; 00174 00175 protected: 00176 00177 // constructor 00178 00179 sc_fifo_out_if() 00180 {} 00181 00182 private: 00183 00184 // disabled 00185 sc_fifo_out_if( const sc_fifo_out_if<T>& ); 00186 sc_fifo_out_if<T>& operator = ( const sc_fifo_out_if<T>& ); 00187 }; 00188 00189 /***************************************************************************** 00190 00191 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 00192 changes you are making here. 00193 00194 Name, Affiliation, Date: Bishnupriya Bhattacharye, Cadence Design Systems, 00195 30 Jan, 2004 00196 Description of Modification: Split up the interfaces into blocking and 00197 non blocking parts 00198 00199 Name, Affiliation, Date: 00200 Description of Modification: 00201 00202 *****************************************************************************/ 00203 //$Log: sc_fifo_ifs.h,v $ 00204 //Revision 1.3 2011/08/26 20:45:40 acg 00205 // Andy Goodrich: moved the modification log to the end of the file to 00206 // eliminate source line number skew when check-ins are done. 00207 // 00208 //Revision 1.2 2011/02/18 20:23:45 acg 00209 // Andy Goodrich: Copyright update. 00210 // 00211 //Revision 1.1.1.1 2006/12/15 20:20:04 acg 00212 //SystemC 2.3 00213 // 00214 //Revision 1.2 2006/01/03 23:18:26 acg 00215 //Changed copyright to include 2006. 00216 // 00217 //Revision 1.1.1.1 2005/12/19 23:16:43 acg 00218 //First check in of SystemC 2.1 into its own archive. 00219 // 00220 //Revision 1.10 2005/06/10 22:43:55 acg 00221 //Added CVS change log annotation. 00222 // 00223 00224 } // namespace sc_core 00225 00226 #endif 00227 00228 // Taf!