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