osd_cl_ctm class

API to access the functionality of the Core Trace Module (CTM).

Usage

#include <osd/osd.h>
#include <osd/cl_ctm.h>

Public Interface

Typedefs

typedef void(* osd_cl_ctm_handler_fn)(void *, const struct osd_ctm_desc *, const struct osd_ctm_event *)

Functions

osd_result osd_cl_ctm_get_desc(struct osd_hostmod_ctx * hostmod_ctx, unsigned int ctm_di_addr, struct osd_ctm_desc * ctm_desc)

Populate the CTM descriptor with data from the debug module

Return
OSD_OK on success OSD_ERROR_WRONG_MODULE if the module at ctm_di_addr is not a CTM any other value indicates an error
Parameters
  • hostmod_ctx: the host module handling the communication
  • ctm_di_addr: DI address of the CTM module to get describe
  • [out] ctm_desc: pre-allocated memory descriptor for the result

osd_result osd_cl_ctm_handle_event(void * arg, struct osd_packet * pkg)

Event handler to process CTM event, to be passed to a hostmod instance

struct osd_ctm_desc
#include <cl_ctm.h>

Information a Core Trace Module

Public Members

unsigned int di_addr

DI address of the memory.

uint16_t addr_width_bit

Width of an address in bit.

uint16_t data_width_bit

Width of a data word in bit.

struct osd_ctm_event
#include <cl_ctm.h>

A single event emitted by the CTM module

In case of an overflow in the system an overflow even is generated, containing the number of missed events. If the overflow value is set to a non-zero value, all other fields except for the timestamp are invalid.

Public Members

uint16_t overflow

number of overflowed packets

uint32_t timestamp

timestamp

uint64_t npc

npc

uint64_t pc

pc

uint8_t mode

privilege mode

bool is_ret

executed instruction is a function return

bool is_call

executed instruction is a function call

bool is_modechange

executed instruction changed the privilege mode

struct osd_ctm_event_handler

Public Members

const struct osd_ctm_desc* ctm_desc
osd_cl_ctm_handler_fn cb_fn
void* cb_arg