OpenCSD - CoreSight Trace Decode Library 1.5.5
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
TrcMemAccCache Class Reference

#include <trc_mem_acc_cache.h>

Public Member Functions

 TrcMemAccCache ()
 
 ~TrcMemAccCache ()
 
ocsd_err_t enableCaching (bool bEnable)
 
ocsd_err_t setCacheSizes (const uint16_t page_size, const int nr_pages, const bool err_on_limit=false)
 
const bool enabled () const
 
const bool enabled_for_size (const uint32_t reqSize) const
 
void invalidateAll ()
 
void invalidateByTraceID (int8_t trcID)
 
void clearPage (cache_block_t *page)
 
ocsd_err_t readBytesFromCache (TrcMemAccessorBase *p_accessor, const ocsd_vaddr_t address, const ocsd_mem_space_acc_t mem_space, const uint8_t trcID, uint32_t *numBytes, uint8_t *byteBuffer)
 
void setErrorLog (ITraceErrorLog *log)
 
void logAndClearCounts ()
 

Static Public Member Functions

static void getenvMemaccCacheSizes (bool &enable, int &page_size, int &num_pages)
 

Detailed Description

class TrcMemAccCache - cache small amounts of data from accessors to speed up decode.

Reduce the need to read files / make callbacks into clients when walking memory images.

Caching is done on a per Core/Trace ID basis - all caches from that ID are invalidated when a context switch appears on the core. This means that we do not account for memory spaces in the cache pages as these only change via a context switch.

Memory space is used on cache miss if reading data from the underlying accessor (file / callback).

Definition at line 78 of file trc_mem_acc_cache.h.

Constructor & Destructor Documentation

◆ TrcMemAccCache()

TrcMemAccCache::TrcMemAccCache ( )
inline

Definition at line 139 of file trc_mem_acc_cache.h.

◆ ~TrcMemAccCache()

TrcMemAccCache::~TrcMemAccCache ( )
inline

Definition at line 147 of file trc_mem_acc_cache.h.

Member Function Documentation

◆ clearPage()

void TrcMemAccCache::clearPage ( cache_block_t page)
inline

Definition at line 190 of file trc_mem_acc_cache.h.

◆ enableCaching()

ocsd_err_t TrcMemAccCache::enableCaching ( bool  bEnable)

◆ enabled()

const bool TrcMemAccCache::enabled ( ) const
inline

Definition at line 89 of file trc_mem_acc_cache.h.

◆ enabled_for_size()

const bool TrcMemAccCache::enabled_for_size ( const uint32_t  reqSize) const
inline

Definition at line 90 of file trc_mem_acc_cache.h.

◆ getenvMemaccCacheSizes()

static void TrcMemAccCache::getenvMemaccCacheSizes ( bool &  enable,
int &  page_size,
int &  num_pages 
)
static

◆ invalidateAll()

void TrcMemAccCache::invalidateAll ( )

◆ invalidateByTraceID()

void TrcMemAccCache::invalidateByTraceID ( int8_t  trcID)

◆ logAndClearCounts()

void TrcMemAccCache::logAndClearCounts ( )

◆ readBytesFromCache()

ocsd_err_t TrcMemAccCache::readBytesFromCache ( TrcMemAccessorBase p_accessor,
const ocsd_vaddr_t  address,
const ocsd_mem_space_acc_t  mem_space,
const uint8_t  trcID,
uint32_t *  numBytes,
uint8_t *  byteBuffer 
)

read bytes from cache if possible - load new page if needed from underlying accessor, bail out if data not available

◆ setCacheSizes()

ocsd_err_t TrcMemAccCache::setCacheSizes ( const uint16_t  page_size,
const int  nr_pages,
const bool  err_on_limit = false 
)

◆ setErrorLog()

void TrcMemAccCache::setErrorLog ( ITraceErrorLog log)

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