]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - tidl/tidl-api.git/blob - docs/source/viewer.rst
Bump develop branch version to 1.4.0
[tidl/tidl-api.git] / docs / source / viewer.rst
1 *******
2 Viewers
3 *******
5 Network graph viewer
6 ++++++++++++++++++++
8 The TIDL network viewer utility, ``tidl_viewer``, can be used to view the network graph. If the ``dot`` utility is available, ``tidl_viewer`` uses it to convert the dot file to svg. ``dot`` is included in the ``Graphviz`` Ubuntu package and typically installed to ``/usr/bin/dot``.
10 For example, the following command will generate a dot graph description for the ``tidl_net_jdetNet_ssd.bin`` network binary in ``ssd.dot``.
12 .. code-block:: bash
14     $ tidl_viewer examples/test/testvecs/config/tidl_models/tidl_net_jdetNet_ssd.bin -d ssd.dot
16 On x86/Linux, if ``/usr/bin/dot`` is available, ``tidl_viewer`` also generates an svg file, ``ssd.dot.svg``.
18 .. figure:: images/ssd.dot.svg
19     :align: center
20     :scale: 30
21     :width: 30%
22     :alt: SVG generated by dot
24     svg file generated by tidl_viewer (click to enlarge)
26 .. note::
27     If ``dot`` is not installed in ``/usr/bin/dot``, ``tidl_viewer`` will not convert the dot to svg. The following command can be used to generate the svg file as a separate step: ``dot -Tsvg ssd.dot -o ssd.dot.svg``. Additional information on ``Graphviz`` and ``dot`` available at:
29     * `Graphviz <https://www.graphviz.org/>`_
30     * `Ubuntu Graphviz package <https://packages.ubuntu.com/search?keywords=graphviz>`_
34 .. _execution-graph:
36 Execution Graph viewer
37 ++++++++++++++++++++++
39 TIDL API v1.2 enables generation of a log file with timestamps for the following methods in the :term:`ExecutionObjectPipeline` and :term:`ExecutionObject` classes:
41 * ProcessFrameStartAsync (start)
42 * ProcessFrameStartAsync (end)
43 * ProcessFrameWait (start)
44 * ProcessFrameWait (end)
46 Add the following call to the TIDL API application to enable timestamp generation:
48     .. code:: c++
50         bool EnableTimeStamps(const std::string& file, size_t num_frames);
52 The generated log file can be viewed on x86/Linux by using the ``execution_graph.py`` script located at ``viewer/execution_graph.py``.
54     .. code:: bash
56         -> <install path>/viewer/execution_graph.py timestamp.log
58 :numref:`Execution Graph Output` shows the output of ``execution_graph.py`` for the ``one_eo_per_frame`` example when run on an AM5749 with 2 EVEs and 2 C66x DSPs:
60 .. _`Execution Graph Output`:
62 .. figure:: images/execution_graph_1eo.png
63     :align: center
64     :width: 80%
65     :alt: Output from execution_graph.py
67     Graph of frame index vs. execution time generated by execution_graph.py (click to enlarge)
70 .. note::
71     ``execution_graph.py`` requires the Python `Matplotlib <https://matplotlib.org/users/installing.html>`_ module.