SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_fifo_ifs.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4  more contributor license agreements. See the NOTICE file distributed
5  with this work for additional information regarding copyright ownership.
6  Accellera licenses this file to you under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with the
8  License. You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15  implied. See the License for the specific language governing
16  permissions and limitations under the License.
17 
18  *****************************************************************************/
19 
20 /*****************************************************************************
21 
22  sc_fifo_ifs.h -- The sc_fifo<T> interface classes.
23 */
33 #ifndef SC_FIFO_IFS_H
34 #define SC_FIFO_IFS_H
35 
36 
38 
39 namespace sc_core {
40 
47 template <class T>
49 : virtual public sc_interface
50 {
51 public:
52 
53  // non-blocking read
54  virtual bool nb_read( T& ) = 0;
55 
56  // get the data written event
57  virtual const sc_event& data_written_event() const = 0;
58 };
59 
66 template <class T>
68 : virtual public sc_interface
69 {
70 public:
71 
72  // blocking read
73  virtual void read( T& ) = 0;
74  virtual T read() = 0;
75 };
76 
83 template <class T>
85 : public sc_fifo_nonblocking_in_if<T>,
86  public sc_fifo_blocking_in_if<T>
87 {
88 public:
89 
90  // get the number of available samples
91  virtual int num_available() const = 0;
92 
93 protected:
94 
95  // constructor
96 
98  {}
99 
100 private:
101 
102  // disabled
103  sc_fifo_in_if( const sc_fifo_in_if<T>& );
104  sc_fifo_in_if<T>& operator = ( const sc_fifo_in_if<T>& );
105 };
106 
107 
114 template <class T>
116 : virtual public sc_interface
117 {
118 public:
119 
120  // non-blocking write
121  virtual bool nb_write( const T& ) = 0;
122 
123  // get the data read event
124  virtual const sc_event& data_read_event() const = 0;
125 };
126 
133 template <class T>
135 : virtual public sc_interface
136 {
137 public:
138 
139  // blocking write
140  virtual void write( const T& ) = 0;
141 
142 };
143 
150 template <class T>
152 : public sc_fifo_nonblocking_out_if<T>,
153  public sc_fifo_blocking_out_if<T>
154 {
155 public:
156 
157  // get the number of free spaces
158  virtual int num_free() const = 0;
159 
160 protected:
161 
162  // constructor
163 
165  {}
166 
167 private:
168 
169  // disabled
171  sc_fifo_out_if<T>& operator = ( const sc_fifo_out_if<T>& );
172 };
173 
174 /*****************************************************************************
175 
176  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
177  changes you are making here.
178 
179  Name, Affiliation, Date: Bishnupriya Bhattacharye, Cadence Design Systems,
180  30 Jan, 2004
181  Description of Modification: Split up the interfaces into blocking and
182  non blocking parts
183 
184  Name, Affiliation, Date:
185  Description of Modification:
186 
187  *****************************************************************************/
188 //$Log: sc_fifo_ifs.h,v $
189 //Revision 1.3 2011/08/26 20:45:40 acg
190 // Andy Goodrich: moved the modification log to the end of the file to
191 // eliminate source line number skew when check-ins are done.
192 //
193 //Revision 1.2 2011/02/18 20:23:45 acg
194 // Andy Goodrich: Copyright update.
195 //
196 //Revision 1.1.1.1 2006/12/15 20:20:04 acg
197 //SystemC 2.3
198 //
199 //Revision 1.2 2006/01/03 23:18:26 acg
200 //Changed copyright to include 2006.
201 //
202 //Revision 1.1.1.1 2005/12/19 23:16:43 acg
203 //First check in of SystemC 2.1 into its own archive.
204 //
205 //Revision 1.10 2005/06/10 22:43:55 acg
206 //Added CVS change log annotation.
207 //
208 
209 } // namespace sc_core
210 
211 #endif
212 
213 // Taf!
virtual const sc_event & data_written_event() const =0
The event class.
Definition: sc_event.h:256
The sc_fifo<T> output interface class.
The sc_fifo<T> input interface class.
Abstract base class of all interface classes.
Abstract base class of all interface classes.
Definition: sc_interface.h:51