component.net
a component sits on a net
What it is ¶
component.net(ref_des, net) yields one row for each place a component connects to a net: the
reference designator and the net name. A component with three pins on three different nets
produces three rows; a net with eight parts on it produces eight. This is the netlist’s core
adjacency. It links components and nets, and every other netlist relation is keyed on one of the
two.
It is the workhorse join. Most multi-relation queries pass through it to get from a component to
its nets or from a net to its components, and the other relations (net.pin_count, net.bus_like,
net.max_voltage, component.class) hang off one end or the other of this edge.
For hardware engineers ¶
This is “what is connected to what,” the raw wire list. On its own a row just says R1 touches
VBUS. Its value is in the joins: which parts share a rail, whether a connector and a clamp sit
on the same signal, what is loaded onto ground. When you want to answer a connectivity question
about a specific net or part, you start here and add relations that qualify one side.
For software engineers ¶
This is the many-to-many edge table between components and nets, the adjacency list of the design
graph (see the analogy guide, where a net is a
shared channel aliasing pins of many instances). A component maps to many nets and a net to many
components, so neither column is unique. It is the natural join key. When a query relates a
component’s properties to a net’s properties, or the reverse, it joins through this relation, the
way you would join two tables through a link table. It is a projection over Nets() and their
connection lists, so rows are 1:1 with connections; it is empty only for a design with no
connections at all.
Go projector ¶
componentOnNetFacts in stdlib/relations/facts.go walks Model.Nets() and, for each net, emits
one row per entry in net.Connections (the component ref as subject, the net name as object).
Cardinality is one row per (component, net) connection, so a part appears once per net it connects to
and a net once per part on it. Empty only when no net carries any connection.
Datalog ¶
Every component-to-net link:
component.net(?r, ?n) => ?r, ?n
Join to component.class to find every diode and the nets it sits on. Most rules build on this
shape, which pulls a property on one entity through the edge to the other:
component.net(?r, ?n), component.class(?r, "diode") => ?r, ?n