18 #ifndef __TLM_FIFO_H__
19 #define __TLM_FIFO_H__
59 explicit tlm_fifo(
const char* name_,
int size_ = 1 )
60 : sc_core::sc_prim_channel( name_ ) {
111 bool nb_peek( T & ,
int n )
const;
112 bool nb_poke(
const T & ,
int n = 0 );
124 if( is_empty() ) std::cout <<
"empty" << std::endl;
125 if( is_full() ) std::cout <<
"full" << std::endl;
127 std::cout <<
"size " <<
size() <<
" - " <<
used() <<
" used "
183 bool is_empty()
const {
187 bool is_full()
const {
197 template <
typename T>
198 const char*
const tlm_fifo<T>::kind_string =
"tlm_fifo";
207 template<
typename T >
213 buffer.resize( size_ );
216 else if( size_ < 0 ) {
217 buffer.resize( -size_ );
229 m_num_read_no_notify =
false;
233 template <
typename T>
238 if( m_num_read > m_num_read_no_notify || m_expand ) {
242 if( m_num_written > 0 ) {
249 m_num_readable = buffer.used();
250 m_num_read_no_notify = 0;
circular_buffer< T > buffer
bool nb_reduce(unsigned int n=1)
void nb_expand(unsigned int n=1)
bool nb_bound(unsigned int n)
sc_core::sc_event m_data_read_event
bool nb_can_peek(tlm_tag< T > *=0) const
const sc_core::sc_event & ok_to_get(tlm_tag< T > *=0) const
T peek(tlm_tag< T > *=0) const
bool nb_can_put(tlm_tag< T > *=0) const
const char * kind() const
const char * sc_gen_unique_name(const char *, bool preserve_first)
bool nb_poke(const T &, int n=0)
void nb_unbound(unsigned int n=16)
const sc_core::sc_event & ok_to_put(tlm_tag< T > *=0) const
const sc_time SC_ZERO_TIME
sc_core::sc_event & read_event(tlm_tag< T > *=0)
static const char *const kind_string
const sc_core::sc_event & ok_to_peek(tlm_tag< T > *=0) const
tlm_fifo(const char *name_, int size_=1)
sc_core::sc_event m_data_written_event
bool nb_can_get(tlm_tag< T > *=0) const