module ti.uia.family.c64p.GemTraceSync

C64X+ specific code for injecting sync point info into the GEM Trace stream

The OVERLAY register (a.k.a. TSDR register) is an undocumented register availble on C64X+ Full GEM targets. Writes into this register are injected into the trace stream. The data that is written is used by the host to determine what target-side context was active at the time the trace data was recorded. [ more ... ]
C synopsis target-domain sourced in ti/uia/family/c64p/GemTraceSync.xdc
DETAILS
The OVERLAY register (a.k.a. TSDR register) is an undocumented register availble on C64X+ Full GEM targets. Writes into this register are injected into the trace stream. The data that is written is used by the host to determine what target-side context was active at the time the trace data was recorded.
The register only has 30 writable bits, so in order to inject a 32b value into the trace stream (e.g. the thread handle of the currently executing thread), the 32b address needs to be split into two pieces and written into the OVERLAY register in two successive write operations. To make it possible to use the OVERLAY register to inject different types of context info into the trace stream, the following bit assignments need to be used when writing data into the OVERLAY register:
OVERLAY register bit assignments: 2 LSBs fixed (011b) 6 MSBs used to determine what type of data the OVERLAY register contains
b31-b26 : a 6 bit ?type ID? that describes what context info the sync point contains 000000b : reserved 000001b : b25-b2 of OVERLAY register contains the 24 LSBs of the sequence number of the Sync Point event that contains correlation info. Only 1 OVERLAY register write is required for this info. 000010b : b25-b2 of OVERLAY register contains the 24 LSBs of the sequence number of the Context Change event that contains context change info. Only 1 OVERLAY register write is required for this info. . . . : reserved 000011b : b25-b2 of OVERLAY register contains the 24 LSBs of the snapshot ID of the snapshot event that contains snapshot info. Only 1 OVERLAY register write is required for this info. 10XXXXb : contains first word of a 2 word OVERLAY register sequence. b25-b2 : the 24 MSBs of 32b context data.
11XXXXb: contains second word of a 2 word OVERLAY register sequence. b29-b10 contain the 20LSBs of the sequence number of an event that contains context info. b9-b2 contain 8 LSBs of 32b context data.
If the 2 word OVERLAY register protocol is being used and there is a sync loss, then only the OVERLAY register data with b31-b30 = 11b will be available since it was the last data written into the register. Since this contains a sequence number, it may be possible for the host to recover the lost sync data by finding the context change event that has the same sequence number.
 
enum GemTraceSync_ContextType

Enumeration of the various types of packet headers. Stored in a 4 bit bitfield (b31-b28) of the first word in the packet

C synopsis target-domain
typedef enum GemTraceSync_ContextType {
    GemTraceSync_ContextType_Reserved0,
    // reserved for future use
    GemTraceSync_ContextType_SyncPoint,
    // Sync Point event serial number
    GemTraceSync_ContextType_ContextChange,
    // Context Change event serial number
    GemTraceSync_ContextType_Snapshot,
    // Snapshot event Snapshot ID
    GemTraceSync_ContextType_Reserved4,
    // reserved for future use
    GemTraceSync_ContextType_Reserved5,
    // reserved for future use
    GemTraceSync_ContextType_Reserved6,
    // reserved for future use
    GemTraceSync_ContextType_Reserved7,
    // reserved for future use
    GemTraceSync_ContextType_Reserved8,
    // reserved for future use
    GemTraceSync_ContextType_Reserved9,
    // reserved for future use
    GemTraceSync_ContextType_Reserved10,
    // reserved for future use
    GemTraceSync_ContextType_Reserved11,
    // reserved for future use
    GemTraceSync_ContextType_Reserved12,
    // reserved for future use
    GemTraceSync_ContextType_Reserved13,
    // reserved for future use
    GemTraceSync_ContextType_Global32bTimestamp,
    // 32b Global Timestamp
    GemTraceSync_ContextType_User
    // User defined data
} GemTraceSync_ContextType;
 
 
GemTraceSync_injectIntoTrace()  // module-wide

Inject syncPoint info into GEM Trace

C synopsis target-domain
Void GemTraceSync_injectIntoTrace(UInt32 serialNum, IUIATraceSyncProvider_ContextType ctxType);
 
ARGUMENTS
serialNum — the serial number that is to be injected
ctxType — the context type ID to be injected into the trace
the CtxChg_ContextType constant that describes what context info the 2 words contain
serialNumber — a sync point serial number to inject into the trace stream
DETAILS
This method logs a sync point event and injects correlation info into the trace stream (if available) to enable correlation between software events and hardware trace.
This method logs a sync point event and injects correlation info into the trace stream (if available) to enable correlation between software events and hardware trace.
Module-Wide Built-Ins

C synopsis target-domain
Types_ModuleId GemTraceSync_Module_id();
// Get this module's unique id
 
Bool GemTraceSync_Module_startupDone();
// Test if this module has completed startup
 
IHeap_Handle GemTraceSync_Module_heap();
// The heap from which this module allocates memory
 
Bool GemTraceSync_Module_hasMask();
// Test whether this module has a diagnostics mask
 
Bits16 GemTraceSync_Module_getMask();
// Returns the diagnostics mask for this module
 
Void GemTraceSync_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
 
Configuration settings sourced in ti/uia/family/c64p/GemTraceSync.xdc
var GemTraceSync = xdc.useModule('ti.uia.family.c64p.GemTraceSync');
module-wide constants & types
module-wide config parameters
 
 
enum GemTraceSync.ContextType

Enumeration of the various types of packet headers. Stored in a 4 bit bitfield (b31-b28) of the first word in the packet

Configuration settings
values of type GemTraceSync.ContextType
    const GemTraceSync.ContextType_Reserved0;
    // reserved for future use
    const GemTraceSync.ContextType_SyncPoint;
    // Sync Point event serial number
    const GemTraceSync.ContextType_ContextChange;
    // Context Change event serial number
    const GemTraceSync.ContextType_Snapshot;
    // Snapshot event Snapshot ID
    const GemTraceSync.ContextType_Reserved4;
    // reserved for future use
    const GemTraceSync.ContextType_Reserved5;
    // reserved for future use
    const GemTraceSync.ContextType_Reserved6;
    // reserved for future use
    const GemTraceSync.ContextType_Reserved7;
    // reserved for future use
    const GemTraceSync.ContextType_Reserved8;
    // reserved for future use
    const GemTraceSync.ContextType_Reserved9;
    // reserved for future use
    const GemTraceSync.ContextType_Reserved10;
    // reserved for future use
    const GemTraceSync.ContextType_Reserved11;
    // reserved for future use
    const GemTraceSync.ContextType_Reserved12;
    // reserved for future use
    const GemTraceSync.ContextType_Reserved13;
    // reserved for future use
    const GemTraceSync.ContextType_Global32bTimestamp;
    // 32b Global Timestamp
    const GemTraceSync.ContextType_User;
    // User defined data
 
C SYNOPSIS
 
metaonly config GemTraceSync.common$  // module-wide

Common module configuration parameters

Configuration settings
GemTraceSync.common$ = Types.Common$ undefined;
 
DETAILS
All modules have this configuration parameter. Its name contains the '$' character to ensure it does not conflict with configuration parameters declared by the module. This allows new configuration parameters to be added in the future without any chance of breaking existing modules.
generated on Tue, 14 Feb 2017 00:15:10 GMT