orca-sim
|
The SignalSet class models a generic set of busses of type T. More...
#include <SignalSet.hpp>
Public Member Functions | |
SignalSet (std::string name, uint32_t nsig) | |
Constructor. More... | |
~SignalSet () | |
Destructor. More... | |
Signal< T > * | GetSignal (uint32_t index) |
Get the a signal from the set. More... | |
void | MapTo (MemoryType *mptr, MemoryAddr addr) |
Maps the signal set to a given memory address. More... | |
a name that identifies the model, advisably not empty. | |
Default ctor. | |
std::string | GetName () |
Getter method for the <_name> field. More... | |
void | SetName (std::string s) |
Setter method for the <_name> field. More... | |
Private Attributes | |
uint32_t | _num_signals |
number of signals in the set. More... | |
MemoryAddr | _mem_addr |
memory position of the first signal. More... | |
MemoryType * | _mem_ptr |
Signal< T > ** | _signals |
a pointer to the first signal. More... | |
std::string | _t_name |
an optional name to identify this model during runtime More... | |
The SignalSet class models a generic set of busses of type T.
Definition at line 47 of file SignalSet.hpp.
SignalSet::SignalSet | ( | std::string | name, |
uint32_t | nsig | ||
) |
Constructor.
Creates a new SignalSet.
name | An arbitrary name for the instance. |
nsig | Number of signals to be created |
Definition at line 46 of file SignalSet.cpp.
SignalSet::~SignalSet | ( | ) |
Destructor.
Definition at line 58 of file SignalSet.cpp.
|
inherited |
Signal< T > * SignalSet::GetSignal | ( | uint32_t | index | ) |
Get the a signal from the set.
index | The identifier of the signal to be returned. |
Definition at line 83 of file SignalSet.cpp.
void SignalSet::MapTo | ( | MemoryType * | mptr, |
MemoryAddr | addr | ||
) |
Maps the signal set to a given memory address.
Signals' addresses are generated by incrementing the address of the first signal.
mptr | Pointer to the memory location to be mapped |
addr | Address to the set to the first signals |
Definition at line 64 of file SignalSet.cpp.
|
inherited |
|
private |
memory position of the first signal.
Other signals' positions are generated by incrementing this index by sizeof(T)
Definition at line 54 of file SignalSet.hpp.
|
private |
Definition at line 55 of file SignalSet.hpp.
|
private |
number of signals in the set.
Cannot be changed runtime.
Definition at line 50 of file SignalSet.hpp.
|
private |
a pointer to the first signal.
An array will be instantiated to store signals in that pointer.
Definition at line 59 of file SignalSet.hpp.
|
private |
an optional name to identify this model during runtime
Definition at line 62 of file SignalSet.hpp.