Board Model
adidt.model holds the dataclasses that carry a fully-assembled
design on its way to DTS output. Both the XSA pipeline and the
declarative adidt.system API produce the same
BoardModel, which BoardModelRenderer then assembles
into DTS strings.
Pipeline
XSA Pipeline Declarative System
───────────── ──────────────────
XsaPipeline.run() adidt.System(name, components)
└─ AD9081Builder └─ system.connect_spi(...)
.build_model() system.add_link(...)
│ │
└──────────────┬──────────────────┘
▼
BoardModel
(components + jesd_links)
│
▼
BoardModelRenderer
.render()
│
▼
{clkgens, jesd204_rx/tx, converters}
│
▼
DTS output
Components and JESD links carry pre-rendered DTS strings (produced by
the declarative device classes in adidt.devices). The renderer
groups components by SPI bus, wraps each group in &spi_bus { ... };,
and concatenates per-direction JESD overlays. No Jinja2 involved.
Classes
- class adidt.model.BoardModel(name: str, platform: str, components: list[ComponentModel] = <factory>, jesd_links: list[JesdLinkModel] = <factory>, fpga_config: FpgaConfig | None = None, metadata: dict[str, ~typing.Any]=<factory>, extra_nodes: list[str] = <factory>)
Bases:
objectUnified board model that both the manual and XSA workflows produce.
A
BoardModelis an editable snapshot of the complete hardware composition. After construction (from either workflow), callers may inspect and modify components, JESD links, and metadata before passing the model toBoardModelRendererfor DTS rendering.
- class adidt.model.ComponentModel(role: str, part: str, spi_bus: str, spi_cs: int, rendered: str | None = None, template: str = '', config: dict[str, ~typing.Any]=<factory>)
Bases:
objectOne physical device on the board (clock chip, converter, etc.).
- rendered
Pre-rendered DT node string emitted by the device’s
render_dt()method. The renderer inserts this verbatim into the SPI-bus group for spi_bus.- Type:
str | None
- template, config
Legacy fields (Jinja2 template name + context dict) kept for backwards compatibility with code that still constructs
ComponentModelby hand. The current renderer ignores them whenrenderedis set.
- class adidt.model.JesdLinkModel(direction: str, jesd_label: str, xcvr_label: str, core_label: str, dma_label: str | None, link_params: dict[str, int]=<factory>, dma_clocks_str: str | None = None, dma_interrupts_str: str | None = None, xcvr_rendered: str | None = None, jesd_overlay_rendered: str | None = None, tpl_core_rendered: str | None = None)
Bases:
objectOne JESD204 link (RX or TX) with its FPGA-side IP labels and rendered overlays.
- dma_clocks_str
Optional
clockscells-string for the DMA overlay (inserted verbatim into the emitted overlay).- Type:
str | None
- dma_interrupts_str
Optional
interruptscells-string for the DMA overlay. When set, the renderer emits a/delete-property/ interrupts;followed by aninterrupts = ...;re-assignment. Use this when the sdtgen-generated IRQ number does not match the IRQ wire in the loaded bitstream.- Type:
str | None
- xcvr_rendered, jesd_overlay_rendered, tpl_core_rendered
Pre-rendered DTS strings for the three FPGA-side IP overlays. Produced by
adidt.devices.fpga_ip.
- class adidt.model.FpgaConfig(platform: str, addr_cells: int, ps_clk_label: str, ps_clk_index: int | None, gpio_label: str)
Bases:
objectPlatform-level FPGA configuration.
- class adidt.model.renderer.BoardModelRenderer
Bases:
objectRenders a
BoardModelinto DTS node strings.The output dict has the same shape that
build()returns:{"clkgens": [...], "jesd204_rx": [...], "jesd204_tx": [...], "converters": [...]}
This allows the existing
DtsMergerto consume the output without changes.- render(model: BoardModel) dict[str, list[str]]
Render model to DTS node strings (overlay mode).
- Parameters:
model – The board model to render.
- Returns:
Dict with keys
clkgens,jesd204_rx,jesd204_tx,converters, each mapping to a list of DTS node strings.
Fields of note
ComponentModel.rendered— pre-rendered DTS string for this component. Declarative devices always populate this; the renderer inserts it verbatim into its SPI-bus group.JesdLinkModel.{xcvr,jesd_overlay,tpl_core}_rendered— the three FPGA-side IP overlays for a single link. All three are produced byadidt.devices.fpga_ipdevices.JesdLinkModel.{xcvr,jesd_overlay,tpl_core}_config— legacy dict-typed fields kept for dict-based tests; unused by the current rendering path.