Skip to content

Commit d148263

Browse files
Alexander MerkleChristoph Sax
authored andcommitted
Add support for Lauterbach PowerDebug devices
Adds driver for Lauterbach TRACE32 debug devices. Both interactive debugging and automation are supported. `examples/lauterbach` demonstrates the workflow for some local and remote use cases.
1 parent 0ba0f75 commit d148263

23 files changed

+1400
-1
lines changed

doc/configuration.rst

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,49 @@ NetworkUSBDebugger
959959
A :any:`NetworkUSBDebugger` describes a `USBDebugger`_ resource available on a
960960
remote computer.
961961

962+
USBLauterbachDebugger
963+
~~~~~~~~~~~~~~~~~~~~~
964+
An USBLauterbachDebugger resource describes a Lauterbach
965+
PowerDebug/PowerTrace/MicroTrace device connected via USB.
966+
967+
.. code-block:: yaml
968+
969+
USBLauterbachDebugger:
970+
match:
971+
ID_PATH: pci-0000:00:10.0-usb-0:1.4
972+
973+
.. code-block:: yaml
974+
975+
USBLauterbachDebugger:
976+
match:
977+
ID_SERIAL_SHORT: C230901234567
978+
979+
Arguments:
980+
- match (dict): key and value pairs for a udev match, see `udev Matching`_
981+
982+
Used by:
983+
- `LauterbachDriver`_
984+
985+
NetworkLauterbachDebugger
986+
~~~~~~~~~~~~~~~~~~~~~~~~~
987+
A NetworkLauterbachDebugger resource describes a Lauterbach
988+
PowerDebug device connected via Ethernet.
989+
990+
.. code-block:: yaml
991+
992+
NetworkLauterbachDebugger:
993+
node: E230901234567
994+
995+
Arguments:
996+
- node (str): Lauterbach NODENAME e.g. IP/NODENAME (factory default: serial number)
997+
- protocol (str, default="UDP"): Protocol to use, must be one of:
998+
999+
- TCP: select TCP-based protocol - enables LG_PROXY support, requires recent device
1000+
- UDP: select UDP-based protocol - works with legacy devices
1001+
1002+
Used by:
1003+
- `LauterbachDriver`_
1004+
9621005
SNMPEthernetPort
9631006
~~~~~~~~~~~~~~~~
9641007
A :any:`SNMPEthernetPort` resource describes a port on an Ethernet switch,
@@ -2089,6 +2132,82 @@ Arguments:
20892132
- board_config (str): optional, board config in the ``openocd/scripts/board/`` directory
20902133
- load_commands (list of str): optional, load commands to use instead of ``init``, ``bootstrap {filename}``, ``shutdown``
20912134

2135+
LauterbachDriver
2136+
~~~~~~~~~~~~~~~~
2137+
Allows to use a Lauterbach TRACE32 USB or Ethernet debugger.
2138+
Both creation of interactive debug sessions and
2139+
automation via Remote API are supported.
2140+
2141+
If connected via USB these Lauterbach debug devices are supported:
2142+
2143+
- PowerDebug X51
2144+
- PowerDebug X50
2145+
- PowerDebug E40
2146+
- PowerDebug PRO
2147+
- MicroTrace
2148+
- PowerDebug USB1.0/USB2.0/Ethernet/II
2149+
- PowerTrace
2150+
2151+
When the USB debug device is connected to a remote exporter,
2152+
the driver makes use of the *t32tcpusb* utility
2153+
to forward the communication traffic via TCP.
2154+
*t32tcpusb* is part of the TRACE32 installation.
2155+
2156+
If connected via Ethernet these Lauterbach debug devices are supported:
2157+
2158+
- PowerDebug X51
2159+
- PowerDebug X50
2160+
- PowerDebug E40
2161+
- PowerDebug PRO
2162+
- PowerDebug Ethernet/II
2163+
- PowerTrace
2164+
2165+
With the exception of PowerDebug X50 and X51, Ethernet debug modules do not support
2166+
TCP-connections and thus not *LG_PROXY* mode.
2167+
2168+
If *t32_sys* is not provided, the driver will use
2169+
2170+
- the environment variable ``T32SYS``,
2171+
- the directory ``~/t32``, and
2172+
- the directory ``/opt/t32``
2173+
2174+
as fallback locations to detect the TRACE32 installation.
2175+
Paths are evaluated in this order.
2176+
*t32_sys* can also be used to select a path from the environment configuration.
2177+
2178+
If the :py:meth:`~.LauterbachDriver.load` method of the BootstrapProtocol is called,
2179+
arguments of the start-up script are prefixed by ``LABGRID_COMMAND=BOOTSTRAP``.
2180+
If any of the :py:meth:`~.LauterbachDriver.start`, :py:meth:`~.LauterbachDriver.control` or :py:meth:`~.LauterbachDriver.execute` methods is called,
2181+
arguments of the start-up script are prefixed by ``LABGRID_COMMAND=DEBUGGER``.
2182+
2183+
Binds to:
2184+
interface:
2185+
- `NetworkLauterbachDebugger`_
2186+
- `USBLauterbachDebugger`_
2187+
2188+
Implements:
2189+
- :any:`BootstrapProtocol`
2190+
2191+
.. code-block:: yaml
2192+
:name: lauterbach-env.yaml
2193+
2194+
targets:
2195+
main:
2196+
resources:
2197+
USBLauterbachDebugger
2198+
drivers:
2199+
LauterbachDriver:
2200+
enable_rcl: true
2201+
2202+
Arguments:
2203+
- t32_sys (str): optional, base folder of the TRACE32 installation
2204+
- t32_bin (str, default="t32marm"): name of the TRACE32 architecture executable `t32m*`
2205+
- script (str): optional, path to the `.cmm` script to run on startup of TRACE32
2206+
- script_args_bootstrap (str, list): parameters passed to `.cmm` script with labgrid command `bootstrap`
2207+
- script_args_debug (str, list): parameters passed to `.cmm` script with command `debugger` and method `control()`
2208+
- enable_rcl (bool): optional, enables the Remote API interface for automation
2209+
tasks
2210+
20922211
QuartusHPSDriver
20932212
~~~~~~~~~~~~~~~~
20942213
A :any:`QuartusHPSDriver` controls the "Quartus Prime Programmer and Tools" to

0 commit comments

Comments
 (0)