Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / model / vendor / TLM-2006-11-29 / tlm / tlm_core / tlm_interfaces / tlm_fifo_ifs.h
CommitLineData
86530b38
AT
1
2/*****************************************************************************
3
4 The following code is derived, directly or indirectly, from the SystemC
5 source code Copyright (c) 1996-2004 by all Contributors.
6 All Rights reserved.
7
8 The contents of this file are subject to the restrictions and limitations
9 set forth in the SystemC Open Source License Version 2.4 (the "License");
10 You may not use this file except in compliance with such restrictions and
11 limitations. You may obtain instructions on how to receive a copy of the
12 License at http://www.systemc.org/. Software distributed by Contributors
13 under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
14 ANY KIND, either express or implied. See the License for the specific
15 language governing rights and limitations under the License.
16
17 *****************************************************************************/
18
19//
20// Note to the LRM writer : These interfaces are channel specific interfaces
21// useful in the context of tlm_fifo.
22//
23
24#ifndef TLM_FIFO_IFS_HEADER
25#define TLM_FIFO_IFS_HEADER
26
27//
28// Fifo specific interfaces
29//
30
31#include "tlm_core/tlm_interfaces/tlm_core_ifs.h"
32
33// Fifo Debug Interface
34
35template< typename T >
36class tlm_fifo_debug_if : public virtual sc_interface
37{
38public:
39 virtual int used() const = 0;
40 virtual int size() const = 0;
41 virtual void debug() const = 0;
42
43 //
44 // non blocking peek and poke - no notification
45 //
46 // n is index of data :
47 // 0 <= n < size(), where 0 is most recently written, and size() - 1
48 // is oldest ie the one about to be read.
49 //
50
51 virtual bool nb_peek( T & , int n ) const = 0;
52 virtual bool nb_poke( const T & , int n = 0 ) = 0;
53
54};
55
56// fifo interfaces = extended + debug
57
58template < typename T >
59class tlm_fifo_put_if :
60 public virtual tlm_put_if<T> ,
61 public virtual tlm_fifo_debug_if<T> {};
62
63template < typename T >
64class tlm_fifo_get_if :
65 public virtual tlm_get_peek_if<T> ,
66 public virtual tlm_fifo_debug_if<T> {};
67
68class tlm_fifo_config_size_if : public virtual sc_interface
69{
70public:
71 virtual void nb_expand( unsigned int n = 1 ) = 0;
72 virtual void nb_unbound( unsigned int n = 16 ) = 0;
73
74 virtual bool nb_reduce( unsigned int n = 1 ) = 0;
75 virtual bool nb_bound( unsigned int n ) = 0;
76
77};
78#endif
79