TIOVX User Guide
Debug Tools for TIOVX

How to enable debug print statements

The TIOVX framework contains informative debug logging that can be enabled and disabled. The logging print statements are enabled based on which level of logging that has been set. The logging levels can be found as a part of the enum tivx_debug_zone_e. By default, the VX_ZONE_WARNING and VX_ZONE_ERROR logging are enabled on each core. Logging levels can be enabled and disabled for each core by calling the tivx_set_debug_zone and tivx_clr_debug_zone respectively. Note, these have to be called for the individual cores, not system-wide.

In order to add additional documentation to custom code written on a given core, reference the VX_PRINT API.

How to use the graph JPEG generation tool

The tivxExportGraphToDot API provides the ability to generate a JPEG diagramming the nodes in a graph. Below are a few notes on how to use this tool.

  • In PC emulation mode, this API will generate both a .txt file and a .jpg file located at the specified output path. The graph diagram will not show the cores that each node runs on, it will simply show the interactions between nodes in the graph.
  • In target mode, this API will generate only a .txt file located at the specified output path. However, the .jpg file can be generated on a Linux machine using the dot command. The command to generate the JPEG can be seen below:

    dot -Tjpg -o<output file path>/<jpg name>="">.jpg <text file="" name>="">

    In the case of a text file called graph.txt, the following command would be used to generate a JPEG called graph.jpg in the current directory:

    dot -Tjpg -o./graph.jpg graph.txt

  • In the case of a pipelined graph, this API outputs 4 separate files:
    • 1. The first file shows the interaction between all nodes and data objects in a graph.
    • 2. In the case of a pipelined graph, the second file shows the interactions between the nodes and data reference queues for every pipeline ID for the pipeline depth of a graph.
    • 3. In the case of a pipelined graph, the third file shows how each of the data reference queues are acquired and released by the framework. (Note: this file requires a more in-depth knowledge of the framework and is mainly intended for debugging issues within the framework.)
    • 4. In the case of a pipelined graph, the fourth file shows the interactions between the nodes and data reference queues for the first pipeline ID of a graph.

How to enable run-time node start/stop event logging

The tivxLogRtTraceEnable, tivxLogRtTraceExportToFile, tivxLogRtTraceDisable APIs provides the ability to log node start, node stop and other useful events to a shared memory. These events can then be written to a file and visualized to gain important insight into a graph execution. While events are being logged, the intrusion into node execution is minimal, hence logging these events does not change performance of the graph being monitored.

To enable run-time event logging in your program do below,

  • After graph verify but before graph execution, call tivxLogRtTraceEnable (graph) to enable event logging for that graph.
  • Execute the graph as usual
  • After graph executions have stopped, or periodically, call tivxLogRtTraceExportToFile (filename) to save event data to a file.
  • After graph executions have stopped and before vxReleaseGraph, call tivxLogRtTraceDisable (graph) to disable run-time logging for that graph

To visualize the graph data do below,

  • [ONE TIME ONLY] Install 'gtkwave' on your linux PC
    sudo apt install gtkwave
  • [ONE TIME ONLY] Build the tools for format converiosn by doing below
    cd tiovx/tools/tivx_log_rt
    make
  • Copy the event log .bin file, saved on EVM via tivxLogRtTraceExportToFile (filename), to a folder in your Linux PC.
  • Generate .vcd file (Value Change Dump) file to visualize the events in gtkwave as below
    tiovx/tools/tivx_log_rt/tivx_log_rt_2_vcd.out -i event_log.bin -o event_log.vcd
  • Generate .html file to visualize per node frame level statistics as below
    tiovx/tools/tivx_log_rt/tivx_log_rt_2_html.out -i event_log.bin -o event_log.html
  • Open the .vcd file in gtkwave
    gtkwave event_log.vcd
  • In gtkwave, drag and drop the 'signals' of interest from bottom left frame to center frame and visualize the 'signals' in the right frame.
  • Open the .html file in web browser to visualize per node frame level statistics.
    Note
    The html files uses dygraphs.js from http://dygraphs.com/ so make sure your internet connectivity works fine

Sample outputs from app_tidl_avp2 demo

VCD View

  1. There are two types of 'signals' in this view, openVX nodes and CPUs / HW accelerators. The nodes are typically represented as bus [3:0], appended by *Node and the CPU / HW accelerators are represented as single bit values (either HIGH or LOW).
  2. Nodes are ScalarNode[3:0], ODPreProcNode[3:0], ODTODLNode[3:0] etc. and CPU / HW accelerators are DISPLAY1, DSP-1, DSP-2, DSP_C7-1 etc.
  3. The value of the node 0, 1, 2, 3 .. depicts which frame is bring processed. This is a relative number just to get a better understanding that when a particular node is processing frame 3, which frame number is being processed by the other nodes.
vcd_view.png

HTML View

  1. The HTML view gives more of a statistical data.
html_view.png