@vessel-dsp/compiler 0.19.0 → 0.21.0

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.
Files changed (56) hide show
  1. package/dist/compile.d.ts +16 -0
  2. package/dist/compile.d.ts.map +1 -1
  3. package/dist/compile.js +53 -2
  4. package/dist/compile.js.map +1 -1
  5. package/dist/device-laws.d.ts +48 -1
  6. package/dist/device-laws.d.ts.map +1 -1
  7. package/dist/device-laws.js +205 -4
  8. package/dist/device-laws.js.map +1 -1
  9. package/dist/fixtures/circuits.d.ts +18 -0
  10. package/dist/fixtures/circuits.d.ts.map +1 -1
  11. package/dist/fixtures/circuits.js +423 -0
  12. package/dist/fixtures/circuits.js.map +1 -1
  13. package/dist/index.d.ts +2 -2
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +1 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/netlist.d.ts.map +1 -1
  18. package/dist/netlist.js +65 -0
  19. package/dist/netlist.js.map +1 -1
  20. package/dist/part-catalog.d.ts.map +1 -1
  21. package/dist/part-catalog.js +4 -0
  22. package/dist/part-catalog.js.map +1 -1
  23. package/dist/registry-data/bjt.d.ts.map +1 -1
  24. package/dist/registry-data/bjt.js +1422 -21
  25. package/dist/registry-data/bjt.js.map +1 -1
  26. package/dist/registry-data/diode.d.ts.map +1 -1
  27. package/dist/registry-data/diode.js +293 -0
  28. package/dist/registry-data/diode.js.map +1 -1
  29. package/dist/registry-data/index.d.ts +1 -1
  30. package/dist/registry-data/index.d.ts.map +1 -1
  31. package/dist/registry-data/index.js.map +1 -1
  32. package/dist/registry-data/jfet.d.ts.map +1 -1
  33. package/dist/registry-data/jfet.js +79 -0
  34. package/dist/registry-data/jfet.js.map +1 -1
  35. package/dist/registry-data/led.d.ts.map +1 -1
  36. package/dist/registry-data/led.js +16 -0
  37. package/dist/registry-data/led.js.map +1 -1
  38. package/dist/registry-data/loader.d.ts +19 -1
  39. package/dist/registry-data/loader.d.ts.map +1 -1
  40. package/dist/registry-data/loader.js +32 -1
  41. package/dist/registry-data/loader.js.map +1 -1
  42. package/dist/registry-data/mosfet.d.ts.map +1 -1
  43. package/dist/registry-data/mosfet.js +12 -0
  44. package/dist/registry-data/mosfet.js.map +1 -1
  45. package/dist/registry-data/schema.d.ts +13 -0
  46. package/dist/registry-data/schema.d.ts.map +1 -1
  47. package/dist/registry-data/schema.js.map +1 -1
  48. package/dist/registry-data/zener.d.ts.map +1 -1
  49. package/dist/registry-data/zener.js +68 -0
  50. package/dist/registry-data/zener.js.map +1 -1
  51. package/dist/registry.d.ts +9 -0
  52. package/dist/registry.d.ts.map +1 -1
  53. package/dist/registry.js.map +1 -1
  54. package/dist/types.d.ts +31 -2
  55. package/dist/types.d.ts.map +1 -1
  56. package/package.json +2 -2
@@ -139,6 +139,63 @@ ${jacks} - id: R1
139
139
  Description: "Clock driver support, not a signal element."
140
140
  wires: []
141
141
  `;
142
+ /**
143
+ * A divider with an NTC thermistor as the top arm: the Fuzz Face bias network in
144
+ * miniature (a thermistor in the collector return against a fixed lower arm).
145
+ * R_ref 10k at 25 C, Beta 3950 K: at 25 C it divides exactly like
146
+ * `resistorDivider` (gain 0.5); at 19 C the top arm is 13127.01 ohms and the gain
147
+ * is 0.43239483. The closed forms are asserted in `thermistor.test.ts`.
148
+ */
149
+ export const thermistorDivider = `${header("Thermistor Divider Fixture")}components:
150
+ ${jacks} - id: RT1
151
+ kind: thermistor
152
+ name: NTC_DISC
153
+ sourceTypeName: Circuit.Thermistor
154
+ origin:
155
+ x: -100
156
+ y: 0
157
+ rotation: 0
158
+ flipped: false
159
+ terminals:
160
+ - name: a
161
+ node: 1
162
+ position:
163
+ x: -100
164
+ y: -20
165
+ - name: b
166
+ node: 2
167
+ position:
168
+ x: -100
169
+ y: 20
170
+ properties:
171
+ Resistance: "10k"
172
+ Beta: "3950"
173
+ Description: "NTC bias disc, 10k at 25 C."
174
+ - id: R2
175
+ kind: resistor
176
+ name: LOWER_ARM
177
+ sourceTypeName: Circuit.Resistor
178
+ origin:
179
+ x: 100
180
+ y: 0
181
+ rotation: 0
182
+ flipped: false
183
+ terminals:
184
+ - name: a
185
+ node: 2
186
+ position:
187
+ x: 100
188
+ y: -20
189
+ - name: b
190
+ node: 0
191
+ position:
192
+ x: 100
193
+ y: 20
194
+ properties:
195
+ Resistance: "10k"
196
+ Description: "Fixed lower arm."
197
+ wires: []
198
+ `;
142
199
  /**
143
200
  * The same divider with one inline terminal node contradicting the declared ledger.
144
201
  *
@@ -146,6 +203,372 @@ wires: []
146
203
  * the output jack. Stage 1 should follow the ledger and still warn that the document is
147
204
  * inconsistent with itself.
148
205
  */
206
+ /**
207
+ * Two PNP germanium gain stages with an NTC thermistor in Q1's collector return:
208
+ * the Fuzz Face bias network in miniature (33k NTC disc RT1 against a fixed lower
209
+ * arm is `thermistorDivider`; here the disc sets a biased stage's operating point).
210
+ * Q1/Q2 are registry AC128 germanium PNPs, so the temperature fold runs EG 0.67;
211
+ * RT1 is R_ref 33k at 25 C, Beta 3950 K: 43319.14 ohms at 19 C, 33000.00 at 25 C.
212
+ * The closed forms and the ngspice parity at both temperatures are asserted in
213
+ * `tests/temperature-parity.test.ts`; the stamp folds in `thermistor.test.ts`.
214
+ */
215
+ export const thermalFuzzFacePair = `${header("Thermal Fuzz Face Pair Fixture")}components:
216
+ - id: JIN
217
+ kind: jack
218
+ name: INPUT
219
+ sourceTypeName: Circuit.Input
220
+ origin:
221
+ x: -200
222
+ y: 0
223
+ rotation: 0
224
+ flipped: false
225
+ terminals:
226
+ - name: tip
227
+ node: 1
228
+ position:
229
+ x: -200
230
+ y: 0
231
+ - id: JOUT
232
+ kind: jack
233
+ name: OUTPUT
234
+ sourceTypeName: Circuit.Output
235
+ origin:
236
+ x: 400
237
+ y: 0
238
+ rotation: 0
239
+ flipped: false
240
+ terminals:
241
+ - name: tip
242
+ node: 6
243
+ position:
244
+ x: 400
245
+ y: 0
246
+ - id: GND1
247
+ kind: ground
248
+ name: GND
249
+ sourceTypeName: Circuit.Ground
250
+ origin:
251
+ x: 0
252
+ y: -100
253
+ rotation: 0
254
+ flipped: false
255
+ terminals:
256
+ - name: gnd
257
+ node: 0
258
+ position:
259
+ x: 0
260
+ y: -100
261
+ - id: V1
262
+ kind: voltage-source
263
+ name: SUPPLY
264
+ sourceTypeName: Circuit.VoltageSource
265
+ origin:
266
+ x: 0
267
+ y: -200
268
+ rotation: 0
269
+ flipped: false
270
+ terminals:
271
+ - name: plus
272
+ role: positive
273
+ node: 5
274
+ position:
275
+ x: 0
276
+ y: -200
277
+ - name: minus
278
+ role: negative
279
+ node: 0
280
+ position:
281
+ x: 0
282
+ y: -180
283
+ properties:
284
+ Voltage: "9"
285
+ - id: CIN
286
+ kind: capacitor
287
+ name: CIN
288
+ sourceTypeName: Circuit.Capacitor
289
+ origin:
290
+ x: -150
291
+ y: 0
292
+ rotation: 0
293
+ flipped: false
294
+ terminals:
295
+ - name: a
296
+ node: 1
297
+ position:
298
+ x: -160
299
+ y: 0
300
+ - name: b
301
+ node: 2
302
+ position:
303
+ x: -140
304
+ y: 0
305
+ properties:
306
+ Capacitance: "10u"
307
+ - id: RB1
308
+ kind: resistor
309
+ name: RB1
310
+ sourceTypeName: Circuit.Resistor
311
+ origin:
312
+ x: -50
313
+ y: -50
314
+ rotation: 0
315
+ flipped: false
316
+ terminals:
317
+ - name: a
318
+ node: 5
319
+ position:
320
+ x: -50
321
+ y: -60
322
+ - name: b
323
+ node: 2
324
+ position:
325
+ x: -50
326
+ y: -40
327
+ properties:
328
+ Resistance: "10k"
329
+ - id: RB2
330
+ kind: resistor
331
+ name: RB2
332
+ sourceTypeName: Circuit.Resistor
333
+ origin:
334
+ x: -50
335
+ y: 50
336
+ rotation: 0
337
+ flipped: false
338
+ terminals:
339
+ - name: a
340
+ node: 2
341
+ position:
342
+ x: -50
343
+ y: 40
344
+ - name: b
345
+ node: 0
346
+ position:
347
+ x: -50
348
+ y: 60
349
+ properties:
350
+ Resistance: "100k"
351
+ - id: Q1
352
+ kind: bjt
353
+ name: Q1
354
+ sourceTypeName: Circuit.BJT
355
+ origin:
356
+ x: 0
357
+ y: 0
358
+ rotation: 0
359
+ flipped: false
360
+ terminals:
361
+ - name: base
362
+ role: base
363
+ node: 2
364
+ position:
365
+ x: -20
366
+ y: 0
367
+ - name: collector
368
+ role: collector
369
+ node: 3
370
+ position:
371
+ x: 20
372
+ y: -20
373
+ - name: emitter
374
+ role: emitter
375
+ node: 4
376
+ position:
377
+ x: 20
378
+ y: 20
379
+ properties:
380
+ Type: "PNP"
381
+ PartNumber: "AC128"
382
+ - id: RE1
383
+ kind: resistor
384
+ name: RE1
385
+ sourceTypeName: Circuit.Resistor
386
+ origin:
387
+ x: 60
388
+ y: -50
389
+ rotation: 0
390
+ flipped: false
391
+ terminals:
392
+ - name: a
393
+ node: 4
394
+ position:
395
+ x: 60
396
+ y: -40
397
+ - name: b
398
+ node: 5
399
+ position:
400
+ x: 60
401
+ y: -60
402
+ properties:
403
+ Resistance: "4.7k"
404
+ - id: RT1
405
+ kind: thermistor
406
+ name: RT1
407
+ sourceTypeName: Circuit.Thermistor
408
+ origin:
409
+ x: 60
410
+ y: 50
411
+ rotation: 0
412
+ flipped: false
413
+ terminals:
414
+ - name: a
415
+ role: end
416
+ node: 3
417
+ position:
418
+ x: 60
419
+ y: 40
420
+ - name: b
421
+ role: end
422
+ node: 5
423
+ position:
424
+ x: 60
425
+ y: 60
426
+ properties:
427
+ Resistance: "33k"
428
+ Beta: "3950"
429
+ - id: C2
430
+ kind: capacitor
431
+ name: C2
432
+ sourceTypeName: Circuit.Capacitor
433
+ origin:
434
+ x: 120
435
+ y: 0
436
+ rotation: 0
437
+ flipped: false
438
+ terminals:
439
+ - name: a
440
+ node: 3
441
+ position:
442
+ x: 110
443
+ y: 0
444
+ - name: b
445
+ node: 7
446
+ position:
447
+ x: 130
448
+ y: 0
449
+ properties:
450
+ Capacitance: "10u"
451
+ - id: RB3
452
+ kind: resistor
453
+ name: RB3
454
+ sourceTypeName: Circuit.Resistor
455
+ origin:
456
+ x: 170
457
+ y: -50
458
+ rotation: 0
459
+ flipped: false
460
+ terminals:
461
+ - name: a
462
+ node: 5
463
+ position:
464
+ x: 170
465
+ y: -60
466
+ - name: b
467
+ node: 7
468
+ position:
469
+ x: 170
470
+ y: -40
471
+ properties:
472
+ Resistance: "10k"
473
+ - id: RB4
474
+ kind: resistor
475
+ name: RB4
476
+ sourceTypeName: Circuit.Resistor
477
+ origin:
478
+ x: 170
479
+ y: 50
480
+ rotation: 0
481
+ flipped: false
482
+ terminals:
483
+ - name: a
484
+ node: 7
485
+ position:
486
+ x: 170
487
+ y: 40
488
+ - name: b
489
+ node: 0
490
+ position:
491
+ x: 170
492
+ y: 60
493
+ properties:
494
+ Resistance: "100k"
495
+ - id: Q2
496
+ kind: bjt
497
+ name: Q2
498
+ sourceTypeName: Circuit.BJT
499
+ origin:
500
+ x: 220
501
+ y: 0
502
+ rotation: 0
503
+ flipped: false
504
+ terminals:
505
+ - name: base
506
+ role: base
507
+ node: 7
508
+ position:
509
+ x: 200
510
+ y: 0
511
+ - name: collector
512
+ role: collector
513
+ node: 6
514
+ position:
515
+ x: 240
516
+ y: -20
517
+ - name: emitter
518
+ role: emitter
519
+ node: 8
520
+ position:
521
+ x: 240
522
+ y: 20
523
+ properties:
524
+ Type: "PNP"
525
+ PartNumber: "AC128"
526
+ - id: RE2
527
+ kind: resistor
528
+ name: RE2
529
+ sourceTypeName: Circuit.Resistor
530
+ origin:
531
+ x: 280
532
+ y: -50
533
+ rotation: 0
534
+ flipped: false
535
+ terminals:
536
+ - name: a
537
+ node: 8
538
+ position:
539
+ x: 280
540
+ y: -40
541
+ - name: b
542
+ node: 5
543
+ position:
544
+ x: 280
545
+ y: -60
546
+ properties:
547
+ Resistance: "4.7k"
548
+ - id: RC2
549
+ kind: resistor
550
+ name: RC2
551
+ sourceTypeName: Circuit.Resistor
552
+ origin:
553
+ x: 280
554
+ y: 50
555
+ rotation: 0
556
+ flipped: false
557
+ terminals:
558
+ - name: a
559
+ node: 6
560
+ position:
561
+ x: 280
562
+ y: 40
563
+ - name: b
564
+ node: 0
565
+ position:
566
+ x: 280
567
+ y: 60
568
+ properties:
569
+ Resistance: "10k"
570
+ wires: []
571
+ `;
149
572
  export const ledgerOverridesInlineDivider = derive(resistorDivider, ' - name: b\n node: 2\n', ' - name: b\n node: 9\n').replace("wires: []", `nodes:
150
573
  - id: 1
151
574
  members: