Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: labgrid-project/labgrid
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: missinglinkelectronics/labgrid
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v24.0.0+mle
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
Loading
58 changes: 57 additions & 1 deletion contrib/completion/labgrid-client.bash
Original file line number Diff line number Diff line change
@@ -808,6 +808,60 @@ _labgrid_client_reserve()
_labgrid_client_generic_subcommand "--wait --shell --prio"
}
_labgrid_client_xlx()
{
local cur prev words cword
_init_completion || return
case "$prev" in
-n|--name)
_labgrid_complete match-names "$cur"
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $(compgen -W "--name $_labgrid_shared_options" -- "$cur") )
;;
*)
local args
_labgrid_count_args "@(-n|--name)" || return
# only complete second argument
[ "$args" -ne 2 ] && return
COMPREPLY=( $(compgen -W "xsdb program-bitstream boot" -- "$cur") )
;;
esac
}
_labgrid_client_intel()
{
local cur prev words cword
_init_completion || return
case "$prev" in
-n|--name)
_labgrid_complete match-names "$cur"
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $(compgen -W "--name $_labgrid_shared_options" -- "$cur") )
;;
*)
local args
_labgrid_count_args "@(-n|--name)" || return
# only complete second argument
[ "$args" -ne 2 ] && return
COMPREPLY=( $(compgen -W "program-bitstream" -- "$cur") )
;;
esac
}
_labgrid_client_export()
{
local cur prev words cword
@@ -928,7 +982,9 @@ _labgrid_client()
wait \
reservations \
version \
export"
export \
xlx \
intel"
COMPREPLY=( $(compgen -W "$subcommands" -- "$cur") )
return
;;
1 change: 1 addition & 0 deletions crossbar-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
crossbar==21.3.1
autobahn<=22.4.1
six==1.16.0
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ Package: labgrid
Architecture: any
Pre-Depends: dpkg (>= 1.16.1), python3, ${misc:Pre-Depends}
Depends: ${python3:Depends}, ${misc:Depends}, ${shlibs:Depends}
Recommends: openssh-client, microcom, socat, sshfs, rsync, bash-completion
Recommends: openssh-client, microcom, socat, sshfs, rsync, bash-completion, python3-amt, freeipmi-tools
Description: embedded board control python library
Labgrid is an embedded board control python library with a focus on testing,
development and general automation. It includes a remote control layer to
143 changes: 143 additions & 0 deletions doc/configuration.rst
Original file line number Diff line number Diff line change
@@ -298,6 +298,47 @@ NetworkYKUSHPowerPort
A :any:`NetworkYKUSHPowerPort` describes a `YKUSHPowerPort`_ available on a
remote computer.

AMTPowerPort
++++++++++++
A :any:`AMTPowerPort` describes a AMT port accessible via `amtctrl`.

.. code-block:: yaml
AMTPowerPort:
host: 'amt-hostname'
password: 'secret-password'
Arguments:
- host (str): hostname or ip the AMT interface of the PC is reachable
- password (str): password to use for AMT login
- timeout (int): time to wait for the command to finish
- polling (int): interval to poll resource in exporter (disabled if 0)

Used by:
- `AMTPowerDriver`_

IPMIPowerPort
++++++++++++
A :any:`IPMIPowerPort` describes a IPMI port accessible via `ipmi-power`.

.. code-block:: yaml
IPMIPowerPort:
host: 'ipmi-hostname'
username: 'admin'
password: 'secret-password'
Arguments:
- host (str): hostname or ip the IPMI interface of the PC is reachable
- username (str): username to use for IPMI login
- password (str): password to use for IPMI login
- timeout (int): time to wait for the command to finish
- polling (int): interval to poll resource in exporter (disabled if 0)
- args (str): extra args to prepend the command with

Used by:
- `IPMIPowerDriver`_

USBPowerPort
++++++++++++
A :any:`USBPowerPort` describes a generic switchable USB hub as supported by
@@ -864,6 +905,59 @@ Arguments:
Used by:
- `OpenOCDDriver`_

XilinxUSBJTAG
~~~~~~~~~~~~~~~~
A XilinxUSBJTAG resource describes a Xilinx-compatible USB JTAG adapter:

- Digilent JTAG-HS3
- Digilent JTAG-SMT2
- Trenz Electronic TE0790-03
- Xilinx Platform Cable USB (see `Matching a Xilinx Platform Cable USB (II)`_)
- Xilinx Platform Cable USB II (see `Matching a Xilinx Platform Cable USB (II)`_)

The exporter launches a Vivado hardware server bound to the respective USB JTAG
adapter.

.. code-block:: yaml
XilinxUSBJTAG:
match:
'ID_SERIAL_SHORT': '210308A11F1A'
hw_server_cmd: '/path/to/Xilinx/Vivado/2018.3/bin/hw_server'
agent_url: tcp::3121
gdb_port: 3000
log_level: [events, protocol]
extra_args: ['-S']
- match (dict): key and value for a udev match, see `udev Matching`_
- hw_server_cmd (str): optional, shell command to run the Vivado hardware
server (defaults to ``hw_server``). The minimum Vivado hardware server
version supported is 2018.3.

Note that the Vivado Design Suite and Vivado Lab Solutions come with an
environment script that must be sourced first, i.e.:

.. code-block:: yaml
hw_server_cmd: 'source /path/to/Xilinx/Vivado/2018.3/settings64.sh && hw_server'
Since for the Vivado Lab Solutions, the environment script only adds the
:program:`hw_server` binary to :envvar:`PATH`, you can also directly provide
an absolute path as shown in the example; however, this might change in the
future.
- serial: (str): only required for adapters that do not expose the serial
number via udev, see `Matching a Xilinx Platform Cable USB (II)`_
- agent_url (str): optional, agent listening port and protocol. By default, a
random free TCP port is chosen.
- gdb_port (int): optional, base port number for Xilinx GDB server. By default,
a random free port is chosen.
- log_level ([str]): optional, set log level as a list of categories. Run
``hw_server -h`` to get all available categories.
- extra_args ([str]): optional, extra arguments passed to :program:`hw_server`

Used by:
- `XSDBDriver`_

SNMPEthernetPort
~~~~~~~~~~~~~~~~
A :any:`SNMPEthernetPort` resource describes a port on an Ethernet switch,
@@ -1579,6 +1673,36 @@ udev helper::
Unload module index
Unloaded link configuration context.

Matching a Xilinx Platform Cable USB (II)
+++++++++++++++++++++++++++++++++++++++++

A Xilinx Platform Cable USB (II) does not expose its unique serial number via
udev. Therefore, we have to match the USB device via the respective port
(directly, without parent match).

Accordingly, one must set the ``serial`` attribute to enable the Vivado
hardware server to filter for the respective port. Run the XSDB command ``jtag
targets`` to get the serial number of the respective Platform Cable USB (II):

.. code-block:: console
:emphasize-lines: 4
$ xsdb
xsdb% jtag targets
1 Platform Cable USB II 00001296718a01
2 xczu9 (idcode 24738093 irlen 12 fpga)
3 arm_dap (idcode 5ba00477 irlen 4)
.. code-block:: yaml
:emphasize-lines: 5
XilinxUSBJTAG:
match:
'sys_name': '3-3'
hw_server_cmd: '/path/to/Xilinx/Vivado/2018.3/bin/hw_server'
serial: 00001296718a01
Drivers
-------

@@ -1969,6 +2093,25 @@ Arguments:
The driver can be used in test cases by calling its ``flash()`` method. An
example strategy is included in labgrid.

XSDBDriver
~~~~~~~~~~
A XSDBDriver connects to a Vivado hardware server to control a Xilinx device
via JTAG.

Binds to:
interface:
- `XilinxUSBJTAG`_

Implements:
- None

Arguments:
- bitstream (str): filename of bitstream for programmable logic (PL)

The driver can be used in test cases to program a bitstream via the
`program_bitstream` function or run arbitrary XSDB Tcl commands by calling the
`run` function.

ManualPowerDriver
~~~~~~~~~~~~~~~~~
A :any:`ManualPowerDriver` requires the user to control the target power
Loading