主要内容

Hardware Profiler

R2026b

Profiles function-call subsystem using GPIO, ERAD, or Timer measurement modes

Since R2024b

  • Hardware Profiler Block

Libraries:
C2000 Microcontroller Blockset / Scheduling

Description

The Hardware Profiler block enables you to profile a function-call subsystem on target hardware using General Purpose Input Output (GPIO), Embedded Real-time Analysis & Diagnostic (ERAD), and Timer measurement modes.

  • ERAD: Measure and analyze the execution times of start-to-end downstream function-call subsystems.

  • GPIO: Set and clear GPIO pins before and after the execution of downstream function-call subsystems.

  • Timer: Measure execution time of events by calculating the duration between pre-execution and post-execution timer counts.

Use these techniques to profile and optimize the performance of your code running on TI C2000 processors.

The Hardware Profiler block with Timer and ERAD mode provides output in clock cycles. To convert the output into seconds, use the following formula:

Time in seconds equals clock cycles divided by CPU frequency

In ERAD measurement mode, the block reports the current cycle count of execution time.

Examples

Ports

Output

expand all

Connect a function call subsystem to this port. When the subsystem executes, it is profiled using the selected measurement technique.

The port outputs the current cycle count of the execution time.

Dependencies

To enable this port, set the Measurement mode parameter to either Embedded Real-time Analysis & Diagnostic (ERAD) or Timer.

Data Types: uint32

Parameters

expand all

Select the measurement technique to profile a function-call subsystem on the target hardware.

  • ERAD: Measure and analyze the execution times of start-to-end downstream function-call subsystems.

  • GPIO: Use GPIO pins to set and clear signals before and after executing downstream function-call subsystems.

  • Timer Measurement: Use timers to measure execution time by calculating the duration between pre-execution and post-execution timer counts. When you select Timer Measurement, Timer 2 is used for timer-based profiling.

Specify the ERAD module. The ERAD module consists of an ERAD counter and two ERAD breakpoints. When you select the ERAD module, the block puts breakpoints at the function beginning and end and measures clock cycles for execution between the two breakpoints.

  • Module 1 - ERAD counter 1 and ERAD breakpoint 1 and 2.

  • Module 2 - ERAD counter 2 and ERAD breakpoint 3 and 4.

  • Module 3 - ERAD counter 3 and ERAD breakpoint 5 and 6.

  • Module 4 - ERAD counter 4 and ERAD breakpoint 7 and 8.

The ERAD module is available only on specific TI C2000 processors that support ERAD.

Dependencies

To enable this parameter, set the Measurement mode parameter to Embedded Real-time Analysis & Diagnostic (ERAD).

Specify the GPIO number for the block.

Dependencies

To enable this parameter, set the Measurement mode parameter to General Purpose Input Output (GPIO).

Sample time at which the Hardware Profiler block triggers the downstream function-call subsystem.

Use this parameter to specify the time interval between two function-call triggers. The count data is also updated at the specified sample time. To inherit sample time, set this parameter to -1.

Version History

Introduced in R2024b