Resources API

Resources are configuration descriptors for hardware and network components.

VesyncOutlet

class adi_lg_plugins.resources.vesync.VesyncOutlet(target, name, outlet_names, username, password, delay=5.0)[source]

Bases: Resource

The VeSyncOutlet describes a smart outlet controlled with VeSync

Parameters:
  • outlet_names (str) – list of outlet names to control separated by commas

  • username (str) – VeSync account username (email)

  • password (str) – VeSync account password

  • delay (float, default=5.0) – delay between power off and power on during reset operation

__init__(target, name, outlet_names, username, password, delay=5.0)

Method generated by attrs for class VesyncOutlet.

Return type:

None

CyberPowerOutlet

class adi_lg_plugins.resources.cyberpowerpdu.CyberPowerOutlet(target, name, address, outlet, delay=5.0)[source]

Bases: Resource

The CyberPowerOutlet describes a smart outlet controlled with CyberPower

Parameters:
  • address (str) – IP address of the CyberPower PDU

  • outlet (int) – Outlet number on the PDU to control

  • delay (float, default=5.0) – delay between power off and power on during reset operation

__init__(target, name, address, outlet, delay=5.0)

Method generated by attrs for class CyberPowerOutlet.

Return type:

None

HomeAssistantOutlet

class adi_lg_plugins.resources.homeassistant.HomeAssistantOutlet(target, name, url, token, entity_id, delay=5.0)[source]

Bases: Resource

The HomeAssistantOutlet describes a switch/outlet controlled via Home Assistant REST API

Parameters:
  • url (str) – Base URL of the Home Assistant instance (e.g. http://192.168.1.100:8123)

  • token (str) – Long-lived access token for Home Assistant authentication

  • entity_id (str) – Entity ID of the switch to control (e.g. switch.lab_outlet_1)

  • delay (float, default=5.0) – delay between power off and power on during reset operation

__init__(target, name, url, token, entity_id, delay=5.0)

Method generated by attrs for class HomeAssistantOutlet.

Return type:

None

MassStorageDevice

class adi_lg_plugins.resources.massstorage.MassStorageDevice(target, name, path, file_updates={}, use_with_sdmux=False)[source]

Bases: Resource

The MassStorageDevice describes a USB mass storage device

Parameters:
  • path (str) – Path to the mass storage device. Can be device path, sysfs path or USB path.

  • file_updates – dict: mapping of source file paths to destination paths on the mass storage device

  • use_with_sdmux (bool) – Manage state with USBSDMuxDriver if True in strategy. Default: False

__init__(target, name, path, file_updates={}, use_with_sdmux=False)

Method generated by attrs for class MassStorageDevice.

Return type:

None

KuiperRelease

class adi_lg_plugins.resources.kuiperrelease.KuiperRelease(target, name, release_version, cache_path='~/.labgrid/kuiper_releases/', kernel_path=None, BOOTBIN_path=None, device_tree_path=None)[source]

Bases: Resource

The KuiperRelease describes a Kuiper release resource

Parameters:
  • release_version (str) – Version of the Kuiper release to download and manage.

  • cache_path (str) – Path to cache the downloaded Kuiper release. Defaults to /home/<user>/.labgrid/kuiper_releases/

  • kernel_path (str) – Path to the kernel file to use with the Kuiper release.

  • BOOTBIN_path (str) – Path to the BOOTBIN file to use with the Kuiper release.

  • device_tree_path (str) – Path to the device tree file to use with the Kuiper release.

__init__(target, name, release_version, cache_path='~/.labgrid/kuiper_releases/', kernel_path=None, BOOTBIN_path=None, device_tree_path=None)

Method generated by attrs for class KuiperRelease.

Return type:

None

TFTPServerResource

class adi_lg_plugins.resources.tftpserver.TFTPServerResource(target, name, address='auto', port=3069, root='/var/lib/tftpboot')[source]

Bases: Resource

Resource to configure or discover the TFTP server address.

get_ip()[source]

Returns the configured IP or discovers it if set to ‘auto’.

__init__(target, name, address='auto', port=3069, root='/var/lib/tftpboot')

Method generated by attrs for class TFTPServerResource.

Return type:

None

XilinxDeviceJTAG

class adi_lg_plugins.resources.xilinxdevice.XilinxDeviceJTAG(target, name='xilinxdevicejtag', root_target=1, microblaze_target=3, bitstream_path=None, kernel_path=None, devicetree_path=None)[source]

Bases: Resource

Xilinx FPGA device JTAG configuration.

Defines JTAG target IDs and file paths for Virtex/Artix/Kintex FPGAs with Microblaze soft processors.

root_target

JTAG target ID for root device (default: 1). This is typically the FPGA fabric target identified by xsdb ‘targets’ command.

Type:

int

microblaze_target

JTAG target ID for Microblaze processor (default: 3). This is typically the processor core target for xsdb commands.

Type:

int

bitstream_path

Path to FPGA bitstream file (.bit). Required when using BootFabric strategy. Must exist on filesystem.

Type:

str, optional

kernel_path

Path to Microblaze Linux kernel image (.strip). Required when using BootFabric strategy. Must exist on filesystem.

Type:

str, optional

devicetree_path

Path to device tree binary (.dtb). Only needed if device tree is separate from kernel image.

Type:

str, optional

__init__(target, name='xilinxdevicejtag', root_target=1, microblaze_target=3, bitstream_path=None, kernel_path=None, devicetree_path=None)

Method generated by attrs for class XilinxDeviceJTAG.

Return type:

None

XilinxVivadoTool

class adi_lg_plugins.resources.xilinxtool.XilinxVivadoTool(target, name='xilinxvivadotool', vivado_path='/tools/Xilinx/2025.1/Vivado', version=None)[source]

Bases: Resource

Xilinx Vivado/Vitis tool installation configuration.

Specifies paths to Xilinx tools (xsdb, xsct) for JTAG operations. Automatically locates xsdb binary and provides methods to execute TCL scripts via xsdb.

vivado_path

Root path to Xilinx Vivado installation (default: “/tools/Xilinx/Vivado”). Example: “/opt/Xilinx/Vivado/2023.2” or “/tools/Xilinx/2025.1/Vivado”

Type:

str, optional

version

Vivado version string (e.g., “2023.2”). Used to locate vivado_path if not explicitly set.

Type:

str, optional

__attrs_post_init__()[source]

Initialize xsdb_path based on vivado_path and version.

run_xsdb_script(tcl_script)[source]

Execute TCL script via xsdb.

Parameters:

tcl_script (str) – TCL commands to execute. Will be written to a temporary file and executed by xsdb.

Returns:

(stdout, stderr, returncode) where stdout and stderr are strings.

Return type:

tuple

Raises:

RuntimeError – If xsdb execution fails or times out.

Example

>>> tool = XilinxVivadoTool()
>>> stdout, stderr, rc = tool.run_xsdb_script(
...     "connect\nafter 1000\nfpga -f design.bit\ndisconnect"
... )
>>> if rc == 0:
...     print("Success:", stdout)
... else:
...     print("Error:", stderr)
__init__(target, name='xilinxvivadotool', vivado_path='/tools/Xilinx/2025.1/Vivado', version=None)

Method generated by attrs for class XilinxVivadoTool.

Return type:

None