The Sparta Modeling Framework
|
Class that allows the writing of data this cycle, but not visable until next cycle. More...
#include <SharedData.hpp>
Public Member Functions | |
template<typename U = DataT> | |
SharedData (const std::string &name, const Clock *clk, U &&init_val=U()) | |
Construct a SharedData item. | |
SharedData (const SharedData &rhs) | |
SharedData (SharedData &&rhs) | |
SharedData & | operator= (const SharedData &rhs) |
SharedData & | operator= (SharedData &&rhs) |
void | writePS (const DataT &dat) |
Write data to the current view. | |
void | writePS (DataT &&dat) |
Write data to the current view. | |
bool | isValid () const |
Is there data in the current view. | |
const DataT & | read () const |
Get a constant reference to the data visible this cycle. | |
DataT & | access () |
Get a non-constant reference to the data visible this cycle. | |
void | write (const DataT &dat) |
Write data for the next cycle view. | |
void | write (DataT &&dat) |
Write data for the next cycle view. | |
bool | isValidNS () const |
Is there data for the next cycle? | |
const DataT & | readNS () const |
Get a constant reference to the data that will be visible next cycle. | |
DataT & | accessNS () |
Get a non-constant reference to the data that will be visible next cycle. | |
void | clear () |
Clear both Present State and Next State valids. | |
void | clearNS () |
Clear Next State valid. | |
void | clearPS () |
Clear Present State valid. | |
void | update () |
Update the SharedData class – move next cycle data to current view. Can only be called on a manually updated SharedData class. | |
Class that allows the writing of data this cycle, but not visable until next cycle.
DataT | The data to share |
manual_update | Is this SharedData object manually updated? Default is false |
This class supports two views of data: current view and the next cycle view. This class represents a latch concept.
For auto-updates, the SharedData item will propogate the next state value to the present state between clock cycles. This will occur only once per write(), and the present state value will be clobbered.
Definition at line 37 of file SharedData.hpp.
|
inline |
Construct a SharedData item.
name | The name of this SharedData object |
clk | The clock it uses to advance the internal data |
init_val | The initial value of SharedData item |
Definition at line 65 of file SharedData.hpp.
|
inline |
Definition at line 73 of file SharedData.hpp.
|
inline |
Definition at line 81 of file SharedData.hpp.
|
inline |
Get a non-constant reference to the data visible this cycle.
SpartaException | if data is not valid |
Definition at line 150 of file SharedData.hpp.
|
inline |
Get a non-constant reference to the data that will be visible next cycle.
SpartaException | if data is not valid |
Definition at line 196 of file SharedData.hpp.
|
inline |
Clear both Present State and Next State valids.
Definition at line 202 of file SharedData.hpp.
|
inline |
Clear Next State valid.
Definition at line 208 of file SharedData.hpp.
|
inline |
Clear Present State valid.
Definition at line 213 of file SharedData.hpp.
|
inline |
Is there data in the current view.
Definition at line 131 of file SharedData.hpp.
|
inline |
Is there data for the next cycle?
Definition at line 175 of file SharedData.hpp.
|
inline |
Definition at line 89 of file SharedData.hpp.
|
inline |
Definition at line 100 of file SharedData.hpp.
|
inline |
Get a constant reference to the data visible this cycle.
SpartaException | if data is not valid |
Definition at line 140 of file SharedData.hpp.
|
inline |
Get a constant reference to the data that will be visible next cycle.
SpartaException | if data is not valid |
Definition at line 185 of file SharedData.hpp.
|
inline |
Update the SharedData class – move next cycle data to current view. Can only be called on a manually updated SharedData class.
Definition at line 220 of file SharedData.hpp.
|
inline |
Write data for the next cycle view.
dat | The data to write for visibility next cycle |
Definition at line 159 of file SharedData.hpp.
|
inline |
Write data for the next cycle view.
dat | The data to write for visibility next cycle |
Definition at line 167 of file SharedData.hpp.
|
inline |
Write data to the current view.
dat | The data to write for visibility this cycle |
Definition at line 115 of file SharedData.hpp.
|
inline |
Write data to the current view.
dat | The data to write for visibility this cycle |
Definition at line 123 of file SharedData.hpp.