@modular-circuit/perc 0.0.51

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 (136) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +40 -0
  3. package/build/erc/connect_graph_visitor/index.d.ts +2 -0
  4. package/build/erc/connect_graph_visitor/index.d.ts.map +1 -0
  5. package/build/erc/connect_graph_visitor/index.js +1 -0
  6. package/build/erc/connect_graph_visitor/visitor.d.ts +5 -0
  7. package/build/erc/connect_graph_visitor/visitor.d.ts.map +1 -0
  8. package/build/erc/connect_graph_visitor/visitor.js +0 -0
  9. package/build/erc/context/connection_graph_builder_ctx.d.ts +7 -0
  10. package/build/erc/context/connection_graph_builder_ctx.d.ts.map +1 -0
  11. package/build/erc/context/connection_graph_builder_ctx.js +0 -0
  12. package/build/erc/context/error_severity.d.ts +11 -0
  13. package/build/erc/context/error_severity.d.ts.map +1 -0
  14. package/build/erc/context/error_severity.js +13 -0
  15. package/build/erc/context/graph.d.ts +3 -0
  16. package/build/erc/context/graph.d.ts.map +1 -0
  17. package/build/erc/context/graph.js +0 -0
  18. package/build/erc/context/graph_converter.d.ts +8 -0
  19. package/build/erc/context/graph_converter.d.ts.map +1 -0
  20. package/build/erc/context/graph_converter.js +0 -0
  21. package/build/erc/context/index.d.ts +6 -0
  22. package/build/erc/context/index.d.ts.map +1 -0
  23. package/build/erc/context/index.js +5 -0
  24. package/build/erc/context/pin_to_pin_test_ctx.d.ts +7 -0
  25. package/build/erc/context/pin_to_pin_test_ctx.d.ts.map +1 -0
  26. package/build/erc/context/pin_to_pin_test_ctx.js +0 -0
  27. package/build/erc/index.d.ts +5 -0
  28. package/build/erc/index.d.ts.map +1 -0
  29. package/build/erc/index.js +4 -0
  30. package/build/erc/netlist/constraints.d.ts +5 -0
  31. package/build/erc/netlist/constraints.d.ts.map +1 -0
  32. package/build/erc/netlist/constraints.js +30 -0
  33. package/build/erc/netlist/index.d.ts +3 -0
  34. package/build/erc/netlist/index.d.ts.map +1 -0
  35. package/build/erc/netlist/index.js +2 -0
  36. package/build/erc/netlist/tester.d.ts +10 -0
  37. package/build/erc/netlist/tester.d.ts.map +1 -0
  38. package/build/erc/netlist/tester.js +67 -0
  39. package/build/erc/parameter_propagation/error_code.d.ts +41 -0
  40. package/build/erc/parameter_propagation/error_code.d.ts.map +1 -0
  41. package/build/erc/parameter_propagation/error_code.js +74 -0
  42. package/build/erc/parameter_propagation/index.d.ts +3 -0
  43. package/build/erc/parameter_propagation/index.d.ts.map +1 -0
  44. package/build/erc/parameter_propagation/index.js +2 -0
  45. package/build/erc/parameter_propagation/link_testers/index.d.ts +2 -0
  46. package/build/erc/parameter_propagation/link_testers/index.d.ts.map +1 -0
  47. package/build/erc/parameter_propagation/link_testers/index.js +1 -0
  48. package/build/erc/parameter_propagation/link_testers/link_tester_base.d.ts +23 -0
  49. package/build/erc/parameter_propagation/link_testers/link_tester_base.d.ts.map +1 -0
  50. package/build/erc/parameter_propagation/link_testers/link_tester_base.js +112 -0
  51. package/build/erc/parameter_propagation/link_testers/tester_impl.d.ts +247 -0
  52. package/build/erc/parameter_propagation/link_testers/tester_impl.d.ts.map +1 -0
  53. package/build/erc/parameter_propagation/link_testers/tester_impl.js +1456 -0
  54. package/build/erc/parameter_propagation/tester.d.ts +16 -0
  55. package/build/erc/parameter_propagation/tester.d.ts.map +1 -0
  56. package/build/erc/parameter_propagation/tester.js +215 -0
  57. package/build/erc/pin_compatibility_matrix/erc_setting.d.ts +29 -0
  58. package/build/erc/pin_compatibility_matrix/erc_setting.d.ts.map +1 -0
  59. package/build/erc/pin_compatibility_matrix/erc_setting.js +110 -0
  60. package/build/erc/pin_compatibility_matrix/error_code.d.ts +55 -0
  61. package/build/erc/pin_compatibility_matrix/error_code.d.ts.map +1 -0
  62. package/build/erc/pin_compatibility_matrix/error_code.js +56 -0
  63. package/build/erc/pin_compatibility_matrix/index.d.ts +5 -0
  64. package/build/erc/pin_compatibility_matrix/index.d.ts.map +1 -0
  65. package/build/erc/pin_compatibility_matrix/index.js +4 -0
  66. package/build/erc/pin_compatibility_matrix/pin_error.d.ts +7 -0
  67. package/build/erc/pin_compatibility_matrix/pin_error.d.ts.map +1 -0
  68. package/build/erc/pin_compatibility_matrix/pin_error.js +7 -0
  69. package/build/erc/pin_compatibility_matrix/tester.d.ts +9 -0
  70. package/build/erc/pin_compatibility_matrix/tester.d.ts.map +1 -0
  71. package/build/erc/pin_compatibility_matrix/tester.js +23 -0
  72. package/build/graphics/index.d.ts +3 -0
  73. package/build/graphics/index.d.ts.map +1 -0
  74. package/build/graphics/index.js +2 -0
  75. package/build/graphics/maker/index.d.ts +4 -0
  76. package/build/graphics/maker/index.d.ts.map +1 -0
  77. package/build/graphics/maker/index.js +3 -0
  78. package/build/graphics/maker/maker_base.d.ts +35 -0
  79. package/build/graphics/maker/maker_base.d.ts.map +1 -0
  80. package/build/graphics/maker/maker_base.js +0 -0
  81. package/build/graphics/maker/maker_type.d.ts +10 -0
  82. package/build/graphics/maker/maker_type.d.ts.map +1 -0
  83. package/build/graphics/maker/maker_type.js +10 -0
  84. package/build/graphics/maker/sch_maker.d.ts +5 -0
  85. package/build/graphics/maker/sch_maker.d.ts.map +1 -0
  86. package/build/graphics/maker/sch_maker.js +0 -0
  87. package/build/graphics/sch_erc_item.d.ts +28 -0
  88. package/build/graphics/sch_erc_item.d.ts.map +1 -0
  89. package/build/graphics/sch_erc_item.js +0 -0
  90. package/build/index.d.ts +6 -0
  91. package/build/index.d.ts.map +1 -0
  92. package/build/index.js +5 -0
  93. package/build/report/erc_report.d.ts +16 -0
  94. package/build/report/erc_report.d.ts.map +1 -0
  95. package/build/report/erc_report.js +16 -0
  96. package/build/report/erc_reporter.d.ts +88 -0
  97. package/build/report/erc_reporter.d.ts.map +1 -0
  98. package/build/report/erc_reporter.js +87 -0
  99. package/build/report/index.d.ts +3 -0
  100. package/build/report/index.d.ts.map +1 -0
  101. package/build/report/index.js +2 -0
  102. package/build/rule_check_item/erc_item.d.ts +4 -0
  103. package/build/rule_check_item/erc_item.d.ts.map +1 -0
  104. package/build/rule_check_item/erc_item.js +0 -0
  105. package/build/rule_check_item/index.d.ts +3 -0
  106. package/build/rule_check_item/index.d.ts.map +1 -0
  107. package/build/rule_check_item/index.js +2 -0
  108. package/build/rule_check_item/rc_item.d.ts +33 -0
  109. package/build/rule_check_item/rc_item.d.ts.map +1 -0
  110. package/build/rule_check_item/rc_item.js +0 -0
  111. package/build/tester/erc_tester.d.ts +18 -0
  112. package/build/tester/erc_tester.d.ts.map +1 -0
  113. package/build/tester/erc_tester.js +66 -0
  114. package/build/tester/graph/connection_graphs_builder.d.ts +22 -0
  115. package/build/tester/graph/connection_graphs_builder.d.ts.map +1 -0
  116. package/build/tester/graph/connection_graphs_builder.js +187 -0
  117. package/build/tester/graph/graph_erc.d.ts +16 -0
  118. package/build/tester/graph/graph_erc.d.ts.map +1 -0
  119. package/build/tester/graph/graph_erc.js +63 -0
  120. package/build/tester/graph/index.d.ts +4 -0
  121. package/build/tester/graph/index.d.ts.map +1 -0
  122. package/build/tester/graph/index.js +3 -0
  123. package/build/tester/graph/ir_graph_converter.d.ts +30 -0
  124. package/build/tester/graph/ir_graph_converter.d.ts.map +1 -0
  125. package/build/tester/graph/ir_graph_converter.js +279 -0
  126. package/build/tester/index.d.ts +3 -0
  127. package/build/tester/index.d.ts.map +1 -0
  128. package/build/tester/index.js +2 -0
  129. package/build/tsconfig.build.tsbuildinfo +1 -0
  130. package/build/utils/get_dependent_modules_definition.d.ts +4 -0
  131. package/build/utils/get_dependent_modules_definition.d.ts.map +1 -0
  132. package/build/utils/get_dependent_modules_definition.js +145 -0
  133. package/build/utils/index.d.ts +2 -0
  134. package/build/utils/index.d.ts.map +1 -0
  135. package/build/utils/index.js +1 -0
  136. package/package.json +39 -0
@@ -0,0 +1,10 @@
1
+ export declare enum MakerType {
2
+ MARKER_UNSPEC = 0,
3
+ MARKER_ERC = 1,
4
+ MARKER_DRC = 2,
5
+ MARKER_DRAWING_SHEET = 3,
6
+ MARKER_RATSNEST = 4,
7
+ MARKER_PARITY = 5,
8
+ MARKER_SIMUL = 6
9
+ }
10
+ //# sourceMappingURL=maker_type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maker_type.d.ts","sourceRoot":"","sources":["../../../src/graphics/maker/maker_type.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,aAAa,IAAI;IACjB,UAAU,IAAI;IACd,UAAU,IAAI;IACd,oBAAoB,IAAI;IACxB,eAAe,IAAI;IACnB,aAAa,IAAI;IACjB,YAAY,IAAI;CACjB"}
@@ -0,0 +1,10 @@
1
+ export var MakerType;
2
+ (function (MakerType) {
3
+ MakerType[MakerType["MARKER_UNSPEC"] = 0] = "MARKER_UNSPEC";
4
+ MakerType[MakerType["MARKER_ERC"] = 1] = "MARKER_ERC";
5
+ MakerType[MakerType["MARKER_DRC"] = 2] = "MARKER_DRC";
6
+ MakerType[MakerType["MARKER_DRAWING_SHEET"] = 3] = "MARKER_DRAWING_SHEET";
7
+ MakerType[MakerType["MARKER_RATSNEST"] = 4] = "MARKER_RATSNEST";
8
+ MakerType[MakerType["MARKER_PARITY"] = 5] = "MARKER_PARITY";
9
+ MakerType[MakerType["MARKER_SIMUL"] = 6] = "MARKER_SIMUL";
10
+ })(MakerType || (MakerType = {}));
@@ -0,0 +1,5 @@
1
+ import type { SCH_ITEM } from '@modular-circuit/ir';
2
+ import type { MarkerBase } from './maker_base';
3
+ export interface SCH_MARKER extends MarkerBase, SCH_ITEM {
4
+ }
5
+ //# sourceMappingURL=sch_maker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sch_maker.d.ts","sourceRoot":"","sources":["../../../src/graphics/maker/sch_maker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C,MAAM,WAAW,UAAW,SAAQ,UAAU,EAAE,QAAQ;CAAG"}
File without changes
@@ -0,0 +1,28 @@
1
+ import type { GS_SCH_SHEET_PATH } from '@modular-circuit/electronics-model';
2
+ import type { ERC_ITEM } from '../rule_check_item/erc_item';
3
+ export interface SCH_ERC_ITEM extends ERC_ITEM {
4
+ /**
5
+ * Determines whether the ERC item is bound to a specific sheet, or is common across multiple
6
+ * sheets (e.g. whether the error is internal to a hierarchical sheet, or is due to an enclosing
7
+ * context interacting with the hierarchical sheet)
8
+ * @return true if ERC applies to a specific sheet, otherwise false
9
+ */
10
+ sheet_specific?: boolean;
11
+ /**
12
+ * Gets the EM_SCH_SHEET_PATH this ERC item is bound to. Throws std::bad_optional_access if there
13
+ * is no specific sheet path binding
14
+ * @return the EM_SCH_SHEET_PATH containing the ERC violation
15
+ */
16
+ sheet_specific_path?: GS_SCH_SHEET_PATH;
17
+ /**
18
+ * Gets the EM_SCH_SHEET_PATH of the main item causing this ERC violation
19
+ * @return EM_SCH_SHEET_PATH containing the main item
20
+ */
21
+ main_item_sheet_path?: GS_SCH_SHEET_PATH;
22
+ /**
23
+ * Gets the EM_SCH_SHEET_PATH of the auxiliary item causing this ERC violation
24
+ * @return EM_SCH_SHEET_PATH containing the auxiliary item
25
+ */
26
+ aux_item_sheet_path?: GS_SCH_SHEET_PATH;
27
+ }
28
+ //# sourceMappingURL=sch_erc_item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sch_erc_item.d.ts","sourceRoot":"","sources":["../../src/graphics/sch_erc_item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAC3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAE3D,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC5C;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,iBAAiB,CAAA;IACvC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,iBAAiB,CAAA;IACxC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,iBAAiB,CAAA;CACxC"}
File without changes
@@ -0,0 +1,6 @@
1
+ export * from './graphics';
2
+ export * from './rule_check_item';
3
+ export * from './tester';
4
+ export * from './report';
5
+ export * from './erc';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA"}
package/build/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export * from './graphics';
2
+ export * from './rule_check_item';
3
+ export * from './tester';
4
+ export * from './report';
5
+ export * from './erc';
@@ -0,0 +1,16 @@
1
+ import { type ERCE_T, type PP_ERROR, type SEVERITY } from '../erc';
2
+ import type { SCH_ERC_ITEM, SCH_MARKER } from '../graphics';
3
+ export interface ERC_REPORT {
4
+ markers: SCH_MARKER[];
5
+ erc_errors: SCH_ERC_ITEM[];
6
+ }
7
+ export interface ERC_REPORTER_CONTEXT {
8
+ pin_name_table: Record<string, string>;
9
+ pin_module_name_table: Record<string, string>;
10
+ }
11
+ export declare function fmt_erc_item_description(id: string, ctx: ERC_REPORTER_CONTEXT): string;
12
+ export declare function get_erc_severity(code: string, settings?: {
13
+ erc_setting?: Record<ERCE_T, SEVERITY>;
14
+ pp_erc_setting?: Record<PP_ERROR, SEVERITY>;
15
+ }): SEVERITY;
16
+ //# sourceMappingURL=erc_report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erc_report.d.ts","sourceRoot":"","sources":["../../src/report/erc_report.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAC/G,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE3D,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,UAAU,EAAE,YAAY,EAAE,CAAA;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC9C;AAED,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,oBAAoB,UAI7E;AACD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE;IACT,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;CAC5C,YAQF"}
@@ -0,0 +1,16 @@
1
+ import { DEFAULT_PP_ERROR_SEVERITY, DEFAULT_SEVERITY } from '../erc';
2
+ export function fmt_erc_item_description(id, ctx) {
3
+ if (id in ctx.pin_module_name_table)
4
+ return "Module ".concat(ctx.pin_module_name_table[id], " port ").concat(ctx.pin_name_table[id]);
5
+ // Shall be global power symbols
6
+ return ctx.pin_name_table[id];
7
+ }
8
+ export function get_erc_severity(code, settings) {
9
+ var _a;
10
+ var erc_setting = (settings === null || settings === void 0 ? void 0 : settings.erc_setting) || DEFAULT_SEVERITY;
11
+ var pp_erc_setting = (settings === null || settings === void 0 ? void 0 : settings.pp_erc_setting) || DEFAULT_PP_ERROR_SEVERITY;
12
+ var severity = (_a = erc_setting[code]) !== null && _a !== void 0 ? _a : pp_erc_setting[code];
13
+ if (severity === undefined)
14
+ throw new Error("Unknown ERC code: ".concat(code));
15
+ return severity;
16
+ }
@@ -0,0 +1,88 @@
1
+ import { type ELECTRICAL_NODE } from '@modular-circuit/electronics-model';
2
+ import { ERCE_T, PP_ERROR } from '../erc';
3
+ export declare const ERCE_UNANNOTATED: (id: string) => {
4
+ error_code: ERCE_T;
5
+ error_message: string;
6
+ eda_item_ids: string[];
7
+ };
8
+ export declare const ERCE_PIN_TO_PIN_ERROR: (a: ELECTRICAL_NODE, b: ELECTRICAL_NODE) => {
9
+ error_code: ERCE_T;
10
+ error_message: string;
11
+ eda_item_ids: string[];
12
+ };
13
+ export declare const ERCE_PIN_NOT_CONNECTED: (id: string) => {
14
+ error_code: ERCE_T;
15
+ error_message: string;
16
+ eda_item_ids: string[];
17
+ };
18
+ export declare const ERCE_DRIVER_CONFLICT: (eda_item_ids: string[], primaryName: string, secondaryName: string) => {
19
+ error_code: PP_ERROR;
20
+ error_message: string;
21
+ eda_item_ids: string[];
22
+ };
23
+ export declare const PP_INAPPROPRIATE_FUNC: (eda_item_ids: string[]) => {
24
+ error_code: PP_ERROR;
25
+ error_message: string;
26
+ eda_item_ids: string[];
27
+ };
28
+ export declare const PP_NOT_DRIVEN: (eda_item_ids: string[]) => {
29
+ error_code: PP_ERROR;
30
+ error_message: string;
31
+ eda_item_ids: string[];
32
+ };
33
+ export declare const PP_DUPLICATED_SOURCES: (eda_item_ids: string[]) => {
34
+ error_code: PP_ERROR;
35
+ error_message: string;
36
+ eda_item_ids: string[];
37
+ };
38
+ export declare const PP_INSUFFICIENT_DRIVER: (eda_item_ids: string[], desc?: string) => {
39
+ error_code: PP_ERROR;
40
+ error_message: string;
41
+ eda_item_ids: string[];
42
+ };
43
+ export declare const PP_OVER_DRIVEN: (eda_item_ids: string[], desc?: string) => {
44
+ error_code: PP_ERROR;
45
+ error_message: string;
46
+ eda_item_ids: string[];
47
+ };
48
+ export declare const PP_IMPEDANCE_SIGNAL_INTEGRITY: (eda_item_ids: string[]) => {
49
+ error_code: PP_ERROR;
50
+ error_message: string;
51
+ eda_item_ids: string[];
52
+ };
53
+ export declare const PP_INCOMPATIBLE_VOLTAGE_LEVELS: (source: string) => {
54
+ error_code: PP_ERROR;
55
+ error_message: string;
56
+ eda_item_ids: string[];
57
+ };
58
+ export declare const PP_SIGNAL_LEVELS_NOT_CONTAINED_WITHIN_VOLTAGE: (source: string) => {
59
+ error_code: PP_ERROR;
60
+ error_message: string;
61
+ eda_item_ids: string[];
62
+ };
63
+ export declare const PP_INCOMPATIBLE_SIGNAL_LEVELS: (source: string) => {
64
+ error_code: PP_ERROR;
65
+ error_message: string;
66
+ eda_item_ids: string[];
67
+ };
68
+ export declare const PP_OVERCURRENT: (source: string) => {
69
+ error_code: PP_ERROR;
70
+ error_message: string;
71
+ eda_item_ids: string[];
72
+ };
73
+ export declare const PP_INCOMPATIBLE_DIGITAL_THRESHOLDS: (eda_item_ids: string[]) => {
74
+ error_code: PP_ERROR;
75
+ error_message: string;
76
+ eda_item_ids: string[];
77
+ };
78
+ export declare const PP_REQUIRES_CONNECTED_SOURCE_OR_BIDIR: (eda_item_ids: string[]) => {
79
+ error_code: PP_ERROR;
80
+ error_message: string;
81
+ eda_item_ids: string[];
82
+ };
83
+ export declare const PP_ILLEGAL_CONNECTION: (eda_item_ids: string[], detail: string) => {
84
+ error_code: PP_ERROR;
85
+ error_message: string;
86
+ eda_item_ids: string[];
87
+ };
88
+ //# sourceMappingURL=erc_reporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erc_reporter.d.ts","sourceRoot":"","sources":["../../src/report/erc_reporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAA2B,MAAM,oCAAoC,CAAA;AAClG,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEzC,eAAO,MAAM,gBAAgB,GAAI,IAAI,MAAM;;;;CAIzC,CAAA;AAEF,eAAO,MAAM,qBAAqB,GAAI,GAAG,eAAe,EAAE,GAAG,eAAe;;;;CAI1E,CAAA;AAEF,eAAO,MAAM,sBAAsB,GAAI,IAAI,MAAM;;;;CAI/C,CAAA;AAEF,eAAO,MAAM,oBAAoB,GAAI,cAAc,MAAM,EAAE,EAAE,aAAa,MAAM,EAAE,eAAe,MAAM;;;;CAIrG,CAAA;AAEF,eAAO,MAAM,qBAAqB,GAAI,cAAc,MAAM,EAAE;;;;CAI1D,CAAA;AACF,eAAO,MAAM,aAAa,GAAI,cAAc,MAAM,EAAE;;;;CAIlD,CAAA;AAEF,eAAO,MAAM,qBAAqB,GAAI,cAAc,MAAM,EAAE;;;;CAI1D,CAAA;AAEF,eAAO,MAAM,sBAAsB,GAAI,cAAc,MAAM,EAAE,EAAE,OAAO,MAAM;;;;CAI1E,CAAA;AAEF,eAAO,MAAM,cAAc,GAAI,cAAc,MAAM,EAAE,EAAE,OAAO,MAAM;;;;CAIlE,CAAA;AAEF,eAAO,MAAM,6BAA6B,GAAI,cAAc,MAAM,EAAE;;;;CAIlE,CAAA;AAEF,eAAO,MAAM,8BAA8B,GAAI,QAAQ,MAAM;;;;CAI3D,CAAA;AAEF,eAAO,MAAM,6CAA6C,GAAI,QAAQ,MAAM;;;;CAI1E,CAAA;AAEF,eAAO,MAAM,6BAA6B,GAAI,QAAQ,MAAM;;;;CAI1D,CAAA;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM;;;;CAI3C,CAAA;AACF,eAAO,MAAM,kCAAkC,GAAI,cAAc,MAAM,EAAE;;;;CAIvE,CAAA;AACF,eAAO,MAAM,qCAAqC,GAAI,cAAc,MAAM,EAAE;;;;CAI1E,CAAA;AAEF,eAAO,MAAM,qBAAqB,GAAI,cAAc,MAAM,EAAE,EAAE,QAAQ,MAAM;;;;CAI1E,CAAA"}
@@ -0,0 +1,87 @@
1
+ import { get_electrical_pin_type } from '@modular-circuit/electronics-model';
2
+ import { ERCE_T, PP_ERROR } from '../erc';
3
+ export var ERCE_UNANNOTATED = function (id) { return ({
4
+ error_code: ERCE_T.ERCE_UNANNOTATED,
5
+ error_message: 'Port has no electrical type specified.',
6
+ eda_item_ids: [id],
7
+ }); };
8
+ export var ERCE_PIN_TO_PIN_ERROR = function (a, b) { return ({
9
+ error_code: ERCE_T.ERCE_PIN_TO_PIN_ERROR,
10
+ error_message: "Port ".concat(get_electrical_pin_type(a), " and port ").concat(get_electrical_pin_type(b), " are not compatible."),
11
+ eda_item_ids: [a.uuid, b.uuid],
12
+ }); };
13
+ export var ERCE_PIN_NOT_CONNECTED = function (id) { return ({
14
+ error_code: ERCE_T.ERCE_PIN_NOT_CONNECTED,
15
+ error_message: 'Port not connected.',
16
+ eda_item_ids: [id],
17
+ }); };
18
+ export var ERCE_DRIVER_CONFLICT = function (eda_item_ids, primaryName, secondaryName) { return ({
19
+ error_code: PP_ERROR.INAPPROPRIATE_FUNC,
20
+ error_message: "Both ".concat(primaryName, " and ").concat(secondaryName, " are attached to the same net. "),
21
+ eda_item_ids: eda_item_ids,
22
+ }); };
23
+ export var PP_INAPPROPRIATE_FUNC = function (eda_item_ids) { return ({
24
+ error_code: PP_ERROR.INAPPROPRIATE_FUNC,
25
+ error_message: 'Inappropriate ports functions.',
26
+ eda_item_ids: eda_item_ids,
27
+ }); };
28
+ export var PP_NOT_DRIVEN = function (eda_item_ids) { return ({
29
+ error_code: PP_ERROR.NOT_DRIVEN,
30
+ error_message: 'Net not driven.',
31
+ eda_item_ids: eda_item_ids,
32
+ }); };
33
+ export var PP_DUPLICATED_SOURCES = function (eda_item_ids) { return ({
34
+ error_code: PP_ERROR.DUPLICATED_PWR_SOURCES,
35
+ error_message: 'Net connected to multiple power sources.',
36
+ eda_item_ids: eda_item_ids,
37
+ }); };
38
+ export var PP_INSUFFICIENT_DRIVER = function (eda_item_ids, desc) { return ({
39
+ error_code: PP_ERROR.INSUFFICIENT_DRIVER,
40
+ error_message: "Insufficient ".concat(desc, " driver."),
41
+ eda_item_ids: eda_item_ids,
42
+ }); };
43
+ export var PP_OVER_DRIVEN = function (eda_item_ids, desc) { return ({
44
+ error_code: PP_ERROR.OVER_DRIVEN,
45
+ error_message: "".concat(desc, " over driven."),
46
+ eda_item_ids: eda_item_ids,
47
+ }); };
48
+ export var PP_IMPEDANCE_SIGNAL_INTEGRITY = function (eda_item_ids) { return ({
49
+ error_code: PP_ERROR.IMPEDANCE_SIGNAL_INTEGRITY,
50
+ error_message: 'Source impedance shall be 10x lower than sink impedance for signal integrity.',
51
+ eda_item_ids: eda_item_ids,
52
+ }); };
53
+ export var PP_INCOMPATIBLE_VOLTAGE_LEVELS = function (source) { return ({
54
+ error_code: PP_ERROR.IMPEDANCE_SIGNAL_INTEGRITY,
55
+ error_message: 'Incompatible voltage levels.',
56
+ eda_item_ids: [source],
57
+ }); };
58
+ export var PP_SIGNAL_LEVELS_NOT_CONTAINED_WITHIN_VOLTAGE = function (source) { return ({
59
+ error_code: PP_ERROR.SIGNAL_LEVELS_NOT_CONTAINED_WITHIN_VOLTAGE,
60
+ error_message: 'Signal levels not contained within voltage.',
61
+ eda_item_ids: [source],
62
+ }); };
63
+ export var PP_INCOMPATIBLE_SIGNAL_LEVELS = function (source) { return ({
64
+ error_code: PP_ERROR.INCOMPATIBLE_SIGNAL_LEVELS,
65
+ error_message: 'Incompatible signal levels.',
66
+ eda_item_ids: [source],
67
+ }); };
68
+ export var PP_OVERCURRENT = function (source) { return ({
69
+ error_code: PP_ERROR.OVERCURRENT,
70
+ error_message: 'overcurrent.',
71
+ eda_item_ids: [source],
72
+ }); };
73
+ export var PP_INCOMPATIBLE_DIGITAL_THRESHOLDS = function (eda_item_ids) { return ({
74
+ error_code: PP_ERROR.INCOMPATIBLE_DIGITAL_THRESHOLDS,
75
+ error_message: 'Incompatible digital thresholds.',
76
+ eda_item_ids: eda_item_ids,
77
+ }); };
78
+ export var PP_REQUIRES_CONNECTED_SOURCE_OR_BIDIR = function (eda_item_ids) { return ({
79
+ error_code: PP_ERROR.REQUIRES_CONNECTED_SOURCE_OR_BIDIR,
80
+ error_message: 'Requires connected source or bidir.',
81
+ eda_item_ids: eda_item_ids,
82
+ }); };
83
+ export var PP_ILLEGAL_CONNECTION = function (eda_item_ids, detail) { return ({
84
+ error_code: PP_ERROR.ILLEGAL_CONNECTION,
85
+ error_message: "Illegal connection: ".concat(detail),
86
+ eda_item_ids: eda_item_ids,
87
+ }); };
@@ -0,0 +1,3 @@
1
+ export * from './erc_report';
2
+ export * from './erc_reporter';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/report/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './erc_report';
2
+ export * from './erc_reporter';
@@ -0,0 +1,4 @@
1
+ import type { RC_ITEM } from './rc_item';
2
+ export interface ERC_ITEM extends RC_ITEM {
3
+ }
4
+ //# sourceMappingURL=erc_item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erc_item.d.ts","sourceRoot":"","sources":["../../src/rule_check_item/erc_item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAExC,MAAM,WAAW,QAAS,SAAQ,OAAO;CAAG"}
File without changes
@@ -0,0 +1,3 @@
1
+ export * from './erc_item';
2
+ export * from './rc_item';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rule_check_item/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './erc_item';
2
+ export * from './rc_item';
@@ -0,0 +1,33 @@
1
+ import type { ERCE_T, PP_ERROR } from '../erc';
2
+ /**
3
+ * A holder for a rule check item, DRC in Pcbnew or ERC in Eeschema.
4
+ *
5
+ * RC_ITEMs can have zero, one, or two related EDA_ITEMs.
6
+ */
7
+ export interface RC_ITEM {
8
+ /**
9
+ * The UUIDs of the eda items that are related to this item.
10
+ */
11
+ eda_item_ids: string[];
12
+ /**
13
+ * The error code's numeric value
14
+ */
15
+ error_code: ERCE_T | PP_ERROR;
16
+ /**
17
+ * A message describing the details of this specific error
18
+ */
19
+ error_message: string;
20
+ /**
21
+ * The string describing the type of error
22
+ */
23
+ error_title?: string;
24
+ /**
25
+ * The key used to describe this type of error in settings
26
+ */
27
+ setting_key?: string;
28
+ /**
29
+ * The id of the marker this item belongs to, if any
30
+ */
31
+ parent_id?: string;
32
+ }
33
+ //# sourceMappingURL=rc_item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rc_item.d.ts","sourceRoot":"","sources":["../../src/rule_check_item/rc_item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAE9C;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAA;IAEtB;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,QAAQ,CAAA;IAE7B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
File without changes
@@ -0,0 +1,18 @@
1
+ import type { ConnectionGraph } from '@modular-circuit/electronics-model';
2
+ import { type ERC_SETTING, type PP_ERROR, type SEVERITY } from '../erc';
3
+ import type { ERC_REPORTER_CONTEXT } from '../report';
4
+ export interface ERC_CONTEXT extends ERC_REPORTER_CONTEXT {
5
+ erc_setting: ERC_SETTING;
6
+ pp_erc_setting: Record<PP_ERROR, SEVERITY>;
7
+ connection_graph: ConnectionGraph;
8
+ }
9
+ export declare class ERC_TESTER {
10
+ private ctx;
11
+ constructor(ctx: ERC_CONTEXT);
12
+ run_test(): {
13
+ connection_graph: ConnectionGraph;
14
+ markers: import("..").SCH_MARKER[];
15
+ erc_errors: import("..").SCH_ERC_ITEM[];
16
+ };
17
+ }
18
+ //# sourceMappingURL=erc_tester.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erc_tester.d.ts","sourceRoot":"","sources":["../../src/tester/erc_tester.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,QAAQ,EAEb,KAAK,QAAQ,EACd,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,EAAc,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAEjE,MAAM,WAAW,WAAY,SAAQ,oBAAoB;IACvD,WAAW,EAAE,WAAW,CAAA;IACxB,cAAc,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC1C,gBAAgB,EAAE,eAAe,CAAA;CAClC;AAED,qBAAa,UAAU;IACF,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,WAAW;IAEpC,QAAQ;;;;;CAyBhB"}
@@ -0,0 +1,66 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __values = (this && this.__values) || function(o) {
13
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
14
+ if (m) return m.call(o);
15
+ if (o && typeof o.length === "number") return {
16
+ next: function () {
17
+ if (o && i >= o.length) o = void 0;
18
+ return { value: o && o[i++], done: !o };
19
+ }
20
+ };
21
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
22
+ };
23
+ import { NetlistTester, PIN_COMPATIBILITY_MATRIX_TESTER, ParameterPropagationTester, } from '../erc';
24
+ var ERC_TESTER = /** @class */ (function () {
25
+ function ERC_TESTER(ctx) {
26
+ this.ctx = ctx;
27
+ }
28
+ ERC_TESTER.prototype.run_test = function () {
29
+ var e_1, _a, e_2, _b;
30
+ var report = { erc_errors: [], markers: [] };
31
+ var tester_context = __assign({ report: report }, this.ctx);
32
+ var visitors = [
33
+ new PIN_COMPATIBILITY_MATRIX_TESTER(tester_context),
34
+ new ParameterPropagationTester(tester_context),
35
+ new NetlistTester(tester_context),
36
+ ];
37
+ try {
38
+ for (var _c = __values(this.ctx.connection_graph.subgraphs), _d = _c.next(); !_d.done; _d = _c.next()) {
39
+ var cc = _d.value;
40
+ try {
41
+ for (var visitors_1 = (e_2 = void 0, __values(visitors)), visitors_1_1 = visitors_1.next(); !visitors_1_1.done; visitors_1_1 = visitors_1.next()) {
42
+ var visitor = visitors_1_1.value;
43
+ visitor.visit_cc(cc);
44
+ }
45
+ }
46
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
47
+ finally {
48
+ try {
49
+ if (visitors_1_1 && !visitors_1_1.done && (_b = visitors_1.return)) _b.call(visitors_1);
50
+ }
51
+ finally { if (e_2) throw e_2.error; }
52
+ }
53
+ }
54
+ }
55
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
56
+ finally {
57
+ try {
58
+ if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
59
+ }
60
+ finally { if (e_1) throw e_1.error; }
61
+ }
62
+ return __assign(__assign({}, report), { connection_graph: this.ctx.connection_graph });
63
+ };
64
+ return ERC_TESTER;
65
+ }());
66
+ export { ERC_TESTER };
@@ -0,0 +1,22 @@
1
+ import { type ConnectionGraph, type ConnectionNode, type ConnectionNodeMap, type ConnectionSubgraph } from '@modular-circuit/electronics-model';
2
+ import { type CC_Visitor } from '@modular-circuit/utils';
3
+ import type { CONNECTION_GRAPH_BUILDER_CTX } from '../../erc';
4
+ export declare class ConnectionGraphsBuilder implements CC_Visitor {
5
+ private readonly connection_node_map;
6
+ private net_count;
7
+ private connection_graph;
8
+ private item_graphs;
9
+ constructor(connection_node_map: ConnectionNodeMap);
10
+ end_visit_component(cc: string[]): void;
11
+ resolve_net_drive(nodes: ConnectionNode[], sub_graph: ConnectionSubgraph): void;
12
+ get_connection_graph(): ConnectionGraph;
13
+ get_item_graphs(): Record<string, ConnectionSubgraph>;
14
+ }
15
+ export declare function build_connection_graph(ctx: CONNECTION_GRAPH_BUILDER_CTX): Promise<{
16
+ connection_graph: ConnectionGraph;
17
+ item_graphs: Record<string, ConnectionSubgraph>;
18
+ cg_schematics: Record<string, import("./ir_graph_converter").CG_SCHEMATIC>;
19
+ pin_name_table: Record<string, string>;
20
+ pin_module_name_table: Record<string, string>;
21
+ }>;
22
+ //# sourceMappingURL=connection_graphs_builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection_graphs_builder.d.ts","sourceRoot":"","sources":["../../../src/tester/graph/connection_graphs_builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EAEtB,KAAK,kBAAkB,EAGxB,MAAM,oCAAoC,CAAA;AAE3C,OAAO,EAAE,KAAK,UAAU,EAA6B,MAAM,wBAAwB,CAAA;AACnF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAA;AAI7D,qBAAa,uBAAwB,YAAW,UAAU;IAOrC,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IANvD,OAAO,CAAC,SAAS,CAAI;IAErB,OAAO,CAAC,gBAAgB,CAAiB;IAEzC,OAAO,CAAC,WAAW,CAAyC;gBAExB,mBAAmB,EAAE,iBAAiB;IAM1E,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE;IAgBhC,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,SAAS,EAAE,kBAAkB;IAwDxE,oBAAoB;IAIpB,eAAe;CAGhB;AAED,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,4BAA4B;;;;;;GAY7E"}