dau_driver.capability_decode¶
Shared register-block decode semantics for every DAU transport backend.
linux-xdma, macos-xdma, and the device layer all decode the same identity window; one definition here so a semantics change cannot silently diverge the backends (they were verbatim copies before, and had already drifted).
Attributes¶
Functions¶
|
The platform id as ASCII, or |
|
Decode the register-map version word. |
|
|
|
(hardware operators, host-computed operators) from the identity |
|
The machine-readable capability contract a shell-build manifest |
|
(hardware operators, host-computed operators) from the concrete |
|
|
|
The shell's 64-bit build identity, as TWO 32-bit reads. |
|
The composed-capability words, read only from a shell that |
|
Discovery-time identity snapshot; |
Module Contents¶
- dau_driver.capability_decode.REGISTER_BITMAP_INPUT_TYPES¶
- dau_driver.capability_decode.REGISTER_WINDOW_OFFSETS¶
- dau_driver.capability_decode.decode_platform_id(value: int) str[source]¶
The platform id as ASCII, or
""when the word is not one. A board that advertises no platform is unknown, not dpv1: substituting a default here once reported a dead aperture (all-ones on every word) as a working Artix, and the platform id selects the part, the pricing and the constraints downstream.
- dau_driver.capability_decode.NOT_ADVERTISED_REGISTER_MAP_VERSION¶
- dau_driver.capability_decode.decode_register_map_version(value: int) dau_core.registers.RegisterMapVersion[source]¶
Decode the register-map version word.
An all-ones read means NOT ADVERTISED — the same normalization the capability words use — not a version. Two readers used to disagree on exactly this word: one mapped it to (0, 1), a plausible-looking old shell, while the other ran it through
from_u32and got (65535, 65535), which compares GREATER than the capability-word version and so read words the shell never decoded. A sentinel below every real version makes both readers agree and keeps those offsets unread.
- dau_driver.capability_decode._typed_operators_from_bitmap(bitmap: int, input_types: tuple[dau_core.stream.LogicalType, ...]) tuple[dau_core.capabilities.OperatorCapability, ...][source]¶
- dau_driver.capability_decode.operators_from_snapshot(snapshot: dau_core.registers.RegisterBlockSnapshot) tuple[tuple[dau_core.capabilities.OperatorCapability, ...], tuple[dau_core.capabilities.OperatorCapability, ...]][source]¶
(hardware operators, host-computed operators) from the identity registers, decoded by register map version.
OPERATOR_BITMAP carries only HDL-executed opcodes (typed INT32 at register level) and HOST_OPCODE_BITMAP carries protocol-level opcodes the host derives from hardware results (AVERAGE = SUM/COUNT divide) — those must never be submitted to the device. A shell that advertises neither word reports nothing here, and its manifest capability contract is the authority.
- dau_driver.capability_decode.contract_from_manifest_metadata(metadata: collections.abc.Mapping[str, str]) dau_core.capability_contract.CapabilityContract | None[source]¶
The machine-readable capability contract a shell-build manifest carries (
capability_contractkey, JSON), when present.
- dau_driver.capability_decode.operators_from_contract(contract: dau_core.capability_contract.CapabilityContract) tuple[tuple[dau_core.capabilities.OperatorCapability, ...], tuple[dau_core.capabilities.OperatorCapability, ...]][source]¶
(hardware operators, host-computed operators) from the concrete composition capability contract — per-tile opcodes and input types, no bitmap-times-types expansion.
- dau_driver.capability_decode._capability_word(read_register: collections.abc.Callable[[dau_core.registers.RegisterOffset], int], offset: dau_core.registers.RegisterOffset) int[source]¶
- dau_driver.capability_decode._build_id(read_register: collections.abc.Callable[[dau_core.registers.RegisterOffset], int]) int[source]¶
The shell’s 64-bit build identity, as TWO 32-bit reads.
Deliberately not one 8-byte access: the XDMA user BAR can short-read those. Low half at BUILD_ID_LOW, high at BUILD_ID_HIGH, matching the identity block’s split.
All-ones normalizes to 0 like every other capability word — a word nobody decoded advertises nothing, and 0 is the reserved “not stamped” value a consumer already has to handle for shells built before stamping existed.
- dau_driver.capability_decode._capability_words(read_register: collections.abc.Callable[[dau_core.registers.RegisterOffset], int], register_map_version: dau_core.registers.RegisterMapVersion) dict[str, int][source]¶
The composed-capability words, read only from a shell that advertises them. Shared by every snapshot reader so the gate and the all-ones normalization cannot diverge between them.
- dau_driver.capability_decode.read_register_block_snapshot(read_register: collections.abc.Callable[[dau_core.registers.RegisterOffset], int]) dau_core.registers.RegisterBlockSnapshot[source]¶
Discovery-time identity snapshot;
read_registerabstracts the backend-specific window access (dev-node pread vs DriverKit BAR read). The composed-capability words are only read on register map >= 0.2 — older shells do not decode those offsets.