The Sparta Modeling Framework
|
Used by DataInPort and SyncInPort, this class holds received data from these ports and remembers the time in which the data was set. It also maintains the validity of the data. More...
#include <DataContainer.hpp>
Public Member Functions | |
DataContainer (const sparta::Clock *clk) | |
Construct the DataContainer with the clock used for timestamping. | |
bool | dataReceived () const |
Has this port received data (not timed) | |
bool | dataReceivedThisCycle () const |
Has this port received data this cycle. | |
DataT | pullData () |
Return the last data received by the port, then clear it. | |
const DataT & | peekData () const |
Peek at the data in the port, but don't invalidate it. | |
void | clearData () |
Clear the validity of the data at the port. | |
Clock::Cycle | getReceivedTimeStamp () const |
Returns the clock cycle data was received. | |
Protected Member Functions | |
void | setData_ (const DataT &dat) |
Set the data received. | |
Used by DataInPort and SyncInPort, this class holds received data from these ports and remembers the time in which the data was set. It also maintains the validity of the data.
Definition at line 25 of file DataContainer.hpp.
|
inline |
Construct the DataContainer with the clock used for timestamping.
clk | Clock used to get a timestamp. Must not be nullptr |
Definition at line 34 of file DataContainer.hpp.
|
inline |
Clear the validity of the data at the port.
Definition at line 90 of file DataContainer.hpp.
|
inline |
Has this port received data (not timed)
This function only returns true is data were ever received on this port. It does not indicate that data was delivered on this cycle. For that, use dataReceivedThisCycle function.
Definition at line 48 of file DataContainer.hpp.
|
inline |
Has this port received data this cycle.
This function returns true is data received were on this port this cycle.
Definition at line 59 of file DataContainer.hpp.
|
inline |
Returns the clock cycle data was received.
Definition at line 99 of file DataContainer.hpp.
|
inline |
Peek at the data in the port, but don't invalidate it.
Definition at line 84 of file DataContainer.hpp.
|
inline |
Return the last data received by the port, then clear it.
Pull the data from the port. This is a destructive mechanism, meaning the port is cleared
Definition at line 72 of file DataContainer.hpp.
|
inlineprotected |
Set the data received.
Definition at line 107 of file DataContainer.hpp.