Loading...
Searching...
No Matches
ITargetMemAccess Class Referenceabstract
OpenCSD Library : Interfaces

Interface to target memory access. More...

`#include <trc_tgt_mem_access_i.h>`

Inheritance diagram for ITargetMemAccess:
[legend]

## Public Member Functions

| ITargetMemAccess ()
virtual | ~ITargetMemAccess ()
virtual ocsd_err_t | ReadTargetMemory (const ocsd_vaddr_t address, const uint8_t cs_trace_id, const ocsd_mem_space_acc_t mem_space, uint32_t *num_bytes, uint8_t *p_buffer)=0
virtual void | InvalidateMemAccCache (const uint8_t cs_trace_id)=0

## Detailed Description

Interface to target memory access.

Read Target memory call is used by the decoder to access the memory location in the target memory space for the next instruction(s) to be traced.

Memory data returned is to be little-endian.

The implementator of this interface could either use file(s) containing dumps of memory locations from the target, be an elf file reader extracting code, or a live target connection, depending on the tool execution context.

Definition at line 56 of file trc_tgt_mem_access_i.h.

## Constructor & Destructor Documentation

## ITargetMemAccess()

ITargetMemAccess::ITargetMemAccess | ( |  | ) |

inline

Definition at line 59 of file trc_tgt_mem_access_i.h.

## ~ITargetMemAccess()

virtual ITargetMemAccess::~ITargetMemAccess | ( |  | ) |

inline virtual

default interface constructor

Definition at line 60 of file trc_tgt_mem_access_i.h.

## Member Function Documentation

## InvalidateMemAccCache()

virtual void ITargetMemAccess::InvalidateMemAccCache | ( | const uint8_t | cs_trace_id | ) |

pure virtual

Invalidate any caching that the memory accessor functions are using. Generally called when a memory context changes in the trace.

Parameters

  cs_trace_id | : protocol source trace ID.

Implemented in TrcMemAccMapper.

Here is the caller graph for this function:

## ReadTargetMemory()

virtual ocsd_err_t ITargetMemAccess::ReadTargetMemory | ( | const ocsd_vaddr_t | address,
|  | const uint8_t | cs_trace_id,
|  | const ocsd_mem_space_acc_t | mem_space,
|  | uint32_t * | num_bytes,
|  | uint8_t * | p_buffer
| ) |  |

pure virtual

default interface destructor

Read a block of target memory into supplied buffer.

Bytes read set less than bytes required, along with a success return code indicates full memory location not accessible. Function will return all accessible bytes from the address up to the point where the first inaccessible location appears.

The cs_trace_id associates a memory read with a core. Different cores may have different memory spaces, the memory access may take this into account. Access will first look in the registered memory areas associated with the ID, failing that will look into any global memory spaces.

Parameters

  address | : Address to access.
  cs_trace_id | : protocol source trace ID.
  mem_space | : Memory space to access, (secure, non-secure, optionally with EL, or any).
  num_bytes | : [in] Number of bytes required. [out] Number of bytes actually read.
  *p_buffer | : Buffer to fill with the bytes.

Returns
  ocsd_err_t : OCSD_OK on successful access (including memory not available)

Implemented in TrcMemAccMapper.

Here is the caller graph for this function:

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

- /build/libopencsd-16huoW/libopencsd-1.4.1/decoder/include/interfaces/trc_tgt_mem_access_i.h