SystemC 3.0.0
Accellera SystemC proof-of-concept library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
sc_core::sc_fifo< T > Class Template Reference

#include <sysc/communication/sc_fifo.h>

Inheritance diagram for sc_core::sc_fifo< T >:
Inheritance graph
[legend]
Collaboration diagram for sc_core::sc_fifo< T >:
Collaboration graph
[legend]

Public Member Functions

 sc_fifo (int size_=16)
 
 sc_fifo (const char *name_, int size_=16)
 
virtual ~sc_fifo ()
 
virtual void register_port (sc_port_base &, const char *)
 
virtual void read (T &)
 
virtual T read ()
 
virtual bool nb_read (T &)
 
virtual int num_available () const
 
virtual const sc_eventdata_written_event () const
 
virtual void write (const T &)
 
virtual bool nb_write (const T &)
 
virtual int num_free () const
 
virtual const sc_eventdata_read_event () const
 
 operator T ()
 
sc_fifo< T > & operator= (const T &a)
 
void trace (sc_trace_file *tf) const
 
virtual void print (::std::ostream &=::std::cout) const
 
virtual void dump (::std::ostream &=::std::cout) const
 
virtual const char * kind () const
 
virtual int num_available () const =0
 
virtual bool nb_read (T &)=0
 
virtual const sc_eventdata_written_event () const =0
 
- Public Member Functions inherited from sc_core::sc_interface
virtual void register_port (sc_port_base &port_, const char *if_typename_)
 
virtual const sc_eventdefault_event () const
 
virtual ~sc_interface ()
 
virtual void read (T &)=0
 
virtual T read ()=0
 
virtual int num_free () const =0
 
virtual bool nb_write (const T &)=0
 
virtual const sc_eventdata_read_event () const =0
 
virtual void write (const T &)=0
 
- Public Member Functions inherited from sc_core::sc_prim_channel
virtual const char * kind () const
 
bool update_requested ()
 
void request_update ()
 
void async_request_update ()
 
- Public Member Functions inherited from sc_core::sc_object
const char * name () const
 
const char * basename () const
 
virtual void print (::std::ostream &os=::std::cout) const
 
virtual void dump (::std::ostream &os=::std::cout) const
 
virtual void trace (sc_trace_file *tf) const
 
virtual const char * kind () const
 
sc_simcontextsimcontext () const
 
bool add_attribute (sc_attr_base &)
 
sc_attr_baseget_attribute (const std::string &name_)
 
const sc_attr_baseget_attribute (const std::string &name_) const
 
sc_attr_baseremove_attribute (const std::string &name_)
 
void remove_all_attributes ()
 
int num_attributes () const
 
sc_attr_cltnattr_cltn ()
 
const sc_attr_cltnattr_cltn () const
 
virtual const std::vector< sc_event * > & get_child_events () const
 
virtual const std::vector< sc_object * > & get_child_objects () const
 
sc_objectget_parent () const
 
sc_objectget_parent_object () const
 
virtual ~sc_object ()
 

Protected Member Functions

virtual void update ()
 
void init (int)
 
void buf_init (int)
 
bool buf_write (const T &)
 
bool buf_read (T &)
 
- Protected Member Functions inherited from sc_core::sc_fifo_in_if< T >
 sc_fifo_in_if ()
 
- Protected Member Functions inherited from sc_core::sc_interface
 sc_interface ()
 
- Protected Member Functions inherited from sc_core::sc_fifo_out_if< T >
 sc_fifo_out_if ()
 
- Protected Member Functions inherited from sc_core::sc_prim_channel
 sc_prim_channel ()
 
 sc_prim_channel (const char *)
 
virtual ~sc_prim_channel ()
 
virtual void update ()
 
virtual void before_end_of_elaboration ()
 
virtual void end_of_elaboration ()
 
virtual void start_of_simulation ()
 
virtual void end_of_simulation ()
 
void async_attach_suspending ()
 
void async_detach_suspending ()
 
void wait ()
 
void wait (const sc_event &e)
 
void wait (const sc_event_or_list &el)
 
void wait (const sc_event_and_list &el)
 
void wait (const sc_time &t)
 
void wait (double v, sc_time_unit tu)
 
void wait (const sc_time &t, const sc_event &e)
 
void wait (double v, sc_time_unit tu, const sc_event &e)
 
void wait (const sc_time &t, const sc_event_or_list &el)
 
void wait (double v, sc_time_unit tu, const sc_event_or_list &el)
 
void wait (const sc_time &t, const sc_event_and_list &el)
 
void wait (double v, sc_time_unit tu, const sc_event_and_list &el)
 
void wait (int n)
 
void next_trigger ()
 
void next_trigger (const sc_event &e)
 
void next_trigger (const sc_event_or_list &el)
 
void next_trigger (const sc_event_and_list &el)
 
void next_trigger (const sc_time &t)
 
void next_trigger (double v, sc_time_unit tu)
 
void next_trigger (const sc_time &t, const sc_event &e)
 
void next_trigger (double v, sc_time_unit tu, const sc_event &e)
 
void next_trigger (const sc_time &t, const sc_event_or_list &el)
 
void next_trigger (double v, sc_time_unit tu, const sc_event_or_list &el)
 
void next_trigger (const sc_time &t, const sc_event_and_list &el)
 
void next_trigger (double v, sc_time_unit tu, const sc_event_and_list &el)
 
bool timed_out ()
 
- Protected Member Functions inherited from sc_core::sc_object
 sc_object ()
 
 sc_object (const char *nm)
 
 sc_object (const sc_object &)
 
sc_objectoperator= (const sc_object &)
 
virtual hierarchy_scope get_hierarchy_scope ()
 

Protected Attributes

int m_size
 
T * m_buf
 
int m_free
 
int m_ri
 
int m_wi
 
sc_port_basem_reader
 
sc_port_basem_writer
 
int m_num_readable
 
int m_num_read
 
int m_num_written
 
sc_event m_data_read_event
 
sc_event m_data_written_event
 

Detailed Description

template<class T>
class sc_core::sc_fifo< T >

Definition at line 50 of file sc_fifo.h.

Constructor & Destructor Documentation

◆ sc_fifo() [1/2]

template<class T >
sc_core::sc_fifo< T >::sc_fifo ( int  size_ = 16)
inlineexplicit

Definition at line 59 of file sc_fifo.h.

◆ sc_fifo() [2/2]

template<class T >
sc_core::sc_fifo< T >::sc_fifo ( const char *  name_,
int  size_ = 16 
)
inlineexplicit

Definition at line 65 of file sc_fifo.h.

◆ ~sc_fifo()

template<class T >
virtual sc_core::sc_fifo< T >::~sc_fifo ( )
inlinevirtual

Definition at line 74 of file sc_fifo.h.

Member Function Documentation

◆ buf_init()

template<class T >
void sc_core::sc_fifo< T >::buf_init ( int  size_)
inlineprotected

Definition at line 380 of file sc_fifo.h.

◆ buf_read()

template<class T >
bool sc_core::sc_fifo< T >::buf_read ( T &  val_)
inlineprotected

Definition at line 410 of file sc_fifo.h.

◆ buf_write()

template<class T >
bool sc_core::sc_fifo< T >::buf_write ( const T &  val_)
inlineprotected

Definition at line 396 of file sc_fifo.h.

◆ data_read_event()

template<class T >
virtual const sc_event & sc_core::sc_fifo< T >::data_read_event ( ) const
inlinevirtual

Implements sc_core::sc_fifo_nonblocking_out_if< T >.

Definition at line 118 of file sc_fifo.h.

◆ data_written_event()

template<class T >
virtual const sc_event & sc_core::sc_fifo< T >::data_written_event ( ) const
inlinevirtual

Implements sc_core::sc_fifo_nonblocking_in_if< T >.

Definition at line 99 of file sc_fifo.h.

◆ dump()

template<class T >
void sc_core::sc_fifo< T >::dump ( ::std::ostream &  os = ::std::cout) const
inlinevirtual

Reimplemented from sc_core::sc_object.

Definition at line 326 of file sc_fifo.h.

◆ init()

template<class T >
void sc_core::sc_fifo< T >::init ( int  size_)
inlineprotected

Definition at line 364 of file sc_fifo.h.

◆ kind()

template<class T >
virtual const char * sc_core::sc_fifo< T >::kind ( ) const
inlinevirtual

Reimplemented from sc_core::sc_prim_channel.

Definition at line 138 of file sc_fifo.h.

◆ nb_read()

template<class T >
bool sc_core::sc_fifo< T >::nb_read ( T &  val_)
inlinevirtual

Implements sc_core::sc_fifo_nonblocking_in_if< T >.

Definition at line 245 of file sc_fifo.h.

◆ nb_write()

template<class T >
bool sc_core::sc_fifo< T >::nb_write ( const T &  val_)
inlinevirtual

Implements sc_core::sc_fifo_nonblocking_out_if< T >.

Definition at line 278 of file sc_fifo.h.

◆ num_available()

template<class T >
virtual int sc_core::sc_fifo< T >::num_available ( ) const
inlinevirtual

Implements sc_core::sc_fifo_in_if< T >.

Definition at line 93 of file sc_fifo.h.

◆ num_free()

template<class T >
virtual int sc_core::sc_fifo< T >::num_free ( ) const
inlinevirtual

Implements sc_core::sc_fifo_out_if< T >.

Definition at line 112 of file sc_fifo.h.

◆ operator T()

template<class T >
sc_core::sc_fifo< T >::operator T ( )
inline

Definition at line 124 of file sc_fifo.h.

◆ operator=()

template<class T >
sc_fifo< T > & sc_core::sc_fifo< T >::operator= ( const T &  a)
inline

Definition at line 128 of file sc_fifo.h.

◆ print()

template<class T >
void sc_core::sc_fifo< T >::print ( ::std::ostream &  os = ::std::cout) const
inlinevirtual

Reimplemented from sc_core::sc_object.

Definition at line 312 of file sc_fifo.h.

◆ read() [1/2]

template<class T >
T sc_core::sc_fifo< T >::read
inlinevirtual

Implements sc_core::sc_fifo_blocking_in_if< T >.

Definition at line 233 of file sc_fifo.h.

◆ read() [2/2]

template<class T >
void sc_core::sc_fifo< T >::read ( T &  val_)
inlinevirtual

Implements sc_core::sc_fifo_blocking_in_if< T >.

Definition at line 221 of file sc_fifo.h.

◆ register_port()

template<class T >
void sc_core::sc_fifo< T >::register_port ( sc_port_base port_,
const char *  if_typename_ 
)
inlinevirtual

Reimplemented from sc_core::sc_interface.

Definition at line 184 of file sc_fifo.h.

◆ trace()

template<class T >
void sc_core::sc_fifo< T >::trace ( sc_trace_file tf) const
inlinevirtual

Reimplemented from sc_core::sc_object.

Definition at line 295 of file sc_fifo.h.

◆ update()

template<class T >
void sc_core::sc_fifo< T >::update
inlineprotectedvirtual

Reimplemented from sc_core::sc_prim_channel.

Definition at line 343 of file sc_fifo.h.

◆ write()

template<class T >
void sc_core::sc_fifo< T >::write ( const T &  val_)
inlinevirtual

Implements sc_core::sc_fifo_blocking_out_if< T >.

Definition at line 264 of file sc_fifo.h.

Member Data Documentation

◆ m_buf

template<class T >
T* sc_core::sc_fifo< T >::m_buf
protected

Definition at line 156 of file sc_fifo.h.

◆ m_data_read_event

template<class T >
sc_event sc_core::sc_fifo< T >::m_data_read_event
protected

Definition at line 168 of file sc_fifo.h.

◆ m_data_written_event

template<class T >
sc_event sc_core::sc_fifo< T >::m_data_written_event
protected

Definition at line 169 of file sc_fifo.h.

◆ m_free

template<class T >
int sc_core::sc_fifo< T >::m_free
protected

Definition at line 157 of file sc_fifo.h.

◆ m_num_read

template<class T >
int sc_core::sc_fifo< T >::m_num_read
protected

Definition at line 165 of file sc_fifo.h.

◆ m_num_readable

template<class T >
int sc_core::sc_fifo< T >::m_num_readable
protected

Definition at line 164 of file sc_fifo.h.

◆ m_num_written

template<class T >
int sc_core::sc_fifo< T >::m_num_written
protected

Definition at line 166 of file sc_fifo.h.

◆ m_reader

template<class T >
sc_port_base* sc_core::sc_fifo< T >::m_reader
protected

Definition at line 161 of file sc_fifo.h.

◆ m_ri

template<class T >
int sc_core::sc_fifo< T >::m_ri
protected

Definition at line 158 of file sc_fifo.h.

◆ m_size

template<class T >
int sc_core::sc_fifo< T >::m_size
protected

Definition at line 155 of file sc_fifo.h.

◆ m_wi

template<class T >
int sc_core::sc_fifo< T >::m_wi
protected

Definition at line 159 of file sc_fifo.h.

◆ m_writer

template<class T >
sc_port_base* sc_core::sc_fifo< T >::m_writer
protected

Definition at line 162 of file sc_fifo.h.


The documentation for this class was generated from the following file: