Skip to main content

unit_map

Function unit_map 

Source
pub fn unit_map(
    declarations: &[PortDeclaration],
    unit_count: u32,
    has_symbol: bool,
) -> (BTreeMap<u32, usize>, Vec<UnitProblem>)
Expand description

Which port group each symbol unit binds its pins into, and everything about the mapping that does not hold. The map is unit (1-based) -> index into declarations``; a unit absent from it binds no pins.

unit_count is the symbol’s, and 0 reads as 1. The rule is in this module’s docs; in short, an explicit symbolUnit decides, one group with none takes unit 1, and several groups with none bind nothing.

has_symbol is whether the document carries a symbol at all. A 3D-only part has no units, so it reports no missing ones.