@vessel-dsp/compiler 0.6.0 → 0.7.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 (45) 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 +56 -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 +40 -1
  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 +15 -1
  17. package/dist/netlist.js.map +1 -1
  18. package/dist/part-catalog.d.ts +7 -0
  19. package/dist/part-catalog.d.ts.map +1 -1
  20. package/dist/part-catalog.js +63 -3
  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 +104 -1
  27. package/dist/registry-data/diode.js.map +1 -1
  28. package/dist/registry-data/index.d.ts +1 -0
  29. package/dist/registry-data/index.d.ts.map +1 -1
  30. package/dist/registry-data/index.js +3 -0
  31. package/dist/registry-data/index.js.map +1 -1
  32. package/dist/registry-data/schema.d.ts +4 -0
  33. package/dist/registry-data/schema.d.ts.map +1 -1
  34. package/dist/registry-data/schema.js +9 -0
  35. package/dist/registry-data/schema.js.map +1 -1
  36. package/dist/registry-data/ujt.d.ts +3 -0
  37. package/dist/registry-data/ujt.d.ts.map +1 -0
  38. package/dist/registry-data/ujt.js +48 -0
  39. package/dist/registry-data/ujt.js.map +1 -0
  40. package/dist/registry.d.ts +32 -0
  41. package/dist/registry.d.ts.map +1 -1
  42. package/dist/registry.js.map +1 -1
  43. package/dist/types.d.ts +33 -0
  44. package/dist/types.d.ts.map +1 -1
  45. package/package.json +1 -1
@@ -20,6 +20,13 @@ export declare function diodeLawEntry(record: PartDataEntry): PartEntry;
20
20
  * Throws on any other class and on an empty record.
21
21
  */
22
22
  export declare function fetLawEntry(record: PartDataEntry, cls: "jfet" | "mosfet"): PartEntry;
23
+ /**
24
+ * A unijunction-transistor record's law entry. Requires the tap fraction and the bar
25
+ * together: eta without Rbb cannot place the peak point and Rbb without eta cannot
26
+ * split the bar, so a half record throws rather than shipping half a device. The
27
+ * emitter diode and the snap are law structure, never entry fields.
28
+ */
29
+ export declare function ujtLawEntry(record: PartDataEntry): PartEntry;
23
30
  export declare const zenerCatalogPartIds: ReadonlySet<string>;
24
31
  /**
25
32
  * 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;;;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9D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,MAAM,GAAG,QAAQ,GACpB,SAAS,CAkEX;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CA6B5D;AA+BD,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAInD,CAAC;AAk2QF;;;;;;;;;;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,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, 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: {
@@ -270,6 +276,7 @@ export function fetLawEntry(record, cls) {
270
276
  declaredTypes: [],
271
277
  terminalRoleGroups: [],
272
278
  ...provisionalArmOf(record),
279
+ ...citedArmOf(record),
273
280
  model: {
274
281
  kind: "law",
275
282
  law: {
@@ -293,6 +300,38 @@ export function fetLawEntry(record, cls) {
293
300
  },
294
301
  };
295
302
  }
303
+ /**
304
+ * A unijunction-transistor record's law entry. Requires the tap fraction and the bar
305
+ * together: eta without Rbb cannot place the peak point and Rbb without eta cannot
306
+ * split the bar, so a half record throws rather than shipping half a device. The
307
+ * emitter diode and the snap are law structure, never entry fields.
308
+ */
309
+ export function ujtLawEntry(record) {
310
+ if (record.class !== "ujt") {
311
+ throw new Error(`${record.partIds.join(",")}: a ujt entry needs class "ujt", not "${record.class}"`);
312
+ }
313
+ const intrinsicStandoffRatio = citedValueOf(record, "intrinsicStandoffRatio");
314
+ const interbaseResistanceOhms = citedValueOf(record, "interbaseResistanceOhms");
315
+ if (intrinsicStandoffRatio === undefined || interbaseResistanceOhms === undefined) {
316
+ throw new Error(`${record.partIds.join(",")}: a ujt record states no tap and bar ` +
317
+ `(intrinsicStandoffRatio ${intrinsicStandoffRatio === undefined ? "absent" : "present"}, ` +
318
+ `interbaseResistanceOhms ${interbaseResistanceOhms === undefined ? "absent" : "present"})`);
319
+ }
320
+ return {
321
+ partIds: entryIdsOf(record),
322
+ declaredTypes: [],
323
+ terminalRoleGroups: [],
324
+ ...provisionalArmOf(record),
325
+ model: {
326
+ kind: "law",
327
+ law: {
328
+ kind: "ujt",
329
+ intrinsicStandoffRatio,
330
+ interbaseResistanceOhms,
331
+ },
332
+ },
333
+ };
334
+ }
296
335
  // --- JFET channel records: built by `fetLawEntry` (wave-1 builders above) -------------------
297
336
  //
298
337
  // The JFET class default is avowedly no part's values; see `registry-data/jfet.ts` for the
@@ -1878,7 +1917,21 @@ const entries = [
1878
1917
  "clock",
1879
1918
  "phi1",
1880
1919
  "phi1a"
1881
- ]
1920
+ ],
1921
+ // The two 512-stage sections chain when the document ties the first's output to the
1922
+ // second's input (the EH-4700 does: pins 5 and 15 share one node). The 1024 stages
1923
+ // are then read at the second section's output, pin 12.
1924
+ "cascade": {
1925
+ "sectionOut": [
1926
+ "outputa"
1927
+ ],
1928
+ "nextIn": [
1929
+ "inputb"
1930
+ ],
1931
+ "finalOut": [
1932
+ "outputb"
1933
+ ]
1934
+ }
1882
1935
  },
1883
1936
  "barePinPositions": {
1884
1937
  "audioIn": 1,
@@ -5600,6 +5653,11 @@ const entries = [
5600
5653
  // positions fail `pinoutMatches`, so this needs its own entry rather than an alias added to the
5601
5654
  // existing one. "CD4013AE" is not registered elsewhere, so no collision.
5602
5655
  //
5656
+ // `SCL4013A` (Solid State Scientific, the part `electro-harmonix-slapback-echo`'s `IC3` is printed as on the
5657
+ // factory sheet: a 14-pin 7+7 package with the 4013 pin legend, second-half outputs 12/13 NC) rides this
5658
+ // entry rather than the first CD4013 one because that packet declares the same `pin<N>_<role>` names
5659
+ // as `mxr-m117r-flanger`'s `U3`, in strict pin order 1..14.
5660
+ //
5603
5661
  // Verified directly against the document: `U3`'s 14 terminals are declared in strict ascending
5604
5662
  // pin order (`pin1_q1` through `pin14_vdd`), matching the standard CD4013 pinout, and the
5605
5663
  // component's own `Description` corroborates the same reading pin-by-pin ("pins 4 RESET1, 6 SET1,
@@ -5608,7 +5666,8 @@ const entries = [
5608
5666
  // existing CD4013 entry already assumes for the same law.
5609
5667
  {
5610
5668
  "partIds": [
5611
- "CD4013AE"
5669
+ "CD4013AE",
5670
+ "SCL4013A"
5612
5671
  ],
5613
5672
  "declaredTypes": [],
5614
5673
  "terminalRoleGroups": [],
@@ -8552,6 +8611,7 @@ const entries = [
8552
8611
  ...diodeRegistryRecords.map((record) => diodeLawEntry(record)),
8553
8612
  ...mosfetRegistryRecords.map((record) => fetLawEntry(record, "mosfet")),
8554
8613
  ...jfetRegistryRecords.map((record) => fetLawEntry(record, "jfet")),
8614
+ ...ujtRegistryRecords.map((record) => ujtLawEntry(record)),
8555
8615
  ];
8556
8616
  // --- Op-amp gain-bandwidth product: stamped from the data registry ------------------------------
8557
8617
  /**