The ordered_semaphore primitive channel class.
More...
#include <ordered_semaphore.h>
|
| | ordered_semaphore (unsigned init_value=1) |
| | constructor of an un-named semaphore
|
| | ordered_semaphore (const char *name, unsigned init_value=1, bool value_traceable=false) |
|
| ordered_semaphore (const ordered_semaphore &)=delete |
|
ordered_semaphore & | operator= (const ordered_semaphore &)=delete |
| int | wait () override |
| | lock (take) the semaphore, block if not available
|
|
int | wait (unsigned priority) |
| int | trywait () override |
| | lock (take) the semaphore, return -1 if not available
|
| int | post () override |
| | unlock (give) the semaphore
|
| unsigned | get_capacity () |
| | retrieve the initial capacity of the semaphore
|
| void | set_capacity (unsigned capacity) |
| | change the capacity
|
| int | get_value () const override |
| | get the value of the semaphore
|
| const char * | kind () const override |
| | kind of this SastemC object
|
| void | trace (sc_core::sc_trace_file *tf) const override |
| | adds internal variables to trace
|
| bool | is_trace_enabled () const override |
| | returns of this component shall be traced
|
The ordered_semaphore primitive channel class.
The ordered semaphore acts like an ordinary semaphore. It gives the guarantee that access is granted in the order of arrival (FCFS)
Definition at line 45 of file ordered_semaphore.h.
◆ ordered_semaphore() [1/2]
| scc::ordered_semaphore::ordered_semaphore |
( |
unsigned | init_value = 1 | ) |
|
|
explicit |
constructor of an un-named semaphore
If the initial value is 0 the semaphore has an unlimited capacity but is initially empty
- Parameters
-
| init_value | initial capacity of the semaphore |
Definition at line 65 of file ordered_semaphore.cpp.
◆ ordered_semaphore() [2/2]
| scc::ordered_semaphore::ordered_semaphore |
( |
const char * | name, |
|
|
unsigned | init_value = 1, |
|
|
bool | value_traceable = false ) |
◆ get_capacity()
| unsigned scc::ordered_semaphore::get_capacity |
( |
| ) |
|
|
inline |
◆ get_value()
| int scc::ordered_semaphore::get_value |
( |
| ) |
const |
|
inlineoverride |
◆ in_use()
| bool scc::ordered_semaphore::in_use |
( |
| ) |
|
|
inlineprotected |
◆ is_trace_enabled()
| bool scc::ordered_semaphore::is_trace_enabled |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ kind()
| const char * scc::ordered_semaphore::kind |
( |
| ) |
const |
|
inlineoverride |
◆ post()
| auto scc::ordered_semaphore::post |
( |
| ) |
|
|
override |
◆ report_error()
| void scc::ordered_semaphore::report_error |
( |
const char * | id, |
|
|
const char * | add_msg = 0 ) const |
|
protected |
◆ set_capacity()
| void scc::ordered_semaphore::set_capacity |
( |
unsigned | capacity | ) |
|
◆ trace()
| void scc::ordered_semaphore::trace |
( |
sc_core::sc_trace_file * | tf | ) |
const |
|
override |
adds internal variables to trace
- Parameters
-
| tf | the trace file to register with |
Definition at line 53 of file ordered_semaphore.cpp.
◆ trywait()
| auto scc::ordered_semaphore::trywait |
( |
| ) |
|
|
override |
lock (take) the semaphore, return -1 if not available
- Returns
- value after locking or -1 if the semaphore could not be locked
Definition at line 104 of file ordered_semaphore.cpp.
◆ wait()
| int scc::ordered_semaphore::wait |
( |
| ) |
|
|
inlineoverride |
lock (take) the semaphore, block if not available
- Returns
- value after locking
Definition at line 75 of file ordered_semaphore.h.
◆ capacity
| unsigned scc::ordered_semaphore::capacity |
|
protected |
◆ free_evt
| sc_core::sc_event scc::ordered_semaphore::free_evt |
|
protected |
◆ queue
| std::array<std::deque<sc_core::sc_process_handle>, 2> scc::ordered_semaphore::queue |
|
protected |
◆ value
| int scc::ordered_semaphore::value |
|
protected |
◆ value_ref
◆ value_traceable
| bool scc::ordered_semaphore::value_traceable = false |
|
protected |
The documentation for this class was generated from the following files: