circuit-json 0.0.513 → 0.0.514

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -114,6 +114,8 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
114
114
  - [PcbBend](#pcbbend)
115
115
  - [PcbBoard](#pcbboard)
116
116
  - [PcbBreakoutPoint](#pcbbreakoutpoint)
117
+ - [PcbBusRoutingConstraintError](#pcbbusroutingconstrainterror)
118
+ - [PcbBusRoutingConstraintWarning](#pcbbusroutingconstraintwarning)
117
119
  - [PcbBusLengthSkewError](#pcbbuslengthskewerror)
118
120
  - [PcbComponent](#pcbcomponent)
119
121
  - [PcbComponentInvalidLayerError](#pcbcomponentinvalidlayererror)
@@ -357,8 +359,47 @@ interface SourceBus {
357
359
  source_trace_ids: string[]
358
360
  /** Maximum difference between the longest and shortest member, in millimeters. */
359
361
  max_length_skew?: number
362
+ /** Intended single-ended characteristic impedance, in ohms. */
363
+ target_impedance?: number
364
+ /** Intended differential characteristic impedance, in ohms. */
365
+ target_differential_impedance?: number
366
+ /** Ordered polarity for a resolved point-to-point differential pair. */
367
+ differential_pair?: {
368
+ positive_source_trace_id: string
369
+ negative_source_trace_id: string
370
+ trace_gap?: number
371
+ max_uncoupled_length?: number
372
+ }
373
+ /** Additional traces for length comparison, without changing electrical membership. */
374
+ length_match_source_trace_ids?: string[]
375
+ min_length?: SourceBusRouteLength
376
+ max_length?: SourceBusRouteLength
377
+ target_length?: SourceBusRouteLength
378
+ length_tolerance?: number
379
+ /** Within this bus, excluding declared differential partners. */
380
+ pcb_trace_spacing?: SourceBusTraceSpacing
381
+ /** To all signals outside this bus or pair. */
382
+ pcb_spacing_to_other_signals?: SourceBusTraceSpacing
383
+ target_impedance_min?: number
384
+ target_impedance_max?: number
385
+ target_differential_impedance_min?: number
386
+ target_differential_impedance_max?: number
360
387
  subcircuit_id?: string
361
388
  }
389
+
390
+ /** A routed length in mm, or an offset from the longest endpoint Manhattan distance.
391
+ * Explicit references are resolved source traces; omitted references use the bus
392
+ * members and length_match_source_trace_ids. */
393
+ type SourceBusRouteLength =
394
+ | number
395
+ | {
396
+ reference: "longest_manhattan"
397
+ source_trace_ids?: string[]
398
+ offset?: number
399
+ }
400
+
401
+ /** Centerline separation in mm or a multiple of the larger local trace width. */
402
+ type SourceBusTraceSpacing = number | { width_multiplier: number }
362
403
  ```
363
404
 
364
405
  ### SourceComponentBase
@@ -1526,6 +1567,35 @@ interface PcbBreakoutPoint {
1526
1567
  }
1527
1568
  ```
1528
1569
 
1570
+ ### PcbBusRoutingConstraintError
1571
+
1572
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_routing_constraint_error.ts)
1573
+
1574
+ A discriminated union of bus/pair constraint violations. Every variant includes `source_bus_id`, `source_trace_ids`, `pcb_trace_ids`, `message`, and the error identity fields. Lengths and centerline spacing are mm; impedance is ohms. Spacing variants also require `other_pcb_trace_id` and may include `other_source_trace_id`.
1575
+
1576
+ | `routing_rule` | Required measurements | Optional bounds |
1577
+ | --- | --- | --- |
1578
+ | `length_skew` | `actual_length_skew`, `maximum_length_skew` | — |
1579
+ | `min_length` | `actual_trace_length`, `minimum_trace_length` | — |
1580
+ | `max_length` | `actual_trace_length`, `maximum_trace_length` | — |
1581
+ | `target_length` | `actual_trace_length`, `target_trace_length`, `length_tolerance` | — |
1582
+ | `pcb_trace_spacing` | `actual_centerline_spacing`, `minimum_centerline_spacing` | — |
1583
+ | `pcb_spacing_to_other_signals` | `actual_centerline_spacing`, `minimum_centerline_spacing` | — |
1584
+ | `impedance_target` | `target_impedance` | `minimum_impedance`, `maximum_impedance` (at least one) |
1585
+
1586
+ ```typescript
1587
+ if (error.routing_rule === "max_length") {
1588
+ // Narrowed to the maximum-length variant; these fields are required.
1589
+ console.log(error.actual_trace_length, error.maximum_trace_length)
1590
+ }
1591
+ ```
1592
+
1593
+ ### PcbBusRoutingConstraintWarning
1594
+
1595
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_routing_constraint_warning.ts)
1596
+
1597
+ An unverified constraint, discriminated by `routing_rule`: `route_geometry`, `reference_geometry`, `spacing_geometry`, `target_length`, or `physical_impedance`. Every variant includes `source_bus_id`, `source_trace_ids`, `pcb_trace_ids`, `message`, and warning identity fields. Missing geometry uses an empty `pcb_trace_ids` array; these warnings contain no measurements and must not be interpreted as a pass.
1598
+
1529
1599
  ### PcbBusLengthSkewError
1530
1600
 
1531
1601
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_length_skew_error.ts)