SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_core::sc_semaphore Class Reference

The sc_semaphore primitive channel class. More...

#include <sysc/communication/sc_semaphore.h>

Inheritance diagram for sc_core::sc_semaphore:
Collaboration diagram for sc_core::sc_semaphore:

Public Types

typedef unsigned phase_cb_mask
 

Public Member Functions

 sc_semaphore (int init_value_)
 
 sc_semaphore (const char *name_, int init_value_)
 
virtual int wait ()
 
virtual int trywait ()
 
virtual int post ()
 
virtual int get_value () const
 
virtual const char * kind () const
 
virtual void register_port (sc_port_base &port_, const char *if_typename_)
 
virtual const sc_eventdefault_event () const
 
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
 
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

bool in_use () const
 
void report_error (const char *id, const char *add_msg=0) const
 
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

sc_event m_free
 
int m_value
 

Detailed Description

The sc_semaphore primitive channel class.

Definition at line 49 of file sc_semaphore.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.

Constructor & Destructor Documentation

◆ sc_semaphore() [1/2]

sc_core::sc_semaphore::sc_semaphore ( int  init_value_)
explicit

◆ sc_semaphore() [2/2]

sc_core::sc_semaphore::sc_semaphore ( const char *  name_,
int  init_value_ 
)

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.

◆ 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

◆ default_event()

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

◆ dump()

virtual void sc_core::sc_object::dump ( ::std::ostream &  os = ::std::cout) const
virtualinherited

◆ 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.

◆ get_value()

virtual int sc_core::sc_semaphore::get_value ( ) const
inlinevirtual

Implements sc_core::sc_semaphore_if.

Definition at line 73 of file sc_semaphore.h.

◆ in_use()

bool sc_core::sc_semaphore::in_use ( ) const
inlineprotected

Definition at line 83 of file sc_semaphore.h.

◆ kind()

virtual const char* sc_core::sc_semaphore::kind ( ) const
inlinevirtual

Reimplemented from sc_core::sc_object.

Definition at line 76 of file sc_semaphore.h.

◆ name()

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

Definition at line 77 of file sc_object.h.

◆ num_attributes()

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

◆ post()

virtual int sc_core::sc_semaphore::post ( )
virtual

◆ print()

virtual void sc_core::sc_object::print ( ::std::ostream &  os = ::std::cout) const
virtualinherited

◆ register_port()

virtual void sc_core::sc_interface::register_port ( sc_port_base port_,
const char *  if_typename_ 
)
virtualinherited

◆ 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.

◆ report_error()

void sc_core::sc_semaphore::report_error ( const char *  id,
const char *  add_msg = 0 
) const
protected

◆ simcontext()

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

Definition at line 91 of file sc_object.h.

◆ trace()

virtual void sc_core::sc_object::trace ( sc_trace_file tf) const
virtualinherited

◆ trywait()

virtual int sc_core::sc_semaphore::trywait ( )
virtual

◆ unregister_simulation_phase_callback()

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

◆ wait()

virtual int sc_core::sc_semaphore::wait ( )
virtual

Member Data Documentation

◆ m_free

sc_event sc_core::sc_semaphore::m_free
protected

Definition at line 92 of file sc_semaphore.h.

◆ m_value

int sc_core::sc_semaphore::m_value
protected

Definition at line 93 of file sc_semaphore.h.


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