The Sparta Modeling Framework
|
#include <ArchDataSegment.hpp>
Public Types | |
typedef uint64_t | offset_type |
typedef uint32_t | ident_type |
Public Member Functions | |
ArchDataSegment (const ArchDataSegment &)=delete | |
ArchDataSegment (const ArchDataSegment &&)=delete | |
ArchDataSegment & | operator= (const ArchDataSegment &)=delete |
ArchDataSegment (ArchData *data, offset_type size, ident_type id, ident_type subset_of=INVALID_ID, offset_type subset_offset=0) | |
Constructor. | |
virtual | ~ArchDataSegment () |
Virtual destructor. | |
void | place (offset_type offset) |
Sets the offset of this DataView within its ArchData then invokes the place_ method for subclasses to handle. | |
void | writeInitial () |
Invokes writeInitial_, giving subclasses a chance to write a value to memory during initialization or reset of an ArchData. | |
bool | isPlaced () const |
Has this segment been placed yet. | |
offset_type | getOffset () const |
Gets the offset of this segment once placed. | |
offset_type | getLayoutSize () const |
Gets the layout size of this segment (number of bytes) | |
ident_type | getLayoutID () const |
Gets the layout Identifier of this segment. | |
ident_type | getSubsetOf () const |
Gets the segment of which this segment is a subset. | |
offset_type | getSubsetOffset () const |
Gets the offset into the segment of which this segment is a subset. | |
ArchData * | getArchData () |
Gets the ArchData associated with this segment. | |
const ArchData * | getArchData () const |
Gets the ArchData associated with this segment. | |
Static Public Attributes | |
static const ident_type | INVALID_ID = ~(ident_type)0 |
Indicates an invalid ID for an ArchDataSegment or any refinement. | |
Protected Member Functions | |
virtual void | place_ (offset_type offset) |
Allows subclasses to observe placement in an ArchData. Do not write an initial value from within this method. Use writeInitial_ instead. | |
virtual void | writeInitial_ () |
Write initial value of this segment into ArchData. This occurrs immediately after placement and may occur multiple times later if the owning ArchData is reset. | |
Layout interface used by ArchData class Noncopyable. ArchData will track these segments by pointer.
Definition at line 19 of file ArchDataSegment.hpp.
typedef uint32_t sparta::ArchDataSegment::ident_type |
Definition at line 24 of file ArchDataSegment.hpp.
typedef uint64_t sparta::ArchDataSegment::offset_type |
Definition at line 23 of file ArchDataSegment.hpp.
|
inline |
Constructor.
data | Data which this view will access |
size | size of <data> accessed by this view. Must be a power of 2 greater than 0 and less than or equal to the line size of <data> (sparta::ArchData::getLineSize) |
subset_of | Segment of which this segment is a subset (refers to only a subset of the same bytes in this other register). |
subset_offset | Offset into the register indicated by subset_of if subset_of is not INVALID_ID. Otherwise, is ignored. |
Definition at line 44 of file ArchDataSegment.hpp.
|
inlinevirtual |
Virtual destructor.
Definition at line 72 of file ArchDataSegment.hpp.
|
inline |
Gets the ArchData associated with this segment.
Definition at line 150 of file ArchDataSegment.hpp.
|
inline |
Gets the ArchData associated with this segment.
Definition at line 155 of file ArchDataSegment.hpp.
|
inline |
Gets the layout Identifier of this segment.
Definition at line 130 of file ArchDataSegment.hpp.
|
inline |
Gets the layout size of this segment (number of bytes)
Definition at line 124 of file ArchDataSegment.hpp.
|
inline |
Gets the offset of this segment once placed.
Definition at line 115 of file ArchDataSegment.hpp.
|
inline |
Gets the segment of which this segment is a subset.
Definition at line 137 of file ArchDataSegment.hpp.
|
inline |
Gets the offset into the segment of which this segment is a subset.
Definition at line 145 of file ArchDataSegment.hpp.
|
inline |
Has this segment been placed yet.
Definition at line 109 of file ArchDataSegment.hpp.
|
inline |
Sets the offset of this DataView within its ArchData then invokes the place_ method for subclasses to handle.
offset | Offset into ArchData (data_) where this segment resides now. |
SpartaException | if already placed. Re-placing is illegal. |
Definition at line 81 of file ArchDataSegment.hpp.
|
inlineprotectedvirtual |
Allows subclasses to observe placement in an ArchData. Do not write an initial value from within this method. Use writeInitial_ instead.
Subclasses may override and then indirectly invoke this method to respond to the placement. Actual placement may not be modified, however. I
At this point, it is not yet safe to read and write from the ArchData at the specified <offset> with the registered size (size_). Wait until the ArchData completes its layout (adata_.isLaidOut()).
Reimplemented in sparta::DataView.
Definition at line 172 of file ArchDataSegment.hpp.
|
inline |
Invokes writeInitial_, giving subclasses a chance to write a value to memory during initialization or reset of an ArchData.
Definition at line 98 of file ArchDataSegment.hpp.
|
inlineprotectedvirtual |
Write initial value of this segment into ArchData. This occurrs immediately after placement and may occur multiple times later if the owning ArchData is reset.
Subclasses may overwrite to supply an initial value after placement.
Reimplemented in sparta::DataView.
Definition at line 184 of file ArchDataSegment.hpp.
|
static |
Indicates an invalid ID for an ArchDataSegment or any refinement.
Definition at line 27 of file ArchDataSegment.hpp.