Skip to content

bus_lanes treats through-hole pads as top-only terminals, adding an unneeded via per connection #5802

Open

Description

@nitina-ariveguru

autorouter="bus_lanes" treats a through-hole pad as a top-layer-only terminal. A bus between bottom-side SMD pads and a through-hole header then gets one via per connection, even though a via-free route on the bottom layer exists. The default autorouter routes the same board on the bottom layer with no vias.

Tested on tscircuit 0.0.3279 (core 0.0.2460, the latest).

Repro

export default () => (
  <board width="16mm" height="10mm">
    <resistor name="R1" resistance="1k" footprint="0402" layer="bottom" pcbX={-4} pcbY={-1.27} />
    <resistor name="R2" resistance="1k" footprint="0402" layer="bottom" pcbX={-4} pcbY={1.27} />
    <pinheader name="J1" pinCount={2} pitch="2.54mm" pcbX={4} pcbY={0} pcbRotation={90} />
    <trace name="DATA0" from=".R1 > .pin2" to=".J1 > .pin1" />
    <trace name="DATA1" from=".R2 > .pin2" to=".J1 > .pin2" />
    <autoroutingphase name="LANES" phaseIndex={0} autorouter="bus_lanes" connections={["R1.pin2", "R2.pin2"]} />
    <bus name="DATA" connections={["DATA0", "DATA1"]} maxLengthSkew="0.1mm" pcbTraceWidth="0.15mm" />
  </board>
)

tsci build succeeds. Each DATA trace leaves its bottom pad, drops a via 0.5 mm away, and crosses to the header on top:

bottom wire (-4.51, -1.27) → (-4.00, -0.76)
via         (-4.00, -0.76) bottom → top
top wire    (-4.00, -0.76) → (-3.49, -1.27) → (4.00, -1.27)   J1.pin1
Variant Vias Layers
this repro (bottom SMD → through-hole header), bus_lanes 2 bottom + top
same board, <autoroutingphase> removed (default router) 0 bottom
all four resistors on the bottom (SMD → SMD), bus_lanes 0 bottom
resistors on top → through-hole header, bus_lanes 0 top

So bus_lanes routes on the bottom when every terminal is bottom SMD, and the only thing that forces the layer change is the through-hole pad.

Likely cause

In the phase's SimpleRouteJson (--autorouter-dump-srj all), the header's obstacle has layers: ["top", "bottom"], but its connection point only has layer: "top":

source_trace_0 pointsToConnect: (-4.51, -1.27, layer "bottom"), (4, -1.27, layer "top")

The default router seems to reach the plated hole on either layer, but the bus-lanes pipeline takes the point's single layer as the terminal layer and adds a "surface transition" to reach it.

Same thing on a larger board

On a SOIC-16 → 8-pin header data bus (D0–D7, all top-side SMD), bus_lanes routed the bus on the bottom layer. It then added 16 vias: one escape via next to each SOIC pad, which is expected, and one more next to each header pin, which is not needed, because the through-hole pad is already on the bottom layer. Each of those last vias sits 1.27 mm from its header pad, and a short top-layer stub joins it back to the pad.

Expected

A through-hole terminal should be reachable on any layer its plated hole spans. The repro should route on the bottom with no vias, and the larger board should need only the 8 SOIC-side escape vias.

Related: the bus-lanes skill page (BUS_LANES.md) still says "The router adds no vias", but the integrated pipeline now adds terminal escapes, as the bus-lanes-solver README describes, so that line may need an update too.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions