112027Sjungma@eit.uni-kl.de/*****************************************************************************
212027Sjungma@eit.uni-kl.de
312027Sjungma@eit.uni-kl.de  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
412027Sjungma@eit.uni-kl.de  more contributor license agreements.  See the NOTICE file distributed
512027Sjungma@eit.uni-kl.de  with this work for additional information regarding copyright ownership.
612027Sjungma@eit.uni-kl.de  Accellera licenses this file to you under the Apache License, Version 2.0
712027Sjungma@eit.uni-kl.de  (the "License"); you may not use this file except in compliance with the
812027Sjungma@eit.uni-kl.de  License.  You may obtain a copy of the License at
912027Sjungma@eit.uni-kl.de
1012027Sjungma@eit.uni-kl.de    http://www.apache.org/licenses/LICENSE-2.0
1112027Sjungma@eit.uni-kl.de
1212027Sjungma@eit.uni-kl.de  Unless required by applicable law or agreed to in writing, software
1312027Sjungma@eit.uni-kl.de  distributed under the License is distributed on an "AS IS" BASIS,
1412027Sjungma@eit.uni-kl.de  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
1512027Sjungma@eit.uni-kl.de  implied.  See the License for the specific language governing
1612027Sjungma@eit.uni-kl.de  permissions and limitations under the License.
1712027Sjungma@eit.uni-kl.de
1812027Sjungma@eit.uni-kl.de *****************************************************************************/
1912027Sjungma@eit.uni-kl.de
2012027Sjungma@eit.uni-kl.de//
2112027Sjungma@eit.uni-kl.de// Note to the LRM writer : These interfaces are channel specific interfaces
2212027Sjungma@eit.uni-kl.de// useful in the context of tlm_fifo.
2312027Sjungma@eit.uni-kl.de//
2412027Sjungma@eit.uni-kl.de
2512027Sjungma@eit.uni-kl.de#ifndef __TLM_FIFO_IFS_H__
2612027Sjungma@eit.uni-kl.de#define __TLM_FIFO_IFS_H__
2712027Sjungma@eit.uni-kl.de
2812027Sjungma@eit.uni-kl.de#include "tlm_core/tlm_1/tlm_req_rsp/tlm_1_interfaces/tlm_core_ifs.h"
2912027Sjungma@eit.uni-kl.de
3012027Sjungma@eit.uni-kl.denamespace tlm {
3112027Sjungma@eit.uni-kl.de
3212027Sjungma@eit.uni-kl.de//
3312027Sjungma@eit.uni-kl.de// Fifo specific interfaces
3412027Sjungma@eit.uni-kl.de//
3512027Sjungma@eit.uni-kl.de
3612027Sjungma@eit.uni-kl.de// Fifo Debug Interface
3712027Sjungma@eit.uni-kl.de
3812027Sjungma@eit.uni-kl.detemplate< typename T >
3912027Sjungma@eit.uni-kl.declass tlm_fifo_debug_if : public virtual sc_core::sc_interface
4012027Sjungma@eit.uni-kl.de{
4112027Sjungma@eit.uni-kl.depublic:
4212027Sjungma@eit.uni-kl.de  virtual int used() const = 0;
4312027Sjungma@eit.uni-kl.de  virtual int size() const = 0;
4412027Sjungma@eit.uni-kl.de  virtual void debug() const = 0;
4512027Sjungma@eit.uni-kl.de
4612027Sjungma@eit.uni-kl.de  //
4712027Sjungma@eit.uni-kl.de  // non blocking peek and poke - no notification
4812027Sjungma@eit.uni-kl.de  //
4912027Sjungma@eit.uni-kl.de  // n is index of data :
5012027Sjungma@eit.uni-kl.de  // 0 <= n < size(), where 0 is most recently written, and size() - 1
5112027Sjungma@eit.uni-kl.de  // is oldest ie the one about to be read.
5212027Sjungma@eit.uni-kl.de  //
5312027Sjungma@eit.uni-kl.de
5412027Sjungma@eit.uni-kl.de  virtual bool nb_peek( T & , int n ) const = 0;
5512027Sjungma@eit.uni-kl.de  virtual bool nb_poke( const T & , int n = 0 ) = 0;
5612027Sjungma@eit.uni-kl.de
5712027Sjungma@eit.uni-kl.de};
5812027Sjungma@eit.uni-kl.de
5912027Sjungma@eit.uni-kl.de// fifo interfaces = extended + debug
6012027Sjungma@eit.uni-kl.de
6112027Sjungma@eit.uni-kl.detemplate < typename T >
6212027Sjungma@eit.uni-kl.declass tlm_fifo_put_if :
6312027Sjungma@eit.uni-kl.de  public virtual tlm_put_if<T> ,
6412027Sjungma@eit.uni-kl.de  public virtual tlm_fifo_debug_if<T> {};
6512027Sjungma@eit.uni-kl.de
6612027Sjungma@eit.uni-kl.detemplate < typename T >
6712027Sjungma@eit.uni-kl.declass tlm_fifo_get_if :
6812027Sjungma@eit.uni-kl.de  public virtual tlm_get_peek_if<T> ,
6912027Sjungma@eit.uni-kl.de  public virtual tlm_fifo_debug_if<T> {};
7012027Sjungma@eit.uni-kl.de
7112027Sjungma@eit.uni-kl.declass tlm_fifo_config_size_if : public virtual sc_core::sc_interface
7212027Sjungma@eit.uni-kl.de{
7312027Sjungma@eit.uni-kl.depublic:
7412027Sjungma@eit.uni-kl.de  virtual void nb_expand( unsigned int n = 1 ) = 0;
7512027Sjungma@eit.uni-kl.de  virtual void nb_unbound( unsigned int n = 16 ) = 0;
7612027Sjungma@eit.uni-kl.de
7712027Sjungma@eit.uni-kl.de  virtual bool nb_reduce( unsigned int n = 1 ) = 0;
7812027Sjungma@eit.uni-kl.de  virtual bool nb_bound( unsigned int n ) = 0;
7912027Sjungma@eit.uni-kl.de
8012027Sjungma@eit.uni-kl.de};
8112027Sjungma@eit.uni-kl.de
8212027Sjungma@eit.uni-kl.de} // namespace tlm
8312027Sjungma@eit.uni-kl.de
8412027Sjungma@eit.uni-kl.de#endif
8512027Sjungma@eit.uni-kl.de
86