@tscircuit/schematic-trace-solver 0.0.134 → 0.0.136

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.
@@ -0,0 +1,663 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "schematic_component_7",
5
+ "center": {
6
+ "x": 10.1,
7
+ "y": -3
8
+ },
9
+ "width": 3.1999999999999993,
10
+ "height": 0.5999999999999996,
11
+ "pins": [
12
+ {
13
+ "pinId": "schematic_port_40",
14
+ "x": 8.5,
15
+ "y": -2.9
16
+ },
17
+ {
18
+ "pinId": "schematic_port_41",
19
+ "x": 8.5,
20
+ "y": -3.1
21
+ },
22
+ {
23
+ "pinId": "schematic_port_42",
24
+ "x": 11.7,
25
+ "y": -2.8
26
+ },
27
+ {
28
+ "pinId": "schematic_port_43",
29
+ "x": 11.7,
30
+ "y": -3
31
+ },
32
+ {
33
+ "pinId": "schematic_port_44",
34
+ "x": 11.7,
35
+ "y": -3.2
36
+ }
37
+ ],
38
+ "sectionId": "USB"
39
+ },
40
+ {
41
+ "chipId": "schematic_component_49",
42
+ "center": {
43
+ "x": 5.6,
44
+ "y": -3
45
+ },
46
+ "width": 3.1000000000000014,
47
+ "height": 0.7999999999999998,
48
+ "pins": [
49
+ {
50
+ "pinId": "schematic_port_290",
51
+ "x": 4.049999999999999,
52
+ "y": -2.8
53
+ },
54
+ {
55
+ "pinId": "schematic_port_291",
56
+ "x": 4.049999999999999,
57
+ "y": -3
58
+ },
59
+ {
60
+ "pinId": "schematic_port_292",
61
+ "x": 4.049999999999999,
62
+ "y": -3.2
63
+ },
64
+ {
65
+ "pinId": "schematic_port_293",
66
+ "x": 7.15,
67
+ "y": -3.2
68
+ },
69
+ {
70
+ "pinId": "schematic_port_294",
71
+ "x": 7.15,
72
+ "y": -3
73
+ },
74
+ {
75
+ "pinId": "schematic_port_295",
76
+ "x": 7.15,
77
+ "y": -2.8
78
+ }
79
+ ],
80
+ "sectionId": "USB"
81
+ },
82
+ {
83
+ "chipId": "schematic_component_50",
84
+ "center": {
85
+ "x": 8.1,
86
+ "y": -2
87
+ },
88
+ "width": 0.9600000000000009,
89
+ "height": 0.6800000000000002,
90
+ "pins": [
91
+ {
92
+ "pinId": "schematic_port_296",
93
+ "x": 7.619999999999999,
94
+ "y": -2,
95
+ "_facingDirection": "x-"
96
+ },
97
+ {
98
+ "pinId": "schematic_port_297",
99
+ "x": 8.58,
100
+ "y": -2,
101
+ "_facingDirection": "x+"
102
+ }
103
+ ],
104
+ "sectionId": "USB"
105
+ },
106
+ {
107
+ "chipId": "schematic_component_51",
108
+ "center": {
109
+ "x": 8.1,
110
+ "y": -4
111
+ },
112
+ "width": 0.9600000000000009,
113
+ "height": 0.6800000000000002,
114
+ "pins": [
115
+ {
116
+ "pinId": "schematic_port_298",
117
+ "x": 7.619999999999999,
118
+ "y": -4,
119
+ "_facingDirection": "x-"
120
+ },
121
+ {
122
+ "pinId": "schematic_port_299",
123
+ "x": 8.58,
124
+ "y": -4,
125
+ "_facingDirection": "x+"
126
+ }
127
+ ],
128
+ "sectionId": "USB"
129
+ },
130
+ {
131
+ "chipId": "schematic_component_52",
132
+ "center": {
133
+ "x": 12,
134
+ "y": 8
135
+ },
136
+ "width": 0.9400000000000013,
137
+ "height": 0.7189106999999986,
138
+ "pins": [
139
+ {
140
+ "pinId": "schematic_port_300",
141
+ "x": 11.53,
142
+ "y": 7.95,
143
+ "_facingDirection": "x-"
144
+ },
145
+ {
146
+ "pinId": "schematic_port_301",
147
+ "x": 12.47,
148
+ "y": 7.95,
149
+ "_facingDirection": "x+"
150
+ }
151
+ ],
152
+ "sectionId": "USB"
153
+ },
154
+ {
155
+ "chipId": "schematic_component_53",
156
+ "center": {
157
+ "x": 8,
158
+ "y": 8
159
+ },
160
+ "width": 1.0799999999999992,
161
+ "height": 0.6799999999999997,
162
+ "pins": [
163
+ {
164
+ "pinId": "schematic_port_302",
165
+ "x": 7.460000000000001,
166
+ "y": 8,
167
+ "_facingDirection": "x-"
168
+ },
169
+ {
170
+ "pinId": "schematic_port_303",
171
+ "x": 8.54,
172
+ "y": 8,
173
+ "_facingDirection": "x+"
174
+ }
175
+ ],
176
+ "sectionId": "USB"
177
+ },
178
+ {
179
+ "chipId": "schematic_component_54",
180
+ "center": {
181
+ "x": 8,
182
+ "y": 6
183
+ },
184
+ "width": 1.3200000000000003,
185
+ "height": 0.6799999999999997,
186
+ "pins": [
187
+ {
188
+ "pinId": "schematic_port_304",
189
+ "x": 7.34,
190
+ "y": 6,
191
+ "_facingDirection": "x-"
192
+ },
193
+ {
194
+ "pinId": "schematic_port_305",
195
+ "x": 8.66,
196
+ "y": 6,
197
+ "_facingDirection": "x+"
198
+ }
199
+ ],
200
+ "sectionId": "USB"
201
+ },
202
+ {
203
+ "chipId": "schematic_component_55",
204
+ "center": {
205
+ "x": 12,
206
+ "y": 1
207
+ },
208
+ "width": 0.9400000000000013,
209
+ "height": 0.718910699999999,
210
+ "pins": [
211
+ {
212
+ "pinId": "schematic_port_306",
213
+ "x": 11.53,
214
+ "y": 0.95,
215
+ "_facingDirection": "x-"
216
+ },
217
+ {
218
+ "pinId": "schematic_port_307",
219
+ "x": 12.47,
220
+ "y": 0.95,
221
+ "_facingDirection": "x+"
222
+ }
223
+ ],
224
+ "sectionId": "USB"
225
+ },
226
+ {
227
+ "chipId": "schematic_component_56",
228
+ "center": {
229
+ "x": 8,
230
+ "y": 0.9999999999999999
231
+ },
232
+ "width": 1.1999999999999993,
233
+ "height": 0.6799999999999999,
234
+ "pins": [
235
+ {
236
+ "pinId": "schematic_port_308",
237
+ "x": 7.4,
238
+ "y": 1,
239
+ "_facingDirection": "x-"
240
+ },
241
+ {
242
+ "pinId": "schematic_port_309",
243
+ "x": 8.6,
244
+ "y": 1,
245
+ "_facingDirection": "x+"
246
+ }
247
+ ],
248
+ "sectionId": "USB"
249
+ },
250
+ {
251
+ "chipId": "schematic_component_57",
252
+ "center": {
253
+ "x": 5.2524999999999995,
254
+ "y": 1
255
+ },
256
+ "width": 1.4050000000000002,
257
+ "height": 0.7599999999999998,
258
+ "pins": [
259
+ {
260
+ "pinId": "schematic_port_310",
261
+ "x": 5,
262
+ "y": 1.38,
263
+ "_facingDirection": "y+"
264
+ },
265
+ {
266
+ "pinId": "schematic_port_311",
267
+ "x": 5,
268
+ "y": 0.6200000000000001,
269
+ "_facingDirection": "y-"
270
+ }
271
+ ],
272
+ "sectionId": "USB"
273
+ },
274
+ {
275
+ "chipId": "schematic_component_58",
276
+ "center": {
277
+ "x": 1.8,
278
+ "y": -3
279
+ },
280
+ "width": 2.3749999999999996,
281
+ "height": 3.0000000000000004,
282
+ "pins": [
283
+ {
284
+ "pinId": "schematic_port_312",
285
+ "x": 2.9875,
286
+ "y": -1.4999999999999998
287
+ },
288
+ {
289
+ "pinId": "schematic_port_313",
290
+ "x": 2.9875,
291
+ "y": -1.7
292
+ },
293
+ {
294
+ "pinId": "schematic_port_314",
295
+ "x": 2.9875,
296
+ "y": -1.9000000000000001
297
+ },
298
+ {
299
+ "pinId": "schematic_port_315",
300
+ "x": 2.9875,
301
+ "y": -2.1000000000000005
302
+ },
303
+ {
304
+ "pinId": "schematic_port_316",
305
+ "x": 2.9875,
306
+ "y": -3.7
307
+ },
308
+ {
309
+ "pinId": "schematic_port_317",
310
+ "x": 2.9875,
311
+ "y": -3.1000000000000005
312
+ },
313
+ {
314
+ "pinId": "schematic_port_318",
315
+ "x": 2.9875,
316
+ "y": -2.9000000000000004
317
+ },
318
+ {
319
+ "pinId": "schematic_port_319",
320
+ "x": 2.9875,
321
+ "y": -2.3000000000000007
322
+ },
323
+ {
324
+ "pinId": "schematic_port_320",
325
+ "x": 2.9875,
326
+ "y": -2.7
327
+ },
328
+ {
329
+ "pinId": "schematic_port_321",
330
+ "x": 2.9875,
331
+ "y": -2.5000000000000004
332
+ },
333
+ {
334
+ "pinId": "schematic_port_322",
335
+ "x": 2.9875,
336
+ "y": -3.5
337
+ },
338
+ {
339
+ "pinId": "schematic_port_323",
340
+ "x": 2.9875,
341
+ "y": -3.3000000000000003
342
+ },
343
+ {
344
+ "pinId": "schematic_port_324",
345
+ "x": 2.9875,
346
+ "y": -3.9000000000000004
347
+ },
348
+ {
349
+ "pinId": "schematic_port_325",
350
+ "x": 2.9875,
351
+ "y": -4.1
352
+ },
353
+ {
354
+ "pinId": "schematic_port_326",
355
+ "x": 2.9875,
356
+ "y": -4.300000000000001
357
+ },
358
+ {
359
+ "pinId": "schematic_port_327",
360
+ "x": 2.9875,
361
+ "y": -4.5
362
+ }
363
+ ],
364
+ "sectionId": "USB"
365
+ },
366
+ {
367
+ "chipId": "schematic_component_59",
368
+ "center": {
369
+ "x": 2.2,
370
+ "y": -6.3
371
+ },
372
+ "width": 0.6000000000000001,
373
+ "height": 0.6799999999999997,
374
+ "pins": [
375
+ {
376
+ "pinId": "schematic_port_328",
377
+ "x": 1.9000000000000001,
378
+ "y": -6.3
379
+ },
380
+ {
381
+ "pinId": "schematic_port_329",
382
+ "x": 2.5,
383
+ "y": -6.3
384
+ }
385
+ ],
386
+ "sectionId": "USB"
387
+ },
388
+ {
389
+ "chipId": "schematic_component_60",
390
+ "center": {
391
+ "x": 4.8,
392
+ "y": -6.3
393
+ },
394
+ "width": 0.5999999999999996,
395
+ "height": 0.6799999999999997,
396
+ "pins": [
397
+ {
398
+ "pinId": "schematic_port_330",
399
+ "x": 4.5,
400
+ "y": -6.3,
401
+ "_facingDirection": "x-"
402
+ },
403
+ {
404
+ "pinId": "schematic_port_331",
405
+ "x": 5.1,
406
+ "y": -6.3,
407
+ "_facingDirection": "x+"
408
+ }
409
+ ],
410
+ "sectionId": "USB"
411
+ }
412
+ ],
413
+ "directConnections": [
414
+ {
415
+ "netId": ".J_USB > .pin7 to .U_ESD > .pin1",
416
+ "pinIds": [
417
+ "schematic_port_318",
418
+ "schematic_port_290"
419
+ ]
420
+ },
421
+ {
422
+ "netId": "USB_HS_DM_CONN",
423
+ "pinIds": [
424
+ "schematic_port_320",
425
+ "schematic_port_290"
426
+ ]
427
+ },
428
+ {
429
+ "netId": ".J_USB > .pin8 to .U_ESD > .pin3",
430
+ "pinIds": [
431
+ "schematic_port_319",
432
+ "schematic_port_292"
433
+ ]
434
+ },
435
+ {
436
+ "netId": "USB_HS_DP_CONN",
437
+ "pinIds": [
438
+ "schematic_port_321",
439
+ "schematic_port_292"
440
+ ]
441
+ },
442
+ {
443
+ "netId": "USB_HS_DM_POST_ESD",
444
+ "allowInlineNetLabel": true,
445
+ "inlineNetLabelWidth": 2.28,
446
+ "pinIds": [
447
+ "schematic_port_295",
448
+ "schematic_port_298"
449
+ ]
450
+ },
451
+ {
452
+ "netId": "USB_HS_DP_POST_ESD",
453
+ "allowInlineNetLabel": true,
454
+ "inlineNetLabelWidth": 2.28,
455
+ "pinIds": [
456
+ "schematic_port_293",
457
+ "schematic_port_296"
458
+ ]
459
+ },
460
+ {
461
+ "netId": "USB_HS_DM_MCU",
462
+ "allowInlineNetLabel": true,
463
+ "inlineNetLabelWidth": 1.68,
464
+ "pinIds": [
465
+ "schematic_port_299",
466
+ "schematic_port_40"
467
+ ]
468
+ },
469
+ {
470
+ "netId": "USB_HS_DP_MCU",
471
+ "allowInlineNetLabel": true,
472
+ "inlineNetLabelWidth": 1.68,
473
+ "pinIds": [
474
+ "schematic_port_297",
475
+ "schematic_port_41"
476
+ ]
477
+ },
478
+ {
479
+ "netId": ".R_BOOT_PU > .pin2 to .U_MCU > .pin66",
480
+ "netLabelWidth": 1.56,
481
+ "pinIds": [
482
+ "schematic_port_303",
483
+ "schematic_port_43"
484
+ ]
485
+ },
486
+ {
487
+ "netId": ".U_MCU > .pin66 to .SW_BOOT > .pin1",
488
+ "netLabelWidth": 1.56,
489
+ "pinIds": [
490
+ "schematic_port_43",
491
+ "schematic_port_300"
492
+ ]
493
+ },
494
+ {
495
+ "netId": ".R_GPIO36_PU > .pin2 to .U_MCU > .pin68",
496
+ "netLabelWidth": 1.56,
497
+ "pinIds": [
498
+ "schematic_port_305",
499
+ "schematic_port_44"
500
+ ]
501
+ },
502
+ {
503
+ "netId": ".C_RESET > .pin1 to .U_MCU > .pin103",
504
+ "netLabelWidth": 1.68,
505
+ "pinIds": [
506
+ "schematic_port_310",
507
+ "schematic_port_42"
508
+ ]
509
+ },
510
+ {
511
+ "netId": ".R_RESET_PU > .pin2 to .C_RESET > .pin1",
512
+ "netLabelWidth": 1.68,
513
+ "pinIds": [
514
+ "schematic_port_309",
515
+ "schematic_port_310"
516
+ ]
517
+ },
518
+ {
519
+ "netId": ".R_RESET_PU > .pin2 to .SW_RESET > .pin1",
520
+ "netLabelWidth": 1.68,
521
+ "pinIds": [
522
+ "schematic_port_309",
523
+ "schematic_port_306"
524
+ ]
525
+ },
526
+ {
527
+ "netId": ".J_USB > .pin2 to .J_USB > .pin1",
528
+ "pinIds": [
529
+ "schematic_port_313",
530
+ "schematic_port_312"
531
+ ]
532
+ },
533
+ {
534
+ "netId": ".J_USB > .pin6 to .R_CC1 > .pin1",
535
+ "netLabelWidth": 1.2,
536
+ "pinIds": [
537
+ "schematic_port_317",
538
+ "schematic_port_328"
539
+ ]
540
+ },
541
+ {
542
+ "netId": ".J_USB > .pin12 to .R_CC2 > .pin1",
543
+ "netLabelWidth": 1.2,
544
+ "pinIds": [
545
+ "schematic_port_323",
546
+ "schematic_port_330"
547
+ ]
548
+ }
549
+ ],
550
+ "netConnections": [
551
+ {
552
+ "netId": "GND",
553
+ "netLabelWidth": 0.42,
554
+ "netLabelHeight": 0.48,
555
+ "pinIds": [
556
+ "schematic_port_291",
557
+ "schematic_port_301",
558
+ "schematic_port_307",
559
+ "schematic_port_311",
560
+ "schematic_port_312",
561
+ "schematic_port_313",
562
+ "schematic_port_324",
563
+ "schematic_port_325",
564
+ "schematic_port_326",
565
+ "schematic_port_327"
566
+ ]
567
+ },
568
+ {
569
+ "netId": "V3V3",
570
+ "netLabelWidth": 0.42,
571
+ "netLabelHeight": 0.6,
572
+ "pinIds": [
573
+ "schematic_port_302",
574
+ "schematic_port_304",
575
+ "schematic_port_308"
576
+ ]
577
+ },
578
+ {
579
+ "netId": "VBUS",
580
+ "netLabelWidth": 0.42,
581
+ "netLabelHeight": 0.6,
582
+ "pinIds": [
583
+ "schematic_port_314",
584
+ "schematic_port_315"
585
+ ]
586
+ }
587
+ ],
588
+ "textBoxes": [
589
+ {
590
+ "chipId": "schematic_component_7",
591
+ "center": {
592
+ "x": 9.74,
593
+ "y": -2.5700000000000003
594
+ },
595
+ "width": 1.6799999999999997,
596
+ "height": 0.17999999999999972,
597
+ "text": "U_MCU_USB_BOOT"
598
+ },
599
+ {
600
+ "chipId": "schematic_component_7",
601
+ "center": {
602
+ "x": 9.74,
603
+ "y": -3.4299999999999997
604
+ },
605
+ "width": 1.6799999999999997,
606
+ "height": 0.17999999999999972,
607
+ "text": "ESP32_P4NRW32X"
608
+ },
609
+ {
610
+ "chipId": "schematic_component_49",
611
+ "center": {
612
+ "x": 5.109999999999999,
613
+ "y": -3.53
614
+ },
615
+ "width": 1.3200000000000003,
616
+ "height": 0.17999999999999972,
617
+ "text": "USBLC6_2SC6"
618
+ },
619
+ {
620
+ "chipId": "schematic_component_49",
621
+ "center": {
622
+ "x": 4.749999999999999,
623
+ "y": -2.4850000000000003
624
+ },
625
+ "width": 0.7199999999999989,
626
+ "height": 0.24999999999999956,
627
+ "text": "U_ESD"
628
+ },
629
+ {
630
+ "chipId": "schematic_component_58",
631
+ "center": {
632
+ "x": 1.8525,
633
+ "y": -4.43
634
+ },
635
+ "width": 1.6799999999999997,
636
+ "height": 0.17999999999999972,
637
+ "text": "TYPE-C-31-M-12"
638
+ },
639
+ {
640
+ "chipId": "schematic_component_58",
641
+ "center": {
642
+ "x": 1.3125000000000002,
643
+ "y": -1.585
644
+ },
645
+ "width": 0.7200000000000002,
646
+ "height": 0.2500000000000002,
647
+ "text": "J_USB"
648
+ }
649
+ ],
650
+ "availableNetLabelOrientations": {
651
+ "GND": [
652
+ "y-"
653
+ ],
654
+ "V3V3": [
655
+ "y+"
656
+ ],
657
+ "VBUS": [
658
+ "y+"
659
+ ]
660
+ },
661
+ "maxMspPairDistance": 2.4,
662
+ "_hideRatsNet": false
663
+ }
@@ -0,0 +1,16 @@
1
+ import { expect, test } from "bun:test"
2
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
3
+ import inputProblem from "./board1096-usb-label-overlap-iteration.json"
4
+ import "tests/fixtures/matcher"
5
+
6
+ test("board1096 USB section stops retrying failed merged-label overlaps", () => {
7
+ const solver = new SchematicTracePipelineSolver(inputProblem as any)
8
+
9
+ solver.solve()
10
+
11
+ expect(solver.solved).toBe(true)
12
+ expect(solver.failed).toBe(false)
13
+ expect(solver.error).toBe(null)
14
+ expect(solver.traceLabelOverlapAvoidanceSolver?.iterations).toBe(31)
15
+ expect(solver).toMatchSolverSnapshot(import.meta.path)
16
+ })
@@ -0,0 +1,10 @@
1
+ import { expect, test } from "bun:test"
2
+ import { SchematicTracePipelineSolver } from "../lib"
3
+
4
+ test("SchematicTracePipelineSolver has a stable solver name", () => {
5
+ const solver = Object.create(
6
+ SchematicTracePipelineSolver.prototype,
7
+ ) as SchematicTracePipelineSolver
8
+
9
+ expect(solver.getSolverName()).toBe("SchematicTracePipelineSolver")
10
+ })