@tscircuit/schematic-trace-solver 0.0.173 → 0.0.175
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/dist/index.d.ts +2 -0
- package/dist/index.js +200 -74
- package/lib/solvers/AvailableNetOrientationSolver/AvailableNetOrientationSolver.ts +12 -1
- package/lib/solvers/InlineNetLabelSolver/InlineNetLabelSolver.ts +16 -1
- package/lib/solvers/InlineNetLabelSolver/restoreReroutesAroundSupersededLabels.ts +174 -0
- package/lib/solvers/NetLabelToTraceSolver/NetLabelToTraceSolver.ts +2 -30
- package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +9 -0
- package/lib/utils/doesPathCoincideWithTraces.ts +17 -4
- package/lib/utils/pathIntersectsRenderedLabel.ts +33 -0
- package/package.json +1 -1
- package/site/bug-reports/bug-report-20260831T133233Z.page.tsx +4 -0
- package/site/bug-reports/bug-report-20260901T055358Z.page.tsx +4 -0
- package/site/bug-reports/bug-report-20260901T064117Z.page.tsx +4 -0
- package/site/bug-reports/bug-report-20260901T134241Z.page.tsx +4 -0
- package/tests/bug-reports/bug-report-20260721T221026Z/__snapshots__/bug-report-20260721T221026Z.snap.svg +18 -18
- package/tests/bug-reports/bug-report-20260831T133233Z/__snapshots__/bug-report-20260831T133233Z.snap.svg +85 -0
- package/tests/bug-reports/bug-report-20260831T133233Z/bug-report-20260831T133233Z.json +172 -0
- package/tests/bug-reports/bug-report-20260831T133233Z/bug-report-20260831T133233Z.test.ts +25 -0
- package/tests/bug-reports/bug-report-20260901T055358Z/__snapshots__/bug-report-20260901T055358Z.snap.svg +676 -0
- package/tests/bug-reports/bug-report-20260901T055358Z/bug-report-20260901T055358Z.json +2467 -0
- package/tests/bug-reports/bug-report-20260901T055358Z/bug-report-20260901T055358Z.test.ts +59 -0
- package/tests/bug-reports/bug-report-20260901T064117Z/__snapshots__/bug-report-20260901T064117Z.snap.svg +134 -0
- package/tests/bug-reports/bug-report-20260901T064117Z/bug-report-20260901T064117Z.json +215 -0
- package/tests/bug-reports/bug-report-20260901T064117Z/bug-report-20260901T064117Z.test.ts +12 -0
- package/tests/bug-reports/bug-report-20260901T134241Z/__snapshots__/bug-report-20260901T134241Z.snap.svg +115 -0
- package/tests/bug-reports/bug-report-20260901T134241Z/bug-report-20260901T134241Z.json +359 -0
- package/tests/bug-reports/bug-report-20260901T134241Z/bug-report-20260901T134241Z.test.ts +12 -0
- package/tests/repros/__snapshots__/repro-bq40z60-current-sense.snap.svg +94 -0
- package/tests/repros/__snapshots__/repro-pmp11282-isolated-dcdc.snap.svg +10 -10
- package/tests/repros/__snapshots__/repro-ti-power-output-section.snap.svg +87 -87
- package/tests/repros/__snapshots__/repro-tida-01389-hbridge.snap.svg +47 -153
- package/tests/repros/__snapshots__/repro-tida010076-page02.snap.svg +1625 -1625
- package/tests/repros/__snapshots__/repro-trellis-core-gnd-net-label-overlap.snap.svg +134 -0
- package/tests/repros/__snapshots__/repro-wireless-mouse-charger-section.snap.svg +164 -0
- package/tests/repros/assets/repro-bq40z60-current-sense.input.json +158 -0
- package/tests/repros/assets/repro-tida-01389-hbridge.input.json +67 -657
- package/tests/repros/assets/repro-trellis-core-gnd-net-label-overlap.input.json +178 -0
- package/tests/repros/assets/repro-wireless-mouse-charger-section.input.json +591 -0
- package/tests/repros/repro-bq40z60-current-sense.test.ts +18 -0
- package/tests/repros/repro-tida-01389-hbridge.test.ts +27 -6
- package/tests/repros/repro-trellis-core-gnd-net-label-overlap.test.ts +73 -0
- package/tests/repros/repro-wireless-mouse-charger-section.test.ts +16 -0
- package/tests/solvers/InlineNetLabelSolver/restore-reroutes-around-superseded-labels.test.ts +186 -0
|
@@ -0,0 +1,591 @@
|
|
|
1
|
+
{
|
|
2
|
+
"chips": [
|
|
3
|
+
{
|
|
4
|
+
"chipId": "schematic_component_0",
|
|
5
|
+
"center": {
|
|
6
|
+
"x": -39,
|
|
7
|
+
"y": 0
|
|
8
|
+
},
|
|
9
|
+
"width": 2.760000000000005,
|
|
10
|
+
"height": 0.6,
|
|
11
|
+
"pins": [
|
|
12
|
+
{
|
|
13
|
+
"pinId": "schematic_port_0",
|
|
14
|
+
"displayName": "STAT",
|
|
15
|
+
"x": -37.62,
|
|
16
|
+
"y": -0.1
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"pinId": "schematic_port_1",
|
|
20
|
+
"displayName": "VSS",
|
|
21
|
+
"x": -40.38,
|
|
22
|
+
"y": 0
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"pinId": "schematic_port_2",
|
|
26
|
+
"displayName": "VBAT",
|
|
27
|
+
"x": -37.62,
|
|
28
|
+
"y": 0.1
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"pinId": "schematic_port_3",
|
|
32
|
+
"displayName": "VDD",
|
|
33
|
+
"x": -40.38,
|
|
34
|
+
"y": 0.2
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"pinId": "schematic_port_4",
|
|
38
|
+
"displayName": "PROG",
|
|
39
|
+
"x": -40.38,
|
|
40
|
+
"y": -0.2
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"sectionId": "UsbCharging"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"chipId": "schematic_component_1",
|
|
47
|
+
"center": {
|
|
48
|
+
"x": -39,
|
|
49
|
+
"y": -4
|
|
50
|
+
},
|
|
51
|
+
"width": 1.5600000000000023,
|
|
52
|
+
"height": 0.6800000000000002,
|
|
53
|
+
"pins": [
|
|
54
|
+
{
|
|
55
|
+
"pinId": "schematic_port_5",
|
|
56
|
+
"displayName": "anode",
|
|
57
|
+
"x": -39.78,
|
|
58
|
+
"y": -4,
|
|
59
|
+
"_facingDirection": "x-"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"pinId": "schematic_port_6",
|
|
63
|
+
"displayName": "cathode",
|
|
64
|
+
"x": -38.22,
|
|
65
|
+
"y": -4,
|
|
66
|
+
"_facingDirection": "x+"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"sectionId": "UsbCharging"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"chipId": "schematic_component_2",
|
|
73
|
+
"center": {
|
|
74
|
+
"x": -33.447500000000005,
|
|
75
|
+
"y": -3
|
|
76
|
+
},
|
|
77
|
+
"width": 2.0050000000000026,
|
|
78
|
+
"height": 0.7600000000000007,
|
|
79
|
+
"pins": [
|
|
80
|
+
{
|
|
81
|
+
"pinId": "schematic_port_7",
|
|
82
|
+
"displayName": "1",
|
|
83
|
+
"x": -34,
|
|
84
|
+
"y": -2.6199999999999997,
|
|
85
|
+
"_facingDirection": "y+"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"pinId": "schematic_port_8",
|
|
89
|
+
"displayName": "2",
|
|
90
|
+
"x": -34,
|
|
91
|
+
"y": -3.3800000000000003,
|
|
92
|
+
"_facingDirection": "y-"
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"sectionId": "UsbCharging"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"chipId": "schematic_component_3",
|
|
99
|
+
"center": {
|
|
100
|
+
"x": -35.04,
|
|
101
|
+
"y": 3
|
|
102
|
+
},
|
|
103
|
+
"width": 1.4399999999999977,
|
|
104
|
+
"height": 0.6800000000000006,
|
|
105
|
+
"pins": [
|
|
106
|
+
{
|
|
107
|
+
"pinId": "schematic_port_9",
|
|
108
|
+
"displayName": "anode",
|
|
109
|
+
"x": -35.76,
|
|
110
|
+
"y": 3,
|
|
111
|
+
"_facingDirection": "x-"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"pinId": "schematic_port_10",
|
|
115
|
+
"displayName": "cathode",
|
|
116
|
+
"x": -34.32,
|
|
117
|
+
"y": 3,
|
|
118
|
+
"_facingDirection": "x+"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"sectionId": "UsbCharging"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"chipId": "schematic_component_4",
|
|
125
|
+
"center": {
|
|
126
|
+
"x": -28.96,
|
|
127
|
+
"y": 3
|
|
128
|
+
},
|
|
129
|
+
"width": 1.2000000000000028,
|
|
130
|
+
"height": 1.1800000000000006,
|
|
131
|
+
"pins": [
|
|
132
|
+
{
|
|
133
|
+
"pinId": "schematic_port_11",
|
|
134
|
+
"displayName": "anode",
|
|
135
|
+
"x": -29.560000000000002,
|
|
136
|
+
"y": 3,
|
|
137
|
+
"_facingDirection": "x-"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"pinId": "schematic_port_12",
|
|
141
|
+
"displayName": "cathode",
|
|
142
|
+
"x": -28.36,
|
|
143
|
+
"y": 3,
|
|
144
|
+
"_facingDirection": "x+"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"sectionId": "UsbCharging"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"chipId": "schematic_component_5",
|
|
151
|
+
"center": {
|
|
152
|
+
"x": -27,
|
|
153
|
+
"y": 0
|
|
154
|
+
},
|
|
155
|
+
"width": 2,
|
|
156
|
+
"height": 0.6,
|
|
157
|
+
"pins": [
|
|
158
|
+
{
|
|
159
|
+
"pinId": "schematic_port_13",
|
|
160
|
+
"displayName": "1",
|
|
161
|
+
"x": -28,
|
|
162
|
+
"y": 0.1
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"pinId": "schematic_port_14",
|
|
166
|
+
"displayName": "2",
|
|
167
|
+
"x": -28,
|
|
168
|
+
"y": -0.1
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"pinId": "schematic_port_15",
|
|
172
|
+
"displayName": "3",
|
|
173
|
+
"x": -26,
|
|
174
|
+
"y": -0.1
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"pinId": "schematic_port_16",
|
|
178
|
+
"displayName": "4",
|
|
179
|
+
"x": -26,
|
|
180
|
+
"y": 0.1
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"sectionId": "BatteryPower"
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
"directConnections": [
|
|
187
|
+
{
|
|
188
|
+
"netId": ".U_CHARGER > .PROG to .R_CHARGE_PROG > .pin1",
|
|
189
|
+
"netLabelWidth": 1.8,
|
|
190
|
+
"pinIds": [
|
|
191
|
+
"schematic_port_4",
|
|
192
|
+
"schematic_port_5"
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"netId": ".R_CHARGE_LED > .pin2 to .LED_CHARGE > .anode",
|
|
197
|
+
"netLabelWidth": 1.92,
|
|
198
|
+
"pinIds": [
|
|
199
|
+
"schematic_port_10",
|
|
200
|
+
"schematic_port_11"
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"netId": ".LED_CHARGE > .cathode to .U_CHARGER > .STAT",
|
|
205
|
+
"netLabelWidth": 1.8,
|
|
206
|
+
"pinIds": [
|
|
207
|
+
"schematic_port_12",
|
|
208
|
+
"schematic_port_0"
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
"netConnections": [
|
|
213
|
+
{
|
|
214
|
+
"netId": "GND",
|
|
215
|
+
"isGround": true,
|
|
216
|
+
"netLabelWidth": 0.42,
|
|
217
|
+
"netLabelHeight": 0.48,
|
|
218
|
+
"pinIds": [
|
|
219
|
+
"schematic_port_1",
|
|
220
|
+
"schematic_port_6",
|
|
221
|
+
"schematic_port_8",
|
|
222
|
+
"schematic_port_14"
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"netId": "VBAT",
|
|
227
|
+
"isGround": false,
|
|
228
|
+
"netLabelWidth": 0.42,
|
|
229
|
+
"netLabelHeight": 0.6,
|
|
230
|
+
"pinIds": [
|
|
231
|
+
"schematic_port_2",
|
|
232
|
+
"schematic_port_7",
|
|
233
|
+
"schematic_port_13"
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"netId": "VBUS_USB",
|
|
238
|
+
"isGround": false,
|
|
239
|
+
"netLabelWidth": 0.42,
|
|
240
|
+
"netLabelHeight": 1.08,
|
|
241
|
+
"pinIds": [
|
|
242
|
+
"schematic_port_3",
|
|
243
|
+
"schematic_port_9"
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
],
|
|
247
|
+
"textBoxes": [
|
|
248
|
+
{
|
|
249
|
+
"chipId": "schematic_component_0",
|
|
250
|
+
"center": {
|
|
251
|
+
"x": -38.959999999999994,
|
|
252
|
+
"y": -0.43
|
|
253
|
+
},
|
|
254
|
+
"width": 2.039999999999999,
|
|
255
|
+
"height": 0.18000000000000005,
|
|
256
|
+
"text": "MCP73831T-2ACI/OT"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"chipId": "schematic_component_0",
|
|
260
|
+
"center": {
|
|
261
|
+
"x": -39.44,
|
|
262
|
+
"y": 0.41500000000000004
|
|
263
|
+
},
|
|
264
|
+
"width": 1.2000000000000028,
|
|
265
|
+
"height": 0.25000000000000006,
|
|
266
|
+
"text": "U_CHARGER"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"chipId": "schematic_component_5",
|
|
270
|
+
"center": {
|
|
271
|
+
"x": -26.340000000000003,
|
|
272
|
+
"y": -0.43
|
|
273
|
+
},
|
|
274
|
+
"width": 2.5199999999999996,
|
|
275
|
+
"height": 0.18000000000000005,
|
|
276
|
+
"text": "S2B-PH-SM4-TB(LF)(SN)"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"chipId": "schematic_component_5",
|
|
280
|
+
"center": {
|
|
281
|
+
"x": -26.700000000000003,
|
|
282
|
+
"y": 0.41500000000000004
|
|
283
|
+
},
|
|
284
|
+
"width": 1.9199999999999982,
|
|
285
|
+
"height": 0.25000000000000006,
|
|
286
|
+
"text": "J_BAT_PROTECTED"
|
|
287
|
+
}
|
|
288
|
+
],
|
|
289
|
+
"availableNetLabelOrientations": {
|
|
290
|
+
"VBUS_USB": [
|
|
291
|
+
"y+"
|
|
292
|
+
],
|
|
293
|
+
"GND": [
|
|
294
|
+
"y-"
|
|
295
|
+
],
|
|
296
|
+
"VBAT": [
|
|
297
|
+
"y+"
|
|
298
|
+
]
|
|
299
|
+
},
|
|
300
|
+
"maxMspPairDistance": 2.4,
|
|
301
|
+
"_chipObstacleSpatialIndex": {
|
|
302
|
+
"chips": [
|
|
303
|
+
{
|
|
304
|
+
"chipId": "schematic_component_0",
|
|
305
|
+
"center": {
|
|
306
|
+
"x": -39,
|
|
307
|
+
"y": 0
|
|
308
|
+
},
|
|
309
|
+
"width": 2.760000000000005,
|
|
310
|
+
"height": 0.6,
|
|
311
|
+
"pins": [
|
|
312
|
+
{
|
|
313
|
+
"pinId": "schematic_port_0",
|
|
314
|
+
"displayName": "STAT",
|
|
315
|
+
"x": -37.62,
|
|
316
|
+
"y": -0.1
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"pinId": "schematic_port_1",
|
|
320
|
+
"displayName": "VSS",
|
|
321
|
+
"x": -40.38,
|
|
322
|
+
"y": 0
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"pinId": "schematic_port_2",
|
|
326
|
+
"displayName": "VBAT",
|
|
327
|
+
"x": -37.62,
|
|
328
|
+
"y": 0.1
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"pinId": "schematic_port_3",
|
|
332
|
+
"displayName": "VDD",
|
|
333
|
+
"x": -40.38,
|
|
334
|
+
"y": 0.2
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"pinId": "schematic_port_4",
|
|
338
|
+
"displayName": "PROG",
|
|
339
|
+
"x": -40.38,
|
|
340
|
+
"y": -0.2
|
|
341
|
+
}
|
|
342
|
+
],
|
|
343
|
+
"sectionId": "UsbCharging",
|
|
344
|
+
"bounds": {
|
|
345
|
+
"minX": -40.38,
|
|
346
|
+
"maxX": -37.62,
|
|
347
|
+
"minY": -0.3,
|
|
348
|
+
"maxY": 0.3
|
|
349
|
+
},
|
|
350
|
+
"spatialIndexId": 0
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"chipId": "schematic_component_1",
|
|
354
|
+
"center": {
|
|
355
|
+
"x": -39,
|
|
356
|
+
"y": -4
|
|
357
|
+
},
|
|
358
|
+
"width": 1.5600000000000023,
|
|
359
|
+
"height": 0.6800000000000002,
|
|
360
|
+
"pins": [
|
|
361
|
+
{
|
|
362
|
+
"pinId": "schematic_port_5",
|
|
363
|
+
"displayName": "anode",
|
|
364
|
+
"x": -39.78,
|
|
365
|
+
"y": -4,
|
|
366
|
+
"_facingDirection": "x-"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"pinId": "schematic_port_6",
|
|
370
|
+
"displayName": "cathode",
|
|
371
|
+
"x": -38.22,
|
|
372
|
+
"y": -4,
|
|
373
|
+
"_facingDirection": "x+"
|
|
374
|
+
}
|
|
375
|
+
],
|
|
376
|
+
"sectionId": "UsbCharging",
|
|
377
|
+
"bounds": {
|
|
378
|
+
"minX": -39.78,
|
|
379
|
+
"maxX": -38.22,
|
|
380
|
+
"minY": -4.34,
|
|
381
|
+
"maxY": -3.66
|
|
382
|
+
},
|
|
383
|
+
"spatialIndexId": 1
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"chipId": "schematic_component_2",
|
|
387
|
+
"center": {
|
|
388
|
+
"x": -33.447500000000005,
|
|
389
|
+
"y": -3
|
|
390
|
+
},
|
|
391
|
+
"width": 2.0050000000000026,
|
|
392
|
+
"height": 0.7600000000000007,
|
|
393
|
+
"pins": [
|
|
394
|
+
{
|
|
395
|
+
"pinId": "schematic_port_7",
|
|
396
|
+
"displayName": "1",
|
|
397
|
+
"x": -34,
|
|
398
|
+
"y": -2.6199999999999997,
|
|
399
|
+
"_facingDirection": "y+"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"pinId": "schematic_port_8",
|
|
403
|
+
"displayName": "2",
|
|
404
|
+
"x": -34,
|
|
405
|
+
"y": -3.3800000000000003,
|
|
406
|
+
"_facingDirection": "y-"
|
|
407
|
+
}
|
|
408
|
+
],
|
|
409
|
+
"sectionId": "UsbCharging",
|
|
410
|
+
"bounds": {
|
|
411
|
+
"minX": -34.45,
|
|
412
|
+
"maxX": -32.44500000000001,
|
|
413
|
+
"minY": -3.3800000000000003,
|
|
414
|
+
"maxY": -2.6199999999999997
|
|
415
|
+
},
|
|
416
|
+
"spatialIndexId": 2
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"chipId": "schematic_component_3",
|
|
420
|
+
"center": {
|
|
421
|
+
"x": -35.04,
|
|
422
|
+
"y": 3
|
|
423
|
+
},
|
|
424
|
+
"width": 1.4399999999999977,
|
|
425
|
+
"height": 0.6800000000000006,
|
|
426
|
+
"pins": [
|
|
427
|
+
{
|
|
428
|
+
"pinId": "schematic_port_9",
|
|
429
|
+
"displayName": "anode",
|
|
430
|
+
"x": -35.76,
|
|
431
|
+
"y": 3,
|
|
432
|
+
"_facingDirection": "x-"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"pinId": "schematic_port_10",
|
|
436
|
+
"displayName": "cathode",
|
|
437
|
+
"x": -34.32,
|
|
438
|
+
"y": 3,
|
|
439
|
+
"_facingDirection": "x+"
|
|
440
|
+
}
|
|
441
|
+
],
|
|
442
|
+
"sectionId": "UsbCharging",
|
|
443
|
+
"bounds": {
|
|
444
|
+
"minX": -35.76,
|
|
445
|
+
"maxX": -34.32,
|
|
446
|
+
"minY": 2.6599999999999997,
|
|
447
|
+
"maxY": 3.3400000000000003
|
|
448
|
+
},
|
|
449
|
+
"spatialIndexId": 3
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"chipId": "schematic_component_4",
|
|
453
|
+
"center": {
|
|
454
|
+
"x": -28.96,
|
|
455
|
+
"y": 3
|
|
456
|
+
},
|
|
457
|
+
"width": 1.2000000000000028,
|
|
458
|
+
"height": 1.1800000000000006,
|
|
459
|
+
"pins": [
|
|
460
|
+
{
|
|
461
|
+
"pinId": "schematic_port_11",
|
|
462
|
+
"displayName": "anode",
|
|
463
|
+
"x": -29.560000000000002,
|
|
464
|
+
"y": 3,
|
|
465
|
+
"_facingDirection": "x-"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"pinId": "schematic_port_12",
|
|
469
|
+
"displayName": "cathode",
|
|
470
|
+
"x": -28.36,
|
|
471
|
+
"y": 3,
|
|
472
|
+
"_facingDirection": "x+"
|
|
473
|
+
}
|
|
474
|
+
],
|
|
475
|
+
"sectionId": "UsbCharging",
|
|
476
|
+
"bounds": {
|
|
477
|
+
"minX": -29.560000000000002,
|
|
478
|
+
"maxX": -28.36,
|
|
479
|
+
"minY": 2.4099999999999997,
|
|
480
|
+
"maxY": 3.5900000000000003
|
|
481
|
+
},
|
|
482
|
+
"spatialIndexId": 4
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"chipId": "schematic_component_5",
|
|
486
|
+
"center": {
|
|
487
|
+
"x": -27,
|
|
488
|
+
"y": 0
|
|
489
|
+
},
|
|
490
|
+
"width": 2,
|
|
491
|
+
"height": 0.6,
|
|
492
|
+
"pins": [
|
|
493
|
+
{
|
|
494
|
+
"pinId": "schematic_port_13",
|
|
495
|
+
"displayName": "1",
|
|
496
|
+
"x": -28,
|
|
497
|
+
"y": 0.1
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"pinId": "schematic_port_14",
|
|
501
|
+
"displayName": "2",
|
|
502
|
+
"x": -28,
|
|
503
|
+
"y": -0.1
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"pinId": "schematic_port_15",
|
|
507
|
+
"displayName": "3",
|
|
508
|
+
"x": -26,
|
|
509
|
+
"y": -0.1
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
"pinId": "schematic_port_16",
|
|
513
|
+
"displayName": "4",
|
|
514
|
+
"x": -26,
|
|
515
|
+
"y": 0.1
|
|
516
|
+
}
|
|
517
|
+
],
|
|
518
|
+
"sectionId": "BatteryPower",
|
|
519
|
+
"bounds": {
|
|
520
|
+
"minX": -28,
|
|
521
|
+
"maxX": -26,
|
|
522
|
+
"minY": -0.3,
|
|
523
|
+
"maxY": 0.3
|
|
524
|
+
},
|
|
525
|
+
"spatialIndexId": 5
|
|
526
|
+
}
|
|
527
|
+
],
|
|
528
|
+
"spatialIndex": {
|
|
529
|
+
"numItems": 6,
|
|
530
|
+
"nodeSize": 16,
|
|
531
|
+
"byteOffset": 0,
|
|
532
|
+
"_levelBounds": [
|
|
533
|
+
24,
|
|
534
|
+
28
|
|
535
|
+
],
|
|
536
|
+
"data": {},
|
|
537
|
+
"_boxes": {
|
|
538
|
+
"0": -40.38,
|
|
539
|
+
"1": -0.3,
|
|
540
|
+
"2": -37.62,
|
|
541
|
+
"3": 0.3,
|
|
542
|
+
"4": -39.78,
|
|
543
|
+
"5": -4.34,
|
|
544
|
+
"6": -38.22,
|
|
545
|
+
"7": -3.66,
|
|
546
|
+
"8": -34.45,
|
|
547
|
+
"9": -3.3800000000000003,
|
|
548
|
+
"10": -32.44500000000001,
|
|
549
|
+
"11": -2.6199999999999997,
|
|
550
|
+
"12": -35.76,
|
|
551
|
+
"13": 2.6599999999999997,
|
|
552
|
+
"14": -34.32,
|
|
553
|
+
"15": 3.3400000000000003,
|
|
554
|
+
"16": -29.560000000000002,
|
|
555
|
+
"17": 2.4099999999999997,
|
|
556
|
+
"18": -28.36,
|
|
557
|
+
"19": 3.5900000000000003,
|
|
558
|
+
"20": -28,
|
|
559
|
+
"21": -0.3,
|
|
560
|
+
"22": -26,
|
|
561
|
+
"23": 0.3,
|
|
562
|
+
"24": -40.38,
|
|
563
|
+
"25": -4.34,
|
|
564
|
+
"26": -26,
|
|
565
|
+
"27": 3.5900000000000003
|
|
566
|
+
},
|
|
567
|
+
"_indices": {
|
|
568
|
+
"0": 0,
|
|
569
|
+
"1": 1,
|
|
570
|
+
"2": 2,
|
|
571
|
+
"3": 3,
|
|
572
|
+
"4": 4,
|
|
573
|
+
"5": 5,
|
|
574
|
+
"6": 0
|
|
575
|
+
},
|
|
576
|
+
"_pos": 28,
|
|
577
|
+
"minX": -40.38,
|
|
578
|
+
"minY": -4.34,
|
|
579
|
+
"maxX": -26,
|
|
580
|
+
"maxY": 3.5900000000000003,
|
|
581
|
+
"_queue": {
|
|
582
|
+
"ids": [],
|
|
583
|
+
"values": [],
|
|
584
|
+
"capacity": null,
|
|
585
|
+
"length": 0
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
"spatialIndexIdToChip": {}
|
|
589
|
+
},
|
|
590
|
+
"_hideRatsNet": false
|
|
591
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { expect, test } from "bun:test"
|
|
2
|
+
import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
|
|
3
|
+
import type { InputProblem } from "lib/types/InputProblem"
|
|
4
|
+
import "tests/fixtures/matcher"
|
|
5
|
+
import inputProblem from "./assets/repro-bq40z60-current-sense.input.json"
|
|
6
|
+
|
|
7
|
+
// Minimal input derived from @tsci/tscircuit.ti's
|
|
8
|
+
// BatteryManagement_2to4Cell_BQ40Z60 subcircuit. It isolates the bottom-left
|
|
9
|
+
// R38/R43/R44 and C26/C36 current-sense section.
|
|
10
|
+
test("repro BQ40Z60 current-sense schematic traces", () => {
|
|
11
|
+
const solver = new SchematicTracePipelineSolver(
|
|
12
|
+
inputProblem as unknown as InputProblem,
|
|
13
|
+
{ hideRatsNet: true },
|
|
14
|
+
)
|
|
15
|
+
solver.solve()
|
|
16
|
+
|
|
17
|
+
expect(solver).toMatchSolverSnapshot(import.meta.path)
|
|
18
|
+
})
|
|
@@ -4,12 +4,12 @@ import type { InputProblem } from "lib/types/InputProblem"
|
|
|
4
4
|
import "tests/fixtures/matcher"
|
|
5
5
|
import inputProblem from "./assets/repro-tida-01389-hbridge.input.json"
|
|
6
6
|
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
test("repro:
|
|
10
|
-
expect(inputProblem.chips).toHaveLength(
|
|
11
|
-
expect(inputProblem.directConnections).toHaveLength(
|
|
12
|
-
expect(inputProblem.netConnections).toHaveLength(
|
|
7
|
+
// Reduced from the TIDA-01389 H-bridge in tscircuit/ti#116. It retains only
|
|
8
|
+
// the four components on the enclosing loop and the two nested capacitors.
|
|
9
|
+
test("repro: enclosing rectangle collapses into two smaller loops", () => {
|
|
10
|
+
expect(inputProblem.chips).toHaveLength(6)
|
|
11
|
+
expect(inputProblem.directConnections).toHaveLength(8)
|
|
12
|
+
expect(inputProblem.netConnections).toHaveLength(0)
|
|
13
13
|
|
|
14
14
|
const solver = new SchematicTracePipelineSolver(
|
|
15
15
|
inputProblem as unknown as InputProblem,
|
|
@@ -18,6 +18,27 @@ test("repro: TIDA-01389 H-bridge traces float above MOSFET ports", () => {
|
|
|
18
18
|
|
|
19
19
|
solver.solve()
|
|
20
20
|
|
|
21
|
+
const pairKeys = new Set(
|
|
22
|
+
solver.mspConnectionPairSolver!.mspConnectionPairs.map((pair) =>
|
|
23
|
+
pair.pins
|
|
24
|
+
.map((pin) => pin.pinId)
|
|
25
|
+
.sort()
|
|
26
|
+
.join("::"),
|
|
27
|
+
),
|
|
28
|
+
)
|
|
29
|
+
expect(
|
|
30
|
+
pairKeys.has("schematic_port_q1a_drain::schematic_port_q1b_source"),
|
|
31
|
+
).toBe(false)
|
|
32
|
+
expect(
|
|
33
|
+
pairKeys.has("schematic_port_q2a_source::schematic_port_q2b_drain"),
|
|
34
|
+
).toBe(false)
|
|
35
|
+
expect(pairKeys.has("schematic_port_c18_1::schematic_port_q1a_drain")).toBe(
|
|
36
|
+
true,
|
|
37
|
+
)
|
|
38
|
+
expect(pairKeys.has("schematic_port_c18_2::schematic_port_q2b_drain")).toBe(
|
|
39
|
+
true,
|
|
40
|
+
)
|
|
41
|
+
|
|
21
42
|
expect(solver.solved).toBe(true)
|
|
22
43
|
expect(solver).toMatchSolverSnapshot(import.meta.path)
|
|
23
44
|
})
|