SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_core::sc_fifo< T > Class Template Reference

#include <sysc/communication/sc_fifo.h>

Inheritance diagram for sc_core::sc_fifo< T >:
Collaboration diagram for sc_core::sc_fifo< T >:

Public Types

enum  { list_end = 0xdb }
 
typedef unsigned phase_cb_mask
 

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 const sc_eventdefault_event () const
 
bool update_requested ()
 
void request_update ()
 
void async_request_update ()
 
const char * name () const
 
const char * basename () 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
 

Protected Member Functions

virtual void update ()
 
void init (int)
 
void buf_init (int)
 
bool buf_write (const T &)
 
bool buf_read (T &)
 
virtual void before_end_of_elaboration ()
 
virtual void end_of_elaboration ()
 
virtual void start_of_simulation ()
 
virtual void end_of_simulation ()
 
bool async_attach_suspending ()
 
bool 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 ()
 
virtual void add_child_event (sc_event *event_p)
 
virtual void add_child_object (sc_object *object_p)
 
virtual bool remove_child_event (sc_event *event_p)
 
virtual bool remove_child_object (sc_object *object_p)
 
phase_cb_mask register_simulation_phase_callback (phase_cb_mask)
 
phase_cb_mask unregister_simulation_phase_callback (phase_cb_mask)
 

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 54 of file sc_fifo.h.

Member Typedef Documentation

◆ phase_cb_mask

typedef unsigned sc_core::sc_object::phase_cb_mask
inherited

Definition at line 75 of file sc_object.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
list_end 

Definition at line 54 of file sc_prim_channel.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 63 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 69 of file sc_fifo.h.

◆ ~sc_fifo()

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

Definition at line 78 of file sc_fifo.h.

Member Function Documentation

◆ add_attribute()

bool sc_core::sc_object::add_attribute ( sc_attr_base )
inherited

◆ add_child_event()

virtual void sc_core::sc_object::add_child_event ( sc_event event_p)
protectedvirtualinherited

◆ add_child_object()

virtual void sc_core::sc_object::add_child_object ( sc_object object_p)
protectedvirtualinherited

Reimplemented in sc_core::sc_process_b.

◆ async_attach_suspending()

bool sc_core::sc_prim_channel::async_attach_suspending ( )
inlineprotectedinherited

Definition at line 363 of file sc_prim_channel.h.

◆ async_detach_suspending()

bool sc_core::sc_prim_channel::async_detach_suspending ( )
inlineprotectedinherited

Definition at line 370 of file sc_prim_channel.h.

◆ async_request_update()

void sc_core::sc_prim_channel::async_request_update ( )
inlineinherited

Definition at line 356 of file sc_prim_channel.h.

◆ attr_cltn() [1/2]

sc_attr_cltn& sc_core::sc_object::attr_cltn ( )
inherited

◆ attr_cltn() [2/2]

const sc_attr_cltn& sc_core::sc_object::attr_cltn ( ) const
inherited

◆ basename()

const char* sc_core::sc_object::basename ( ) const
inherited

◆ before_end_of_elaboration()

virtual void sc_core::sc_prim_channel::before_end_of_elaboration ( )
protectedvirtualinherited

Reimplemented in sc_core::sc_clock.

◆ buf_init()

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

Definition at line 385 of file sc_fifo.h.

◆ buf_read()

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

Definition at line 415 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 401 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 122 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 103 of file sc_fifo.h.

◆ default_event()

virtual const sc_event& sc_core::sc_interface::default_event ( ) const
virtualinherited

◆ 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 330 of file sc_fifo.h.

◆ end_of_elaboration()

virtual void sc_core::sc_prim_channel::end_of_elaboration ( )
protectedvirtualinherited

◆ end_of_simulation()

virtual void sc_core::sc_prim_channel::end_of_simulation ( )
protectedvirtualinherited

◆ get_attribute() [1/2]

sc_attr_base* sc_core::sc_object::get_attribute ( const std::string &  name_)
inherited

◆ get_attribute() [2/2]

const sc_attr_base* sc_core::sc_object::get_attribute ( const std::string &  name_) const
inherited

◆ get_child_events()

virtual const std::vector<sc_event*>& sc_core::sc_object::get_child_events ( ) const
inlinevirtualinherited

Definition at line 114 of file sc_object.h.

◆ get_child_objects()

virtual const std::vector<sc_object*>& sc_core::sc_object::get_child_objects ( ) const
inlinevirtualinherited

Reimplemented in sc_core::sc_process_b, and sc_core::sc_module.

Definition at line 117 of file sc_object.h.

◆ get_parent()

sc_object* sc_core::sc_object::get_parent ( ) const
inherited

◆ get_parent_object()

sc_object* sc_core::sc_object::get_parent_object ( ) const
inlineinherited

Definition at line 121 of file sc_object.h.

◆ init()

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

Definition at line 369 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 142 of file sc_fifo.h.

◆ name()

const char* sc_core::sc_object::name ( ) const
inlineinherited

Definition at line 77 of file sc_object.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 249 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 282 of file sc_fifo.h.

◆ next_trigger() [1/12]

void sc_core::sc_prim_channel::next_trigger ( )
inlineprotectedinherited

Definition at line 150 of file sc_prim_channel.h.

◆ next_trigger() [2/12]

void sc_core::sc_prim_channel::next_trigger ( const sc_event e)
inlineprotectedinherited

Definition at line 156 of file sc_prim_channel.h.

◆ next_trigger() [3/12]

void sc_core::sc_prim_channel::next_trigger ( const sc_event_or_list el)
inlineprotectedinherited

Definition at line 159 of file sc_prim_channel.h.

◆ next_trigger() [4/12]

void sc_core::sc_prim_channel::next_trigger ( const sc_event_and_list el)
inlineprotectedinherited

Definition at line 162 of file sc_prim_channel.h.

◆ next_trigger() [5/12]

void sc_core::sc_prim_channel::next_trigger ( const sc_time t)
inlineprotectedinherited

Definition at line 165 of file sc_prim_channel.h.

◆ next_trigger() [6/12]

void sc_core::sc_prim_channel::next_trigger ( double  v,
sc_time_unit  tu 
)
inlineprotectedinherited

Definition at line 168 of file sc_prim_channel.h.

◆ next_trigger() [7/12]

void sc_core::sc_prim_channel::next_trigger ( const sc_time t,
const sc_event e 
)
inlineprotectedinherited

Definition at line 171 of file sc_prim_channel.h.

◆ next_trigger() [8/12]

void sc_core::sc_prim_channel::next_trigger ( double  v,
sc_time_unit  tu,
const sc_event e 
)
inlineprotectedinherited

Definition at line 174 of file sc_prim_channel.h.

◆ next_trigger() [9/12]

void sc_core::sc_prim_channel::next_trigger ( const sc_time t,
const sc_event_or_list el 
)
inlineprotectedinherited

Definition at line 178 of file sc_prim_channel.h.

◆ next_trigger() [10/12]

void sc_core::sc_prim_channel::next_trigger ( double  v,
sc_time_unit  tu,
const sc_event_or_list el 
)
inlineprotectedinherited

Definition at line 181 of file sc_prim_channel.h.

◆ next_trigger() [11/12]

void sc_core::sc_prim_channel::next_trigger ( const sc_time t,
const sc_event_and_list el 
)
inlineprotectedinherited

Definition at line 185 of file sc_prim_channel.h.

◆ next_trigger() [12/12]

void sc_core::sc_prim_channel::next_trigger ( double  v,
sc_time_unit  tu,
const sc_event_and_list el 
)
inlineprotectedinherited

Definition at line 188 of file sc_prim_channel.h.

◆ num_attributes()

int sc_core::sc_object::num_attributes ( ) const
inherited

◆ 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 97 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 116 of file sc_fifo.h.

◆ operator T()

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

Definition at line 128 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 132 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 316 of file sc_fifo.h.

◆ read() [1/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 225 of file sc_fifo.h.

◆ read() [2/2]

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

Implements sc_core::sc_fifo_blocking_in_if< T >.

Definition at line 237 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 188 of file sc_fifo.h.

◆ register_simulation_phase_callback()

phase_cb_mask sc_core::sc_object::register_simulation_phase_callback ( phase_cb_mask  )
protectedinherited

◆ remove_all_attributes()

void sc_core::sc_object::remove_all_attributes ( )
inherited

◆ remove_attribute()

sc_attr_base* sc_core::sc_object::remove_attribute ( const std::string &  name_)
inherited

◆ remove_child_event()

virtual bool sc_core::sc_object::remove_child_event ( sc_event event_p)
protectedvirtualinherited

◆ remove_child_object()

virtual bool sc_core::sc_object::remove_child_object ( sc_object object_p)
protectedvirtualinherited

Reimplemented in sc_core::sc_process_b.

◆ request_update()

void sc_core::sc_prim_channel::request_update ( )
inlineinherited

Definition at line 344 of file sc_prim_channel.h.

◆ simcontext()

sc_simcontext* sc_core::sc_object::simcontext ( ) const
inlineinherited

Definition at line 91 of file sc_object.h.

◆ start_of_simulation()

virtual void sc_core::sc_prim_channel::start_of_simulation ( )
protectedvirtualinherited

◆ timed_out()

bool sc_core::sc_prim_channel::timed_out ( )
inlineprotectedinherited

Definition at line 195 of file sc_prim_channel.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 299 of file sc_fifo.h.

◆ unregister_simulation_phase_callback()

phase_cb_mask sc_core::sc_object::unregister_simulation_phase_callback ( phase_cb_mask  )
protectedinherited

◆ update()

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

Reimplemented from sc_core::sc_prim_channel.

Definition at line 348 of file sc_fifo.h.

◆ update_requested()

bool sc_core::sc_prim_channel::update_requested ( )
inlineinherited

Definition at line 59 of file sc_prim_channel.h.

◆ wait() [1/13]

void sc_core::sc_prim_channel::wait ( )
inlineprotectedinherited

Definition at line 105 of file sc_prim_channel.h.

◆ wait() [2/13]

void sc_core::sc_prim_channel::wait ( const sc_event e)
inlineprotectedinherited

Definition at line 111 of file sc_prim_channel.h.

◆ wait() [3/13]

void sc_core::sc_prim_channel::wait ( const sc_event_or_list el)
inlineprotectedinherited

Definition at line 114 of file sc_prim_channel.h.

◆ wait() [4/13]

void sc_core::sc_prim_channel::wait ( const sc_event_and_list el)
inlineprotectedinherited

Definition at line 117 of file sc_prim_channel.h.

◆ wait() [5/13]

void sc_core::sc_prim_channel::wait ( const sc_time t)
inlineprotectedinherited

Definition at line 120 of file sc_prim_channel.h.

◆ wait() [6/13]

void sc_core::sc_prim_channel::wait ( double  v,
sc_time_unit  tu 
)
inlineprotectedinherited

Definition at line 123 of file sc_prim_channel.h.

◆ wait() [7/13]

void sc_core::sc_prim_channel::wait ( const sc_time t,
const sc_event e 
)
inlineprotectedinherited

Definition at line 126 of file sc_prim_channel.h.

◆ wait() [8/13]

void sc_core::sc_prim_channel::wait ( double  v,
sc_time_unit  tu,
const sc_event e 
)
inlineprotectedinherited

Definition at line 129 of file sc_prim_channel.h.

◆ wait() [9/13]

void sc_core::sc_prim_channel::wait ( const sc_time t,
const sc_event_or_list el 
)
inlineprotectedinherited

Definition at line 132 of file sc_prim_channel.h.

◆ wait() [10/13]

void sc_core::sc_prim_channel::wait ( double  v,
sc_time_unit  tu,
const sc_event_or_list el 
)
inlineprotectedinherited

Definition at line 135 of file sc_prim_channel.h.

◆ wait() [11/13]

void sc_core::sc_prim_channel::wait ( const sc_time t,
const sc_event_and_list el 
)
inlineprotectedinherited

Definition at line 138 of file sc_prim_channel.h.

◆ wait() [12/13]

void sc_core::sc_prim_channel::wait ( double  v,
sc_time_unit  tu,
const sc_event_and_list el 
)
inlineprotectedinherited

Definition at line 141 of file sc_prim_channel.h.

◆ wait() [13/13]

void sc_core::sc_prim_channel::wait ( int  n)
inlineprotectedinherited

Definition at line 144 of file sc_prim_channel.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 268 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 160 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 172 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 173 of file sc_fifo.h.

◆ m_free

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

Definition at line 161 of file sc_fifo.h.

◆ m_num_read

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

Definition at line 169 of file sc_fifo.h.

◆ m_num_readable

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

Definition at line 168 of file sc_fifo.h.

◆ m_num_written

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

Definition at line 170 of file sc_fifo.h.

◆ m_reader

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

Definition at line 165 of file sc_fifo.h.

◆ m_ri

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

Definition at line 162 of file sc_fifo.h.

◆ m_size

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

Definition at line 159 of file sc_fifo.h.

◆ m_wi

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

Definition at line 163 of file sc_fifo.h.

◆ m_writer

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

Definition at line 166 of file sc_fifo.h.


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