Host-side operational utilities for DAU bench work
Small, package-neutral utilities for operating FPGA bench hosts. Each owns
one mechanism; policy (which devices, when to arm) belongs to the caller —
higher layers such as dau-build compose these into their hardware
command plans.
A driver/PCIe hang can leave the kernel and systemd alive — the hardware
watchdog keeps getting petted, yet a clean systemctl reboot blocks on
the stuck device, and the box needs a walk to the power switch. The
deadman arms a forced reboot before the risky operation and cancels it
on success:
dau-utils-deadman arm --timeout 300 # transient systemd timer; survives SSH loss
# ... rescan / flash / probe ...
dau-utils-deadman disarm # clean return: cancel the reset
dau-utils-deadman statusIf the host wedges before disarm, the timer fires sysrq-b
(emergency_restart()), which resets past the wedged driver without
touching it. The same operations are available as a Python API
(dau_utils.deadman.arm/disarm/is_armed and an armed() context
manager); failures raise DeadmanError — treat the host as unsafe.
Arm it before every PCIe rescan, flash, or register probe against a device that has previously wedged. Synthesis and other non-PCIe work does not need it.
dau-utils-pci-runtime-pm holds or releases Linux PCI runtime PM for
devices matched from lspci -Dnn. The caller decides which patterns
matter; this utility owns the sysfs writes:
dau-utils-pci-runtime-pm hold --pattern Thunderbolt --pattern 10ee:7011
dau-utils-pci-runtime-pm release --pattern Thunderbolt --pattern 10ee:7011Use --dry-run to print the planned writes without touching sysfs.
pip install -e .[develop]
python -m pytest dau_utils/tests
python -m ruff check dau_utilsNote
This library was generated using copier from the Base Python Project Template repository.