21.3 EXECTRACE Instrumentation System

<< Click to Display Table of Contents >>

Navigation:  ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 21 – Debugging, Tracing, and Determinism >

21.3 EXECTRACE Instrumentation System

21.3.1 Architecture

 

Instrumentation is controlled by the AXP_INSTRUMENTATION_TRACE compile-time flag. When enabled, EXECTRACE macros (coreLib/ExecTrace.h) emit structured trace records at architecturally significant events throughout the emulator. All trace hooks are strictly observational — they observe committed state, do not inject ordering, do not alter timing, and do not allocate memory in hot paths.

 


 

21.3.2 Trace Points

 

Macro

Trigger

EXECTRACE_WB_RETIRE

Instruction retirement in WB stage — records PC, instruction, grain identity, result values, retirement cycle

EXECTRACE_PAL_ENTRY

PAL mode entry — records PalEntryReasonTrace (CALL_PAL, FAULT, INTERRUPT, TRAP, MACHINE_CHECK), entry vector, faulting PC

EXECTRACE_PAL_EXIT

PAL mode exit via HW_REI — records return PC, restored state

EXECTRACE_INTERRUPT

Interrupt delivery — records interrupt source, IPL, vector, delivery cycle

EXECTRACE_PIPELINE_FLUSH

Pipeline flush — records caller name, current PC, flush reason

Register write traces

Record WriteEntry (register type, index, value) for each architectural register modification

 

The ExecTrace system records structured data types: PalEntryReasonTrace (CALL_PAL, FAULT, INTERRUPT, TRAP, MACHINE_CHECK), WriteEntry (register type/index/value), and timestamped event records keyed by cycle count and CPU ID.

 


 

21.3.3 Compile-Time Control

 

When AXP_INSTRUMENTATION_TRACE is not defined, all EXECTRACE macros compile to nothing — zero runtime cost. This allows three build configurations: fully instrumented builds (maximum observability), near-production builds (selected trace points only), and release builds (all tracing removed from hot paths). Determinism and tracing can be toggled independently.

 

See Also: coreLib/ExecTrace.h (PalEntryReasonTrace, WriteEntry, EXECTRACE macros).