OpenCSD - CoreSight Trace Decode Library  1.3.3
Public Types | Public Member Functions | Protected Attributes | List of all members
TrcMemAccessorBase Class Referenceabstract

Memory range to access by trace decoder. More...

#include <trc_mem_acc_base.h>

Inheritance diagram for TrcMemAccessorBase:
Inheritance graph
[legend]

Public Types

enum  MemAccTypes { MEMACC_UNKNOWN , MEMACC_FILE , MEMACC_BUFPTR , MEMACC_CB_IF }
 

Public Member Functions

 TrcMemAccessorBase (MemAccTypes type)
 
 TrcMemAccessorBase (MemAccTypes type, ocsd_vaddr_t startAddr, ocsd_vaddr_t endAddr)
 
virtual ~TrcMemAccessorBase ()
 
void setRange (ocsd_vaddr_t startAddr, ocsd_vaddr_t endAddr)
 
virtual const bool addrInRange (const ocsd_vaddr_t s_address) const
 
virtual const bool addrStartOfRange (const ocsd_vaddr_t s_address) const
 
virtual const uint32_t bytesInRange (const ocsd_vaddr_t s_address, const uint32_t reqBytes) const
 
virtual const bool overLapRange (const TrcMemAccessorBase *p_test_acc) const
 
virtual const uint32_t readBytes (const ocsd_vaddr_t s_address, const ocsd_mem_space_acc_t memSpace, const uint8_t trcID, const uint32_t reqBytes, uint8_t *byteBuffer)=0
 
virtual const bool validateRange ()
 
enum MemAccTypes getType () const
 
void setMemSpace (ocsd_mem_space_acc_t memSpace)
 
const ocsd_mem_space_acc_t getMemSpace () const
 
const bool inMemSpace (const ocsd_mem_space_acc_t mem_space) const
 
virtual void getMemAccString (std::string &accStr) const
 

Protected Attributes

ocsd_vaddr_t m_startAddress
 
ocsd_vaddr_t m_endAddress
 
const MemAccTypes m_type
 
ocsd_mem_space_acc_t m_mem_space
 

Detailed Description

Memory range to access by trace decoder.

Represents a memory access range for the trace decoder. Range inclusive from m_startAddress to m_endAddress. e.g. a 1k range from 0x1000 has start of 0x1000 and end of 0x13FF

Derived classes provide specific access types such as binary files and memory buffers.

Definition at line 52 of file trc_mem_acc_base.h.

Member Enumeration Documentation

◆ MemAccTypes

Describes the storage type of the underlying memory accessor

Enumerator
MEMACC_UNKNOWN 
MEMACC_FILE 
MEMACC_BUFPTR 
MEMACC_CB_IF 

Definition at line 57 of file trc_mem_acc_base.h.

Constructor & Destructor Documentation

◆ TrcMemAccessorBase() [1/2]

TrcMemAccessorBase::TrcMemAccessorBase ( MemAccTypes  type)
inline

default constructor

Definition at line 167 of file trc_mem_acc_base.h.

◆ TrcMemAccessorBase() [2/2]

TrcMemAccessorBase::TrcMemAccessorBase ( MemAccTypes  type,
ocsd_vaddr_t  startAddr,
ocsd_vaddr_t  endAddr 
)
inline

costruct with address range values

Definition at line 159 of file trc_mem_acc_base.h.

◆ ~TrcMemAccessorBase()

virtual TrcMemAccessorBase::~TrcMemAccessorBase ( )
inlinevirtual

default desctructor

Definition at line 71 of file trc_mem_acc_base.h.

Member Function Documentation

◆ addrInRange()

const bool TrcMemAccessorBase::addrInRange ( const ocsd_vaddr_t  s_address) const
inlinevirtual

test if an address is in the inclusive range for this accessor

Parameters
s_address: Address to test.
Returns
const bool : true if the address is in range.

Reimplemented in TrcMemAccessorFile.

Definition at line 181 of file trc_mem_acc_base.h.

Here is the caller graph for this function:

◆ addrStartOfRange()

const bool TrcMemAccessorBase::addrStartOfRange ( const ocsd_vaddr_t  s_address) const
inlinevirtual

test if an address is the start of range for this accessor

Parameters
s_address: Address to test.
Returns
const bool : true if the address is start of range.

Reimplemented in TrcMemAccessorFile.

Definition at line 186 of file trc_mem_acc_base.h.

◆ bytesInRange()

const uint32_t TrcMemAccessorBase::bytesInRange ( const ocsd_vaddr_t  s_address,
const uint32_t  reqBytes 
) const
inlinevirtual

Test number of bytes available from the start address, up to the number of requested bytes. Tests if all the requested bytes are available from the supplied start address. Returns the number available up to full requested amount.

Parameters
s_address: Start address within the range.
reqBytes: Number of bytes needed from the start address.
Returns
const uint32_t : Bytes available, up to reqBytes. 0 is s_address not in range.

Reimplemented in TrcMemAccessorFile.

Definition at line 192 of file trc_mem_acc_base.h.

Here is the call graph for this function:

◆ getMemAccString()

virtual void TrcMemAccessorBase::getMemAccString ( std::string &  accStr) const
virtual

Reimplemented in TrcMemAccessorFile.

◆ getMemSpace()

const ocsd_mem_space_acc_t TrcMemAccessorBase::getMemSpace ( ) const
inline

Definition at line 146 of file trc_mem_acc_base.h.

◆ getType()

enum MemAccTypes TrcMemAccessorBase::getType ( ) const
inline

Definition at line 139 of file trc_mem_acc_base.h.

◆ inMemSpace()

const bool TrcMemAccessorBase::inMemSpace ( const ocsd_mem_space_acc_t  mem_space) const
inline

Definition at line 147 of file trc_mem_acc_base.h.

◆ overLapRange()

const bool TrcMemAccessorBase::overLapRange ( const TrcMemAccessorBase p_test_acc) const
inlinevirtual

test is supplied range accessor overlaps this range.

Parameters
*p_test_acc: Accessor to test for overlap.
Returns
bool : true if overlap, false if not.

Reimplemented in TrcMemAccessorFile.

Definition at line 205 of file trc_mem_acc_base.h.

Here is the call graph for this function:

◆ readBytes()

virtual const uint32_t TrcMemAccessorBase::readBytes ( const ocsd_vaddr_t  s_address,
const ocsd_mem_space_acc_t  memSpace,
const uint8_t  trcID,
const uint32_t  reqBytes,
uint8_t *  byteBuffer 
)
pure virtual

Read bytes from via the accessor from the memory range.

Parameters
s_address: Start address of the read.
memSpace: memory space for this access.
trcID: Trace ID of trace source.
reqBytes: Number of bytes required.
*byteBuffer: Buffer to copy the bytes into.
Returns
uint32_t : Number of bytes read, 0 if s_address out of range, or mem space not accessible.

Implemented in FileRegionMemAccessor, TrcMemAccessorFile, TrcMemAccCB, and TrcMemAccBufPtr.

◆ setMemSpace()

void TrcMemAccessorBase::setMemSpace ( ocsd_mem_space_acc_t  memSpace)
inline

Definition at line 145 of file trc_mem_acc_base.h.

◆ setRange()

void TrcMemAccessorBase::setRange ( ocsd_vaddr_t  startAddr,
ocsd_vaddr_t  endAddr 
)
inline

Set the inclusive address range of this accessor.

Parameters
startAddr: start address of the range.
endAddr: end address of the range.

Definition at line 175 of file trc_mem_acc_base.h.

◆ validateRange()

const bool TrcMemAccessorBase::validateRange ( )
inlinevirtual

Validate the address range - ensure addresses aligned, different, st < en etc.

Returns
bool : true if valid range.

Reimplemented in TrcMemAccessorFile.

Definition at line 214 of file trc_mem_acc_base.h.

Member Data Documentation

◆ m_endAddress

ocsd_vaddr_t TrcMemAccessorBase::m_endAddress
protected

accessible range end address

Definition at line 154 of file trc_mem_acc_base.h.

◆ m_mem_space

ocsd_mem_space_acc_t TrcMemAccessorBase::m_mem_space
protected

Definition at line 156 of file trc_mem_acc_base.h.

◆ m_startAddress

ocsd_vaddr_t TrcMemAccessorBase::m_startAddress
protected

accessible range start address

Definition at line 153 of file trc_mem_acc_base.h.

◆ m_type

const MemAccTypes TrcMemAccessorBase::m_type
protected

memory accessor type

Definition at line 155 of file trc_mem_acc_base.h.


The documentation for this class was generated from the following file: