|
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) |
| const std::string & | getName () const |
| Get the name of this SharedData. | |
| 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 74 of file SharedData.hpp.
|
inline |
Definition at line 83 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 163 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 209 of file SharedData.hpp.

|
inline |
Clear both Present State and Next State valids.
Definition at line 215 of file SharedData.hpp.
|
inline |
Clear Next State valid.
Definition at line 221 of file SharedData.hpp.
|
inline |
Clear Present State valid.
Definition at line 226 of file SharedData.hpp.
|
inline |
Get the name of this SharedData.
Definition at line 120 of file SharedData.hpp.
|
inline |
Is there data in the current view.
Definition at line 144 of file SharedData.hpp.
|
inline |
Is there data for the next cycle?
Definition at line 188 of file SharedData.hpp.
|
inline |
Definition at line 92 of file SharedData.hpp.
|
inline |
Definition at line 104 of file SharedData.hpp.
|
inline |
Get a constant reference to the data visible this cycle.
| SpartaException | if data is not valid |
Definition at line 153 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 198 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 233 of file SharedData.hpp.
|
inline |
Write data for the next cycle view.
| dat | The data to write for visibility next cycle |
Definition at line 172 of file SharedData.hpp.
|
inline |
Write data for the next cycle view.
| dat | The data to write for visibility next cycle |
Definition at line 180 of file SharedData.hpp.
|
inline |
Write data to the current view.
| dat | The data to write for visibility this cycle |
Definition at line 128 of file SharedData.hpp.
|
inline |
Write data to the current view.
| dat | The data to write for visibility this cycle |
Definition at line 136 of file SharedData.hpp.