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#ifndef __SYSTEMC_EXT_TLM_CORE_1_REQ_RSP_INTERFACES_FIFO_IFS_HH__
21#define __SYSTEMC_EXT_TLM_CORE_1_REQ_RSP_INTERFACES_FIFO_IFS_HH__
22
23#include "core_ifs.hh"
24
25namespace tlm
26{
27
28//
29// Fifo specific interfaces
30//
31
32// Fifo Debug Interface
33
34template <typename T>
35class tlm_fifo_debug_if : public virtual sc_core::sc_interface
36{
37  public:
38    virtual int used() const = 0;
39    virtual int size() const = 0;
40    virtual void debug() const = 0;
41
42    //
43    // non blocking peek and poke - no notification
44    //
45    // n is index of data :
46    // 0 <= n < size(), where 0 is most recently written, and size() - 1
47    // is oldest ie the one about to be read.
48    //
49
50    virtual bool nb_peek(T &, int n) const = 0;
51    virtual bool nb_poke(const T&, int n=0) = 0;
52};
53
54// fifo interfaces = extended + debug
55
56template <typename T>
57class tlm_fifo_put_if : public virtual tlm_put_if<T>,
58    public virtual tlm_fifo_debug_if<T>
59{};
60
61template <typename T>
62class tlm_fifo_get_if :
63    public virtual tlm_get_peek_if<T>,
64    public virtual tlm_fifo_debug_if<T>
65{};
66
67class tlm_fifo_config_size_if : public virtual sc_core::sc_interface
68{
69  public:
70    virtual void nb_expand(unsigned int n=1) = 0;
71    virtual void nb_unbound(unsigned int n=16) = 0;
72
73    virtual bool nb_reduce(unsigned int n=1) = 0;
74    virtual bool nb_bound(unsigned int n) = 0;
75};
76
77} // namespace tlm
78
79#endif /* __SYSTEMC_EXT_TLM_CORE_1_REQ_RSP_INTERFACES_FIFO_IFS_HH__ */
80