System Trace Embedded Development Tools What is Trace
System Trace Embedded Development Tools
What is Trace? • Advanced debugging capability that allows capturing code execution and system events in real-time • Extension to the basic JTAG debug capabilities of the TI processors • Useful to detect complex, intermittent bugs and profile and fine tune code performance • Two types of trace: – Processor trace: Inspects the code execution • Performs real-time gathering of instructions being executed in a processor – System trace (STM): Oversees system behaviour • Set of built-in capabilities on the device that monitors synchronization and timing between cores and on-chip peripherals CCS APPS
Why Do I Need Trace? • Useful to detect complex, intermittent bugs and profile and fine tune code performance • If you are stuck with an intermittent or complex problem in the code, Processor Trace is usually your last line of defense to see the execution history • If you happen to have runtime problems but can’t identify what is causing the missed real-time deadlines, both Processor and System Trace help evidence it • If the system does not meet the expected or calculated power requirements, System Trace helps CCS APPS
What is System Trace? • Capture several system events that happen inside the device • Attach timestamps to each event • Send data back to Code Composer Studio for post processing analysis using the advanced visualization tools – External memory (EMIF) throughput – Power domain status • The buffer can be either inside the device (ETB) or outside the device via dedicated pins (Pin Trace) to an external Trace pod (XDS 560 v 2 STM) – ETB: Smaller data set (Buffer size: 2 – 8 KB) – XDS 560 v 2 STM: Larger data set (Buffer size: 128 MB) CCS APPS
What Is System Trace? • Trace capability that monitors synchronization and timing between cores and on-chip peripherals – Ability to track bus and peripheral activity and monitor data throughput • Trace data combined synchronously with output from the other cores in the system to give you a picture of the order of events on separate CPUs • Provides system level visibility to software thread execution and hardware performance CCS APPS
What Can I Do With It? • Hardware-accelerated "printf" ability – STM Library (STMLib) provides printf, message logging and data dump APIs for use to instrument your application • Configure Common Platform Tracer (CP_Tracer or CPT) on supported devices to monitor activity on the associated bus and export data via STM – CPT data is exported as STM messages that can be collected with the ETB or XDS 560 v 2 STM – CPT can be programmed through CPTLib or with CCS/AET (via Breakpoints view) • Debug multi-core environments – STM messages from each core are identified and globally time stamped by hardware • Provides a global, time-correlated view of software execution across cores – See both software thread execution and hardware performance correlated in time – See the synchronization and timing between cores and on-chip peripherals in their application as well as the performance of cores and key device interfaces CCS APPS 7
Types of System Trace Device Any XDS emulator USB or Ethernet Peripherals EMIF CP Tracer 14, 20 or 60 -pin JTAG Connector Memory XDS 560 v 2 STM Trace CP Tracer Processor Subsystem Core USB or Ethernet CP Tracer ETB STM Buffer STM module CCS APPS Datapaths: - ETB Trace - STM Pin Trace 20 or 60 -pin JTAG Connector
Types of System Trace – ETB Trace Device Any XDS emulator PC with CCS Peripherals, EMIF CP Tracer Statistics collection USB or Ethernet 14, 20 or 60 -pin JTAG Connector Processor Subsystem 1 CP Tracer System Message units Core STM module Processor Subsystem 2 Key features: CP Tracer System Message units Core ETB Buffer size is limited (typically 2 k to 8 k) It only features circular mode No modifications to the hardware needed Any XDS emulator can be used CCS APPS - BUS watchpoint and traffic monitors
Types of System Trace – Pin Trace Device XDS 560 v 2 STM Trace Peripherals, EMIF PC with CCS CP Tracer Statistics collection USB or Ethernet STM Buffer 20 or 60 -pin JTAG Connector Key features: CP Tracer System Message units Core STM module Processor Subsystem 2 BUS watchpoint and traffic monitors CP Tracer System Message units Core Buffer size is virtually unlimited (up to 64 MB) It features circular and one-shot modes Modifications to the hardware needed, but minimal Both XDS 560 v 2 STM and XDS 560 v 2 PRO Trace emulators can be used CCS APPS - Processor Subsystem 1
STM SW Messages Overview Sort by core, type of message (driver, OS, thread), etc. 13 CCS APPS See sequence of operation across cores.
Processor Trace vs. System Trace • Processor (Core) – Requirements: • XDS 560 v 2 Pro Trace w/60 -pin header • ETB – Single CPU visibility – Features: • Capture activity on Program and Data bus for that CPU – Trace the complete program address execution – Trace all of the data writes to a specific location or range of locations • System (STM) – Requirements: • XDS 560 v 2 STM w/60 -pin header • ETB – System level visibility • Multi-core debug – Features: • Hardware-accelerated, multi-core "printf" ability • CPTracer monitoring • Trace data combined synchronously with the output from the other cores in the system to give you a picture of the order of events on separate CPUs CCS APPS
STM SW Messages (Core 0) Trace Display lists all the messages Logic Analyzer displays a timeline for each function CCS APPS
CP Tracer STM Data – Core. Pac 0 access to Core. Pac 1 L 2 Data Red - MB/s of Core. Pac 0 accesses to Core. Pac 1 L 2 memory Purple - Total Transactions for all masters accessing Core. Pac 1 L 2 Green - Average Access width in bytes Turquoise - % of Core. Pac 1 L 2 bandwidth used by Core. Pac 0 Pink - Overall Average latency CCS APPS
- Slides: 13