TLM-2.0  2.0.3
Accellera TLM-2.0 proof-of-concept library
tlm_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 // Note to the LRM writer : These interfaces are channel specific interfaces
20 // useful in the context of tlm_fifo.
21 //
22 
23 #ifndef __TLM_FIFO_IFS_H__
24 #define __TLM_FIFO_IFS_H__
25 
27 
28 namespace tlm {
29 
30 //
31 // Fifo specific interfaces
32 //
33 
34 // Fifo Debug Interface
35 
36 template< typename T >
38 {
39 public:
40  virtual int used() const = 0;
41  virtual int size() const = 0;
42  virtual void debug() const = 0;
43 
44  //
45  // non blocking peek and poke - no notification
46  //
47  // n is index of data :
48  // 0 <= n < size(), where 0 is most recently written, and size() - 1
49  // is oldest ie the one about to be read.
50  //
51 
52  virtual bool nb_peek( T & , int n ) const = 0;
53  virtual bool nb_poke( const T & , int n = 0 ) = 0;
54 
55 };
56 
57 // fifo interfaces = extended + debug
58 
59 template < typename T >
61  public virtual tlm_put_if<T> ,
62  public virtual tlm_fifo_debug_if<T> {};
63 
64 template < typename T >
66  public virtual tlm_get_peek_if<T> ,
67  public virtual tlm_fifo_debug_if<T> {};
68 
70 {
71 public:
72  virtual void nb_expand( unsigned int n = 1 ) = 0;
73  virtual void nb_unbound( unsigned int n = 16 ) = 0;
74 
75  virtual bool nb_reduce( unsigned int n = 1 ) = 0;
76  virtual bool nb_bound( unsigned int n ) = 0;
77 
78 };
79 
80 } // namespace tlm
81 
82 #endif
83 
virtual bool nb_peek(T &, int n) const =0
virtual void nb_unbound(unsigned int n=16)=0
virtual bool nb_reduce(unsigned int n=1)=0
virtual bool nb_poke(const T &, int n=0)=0
virtual void debug() const =0
virtual int size() const =0
virtual void nb_expand(unsigned int n=1)=0
virtual bool nb_bound(unsigned int n)=0
virtual int used() const =0