NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

Real-Time Hardware Trace and Analysis

From Texas Instruments Wiki
Jump to: navigation, search

Under construction.jpg

Overview[edit]

Most software engineers spend a significant amount of time debugging and optimizing their applications. Traditional emulators and simulation debugging tools uncover the majority of application bugs; but the really hard-to-find intermittent issues sometimes evade developers. In real time systems, traditional stop mode debugging techniques change the state of the system, making these bugs virtually invisible. Performance measurements in a real-time environment are difficult, and often do not provide the granularity needed to properly identify application performance issues.

Trace Analyzer is provided by Code Composer Studio (CCS) to enable non-intrusive debug and analysis of system activity. The target device sends data about the target’s actions over a dedicated port. This allows you to examine the history of the processor’s actions without affecting the real-time behavior of the target application. No application code changes are required to support hardware trace.

TA sc 1.jpg

Trace Analyzer can help detect hard-to-find problems (without stopping the processor) such as:

  • Race conditions between events
  • Pipeline stalls
  • Crashes from stack overflows
  • Runaway code
  • False interrupts without stopping the processor

It can also be used for analyzing and optimizing application:

  • Function Profiling
  • Function Execution Graph
  • Cache and Stall Analysis
  • Memory Throughput and Latency Analysis

Hardware trace has the following advantages over other types of tracing:

  • No changes to the application code are required.
  • The target does not need to be halted to gather data.
  • The real-time performance of your application is not affected by data collection.

Trace can be used for both debugging and profiling. Trace makes it possible to debug difficult problems where visibility to program execution, timing, or CPU data access history is required. Profiling can be used to identify bottlenecks in your application. Event trace can provide visibility to specific memory or system events that may be causing performance issues. Hardware trace is most powerful when you have a trace probe device connected to your target board to perform the data collection for uploading to the host computer. For example, the XDS560V2 Pro Trace emulator captures high-speed trace data exported from the pins of the taget board to which it is connected. This data is then analyzed and visualized in the Trace Analyzer tools provided as part of Code Composer Studio.

Software and Hardware Requirements[edit]

To use Trace Analyzer, you'll need Code Composer Studio (preferrably CCS5.4 or newer to access the new user interface), a trace capable target board (see Device Capabilities section below) and an Emulator to retrieve the trace data (see Emulator Capabilities section below).

Type of hardware traces[edit]

The following types of hardware tracing are supported:

  • PC Trace
    • Standard PC Trace: Traces program execution and data memory read/write. Data collected from Standard PC Trace can be used for debugging and/or for analysis such as function cycle profiling and code coverage.
    • Event trace: Traces CPU events such as caching and stalls. Data collected from Event Trace can be used for Stall and Cache profiling.
  • System trace: Use counters to monitor bus activities interconnect traffic and interfaces such as DDR throughput and latency. On certain chips, STM also provides power and clock profiling capability.

Standard and Event Trace is supported by CPU or PC Trace technology. System trace is supported by STM (System Trace Module) technology.

Analysis Capabilities[edit]

What is supported by Trace Analyzer[edit]

In CCSv5.4 and newer, Trace Analyzer has been simplified by the introduction of Analysis Configurations. These configurations takes care of setting up the trace receiver, the trace triggers and running the necessary analysis features. CCS is shipped with the following prebuilt configurations:

PREBUILT CONFIGURATIONS RECEIVER (default) TRIGGERS (default) ANALYSIS FEATURES COMMENTS
Function Profiling ETB PC Trace with Timing Exclusive Function Profiling Output the number of cycles spent in each function (exclusive only) and how many cycles are a result of stalls
Stall Profiling ETB Stall Event Stall Profiling Output the number of stall cycles in each function (exclusive only)
Cache Profiling ETB Cache Event Cache Analysis Output the number of cache events in each function (exclusive only)
Memory Throughput and Access Analysis ETB DDR Throughput Throughput and Latency Analysis Displays Throughput and Latency statistics on DDR resulting from CPU activities
Power and Clock Analysis ETB PMI activity PMI Analysis Shows power state changes
PC Trace ETB PC Trace with Timing None Show PC trace logs. Useful when debugging and no particular analysis is required
Custom PC Trace ETB None None Show whatever data is received. This is useful when triggers is set by target application. This configuration also supports usecase where ETB is drained to system memory
Custom STM ETB None None Show whatever data is received. This is useful when triggers is set by target application. This configuration also supports usecase where ETB is drained to system memory

What is supported by Device[edit]

Document and Tutorials[edit]

User Guide[edit]

CCS has built in online help which can be accessed via F1 in the appropriate views/dialogs. A PDF version of the User Guide can be found here Trace Analyzer User Guide.

Presentations and Workshops[edit]

Workshop slides using MCSDK Image Processing Demo on Nyquist (C6670) can be found here Trace Analyzer Workshop

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Real-Time Hardware Trace and Analysis here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Real-Time Hardware Trace and Analysis here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article Real-Time Hardware Trace and Analysis here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article Real-Time Hardware Trace and Analysis here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article Real-Time Hardware Trace and Analysis here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Real-Time Hardware Trace and Analysis here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Real-Time Hardware Trace and Analysis here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article Real-Time Hardware Trace and Analysis here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Real-Time Hardware Trace and Analysis here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity