@modular-circuit/perc 0.0.61 → 0.1.1
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.mts +476 -0
- package/dist/index.d.ts +476 -0
- package/dist/index.js +1881 -0
- package/dist/index.mjs +1845 -0
- package/package.json +14 -11
- package/build/erc/connect_graph_visitor/index.d.ts +0 -2
- package/build/erc/connect_graph_visitor/index.d.ts.map +0 -1
- package/build/erc/connect_graph_visitor/index.js +0 -1
- package/build/erc/connect_graph_visitor/visitor.d.ts +0 -5
- package/build/erc/connect_graph_visitor/visitor.d.ts.map +0 -1
- package/build/erc/connect_graph_visitor/visitor.js +0 -0
- package/build/erc/context/connection_graph_builder_ctx.d.ts +0 -7
- package/build/erc/context/connection_graph_builder_ctx.d.ts.map +0 -1
- package/build/erc/context/connection_graph_builder_ctx.js +0 -0
- package/build/erc/context/error_severity.d.ts +0 -11
- package/build/erc/context/error_severity.d.ts.map +0 -1
- package/build/erc/context/error_severity.js +0 -13
- package/build/erc/context/graph.d.ts +0 -3
- package/build/erc/context/graph.d.ts.map +0 -1
- package/build/erc/context/graph.js +0 -0
- package/build/erc/context/graph_converter.d.ts +0 -8
- package/build/erc/context/graph_converter.d.ts.map +0 -1
- package/build/erc/context/graph_converter.js +0 -0
- package/build/erc/context/index.d.ts +0 -6
- package/build/erc/context/index.d.ts.map +0 -1
- package/build/erc/context/index.js +0 -5
- package/build/erc/context/pin_to_pin_test_ctx.d.ts +0 -7
- package/build/erc/context/pin_to_pin_test_ctx.d.ts.map +0 -1
- package/build/erc/context/pin_to_pin_test_ctx.js +0 -0
- package/build/erc/index.d.ts +0 -5
- package/build/erc/index.d.ts.map +0 -1
- package/build/erc/index.js +0 -4
- package/build/erc/netlist/constraints.d.ts +0 -5
- package/build/erc/netlist/constraints.d.ts.map +0 -1
- package/build/erc/netlist/constraints.js +0 -30
- package/build/erc/netlist/index.d.ts +0 -3
- package/build/erc/netlist/index.d.ts.map +0 -1
- package/build/erc/netlist/index.js +0 -2
- package/build/erc/netlist/tester.d.ts +0 -10
- package/build/erc/netlist/tester.d.ts.map +0 -1
- package/build/erc/netlist/tester.js +0 -67
- package/build/erc/parameter_propagation/error_code.d.ts +0 -41
- package/build/erc/parameter_propagation/error_code.d.ts.map +0 -1
- package/build/erc/parameter_propagation/error_code.js +0 -74
- package/build/erc/parameter_propagation/index.d.ts +0 -3
- package/build/erc/parameter_propagation/index.d.ts.map +0 -1
- package/build/erc/parameter_propagation/index.js +0 -2
- package/build/erc/parameter_propagation/link_testers/index.d.ts +0 -2
- package/build/erc/parameter_propagation/link_testers/index.d.ts.map +0 -1
- package/build/erc/parameter_propagation/link_testers/index.js +0 -1
- package/build/erc/parameter_propagation/link_testers/link_tester_base.d.ts +0 -23
- package/build/erc/parameter_propagation/link_testers/link_tester_base.d.ts.map +0 -1
- package/build/erc/parameter_propagation/link_testers/link_tester_base.js +0 -112
- package/build/erc/parameter_propagation/link_testers/tester_impl.d.ts +0 -247
- package/build/erc/parameter_propagation/link_testers/tester_impl.d.ts.map +0 -1
- package/build/erc/parameter_propagation/link_testers/tester_impl.js +0 -1456
- package/build/erc/parameter_propagation/tester.d.ts +0 -16
- package/build/erc/parameter_propagation/tester.d.ts.map +0 -1
- package/build/erc/parameter_propagation/tester.js +0 -215
- package/build/erc/pin_compatibility_matrix/erc_setting.d.ts +0 -29
- package/build/erc/pin_compatibility_matrix/erc_setting.d.ts.map +0 -1
- package/build/erc/pin_compatibility_matrix/erc_setting.js +0 -110
- package/build/erc/pin_compatibility_matrix/error_code.d.ts +0 -55
- package/build/erc/pin_compatibility_matrix/error_code.d.ts.map +0 -1
- package/build/erc/pin_compatibility_matrix/error_code.js +0 -56
- package/build/erc/pin_compatibility_matrix/index.d.ts +0 -5
- package/build/erc/pin_compatibility_matrix/index.d.ts.map +0 -1
- package/build/erc/pin_compatibility_matrix/index.js +0 -4
- package/build/erc/pin_compatibility_matrix/pin_error.d.ts +0 -7
- package/build/erc/pin_compatibility_matrix/pin_error.d.ts.map +0 -1
- package/build/erc/pin_compatibility_matrix/pin_error.js +0 -7
- package/build/erc/pin_compatibility_matrix/tester.d.ts +0 -9
- package/build/erc/pin_compatibility_matrix/tester.d.ts.map +0 -1
- package/build/erc/pin_compatibility_matrix/tester.js +0 -23
- package/build/graphics/index.d.ts +0 -3
- package/build/graphics/index.d.ts.map +0 -1
- package/build/graphics/index.js +0 -2
- package/build/graphics/maker/index.d.ts +0 -4
- package/build/graphics/maker/index.d.ts.map +0 -1
- package/build/graphics/maker/index.js +0 -3
- package/build/graphics/maker/maker_base.d.ts +0 -35
- package/build/graphics/maker/maker_base.d.ts.map +0 -1
- package/build/graphics/maker/maker_base.js +0 -0
- package/build/graphics/maker/maker_type.d.ts +0 -10
- package/build/graphics/maker/maker_type.d.ts.map +0 -1
- package/build/graphics/maker/maker_type.js +0 -10
- package/build/graphics/maker/sch_maker.d.ts +0 -5
- package/build/graphics/maker/sch_maker.d.ts.map +0 -1
- package/build/graphics/maker/sch_maker.js +0 -0
- package/build/graphics/sch_erc_item.d.ts +0 -28
- package/build/graphics/sch_erc_item.d.ts.map +0 -1
- package/build/graphics/sch_erc_item.js +0 -0
- package/build/index.d.ts +0 -6
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -5
- package/build/report/erc_report.d.ts +0 -16
- package/build/report/erc_report.d.ts.map +0 -1
- package/build/report/erc_report.js +0 -16
- package/build/report/erc_reporter.d.ts +0 -88
- package/build/report/erc_reporter.d.ts.map +0 -1
- package/build/report/erc_reporter.js +0 -87
- package/build/report/index.d.ts +0 -3
- package/build/report/index.d.ts.map +0 -1
- package/build/report/index.js +0 -2
- package/build/rule_check_item/erc_item.d.ts +0 -4
- package/build/rule_check_item/erc_item.d.ts.map +0 -1
- package/build/rule_check_item/erc_item.js +0 -0
- package/build/rule_check_item/index.d.ts +0 -3
- package/build/rule_check_item/index.d.ts.map +0 -1
- package/build/rule_check_item/index.js +0 -2
- package/build/rule_check_item/rc_item.d.ts +0 -33
- package/build/rule_check_item/rc_item.d.ts.map +0 -1
- package/build/rule_check_item/rc_item.js +0 -0
- package/build/tester/erc_tester.d.ts +0 -18
- package/build/tester/erc_tester.d.ts.map +0 -1
- package/build/tester/erc_tester.js +0 -66
- package/build/tester/graph/connection_graphs_builder.d.ts +0 -22
- package/build/tester/graph/connection_graphs_builder.d.ts.map +0 -1
- package/build/tester/graph/connection_graphs_builder.js +0 -187
- package/build/tester/graph/graph_erc.d.ts +0 -16
- package/build/tester/graph/graph_erc.d.ts.map +0 -1
- package/build/tester/graph/graph_erc.js +0 -63
- package/build/tester/graph/index.d.ts +0 -4
- package/build/tester/graph/index.d.ts.map +0 -1
- package/build/tester/graph/index.js +0 -3
- package/build/tester/graph/ir_graph_converter.d.ts +0 -30
- package/build/tester/graph/ir_graph_converter.d.ts.map +0 -1
- package/build/tester/graph/ir_graph_converter.js +0 -279
- package/build/tester/index.d.ts +0 -3
- package/build/tester/index.d.ts.map +0 -1
- package/build/tester/index.js +0 -2
- package/build/tsconfig.build.tsbuildinfo +0 -1
- package/build/utils/get_dependent_modules_definition.d.ts +0 -4
- package/build/utils/get_dependent_modules_definition.d.ts.map +0 -1
- package/build/utils/get_dependent_modules_definition.js +0 -145
- package/build/utils/index.d.ts +0 -2
- package/build/utils/index.d.ts.map +0 -1
- package/build/utils/index.js +0 -1
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
import * as _modular_circuit_electronics_model from '@modular-circuit/electronics-model';
|
|
2
|
+
import { VECTOR2, BOX2, ELECTRICAL_NODE, ELECTRICAL_PINTYPE, ConnectionSubgraph, ConnectionNodeMap, GS_SCH_SHEET_PATH, ConnectionGraph, CG_SHEET, NL_PowerSymbol, PowerShape, PowerSymbolPort, Connection, ConnectionNode } from '@modular-circuit/electronics-model';
|
|
3
|
+
import { SCH_ITEM, ModuleResolver, ModuleCircuit, IR_Graph } from '@modular-circuit/ir';
|
|
4
|
+
import { PowerBase } from '@modular-circuit/ir/build/graph/pwr_base';
|
|
5
|
+
import { CC_Visitor } from '@modular-circuit/utils';
|
|
6
|
+
|
|
7
|
+
declare enum SEVERITY {
|
|
8
|
+
RPT_SEVERITY_UNDEFINED = 1,
|
|
9
|
+
RPT_SEVERITY_INFO = 2,
|
|
10
|
+
RPT_SEVERITY_EXCLUSION = 4,
|
|
11
|
+
RPT_SEVERITY_ACTION = 8,
|
|
12
|
+
RPT_SEVERITY_WARNING = 16,
|
|
13
|
+
RPT_SEVERITY_ERROR = 32,
|
|
14
|
+
RPT_SEVERITY_IGNORE = 64,
|
|
15
|
+
RPT_SEVERITY_DEBUG = 128
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare enum MakerType {
|
|
19
|
+
MARKER_UNSPEC = 0,
|
|
20
|
+
MARKER_ERC = 1,
|
|
21
|
+
MARKER_DRC = 2,
|
|
22
|
+
MARKER_DRAWING_SHEET = 3,
|
|
23
|
+
MARKER_RATSNEST = 4,
|
|
24
|
+
MARKER_PARITY = 5,
|
|
25
|
+
MARKER_SIMUL = 6
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Marker are mainly used to show a DRC or ERC error or warning
|
|
30
|
+
*/
|
|
31
|
+
interface MarkerBase {
|
|
32
|
+
uuid: string;
|
|
33
|
+
/**
|
|
34
|
+
* @return the position of this marker in internal units.
|
|
35
|
+
*/
|
|
36
|
+
pos: VECTOR2;
|
|
37
|
+
/**
|
|
38
|
+
* The type of marker (useful to filter markers)
|
|
39
|
+
*/
|
|
40
|
+
maker_type: MakerType;
|
|
41
|
+
/**
|
|
42
|
+
* User has excluded this specific error
|
|
43
|
+
*/
|
|
44
|
+
excluded: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* User-supplied comment (generally for exclusions)
|
|
47
|
+
*/
|
|
48
|
+
comment: string;
|
|
49
|
+
severity: SEVERITY;
|
|
50
|
+
/**
|
|
51
|
+
* The ID of the RC item that generated this marker
|
|
52
|
+
*/
|
|
53
|
+
rc_item_id: string;
|
|
54
|
+
/**
|
|
55
|
+
* Return the orthogonal, bounding box of this object for display purposes.
|
|
56
|
+
*/
|
|
57
|
+
bounding_box: BOX2;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface SCH_MARKER extends MarkerBase, SCH_ITEM {
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface ERC_REPORT {
|
|
64
|
+
markers: SCH_MARKER[];
|
|
65
|
+
erc_errors: SCH_ERC_ITEM[];
|
|
66
|
+
}
|
|
67
|
+
interface ERC_REPORTER_CONTEXT {
|
|
68
|
+
pin_name_table: Record<string, string>;
|
|
69
|
+
pin_module_name_table: Record<string, string>;
|
|
70
|
+
}
|
|
71
|
+
declare function fmt_erc_item_description(id: string, ctx: ERC_REPORTER_CONTEXT): string;
|
|
72
|
+
declare function get_erc_severity(code: string, settings?: {
|
|
73
|
+
erc_setting?: Record<ERCE_T, SEVERITY>;
|
|
74
|
+
pp_erc_setting?: Record<PP_ERROR, SEVERITY>;
|
|
75
|
+
}): SEVERITY;
|
|
76
|
+
|
|
77
|
+
declare const ERCE_UNANNOTATED: (id: string) => {
|
|
78
|
+
error_code: ERCE_T;
|
|
79
|
+
error_message: string;
|
|
80
|
+
eda_item_ids: string[];
|
|
81
|
+
};
|
|
82
|
+
declare const ERCE_PIN_TO_PIN_ERROR: (a: ELECTRICAL_NODE, b: ELECTRICAL_NODE) => {
|
|
83
|
+
error_code: ERCE_T;
|
|
84
|
+
error_message: string;
|
|
85
|
+
eda_item_ids: string[];
|
|
86
|
+
};
|
|
87
|
+
declare const ERCE_PIN_NOT_CONNECTED: (id: string) => {
|
|
88
|
+
error_code: ERCE_T;
|
|
89
|
+
error_message: string;
|
|
90
|
+
eda_item_ids: string[];
|
|
91
|
+
};
|
|
92
|
+
declare const ERCE_DRIVER_CONFLICT: (eda_item_ids: string[], primaryName: string, secondaryName: string) => {
|
|
93
|
+
error_code: PP_ERROR;
|
|
94
|
+
error_message: string;
|
|
95
|
+
eda_item_ids: string[];
|
|
96
|
+
};
|
|
97
|
+
declare const PP_INAPPROPRIATE_FUNC: (eda_item_ids: string[]) => {
|
|
98
|
+
error_code: PP_ERROR;
|
|
99
|
+
error_message: string;
|
|
100
|
+
eda_item_ids: string[];
|
|
101
|
+
};
|
|
102
|
+
declare const PP_NOT_DRIVEN: (eda_item_ids: string[]) => {
|
|
103
|
+
error_code: PP_ERROR;
|
|
104
|
+
error_message: string;
|
|
105
|
+
eda_item_ids: string[];
|
|
106
|
+
};
|
|
107
|
+
declare const PP_DUPLICATED_SOURCES: (eda_item_ids: string[]) => {
|
|
108
|
+
error_code: PP_ERROR;
|
|
109
|
+
error_message: string;
|
|
110
|
+
eda_item_ids: string[];
|
|
111
|
+
};
|
|
112
|
+
declare const PP_INSUFFICIENT_DRIVER: (eda_item_ids: string[], desc?: string) => {
|
|
113
|
+
error_code: PP_ERROR;
|
|
114
|
+
error_message: string;
|
|
115
|
+
eda_item_ids: string[];
|
|
116
|
+
};
|
|
117
|
+
declare const PP_OVER_DRIVEN: (eda_item_ids: string[], desc?: string) => {
|
|
118
|
+
error_code: PP_ERROR;
|
|
119
|
+
error_message: string;
|
|
120
|
+
eda_item_ids: string[];
|
|
121
|
+
};
|
|
122
|
+
declare const PP_IMPEDANCE_SIGNAL_INTEGRITY: (eda_item_ids: string[]) => {
|
|
123
|
+
error_code: PP_ERROR;
|
|
124
|
+
error_message: string;
|
|
125
|
+
eda_item_ids: string[];
|
|
126
|
+
};
|
|
127
|
+
declare const PP_INCOMPATIBLE_VOLTAGE_LEVELS: (source: string) => {
|
|
128
|
+
error_code: PP_ERROR;
|
|
129
|
+
error_message: string;
|
|
130
|
+
eda_item_ids: string[];
|
|
131
|
+
};
|
|
132
|
+
declare const PP_SIGNAL_LEVELS_NOT_CONTAINED_WITHIN_VOLTAGE: (source: string) => {
|
|
133
|
+
error_code: PP_ERROR;
|
|
134
|
+
error_message: string;
|
|
135
|
+
eda_item_ids: string[];
|
|
136
|
+
};
|
|
137
|
+
declare const PP_INCOMPATIBLE_SIGNAL_LEVELS: (source: string) => {
|
|
138
|
+
error_code: PP_ERROR;
|
|
139
|
+
error_message: string;
|
|
140
|
+
eda_item_ids: string[];
|
|
141
|
+
};
|
|
142
|
+
declare const PP_OVERCURRENT: (source: string) => {
|
|
143
|
+
error_code: PP_ERROR;
|
|
144
|
+
error_message: string;
|
|
145
|
+
eda_item_ids: string[];
|
|
146
|
+
};
|
|
147
|
+
declare const PP_INCOMPATIBLE_DIGITAL_THRESHOLDS: (eda_item_ids: string[]) => {
|
|
148
|
+
error_code: PP_ERROR;
|
|
149
|
+
error_message: string;
|
|
150
|
+
eda_item_ids: string[];
|
|
151
|
+
};
|
|
152
|
+
declare const PP_REQUIRES_CONNECTED_SOURCE_OR_BIDIR: (eda_item_ids: string[]) => {
|
|
153
|
+
error_code: PP_ERROR;
|
|
154
|
+
error_message: string;
|
|
155
|
+
eda_item_ids: string[];
|
|
156
|
+
};
|
|
157
|
+
declare const PP_ILLEGAL_CONNECTION: (eda_item_ids: string[], detail: string) => {
|
|
158
|
+
error_code: PP_ERROR;
|
|
159
|
+
error_message: string;
|
|
160
|
+
eda_item_ids: string[];
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/**Token from KiCAD
|
|
164
|
+
* https://gitlab.com/kicad/code/kicad/-/blob/master/eeschema/erc/erc_settings.h
|
|
165
|
+
*/
|
|
166
|
+
declare enum ERCE_T {
|
|
167
|
+
ERCE_DUPLICATE_SHEET_NAME = "duplicate_sheet_names",
|
|
168
|
+
ERCE_ENDPOINT_OFF_GRID = "endpoint_off_grid",
|
|
169
|
+
ERCE_PIN_NOT_CONNECTED = "pin_not_connected",
|
|
170
|
+
ERCE_PIN_NOT_DRIVEN = "pin_not_driven",
|
|
171
|
+
ERCE_POWERPIN_NOT_DRIVEN = "power_pin_not_driven",
|
|
172
|
+
ERCE_HIERACHICAL_LABEL = "hier_label_mismatch",
|
|
173
|
+
ERCE_NOCONNECT_CONNECTED = "no_connect_connected",
|
|
174
|
+
ERCE_NOCONNECT_NOT_CONNECTED = "no_connect_dangling",
|
|
175
|
+
ERCE_LABEL_NOT_CONNECTED = "label_dangling",
|
|
176
|
+
ERCE_SIMILAR_LABELS = "similar_labels",
|
|
177
|
+
ERCE_SIMILAR_POWER = "similar_power",
|
|
178
|
+
ERCE_SIMILAR_LABEL_AND_POWER = "similar_label_and_power",
|
|
179
|
+
ERCE_SINGLE_GLOBAL_LABEL = "single_global_label",
|
|
180
|
+
ERCE_SAME_LOCAL_GLOBAL_LABEL = "same_local_global_label",
|
|
181
|
+
ERCE_DIFFERENT_UNIT_FP = "different_unit_footprint",
|
|
182
|
+
ERCE_MISSING_POWER_INPUT_PIN = "missing_power_input_pin",
|
|
183
|
+
ERCE_MISSING_INPUT_PIN = "missing_input_pin",
|
|
184
|
+
ERCE_MISSING_BIDI_PIN = "missing_bidi_pin",
|
|
185
|
+
ERCE_MISSING_UNIT = "missing_unit",
|
|
186
|
+
ERCE_DIFFERENT_UNIT_NET = "different_unit_net",
|
|
187
|
+
ERCE_BUS_ALIAS_CONFLICT = "bus_definition_conflict",
|
|
188
|
+
ERCE_DRIVER_CONFLICT = "multiple_net_names",
|
|
189
|
+
ERCE_BUS_ENTRY_CONFLICT = "net_not_bus_member",
|
|
190
|
+
ERCE_BUS_TO_BUS_CONFLICT = "bus_to_bus_conflict",
|
|
191
|
+
ERCE_BUS_TO_NET_CONFLICT = "bus_to_net_conflict",
|
|
192
|
+
ERCE_GLOBLABEL = "global_label_dangling",
|
|
193
|
+
ERCE_UNRESOLVED_VARIABLE = "unresolved_variable",
|
|
194
|
+
ERCE_UNDEFINED_NETCLASS = "undefined_netclass",
|
|
195
|
+
ERCE_SIMULATION_MODEL = "simulation_model_issue",
|
|
196
|
+
ERCE_WIRE_DANGLING = "wire_dangling",
|
|
197
|
+
ERCE_LIB_SYMBOL_ISSUES = "lib_symbol_issues",
|
|
198
|
+
ERCE_LIB_SYMBOL_MISMATCH = "lib_symbol_mismatch",
|
|
199
|
+
ERCE_FOOTPRINT_LINK_ISSUES = "footprint_link_issues",
|
|
200
|
+
ERCE_FOOTPRINT_FILTERS = "footprint_filter",
|
|
201
|
+
ERCE_UNANNOTATED = "unannotated",
|
|
202
|
+
ERCE_EXTRA_UNITS = "extra_units",
|
|
203
|
+
ERCE_DIFFERENT_UNIT_VALUE = "unit_value_mismatch",
|
|
204
|
+
ERCE_DUPLICATE_REFERENCE = "duplicate_reference",
|
|
205
|
+
ERCE_BUS_ENTRY_NEEDED = "bus_entry_needed",
|
|
206
|
+
ERCE_FOUR_WAY_JUNCTION = "four_way_junction",
|
|
207
|
+
ERCE_LABEL_MULTIPLE_WIRES = "label_multiple_wires",
|
|
208
|
+
ERCE_UNCONNECTED_WIRE_ENDPOINT = "unconnected_wire_endpoint",
|
|
209
|
+
ERCE_LAST = "unconnected_wire_endpoint",
|
|
210
|
+
ERCE_DUPLICATE_PIN_ERROR = "ERCE_DUPLICATE_PIN_ERROR",
|
|
211
|
+
ERCE_PIN_TO_PIN_WARNING = "ERCE_PIN_TO_PIN_WARNING",
|
|
212
|
+
ERCE_PIN_TO_PIN_ERROR = "ERCE_PIN_TO_PIN_ERROR",
|
|
213
|
+
ERCE_ANNOTATION_ACTION = "ERCE_ANNOTATION_ACTION",
|
|
214
|
+
ERCE_GENERIC_WARNING = "ERCE_GENERIC_WARNING",
|
|
215
|
+
ERCE_GENERIC_ERROR = "ERCE_GENERIC_ERROR"
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
declare enum PIN_ERROR {
|
|
219
|
+
OK = 0,
|
|
220
|
+
WARNING = 1,
|
|
221
|
+
PP_ERROR = 2,
|
|
222
|
+
UNCONNECTED = 3
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
declare class ERC_SETTING {
|
|
226
|
+
private pin_map;
|
|
227
|
+
private rule_severities;
|
|
228
|
+
constructor({ pin_map, rule_severities, }: {
|
|
229
|
+
pin_map: PIN_ERROR[][];
|
|
230
|
+
rule_severities: Record<ERCE_T, SEVERITY>;
|
|
231
|
+
});
|
|
232
|
+
IsTestEnabled(code: ERCE_T): boolean;
|
|
233
|
+
GetPinMapValue(aFirstType: ELECTRICAL_PINTYPE, aSecondType: ELECTRICAL_PINTYPE): PIN_ERROR;
|
|
234
|
+
SetPinMapValue(aFirstType: ELECTRICAL_PINTYPE, aSecondType: ELECTRICAL_PINTYPE, aValue: PIN_ERROR): void;
|
|
235
|
+
GetSeverity(code: ERCE_T): SEVERITY;
|
|
236
|
+
SetSeverity(code: ERCE_T, severity: SEVERITY): void;
|
|
237
|
+
toJSON(): {
|
|
238
|
+
pin_map: PIN_ERROR[][];
|
|
239
|
+
rule_severities: Record<ERCE_T, SEVERITY>;
|
|
240
|
+
erc_exclusions: never[];
|
|
241
|
+
meta: {
|
|
242
|
+
version: number;
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
declare const DEFAULT_PIN_MAP: PIN_ERROR[][];
|
|
247
|
+
declare const DEFAULT_SEVERITY: Record<ERCE_T, SEVERITY>;
|
|
248
|
+
declare const DEFAULT_ERC_SETTING: ERC_SETTING;
|
|
249
|
+
|
|
250
|
+
interface CG_Visitor {
|
|
251
|
+
visit_cc(cc: ConnectionSubgraph): void;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
declare class PIN_COMPATIBILITY_MATRIX_TESTER implements CG_Visitor {
|
|
255
|
+
private readonly ctx;
|
|
256
|
+
constructor(ctx: PIN_TO_PIN_TEST_CONTEXT);
|
|
257
|
+
visit_cc(cc: ConnectionSubgraph): void;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
interface PIN_TO_PIN_TEST_CONTEXT {
|
|
261
|
+
report: ERC_REPORT;
|
|
262
|
+
erc_setting: ERC_SETTING;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
type ADT_AdjacencyList = Set<string>;
|
|
266
|
+
type ADT_Graph = Record<string, ADT_AdjacencyList>;
|
|
267
|
+
|
|
268
|
+
interface GRAPH_CONVERTER {
|
|
269
|
+
convert_to_graph(design: unknown): true | Error[];
|
|
270
|
+
get_graph(): ADT_Graph;
|
|
271
|
+
get_connection_node_map(): ConnectionNodeMap;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
interface CONNECTION_GRAPH_BUILDER_CTX {
|
|
275
|
+
module_resolver: ModuleResolver;
|
|
276
|
+
dependencies?: Record<string, string>;
|
|
277
|
+
schematics: Record<string, unknown>;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* PolymorphicBlocks blocks error codes start here.
|
|
282
|
+
*
|
|
283
|
+
* See https://github.com/BerkeleyHCI/PolymorphicBlocks/blob/master/compiler/src/main/scala/edg/compiler/CompilerError.scala
|
|
284
|
+
*/
|
|
285
|
+
|
|
286
|
+
declare enum PP_ERROR {
|
|
287
|
+
UN_COMPILED_BLOCK = "un_compiled_block",
|
|
288
|
+
UN_COMPILED_LINK = "un_compiled_link",
|
|
289
|
+
UN_COMPILED_LINK_ARRAY = "un_compiled_link_array",
|
|
290
|
+
UN_COMPILED_PARAMETER = "un_compiled_parameter",
|
|
291
|
+
UN_COMPILED_INTERNAL_ELEMENT = "un_compiled_internal_element",
|
|
292
|
+
UN_COMPILED_LIBRARY_ELEMENT = "un_compiled_library_element",
|
|
293
|
+
UNDEFINED_PORT_ARRAY = "undefined_port_array",
|
|
294
|
+
LIBRARY_ERROR = "library_error",
|
|
295
|
+
GENERATOR_ERROR = "generator_error",
|
|
296
|
+
REFINEMENT_SUBCLASS_ERROR = "refinement_subclass_error",
|
|
297
|
+
OVER_ASSIGN = "over_assign",
|
|
298
|
+
BAD_REFERENCE = "bad_reference",
|
|
299
|
+
ABSTRACT_BLOCK = "abstract_block",
|
|
300
|
+
FAILED_ASSERTION = "failed_assertion",
|
|
301
|
+
UN_EVALUATED_ASSERTION = "un_evaluated_assertion",
|
|
302
|
+
INCONSISTENT_LINK_ARRAY_ELEMENTS = "inconsistent_link_array_elements",
|
|
303
|
+
PP_UNANNOTATED = "pp_unannotated",
|
|
304
|
+
PP_UNKNOWN_PORT_TYPE = "pp_unknown_port_type",
|
|
305
|
+
INAPPROPRIATE_FUNC = "Functionally inappropriate link",
|
|
306
|
+
NOT_DRIVEN = "pp_not_driven",
|
|
307
|
+
DUPLICATED_PWR_SOURCES = "duplicated_pwr_sources",
|
|
308
|
+
INSUFFICIENT_DRIVER = "Insufficient_driver",
|
|
309
|
+
OVER_DRIVEN = "over_driven",
|
|
310
|
+
IMPEDANCE_SIGNAL_INTEGRITY = "impedance_signal_integrity",
|
|
311
|
+
INCOMPATIBLE_VOLTAGE_LEVELS = "incompatible_voltage_levels",
|
|
312
|
+
SIGNAL_LEVELS_NOT_CONTAINED_WITHIN_VOLTAGE = "signal_levels_not_contained_within_voltage",
|
|
313
|
+
INCOMPATIBLE_SIGNAL_LEVELS = "incompatible_signal_levels",
|
|
314
|
+
OVERCURRENT = "overcurrent",
|
|
315
|
+
INCOMPATIBLE_DIGITAL_THRESHOLDS = "incompatible_digital_thresholds",
|
|
316
|
+
REQUIRES_CONNECTED_SOURCE_OR_BIDIR = "requires_connected_source_or_bidir",
|
|
317
|
+
ILLEGAL_CONNECTION = "Illegal_connection"
|
|
318
|
+
}
|
|
319
|
+
declare const DEFAULT_PP_ERROR_SEVERITY: Record<PP_ERROR, SEVERITY>;
|
|
320
|
+
|
|
321
|
+
interface ParameterPropagationTestContext {
|
|
322
|
+
report: ERC_REPORT;
|
|
323
|
+
}
|
|
324
|
+
declare class ParameterPropagationTester implements CG_Visitor {
|
|
325
|
+
private readonly ctx;
|
|
326
|
+
constructor(ctx: ParameterPropagationTestContext);
|
|
327
|
+
private link_map;
|
|
328
|
+
private port_id;
|
|
329
|
+
private has_passive_port;
|
|
330
|
+
private run_test;
|
|
331
|
+
visit_cc(cc: ConnectionSubgraph): void;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
declare const DrivingPinTypes: Set<ELECTRICAL_PINTYPE>;
|
|
335
|
+
declare const PowerDrivingPinTypes: Set<ELECTRICAL_PINTYPE>;
|
|
336
|
+
declare const DrivenPinTypes: Set<ELECTRICAL_PINTYPE>;
|
|
337
|
+
|
|
338
|
+
declare class NetlistTester implements CG_Visitor {
|
|
339
|
+
private readonly ctx;
|
|
340
|
+
constructor(ctx: PIN_TO_PIN_TEST_CONTEXT);
|
|
341
|
+
visit_cc(cc: ConnectionSubgraph): void;
|
|
342
|
+
private ercCheckMultipleDrivers;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* A holder for a rule check item, DRC in Pcbnew or ERC in Eeschema.
|
|
347
|
+
*
|
|
348
|
+
* RC_ITEMs can have zero, one, or two related EDA_ITEMs.
|
|
349
|
+
*/
|
|
350
|
+
interface RC_ITEM {
|
|
351
|
+
/**
|
|
352
|
+
* The UUIDs of the eda items that are related to this item.
|
|
353
|
+
*/
|
|
354
|
+
eda_item_ids: string[];
|
|
355
|
+
/**
|
|
356
|
+
* The error code's numeric value
|
|
357
|
+
*/
|
|
358
|
+
error_code: ERCE_T | PP_ERROR;
|
|
359
|
+
/**
|
|
360
|
+
* A message describing the details of this specific error
|
|
361
|
+
*/
|
|
362
|
+
error_message: string;
|
|
363
|
+
/**
|
|
364
|
+
* The string describing the type of error
|
|
365
|
+
*/
|
|
366
|
+
error_title?: string;
|
|
367
|
+
/**
|
|
368
|
+
* The key used to describe this type of error in settings
|
|
369
|
+
*/
|
|
370
|
+
setting_key?: string;
|
|
371
|
+
/**
|
|
372
|
+
* The id of the marker this item belongs to, if any
|
|
373
|
+
*/
|
|
374
|
+
parent_id?: string;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
interface ERC_ITEM extends RC_ITEM {
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
interface SCH_ERC_ITEM extends ERC_ITEM {
|
|
381
|
+
/**
|
|
382
|
+
* Determines whether the ERC item is bound to a specific sheet, or is common across multiple
|
|
383
|
+
* sheets (e.g. whether the error is internal to a hierarchical sheet, or is due to an enclosing
|
|
384
|
+
* context interacting with the hierarchical sheet)
|
|
385
|
+
* @return true if ERC applies to a specific sheet, otherwise false
|
|
386
|
+
*/
|
|
387
|
+
sheet_specific?: boolean;
|
|
388
|
+
/**
|
|
389
|
+
* Gets the EM_SCH_SHEET_PATH this ERC item is bound to. Throws std::bad_optional_access if there
|
|
390
|
+
* is no specific sheet path binding
|
|
391
|
+
* @return the EM_SCH_SHEET_PATH containing the ERC violation
|
|
392
|
+
*/
|
|
393
|
+
sheet_specific_path?: GS_SCH_SHEET_PATH;
|
|
394
|
+
/**
|
|
395
|
+
* Gets the EM_SCH_SHEET_PATH of the main item causing this ERC violation
|
|
396
|
+
* @return EM_SCH_SHEET_PATH containing the main item
|
|
397
|
+
*/
|
|
398
|
+
main_item_sheet_path?: GS_SCH_SHEET_PATH;
|
|
399
|
+
/**
|
|
400
|
+
* Gets the EM_SCH_SHEET_PATH of the auxiliary item causing this ERC violation
|
|
401
|
+
* @return EM_SCH_SHEET_PATH containing the auxiliary item
|
|
402
|
+
*/
|
|
403
|
+
aux_item_sheet_path?: GS_SCH_SHEET_PATH;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
interface ERC_CONTEXT {
|
|
407
|
+
erc_setting: ERC_SETTING;
|
|
408
|
+
pp_erc_setting: Record<PP_ERROR, SEVERITY>;
|
|
409
|
+
connection_graph: ConnectionGraph;
|
|
410
|
+
}
|
|
411
|
+
declare class ERC_TESTER {
|
|
412
|
+
private ctx;
|
|
413
|
+
constructor(ctx: ERC_CONTEXT);
|
|
414
|
+
run_test(): {
|
|
415
|
+
connection_graph: ConnectionGraph;
|
|
416
|
+
markers: SCH_MARKER[];
|
|
417
|
+
erc_errors: SCH_ERC_ITEM[];
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
interface CG_SCHEMATIC {
|
|
422
|
+
uuid: string;
|
|
423
|
+
sheets: CG_SHEET[];
|
|
424
|
+
powers: NL_PowerSymbol[];
|
|
425
|
+
}
|
|
426
|
+
declare class IR_GRAPH_CONVERTER implements GRAPH_CONVERTER {
|
|
427
|
+
private readonly circuits;
|
|
428
|
+
private graph;
|
|
429
|
+
private connection_node_map;
|
|
430
|
+
private schematics;
|
|
431
|
+
private reporter_context;
|
|
432
|
+
get_report_context(): ERC_REPORTER_CONTEXT;
|
|
433
|
+
constructor(circuits: Record<string, ModuleCircuit>);
|
|
434
|
+
convert_to_graph(designs: Record<string, IR_Graph>): true | Error[];
|
|
435
|
+
add_node(id: string): void;
|
|
436
|
+
add_pwr(pwr: PowerBase, shape: PowerShape, sch_name: string, param: PowerSymbolPort): void;
|
|
437
|
+
add_connection(from: string, to: string): void;
|
|
438
|
+
do_add_connection(conn: Connection): void;
|
|
439
|
+
get_connection_node_map(): ConnectionNodeMap;
|
|
440
|
+
get_graph(): ADT_Graph;
|
|
441
|
+
get_schematics(): Record<string, CG_SCHEMATIC>;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
declare class ConnectionGraphsBuilder implements CC_Visitor {
|
|
445
|
+
private readonly connection_node_map;
|
|
446
|
+
private net_count;
|
|
447
|
+
private connection_graph;
|
|
448
|
+
private item_graphs;
|
|
449
|
+
constructor(connection_node_map: ConnectionNodeMap);
|
|
450
|
+
end_visit_component(cc: string[]): void;
|
|
451
|
+
resolve_net_drive(nodes: ConnectionNode[], sub_graph: ConnectionSubgraph): void;
|
|
452
|
+
get_connection_graph(): ConnectionGraph;
|
|
453
|
+
get_item_graphs(): Record<string, ConnectionSubgraph>;
|
|
454
|
+
}
|
|
455
|
+
declare function build_connection_graph(ctx: CONNECTION_GRAPH_BUILDER_CTX): Promise<{
|
|
456
|
+
connection_graph: ConnectionGraph;
|
|
457
|
+
item_graphs: Record<string, ConnectionSubgraph>;
|
|
458
|
+
cg_schematics: Record<string, CG_SCHEMATIC>;
|
|
459
|
+
pin_name_table: Record<string, string>;
|
|
460
|
+
pin_module_name_table: Record<string, string>;
|
|
461
|
+
}>;
|
|
462
|
+
|
|
463
|
+
type ERC_INPUT = CONNECTION_GRAPH_BUILDER_CTX & Omit<ERC_CONTEXT, 'connection_graph'>;
|
|
464
|
+
declare function graph_ecr(ctx: Omit<ERC_INPUT, 'schematics'> & {
|
|
465
|
+
schematics: Record<string, IR_Graph>;
|
|
466
|
+
}): Promise<{
|
|
467
|
+
connection_graph: _modular_circuit_electronics_model.ConnectionGraph;
|
|
468
|
+
item_graphs: Record<string, _modular_circuit_electronics_model.ConnectionSubgraph>;
|
|
469
|
+
cg_schematics: Record<string, CG_SCHEMATIC>;
|
|
470
|
+
pin_name_table: Record<string, string>;
|
|
471
|
+
pin_module_name_table: Record<string, string>;
|
|
472
|
+
markers: SCH_MARKER[];
|
|
473
|
+
erc_errors: SCH_ERC_ITEM[];
|
|
474
|
+
}>;
|
|
475
|
+
|
|
476
|
+
export { type ADT_AdjacencyList, type ADT_Graph, type CG_SCHEMATIC, type CONNECTION_GRAPH_BUILDER_CTX, ConnectionGraphsBuilder, DEFAULT_ERC_SETTING, DEFAULT_PIN_MAP, DEFAULT_PP_ERROR_SEVERITY, DEFAULT_SEVERITY, DrivenPinTypes, DrivingPinTypes, ERCE_DRIVER_CONFLICT, ERCE_PIN_NOT_CONNECTED, ERCE_PIN_TO_PIN_ERROR, ERCE_T, ERCE_UNANNOTATED, type ERC_CONTEXT, type ERC_INPUT, type ERC_ITEM, type ERC_REPORT, type ERC_REPORTER_CONTEXT, ERC_SETTING, ERC_TESTER, type GRAPH_CONVERTER, IR_GRAPH_CONVERTER, MakerType, type MarkerBase, NetlistTester, PIN_COMPATIBILITY_MATRIX_TESTER, PIN_ERROR, type PIN_TO_PIN_TEST_CONTEXT, PP_DUPLICATED_SOURCES, PP_ERROR, PP_ILLEGAL_CONNECTION, PP_IMPEDANCE_SIGNAL_INTEGRITY, PP_INAPPROPRIATE_FUNC, PP_INCOMPATIBLE_DIGITAL_THRESHOLDS, PP_INCOMPATIBLE_SIGNAL_LEVELS, PP_INCOMPATIBLE_VOLTAGE_LEVELS, PP_INSUFFICIENT_DRIVER, PP_NOT_DRIVEN, PP_OVERCURRENT, PP_OVER_DRIVEN, PP_REQUIRES_CONNECTED_SOURCE_OR_BIDIR, PP_SIGNAL_LEVELS_NOT_CONTAINED_WITHIN_VOLTAGE, type ParameterPropagationTestContext, ParameterPropagationTester, PowerDrivingPinTypes, type RC_ITEM, type SCH_ERC_ITEM, type SCH_MARKER, SEVERITY, build_connection_graph, fmt_erc_item_description, get_erc_severity, graph_ecr };
|