pyadi-dt CLI
Use adidtc to inspect, generate, validate, and deploy Linux device trees for
Analog Devices hardware. Prefer discovery and read-only commands first. Treat SD
card writes, property writes, and reboots as hardware-changing operations.
Start here
Confirm the executable and inspect the current command surface:
command -v adidtc
adidtc --help
If it is unavailable, from the pyadi-dt repository create an isolated
environment instead of modifying the system Python:
python3 -m venv .venv
.venv/bin/pip install -e .
.venv/bin/adidtc --help
For XSA generation, install the XSA extra and ensure sdtgen is available:
.venv/bin/pip install -e '.[xsa]'
command -v sdtgen
Ask for or discover the input path, board/profile, desired output, and whether
hardware mutation is allowed. Do not guess a board, IP address, credential,
PetaLinux project, or output path.
Run the narrow command's --help before composing an unfamiliar invocation.
Route the task
| Goal |
Command |
Safe first action |
| Discover supported Kuiper designs |
kuiper-boards |
adidtc kuiper-boards --json-output |
| Discover XSA profiles |
xsa-profiles, xsa-profile-show |
List, then inspect one profile |
| Generate from Vivado XSA |
xsa2dt |
Validate XSA/config/profile and write to a new directory |
| Generate without Vivado/XSA |
gen-dts |
Write a new .dts; add --compile only when dtc exists |
| Analyze DTS includes |
deps |
Use tree or JSON output; do not modify source files |
| Inspect one node/property |
prop |
Use local_file, local_sysfs, or remote_sysfs |
| Navigate nested nodes |
props |
Read without --value first |
| Apply pyadi-jif clocks |
jif, then jif clock |
Inspect its help and inputs before writing |
| Switch an SD reference design |
sd-move |
Always run --dry-run --show first |
| Copy boot files to an SD card |
sd-remote-copy |
Always run --dry-run --show first |
See reference/commands.md for copy/pasteable recipes and output checks.
XSA-to-DTS workflow
Verify inputs exist and preserve them unchanged:
test -f design.xsa
test -f cfg.json
python -m json.tool cfg.json >/dev/null
adidtc xsa-profiles
adidtc xsa-profile-show ad9081_zcu102
Use a fresh output directory. Prefer linting, and use strict validation for a
release or hardware-bound artifact:
adidtc xsa2dt \
-x design.xsa \
-c cfg.json \
--profile ad9081_zcu102 \
-o generated/ad9081-zcu102 \
--strict-lint
When a trusted DTS exists, request parity evidence:
adidtc xsa2dt \
-x design.xsa \
-c cfg.json \
--profile ad9081_zcu102 \
--reference-dts reference.dts \
--strict-parity \
--strict-lint \
-o generated/ad9081-zcu102
Verify the command exited successfully and inspect every reported artifact.
Expected outputs can include a generated overlay (.dtso), merged source
(.dts), HTML report, map/coverage reports, and PetaLinux files when that
format is selected. Do not claim the tree boots until it has actually been
compiled and tested on the intended hardware.
Use --format petalinux without --petalinux-project to review generated
integration files first. Copy into a real project only when the user supplied
and approved its path.
Inspection workflow
Choose the least invasive context:
local_file: read a supplied .dts or .dtb; no hardware access.
local_sysfs: inspect /proc/device-tree on the current target.
remote_sysfs: inspect a running board over SSH; read-only.
local_sd / remote_sd: persistent boot media; writes are possible.
Examples:
adidtc -c local_file -f system.dtb prop -cp adi,ad9081 clock-output-names
adidtc -c remote_sysfs -i BOARD_IP prop -cp adi,ad9361 clock-output-names
adidtc -c local_file -f system.dtb props amba spi0
Replace BOARD_IP with a user-provided or independently discovered address.
Keep global options before the subcommand. First identify nodes, then read the
property, then propose any change.
Hardware mutation guardrails
- Do not write a property, alter SD contents, or reboot unless the user explicitly
requested that side effect and identified the target.
- Never place passwords, tokens, or private keys in files, command history,
reports, or the skill. Prefer existing SSH configuration or an interactive
credential mechanism. Do not print secrets.
- Before
sd-move or sd-remote-copy, run the identical operation with
--dry-run --show, review source files and destination target, then run the
real command only after explicit approval.
- Omit
--reboot on the first real write unless reboot was explicitly requested.
- Preserve original XSA, DTS/DTB, boot files, and configs. Generate into a new
path and report it.
- A successful generation is not hardware validation. A successful copy is not
proof of a successful boot. Verify each stage separately.
Failure handling
adidtc: command not found: use the repository venv or install in a fresh venv.
- Missing
sdtgen: install lopper/XSA dependencies or source the correct
Vivado/Vitis environment; do not substitute a fabricated base DTS.
- Missing
dtc: generation may still produce DTS, but --compile cannot be
claimed successful.
- Unknown profile: run
adidtc xsa-profiles; do not invent profile names.
- Invalid config or parity/lint failure: preserve the output and report the exact
diagnostic. Do not disable strict checks merely to get a green command.
- Remote connection failure: distinguish address/authentication/network failures
from device-tree errors before changing the invocation.
Completion checklist
1---2name: pyadi-dt-cli3description: Use the pyadi-dt adidtc CLI to inspect, generate, validate, and safely deploy Analog Devices Linux device trees. Trigger for Vivado XSA-to-DTS generation, built-in board profiles, Kuiper support discovery, DTS include analysis, local DTB inspection, live-board property reads, SD-card updates, or pyadi-jif clock updates.4---56# pyadi-dt CLI78Use `adidtc` to inspect, generate, validate, and deploy Linux device trees for9Analog Devices hardware. Prefer discovery and read-only commands first. Treat SD10card writes, property writes, and reboots as hardware-changing operations.1112## Start here13141. Confirm the executable and inspect the current command surface:1516 ```bash17 command -v adidtc18 adidtc --help19 ```20212. If it is unavailable, from the pyadi-dt repository create an isolated22 environment instead of modifying the system Python:2324 ```bash25 python3 -m venv .venv26 .venv/bin/pip install -e .27 .venv/bin/adidtc --help28 ```2930 For XSA generation, install the XSA extra and ensure `sdtgen` is available:3132 ```bash33 .venv/bin/pip install -e '.[xsa]'34 command -v sdtgen35 ```36373. Ask for or discover the input path, board/profile, desired output, and whether38 hardware mutation is allowed. Do not guess a board, IP address, credential,39 PetaLinux project, or output path.40414. Run the narrow command's `--help` before composing an unfamiliar invocation.4243## Route the task4445| Goal | Command | Safe first action |46|---|---|---|47| Discover supported Kuiper designs | `kuiper-boards` | `adidtc kuiper-boards --json-output` |48| Discover XSA profiles | `xsa-profiles`, `xsa-profile-show` | List, then inspect one profile |49| Generate from Vivado XSA | `xsa2dt` | Validate XSA/config/profile and write to a new directory |50| Generate without Vivado/XSA | `gen-dts` | Write a new `.dts`; add `--compile` only when `dtc` exists |51| Analyze DTS includes | `deps` | Use tree or JSON output; do not modify source files |52| Inspect one node/property | `prop` | Use `local_file`, `local_sysfs`, or `remote_sysfs` |53| Navigate nested nodes | `props` | Read without `--value` first |54| Apply pyadi-jif clocks | `jif`, then `jif clock` | Inspect its help and inputs before writing |55| Switch an SD reference design | `sd-move` | Always run `--dry-run --show` first |56| Copy boot files to an SD card | `sd-remote-copy` | Always run `--dry-run --show` first |5758See `reference/commands.md` for copy/pasteable recipes and output checks.5960## XSA-to-DTS workflow61621. Verify inputs exist and preserve them unchanged:6364 ```bash65 test -f design.xsa66 test -f cfg.json67 python -m json.tool cfg.json >/dev/null68 adidtc xsa-profiles69 adidtc xsa-profile-show ad9081_zcu10270 ```71722. Use a fresh output directory. Prefer linting, and use strict validation for a73 release or hardware-bound artifact:7475 ```bash76 adidtc xsa2dt \77 -x design.xsa \78 -c cfg.json \79 --profile ad9081_zcu102 \80 -o generated/ad9081-zcu102 \81 --strict-lint82 ```83843. When a trusted DTS exists, request parity evidence:8586 ```bash87 adidtc xsa2dt \88 -x design.xsa \89 -c cfg.json \90 --profile ad9081_zcu102 \91 --reference-dts reference.dts \92 --strict-parity \93 --strict-lint \94 -o generated/ad9081-zcu10295 ```96974. Verify the command exited successfully and inspect every reported artifact.98 Expected outputs can include a generated overlay (`.dtso`), merged source99 (`.dts`), HTML report, map/coverage reports, and PetaLinux files when that100 format is selected. Do not claim the tree boots until it has actually been101 compiled and tested on the intended hardware.1021035. Use `--format petalinux` without `--petalinux-project` to review generated104 integration files first. Copy into a real project only when the user supplied105 and approved its path.106107## Inspection workflow108109Choose the least invasive context:110111- `local_file`: read a supplied `.dts` or `.dtb`; no hardware access.112- `local_sysfs`: inspect `/proc/device-tree` on the current target.113- `remote_sysfs`: inspect a running board over SSH; read-only.114- `local_sd` / `remote_sd`: persistent boot media; writes are possible.115116Examples:117118```bash119adidtc -c local_file -f system.dtb prop -cp adi,ad9081 clock-output-names120adidtc -c remote_sysfs -i BOARD_IP prop -cp adi,ad9361 clock-output-names121adidtc -c local_file -f system.dtb props amba spi0122```123124Replace `BOARD_IP` with a user-provided or independently discovered address.125Keep global options before the subcommand. First identify nodes, then read the126property, then propose any change.127128## Hardware mutation guardrails129130- Do not write a property, alter SD contents, or reboot unless the user explicitly131 requested that side effect and identified the target.132- Never place passwords, tokens, or private keys in files, command history,133 reports, or the skill. Prefer existing SSH configuration or an interactive134 credential mechanism. Do not print secrets.135- Before `sd-move` or `sd-remote-copy`, run the identical operation with136 `--dry-run --show`, review source files and destination target, then run the137 real command only after explicit approval.138- Omit `--reboot` on the first real write unless reboot was explicitly requested.139- Preserve original XSA, DTS/DTB, boot files, and configs. Generate into a new140 path and report it.141- A successful generation is not hardware validation. A successful copy is not142 proof of a successful boot. Verify each stage separately.143144## Failure handling145146- `adidtc: command not found`: use the repository venv or install in a fresh venv.147- Missing `sdtgen`: install lopper/XSA dependencies or source the correct148 Vivado/Vitis environment; do not substitute a fabricated base DTS.149- Missing `dtc`: generation may still produce DTS, but `--compile` cannot be150 claimed successful.151- Unknown profile: run `adidtc xsa-profiles`; do not invent profile names.152- Invalid config or parity/lint failure: preserve the output and report the exact153 diagnostic. Do not disable strict checks merely to get a green command.154- Remote connection failure: distinguish address/authentication/network failures155 from device-tree errors before changing the invocation.156157## Completion checklist158159- [ ] Used an isolated environment and the actual `adidtc --help` surface.160- [ ] Confirmed input files, target/profile, and output path.161- [ ] Preserved source artifacts and wrote generated files to a new path.162- [ ] Used read-only context or dry-run before hardware-changing operations.163- [ ] Ran applicable lint, parity, JSON, DTS/DTB, or hardware validation.164- [ ] Reported the executed command, exit status, artifact paths, and limitations.