pragma SDS trace


The SDSoC™ environment tracing feature provides you a detailed view of what is happening in the system during execution of an application, through the use of hardware/software event tracing. See the SDSoC Environment User Guide (UG1027) for more information.

This pragma specifies the trace insertion for the accelerator with granularity at the function level or the argument level, to let you monitor the activity on the accelerator for debug purposes. When tracing is enabled, tracing instrumentation is automatically inserted into the software code, and hardware monitors are inserted into the hardware system during implementation of the hardware logic. You can monitor either the complete accelerator function, or an individual parameter of the function.

The type of trace can be SW, HW, or both. HW trace means the "start" and "stop" of the corresponding hardware component, such as the start and stop of the hardware accelerator, or the start and stop of data transfer of the specified argument. This lets you monitor activity moving onto and off of the hardware. The SW trace lets you observe the software stub for the hardware accelerated function, to monitor the function and arguments on the software side of the transaction. You can also monitor both the hardware and software transactions.


This pragma must be specified immediately preceding a function declaration, or immediately preceding another #pragma SDS bound to the function declaration.
#pragma SDS trace(<var1>[:SW|:HW][,<var2>[:SW|:HW]])


  • <var>: Specifies either the function name, or one of the parameters of the function.
  • [:SW|:HW]: Specifies either HW tracing or SW tracing. The absence of this option indicates that both HW and SW traces are inserted.

Example 1

The following example traces the accelerator function foo:
#pragma SDS monitor trace(foo)
void foo(int a, int b);
TIP: The absence of either :HW or :SW indicates that both traces are inserted for the accelerator.

Example 2

The example demonstrates using this pragma to trace multiple arguments of the function.
#pragma SDS monitor trace(a, b:SW, c:HW)
void foo(int a, int b, int *c);

In the above example, both HW and SW traces are inserted for argument a. Only the SW trace is inserted for argument b. For argument c, only the HW trace is inserted.

See Also

  • SDSoC Environment Profiling and Optimization Guide (UG1235)
  • SDSoC Environment User Guide (UG1027)