nets module#
Resolve JITX nets to the TO.N attribute every conducting object carries.
The spec recommends .N on all copper objects because “the absence of the .N attribute does not mean there is no net and is therefore ambiguous”, so copper that is genuinely on no net gets the reserved empty value %TO.N,*% rather than no attribute at all.
Net names are not mangled here. The X2 field escaping in format.model already turns every reserved character into a uXXXX escape, so a name reaches the file intact and two names that differ cannot be collapsed into one by a sanitizer.
- EMPTY_NET = ''#
an object genuinely on no net.
- Type:
The reserved %TO.N,*% value
- SYNTHETIC_PREFIX = 'N$'#
Prefix for a name synthesized for a net object that arrived unnamed.
- net_attribute(names)[source]#
TO.N for an object spanning a known set of nets.
An empty set, or one holding only unconnected copper, is the reserved empty value: the spec calls omitting the attribute ambiguous, so netless copper says so explicitly rather than staying silent. Several names is 5.6.13’s list form, which describes an object whose parts lie on different nets.
- class NetResolver(design)[source]#
Bases:
objectNet names for design objects, and the TO.N attribute for them.
Two situations look identical at the call site and are kept apart, which is the whole reason this class exists:
No net object at all is unconnected copper - tooling pads, isolated islands, logos - and takes the reserved empty value.
A net object with no name should not occur, because connected nets are named by the runtime one way or another. Collapsing it to the empty value would assert that connected copper is isolated, which is both wrong and invisible downstream, so a deterministic name is synthesized and the occurrences are counted into the run log.
- Parameters:
design (RuntimeDesign)
- name(element)[source]#
The net name for an element, or None when it is on no net.
None means the design has no net object for the element, which is what the empty .N value describes. It never means “unnamed”.