@vessel-dsp/compiler 0.6.0 → 0.8.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 (49) hide show
  1. package/README.md +1 -1
  2. package/dist/bbd-clock.d.ts +42 -0
  3. package/dist/bbd-clock.d.ts.map +1 -1
  4. package/dist/bbd-clock.js +378 -1
  5. package/dist/bbd-clock.js.map +1 -1
  6. package/dist/compile.d.ts.map +1 -1
  7. package/dist/compile.js +92 -23
  8. package/dist/compile.js.map +1 -1
  9. package/dist/device-laws.d.ts.map +1 -1
  10. package/dist/device-laws.js +77 -11
  11. package/dist/device-laws.js.map +1 -1
  12. package/dist/lower.d.ts.map +1 -1
  13. package/dist/lower.js +13 -0
  14. package/dist/lower.js.map +1 -1
  15. package/dist/netlist.d.ts.map +1 -1
  16. package/dist/netlist.js +27 -1
  17. package/dist/netlist.js.map +1 -1
  18. package/dist/part-catalog.d.ts +19 -0
  19. package/dist/part-catalog.d.ts.map +1 -1
  20. package/dist/part-catalog.js +114 -4
  21. package/dist/part-catalog.js.map +1 -1
  22. package/dist/partition.d.ts.map +1 -1
  23. package/dist/partition.js +6 -0
  24. package/dist/partition.js.map +1 -1
  25. package/dist/registry-data/diode.d.ts.map +1 -1
  26. package/dist/registry-data/diode.js +181 -64
  27. package/dist/registry-data/diode.js.map +1 -1
  28. package/dist/registry-data/index.d.ts +2 -0
  29. package/dist/registry-data/index.d.ts.map +1 -1
  30. package/dist/registry-data/index.js +15 -3
  31. package/dist/registry-data/index.js.map +1 -1
  32. package/dist/registry-data/led.d.ts +20 -0
  33. package/dist/registry-data/led.d.ts.map +1 -0
  34. package/dist/registry-data/led.js +415 -0
  35. package/dist/registry-data/led.js.map +1 -0
  36. package/dist/registry-data/schema.d.ts +11 -3
  37. package/dist/registry-data/schema.d.ts.map +1 -1
  38. package/dist/registry-data/schema.js +20 -4
  39. package/dist/registry-data/schema.js.map +1 -1
  40. package/dist/registry-data/ujt.d.ts +3 -0
  41. package/dist/registry-data/ujt.d.ts.map +1 -0
  42. package/dist/registry-data/ujt.js +48 -0
  43. package/dist/registry-data/ujt.js.map +1 -0
  44. package/dist/registry.d.ts +32 -0
  45. package/dist/registry.d.ts.map +1 -1
  46. package/dist/registry.js.map +1 -1
  47. package/dist/types.d.ts +57 -1
  48. package/dist/types.d.ts.map +1 -1
  49. package/package.json +2 -2
@@ -13,6 +13,18 @@ export declare function bjtLawEntry(record: PartDataEntry): PartEntry;
13
13
  * stamps (a zener knee belongs to class `zener` and the existing `zenerLaw` path, not here).
14
14
  */
15
15
  export declare function diodeLawEntry(record: PartDataEntry): PartEntry;
16
+ /**
17
+ * An LED colour-default record's law entry. Requires the forward pair together, like
18
+ * `diodeLawEntry`: the only admitted LED derivation (four fitted (I, Vf) points, or two
19
+ * with Rs fixed) yields IS and n as one working, so a lone IS without n is a broken
20
+ * derivation and throws rather than shipping half a knee. Gap-fills are the LED class
21
+ * defaults the unregistered path stamps (`device-laws.ts` diode case with `isLed`):
22
+ * thermalVoltage 0.05, seriesResistance 2.0 -- every shipped LED record states both
23
+ * explicitly (the fits were referred to VT 0.025852 V with fitted Rs), so the gap-fill
24
+ * only fires for a future sparse record, and the sparse-record test pins it to the live
25
+ * class defaults. breakdownVolts 0 keeps the no-knee reading; isLed true marks the law.
26
+ */
27
+ export declare function ledLawEntry(record: PartDataEntry): PartEntry;
16
28
  /**
17
29
  * A JFET- or MOSFET-channel record's law entry. The class selects the gap-fill constants
18
30
  * (JFET depletion defaults with the silicon gate; MOSFET enhancement defaults with the
@@ -20,6 +32,13 @@ export declare function diodeLawEntry(record: PartDataEntry): PartEntry;
20
32
  * Throws on any other class and on an empty record.
21
33
  */
22
34
  export declare function fetLawEntry(record: PartDataEntry, cls: "jfet" | "mosfet"): PartEntry;
35
+ /**
36
+ * A unijunction-transistor record's law entry. Requires the tap fraction and the bar
37
+ * together: eta without Rbb cannot place the peak point and Rbb without eta cannot
38
+ * split the bar, so a half record throws rather than shipping half a device. The
39
+ * emitter diode and the snap are law structure, never entry fields.
40
+ */
41
+ export declare function ujtLawEntry(record: PartDataEntry): PartEntry;
23
42
  export declare const zenerCatalogPartIds: ReadonlySet<string>;
24
43
  /**
25
44
  * The catalog's op-amp entries with each registry record's swing pair stamped onto the sections
@@ -1 +1 @@
1
- {"version":3,"file":"part-catalog.d.ts","sourceRoot":"","sources":["../src/part-catalog.ts"],"names":[],"mappings":"AAsDA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1D,OAAO,EAaN,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI5D,OAAO,EACN,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACtB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AA+HzD,6FAA6F;AAC7F,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CA8B5D;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CAiC9D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,MAAM,GAAG,QAAQ,GACpB,SAAS,CAiEX;AA+BD,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAInD,CAAC;AA60QF;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACvC,IAAI,EAAE,SAAS,SAAS,EAAE,EAC1B,IAAI,GAAE,SAAS,mBAAmB,EAAyB,EAC3D,UAAU,GAAE,aAAa,CAAC;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,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ACvC,IAAI,EAAE,SAAS,SAAS,EAAE,EAC1B,IAAI,GAAE,SAAS,mBAAmB,EAAyB,EAC3D,UAAU,GAAE,aAAa,CAAC;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAA0B,GAClH,SAAS,SAAS,EAAE,CAgHtB;AAeD,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAUlD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,YAE9B,CAAC"}
@@ -52,7 +52,7 @@
52
52
  // runs at 9 V, so the carry is a named choice, and `opamp-law-default-parameters` names
53
53
  // every device it was carried for.
54
54
  import { foldPartId, opampOutputSwingOf } from "./registry.js";
55
- import { bjtRegistryRecords, chargePumpRegistryRecords, diodeRegistryRecords, findPartRegistryData, jfetRegistryRecords, mosfetRegistryRecords, opampGainBandwidthAbsent, opampOutputSwingAbsent, opampRegistryRecords, regulatorRegistryRecords, zenerRegistryRecords, communityProvenanceOf, } from "./registry-data/index.js";
55
+ import { bjtRegistryRecords, chargePumpRegistryRecords, diodeRegistryRecords, findPartRegistryData, jfetRegistryRecords, ledRegistryRecords, mosfetRegistryRecords, opampGainBandwidthAbsent, opampOutputSwingAbsent, opampRegistryRecords, regulatorRegistryRecords, ujtRegistryRecords, zenerRegistryRecords, communityProvenanceOf, } from "./registry-data/index.js";
56
56
  // The absent lists and the merged op-amp records live in `registry-data/opamp.ts` and are
57
57
  // re-exported here so their existing import sites keep working.
58
58
  export { opampGainBandwidthAbsent, opampOutputSwingAbsent, opampRegistryRecords, } from "./registry-data/index.js";
@@ -165,6 +165,10 @@ function citedValueOf(record, name) {
165
165
  const param = record.params[name];
166
166
  return param === undefined ? undefined : param.value;
167
167
  }
168
+ /** The `citedParams` arm of a law entry built from a record: the parameters it states. */
169
+ function citedArmOf(record) {
170
+ return { citedParams: Object.keys(record.params) };
171
+ }
168
172
  /** The entry's id list: canonical ids plus typed alias spellings, in listing order. */
169
173
  function entryIdsOf(record) {
170
174
  return [...record.partIds, ...(record.aliases ?? [])];
@@ -182,6 +186,7 @@ export function bjtLawEntry(record) {
182
186
  declaredTypes: [],
183
187
  terminalRoleGroups: [],
184
188
  ...provisionalArmOf(record),
189
+ ...citedArmOf(record),
185
190
  model: {
186
191
  kind: "law",
187
192
  law: {
@@ -219,6 +224,7 @@ export function diodeLawEntry(record) {
219
224
  declaredTypes: [],
220
225
  terminalRoleGroups: [],
221
226
  ...provisionalArmOf(record),
227
+ ...citedArmOf(record),
222
228
  model: {
223
229
  kind: "law",
224
230
  law: {
@@ -233,6 +239,48 @@ export function diodeLawEntry(record) {
233
239
  },
234
240
  };
235
241
  }
242
+ /**
243
+ * An LED colour-default record's law entry. Requires the forward pair together, like
244
+ * `diodeLawEntry`: the only admitted LED derivation (four fitted (I, Vf) points, or two
245
+ * with Rs fixed) yields IS and n as one working, so a lone IS without n is a broken
246
+ * derivation and throws rather than shipping half a knee. Gap-fills are the LED class
247
+ * defaults the unregistered path stamps (`device-laws.ts` diode case with `isLed`):
248
+ * thermalVoltage 0.05, seriesResistance 2.0 -- every shipped LED record states both
249
+ * explicitly (the fits were referred to VT 0.025852 V with fitted Rs), so the gap-fill
250
+ * only fires for a future sparse record, and the sparse-record test pins it to the live
251
+ * class defaults. breakdownVolts 0 keeps the no-knee reading; isLed true marks the law.
252
+ */
253
+ export function ledLawEntry(record) {
254
+ if (record.class !== "led") {
255
+ throw new Error(`${record.partIds.join(",")}: a led entry needs class "led", not "${record.class}"`);
256
+ }
257
+ const saturationCurrent = citedValueOf(record, "saturationCurrent");
258
+ const emissionCoefficient = citedValueOf(record, "emissionCoefficient");
259
+ if (saturationCurrent === undefined || emissionCoefficient === undefined) {
260
+ throw new Error(`${record.partIds.join(",")}: a led record states no forward pair ` +
261
+ `(saturationCurrent ${saturationCurrent === undefined ? "absent" : "present"}, ` +
262
+ `emissionCoefficient ${emissionCoefficient === undefined ? "absent" : "present"})`);
263
+ }
264
+ return {
265
+ partIds: entryIdsOf(record),
266
+ declaredTypes: [],
267
+ terminalRoleGroups: [],
268
+ ...provisionalArmOf(record),
269
+ ...citedArmOf(record),
270
+ model: {
271
+ kind: "law",
272
+ law: {
273
+ kind: "diode",
274
+ saturationCurrent,
275
+ emissionCoefficient,
276
+ thermalVoltage: citedValueOf(record, "thermalVoltage") ?? 0.05,
277
+ breakdownVolts: citedValueOf(record, "breakdownVolts") ?? 0,
278
+ seriesResistance: citedValueOf(record, "seriesResistance") ?? 2.0,
279
+ isLed: true,
280
+ },
281
+ },
282
+ };
283
+ }
236
284
  /**
237
285
  * A JFET- or MOSFET-channel record's law entry. The class selects the gap-fill constants
238
286
  * (JFET depletion defaults with the silicon gate; MOSFET enhancement defaults with the
@@ -270,6 +318,7 @@ export function fetLawEntry(record, cls) {
270
318
  declaredTypes: [],
271
319
  terminalRoleGroups: [],
272
320
  ...provisionalArmOf(record),
321
+ ...citedArmOf(record),
273
322
  model: {
274
323
  kind: "law",
275
324
  law: {
@@ -293,6 +342,38 @@ export function fetLawEntry(record, cls) {
293
342
  },
294
343
  };
295
344
  }
345
+ /**
346
+ * A unijunction-transistor record's law entry. Requires the tap fraction and the bar
347
+ * together: eta without Rbb cannot place the peak point and Rbb without eta cannot
348
+ * split the bar, so a half record throws rather than shipping half a device. The
349
+ * emitter diode and the snap are law structure, never entry fields.
350
+ */
351
+ export function ujtLawEntry(record) {
352
+ if (record.class !== "ujt") {
353
+ throw new Error(`${record.partIds.join(",")}: a ujt entry needs class "ujt", not "${record.class}"`);
354
+ }
355
+ const intrinsicStandoffRatio = citedValueOf(record, "intrinsicStandoffRatio");
356
+ const interbaseResistanceOhms = citedValueOf(record, "interbaseResistanceOhms");
357
+ if (intrinsicStandoffRatio === undefined || interbaseResistanceOhms === undefined) {
358
+ throw new Error(`${record.partIds.join(",")}: a ujt record states no tap and bar ` +
359
+ `(intrinsicStandoffRatio ${intrinsicStandoffRatio === undefined ? "absent" : "present"}, ` +
360
+ `interbaseResistanceOhms ${interbaseResistanceOhms === undefined ? "absent" : "present"})`);
361
+ }
362
+ return {
363
+ partIds: entryIdsOf(record),
364
+ declaredTypes: [],
365
+ terminalRoleGroups: [],
366
+ ...provisionalArmOf(record),
367
+ model: {
368
+ kind: "law",
369
+ law: {
370
+ kind: "ujt",
371
+ intrinsicStandoffRatio,
372
+ interbaseResistanceOhms,
373
+ },
374
+ },
375
+ };
376
+ }
296
377
  // --- JFET channel records: built by `fetLawEntry` (wave-1 builders above) -------------------
297
378
  //
298
379
  // The JFET class default is avowedly no part's values; see `registry-data/jfet.ts` for the
@@ -1878,7 +1959,21 @@ const entries = [
1878
1959
  "clock",
1879
1960
  "phi1",
1880
1961
  "phi1a"
1881
- ]
1962
+ ],
1963
+ // The two 512-stage sections chain when the document ties the first's output to the
1964
+ // second's input (the EH-4700 does: pins 5 and 15 share one node). The 1024 stages
1965
+ // are then read at the second section's output, pin 12.
1966
+ "cascade": {
1967
+ "sectionOut": [
1968
+ "outputa"
1969
+ ],
1970
+ "nextIn": [
1971
+ "inputb"
1972
+ ],
1973
+ "finalOut": [
1974
+ "outputb"
1975
+ ]
1976
+ }
1882
1977
  },
1883
1978
  "barePinPositions": {
1884
1979
  "audioIn": 1,
@@ -4954,10 +5049,17 @@ const entries = [
4954
5049
  }
4955
5050
  },
4956
5051
  // --- Light-Emitting Diodes / LED Indicators (SLP24B, SLP-24B, general LEDs) --------------------------------------------------
5052
+ // The `red-led` spelling this row carried is gone: the owner's measured red colour
5053
+ // default keys "RED LED" (same fold, "redled"), and one fold must resolve to one law.
5054
+ // This row never served the stamping path (`registryLawFor` only matches `law` models,
5055
+ // never `sections`), so nothing stamped changes for it; what it still serves is
5056
+ // `registryEntryFor` exact-part evidence queries (the custom-override guard, the
5057
+ // supply-amps reads) for LED, green-led, yellow-led and IndicatorLED. Bare "LED"
5058
+ // devices keep stamping the LED class defaults -- the colour is unknown, so no colour
5059
+ // record keys it.
4957
5060
  {
4958
5061
  "partIds": [
4959
5062
  "LED",
4960
- "red-led",
4961
5063
  "green-led",
4962
5064
  "yellow-led",
4963
5065
  "IndicatorLED"
@@ -5600,6 +5702,11 @@ const entries = [
5600
5702
  // positions fail `pinoutMatches`, so this needs its own entry rather than an alias added to the
5601
5703
  // existing one. "CD4013AE" is not registered elsewhere, so no collision.
5602
5704
  //
5705
+ // `SCL4013A` (Solid State Scientific, the part `electro-harmonix-slapback-echo`'s `IC3` is printed as on the
5706
+ // factory sheet: a 14-pin 7+7 package with the 4013 pin legend, second-half outputs 12/13 NC) rides this
5707
+ // entry rather than the first CD4013 one because that packet declares the same `pin<N>_<role>` names
5708
+ // as `mxr-m117r-flanger`'s `U3`, in strict pin order 1..14.
5709
+ //
5603
5710
  // Verified directly against the document: `U3`'s 14 terminals are declared in strict ascending
5604
5711
  // pin order (`pin1_q1` through `pin14_vdd`), matching the standard CD4013 pinout, and the
5605
5712
  // component's own `Description` corroborates the same reading pin-by-pin ("pins 4 RESET1, 6 SET1,
@@ -5608,7 +5715,8 @@ const entries = [
5608
5715
  // existing CD4013 entry already assumes for the same law.
5609
5716
  {
5610
5717
  "partIds": [
5611
- "CD4013AE"
5718
+ "CD4013AE",
5719
+ "SCL4013A"
5612
5720
  ],
5613
5721
  "declaredTypes": [],
5614
5722
  "terminalRoleGroups": [],
@@ -8550,8 +8658,10 @@ const entries = [
8550
8658
  // and the stamp is byte-identical to the bespoke mapping this replaces.
8551
8659
  ...bjtRegistryRecords.map((record) => bjtLawEntry(record)),
8552
8660
  ...diodeRegistryRecords.map((record) => diodeLawEntry(record)),
8661
+ ...ledRegistryRecords.map((record) => ledLawEntry(record)),
8553
8662
  ...mosfetRegistryRecords.map((record) => fetLawEntry(record, "mosfet")),
8554
8663
  ...jfetRegistryRecords.map((record) => fetLawEntry(record, "jfet")),
8664
+ ...ujtRegistryRecords.map((record) => ujtLawEntry(record)),
8555
8665
  ];
8556
8666
  // --- Op-amp gain-bandwidth product: stamped from the data registry ------------------------------
8557
8667
  /**