SystemC  Recoding Infrastructure for SystemC v0.6.2 derived from Accellera SystemC 2.3.1
Accellera SystemC proof-of-concept library
sc_fifo_ifs.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  The following code is derived, directly or indirectly, from the SystemC
4  source code Copyright (c) 1996-2014 by all Contributors.
5  All Rights reserved.
6 
7  The contents of this file are subject to the restrictions and limitations
8  set forth in the SystemC Open Source License (the "License");
9  You may not use this file except in compliance with such restrictions and
10  limitations. You may obtain instructions on how to receive a copy of the
11  License at http://www.accellera.org/. Software distributed by Contributors
12  under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
13  ANY KIND, either express or implied. See the License for the specific
14  language governing rights and limitations under the License.
15 
16  *****************************************************************************/
17 
18 /*****************************************************************************
19 
20  sc_fifo_ifs.h -- The sc_fifo<T> interface classes.
21 
22  Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21
23 
24  CHANGE LOG IS AT THE END OF THE FILE
25  *****************************************************************************/
26 
27 #ifndef SC_FIFO_IFS_H
28 #define SC_FIFO_IFS_H
29 
32 
33 namespace sc_core {
34 
35 /**************************************************************************/
41 template <class T>
43 : virtual public sc_interface
44 {
45 public:
46 
47  // non-blocking read
48  virtual bool nb_read( T& ) = 0;
49 
50  // get the data written event
51  virtual const sc_event& data_written_event() const = 0;
52 };
53 
54 /**************************************************************************/
60 template <class T>
62 : virtual public sc_interface
63 {
64 public:
65 
66  // blocking read
67 
72  // 08/19/2015 GL: modified for the OoO simulation
73  virtual void read( T&, sc_segid ) = 0;
74  virtual void read( T&) = 0;
75 
80  // 08/19/2015 GL: modified for the OoO simulation
81  virtual T read( sc_segid ) = 0;
82  virtual T read( ) = 0;
83 };
84 
85 /**************************************************************************/
91 template <class T>
93 : public sc_fifo_nonblocking_in_if<T>,
94  public sc_fifo_blocking_in_if<T>
95 {
96 public:
97 
98  // get the number of available samples
99  virtual int num_available() const = 0;
100 
101 protected:
102 
103  // constructor
104 
106  {}
107 
108 private:
109 
110  // disabled
111  sc_fifo_in_if( const sc_fifo_in_if<T>& );
112  sc_fifo_in_if<T>& operator = ( const sc_fifo_in_if<T>& );
113 };
114 
115 
116 /**************************************************************************/
122 template <class T>
124 : virtual public sc_interface
125 {
126 public:
127 
128  // non-blocking write
129  virtual bool nb_write( const T& ) = 0;
130 
131  // get the data read event
132  virtual const sc_event& data_read_event() const = 0;
133 };
134 
135 /**************************************************************************/
141 template <class T>
143 : virtual public sc_interface
144 {
145 public:
146 
147  // blocking write
148 
153  // 08/19/2015 GL: modified for the OoO simulation
154  virtual void write( const T&, int ) = 0;
155  virtual void write( const T&) = 0;
156 
157 };
158 
159 /**************************************************************************/
165 template <class T>
167 : public sc_fifo_nonblocking_out_if<T>,
168  public sc_fifo_blocking_out_if<T>
169 {
170 public:
171 
172  // get the number of free spaces
173  virtual int num_free() const = 0;
174 
175 protected:
176 
177  // constructor
178 
180  {}
181 
182 private:
183 
184  // disabled
186  sc_fifo_out_if<T>& operator = ( const sc_fifo_out_if<T>& );
187 };
188 
189 /*****************************************************************************
190 
191  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
192  changes you are making here.
193 
194  Name, Affiliation, Date: Bishnupriya Bhattacharye, Cadence Design Systems,
195  30 Jan, 2004
196  Description of Modification: Split up the interfaces into blocking and
197  non blocking parts
198 
199  Name, Affiliation, Date:
200  Description of Modification:
201 
202  *****************************************************************************/
203 //$Log: sc_fifo_ifs.h,v $
204 //Revision 1.3 2011/08/26 20:45:40 acg
205 // Andy Goodrich: moved the modification log to the end of the file to
206 // eliminate source line number skew when check-ins are done.
207 //
208 //Revision 1.2 2011/02/18 20:23:45 acg
209 // Andy Goodrich: Copyright update.
210 //
211 //Revision 1.1.1.1 2006/12/15 20:20:04 acg
212 //SystemC 2.3
213 //
214 //Revision 1.2 2006/01/03 23:18:26 acg
215 //Changed copyright to include 2006.
216 //
217 //Revision 1.1.1.1 2005/12/19 23:16:43 acg
218 //First check in of SystemC 2.1 into its own archive.
219 //
220 //Revision 1.10 2005/06/10 22:43:55 acg
221 //Added CVS change log annotation.
222 //
223 
224 } // namespace sc_core
225 
226 #endif
227 
228 // Taf!
virtual int num_free() const =0
virtual void write(const T &, int)=0
A new parameter segment ID is added for the out-of-order simulation.
The event class.
Definition: sc_event.h:260
virtual const sc_event & data_written_event() const =0
Abstract base class of all interface classes.
Definition: sc_interface.h:44
virtual int num_available() const =0
The sc_fifo&lt;T&gt; input interface class.
The sc_fifo&lt;T&gt; output interface class.
virtual const sc_event & data_read_event() const =0
segment id currently only used for sc_fifo::read(...) as a bug fix
virtual bool nb_write(const T &)=0