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:
ResourceThe VeSyncOutlet describes a smart outlet controlled with VeSync
- Parameters:
- __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:
ResourceThe CyberPowerOutlet describes a smart outlet controlled with CyberPower
- Parameters:
- __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:
ResourceThe 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:
ResourceThe MassStorageDevice describes a USB mass storage device
- Parameters:
- __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:
ResourceThe 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:
ResourceResource to configure or discover the TFTP server address.
- __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:
ResourceXilinx 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:
- microblaze_target¶
JTAG target ID for Microblaze processor (default: 3). This is typically the processor core target for xsdb commands.
- Type:
- 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:
ResourceXilinx 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
- 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:
- 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