@modular-circuit/perc 0.0.52 → 0.0.54
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/build/erc/connect_graph_visitor/index.js +17 -1
- package/build/erc/connect_graph_visitor/visitor.js +2 -0
- package/build/erc/context/connection_graph_builder_ctx.js +2 -0
- package/build/erc/context/error_severity.js +5 -2
- package/build/erc/context/graph.js +2 -0
- package/build/erc/context/graph_converter.js +2 -0
- package/build/erc/context/index.js +21 -5
- package/build/erc/context/pin_to_pin_test_ctx.js +2 -0
- package/build/erc/index.js +20 -4
- package/build/erc/netlist/constraints.js +12 -9
- package/build/erc/netlist/index.js +18 -2
- package/build/erc/netlist/tester.js +15 -11
- package/build/erc/parameter_propagation/error_code.js +38 -35
- package/build/erc/parameter_propagation/index.js +18 -2
- package/build/erc/parameter_propagation/link_testers/index.js +17 -1
- package/build/erc/parameter_propagation/link_testers/link_tester_base.js +9 -4
- package/build/erc/parameter_propagation/link_testers/tester_impl.js +166 -146
- package/build/erc/parameter_propagation/tester.js +52 -48
- package/build/erc/pin_compatibility_matrix/erc_setting.js +65 -61
- package/build/erc/pin_compatibility_matrix/error_code.js +5 -2
- package/build/erc/pin_compatibility_matrix/index.js +20 -4
- package/build/erc/pin_compatibility_matrix/pin_error.js +5 -2
- package/build/erc/pin_compatibility_matrix/tester.js +13 -9
- package/build/graphics/index.js +18 -2
- package/build/graphics/maker/index.js +19 -3
- package/build/graphics/maker/maker_base.js +2 -0
- package/build/graphics/maker/maker_type.js +5 -2
- package/build/graphics/maker/sch_maker.js +2 -0
- package/build/graphics/sch_erc_item.js +2 -0
- package/build/index.js +21 -5
- package/build/report/erc_report.js +9 -5
- package/build/report/erc_reporter.js +57 -37
- package/build/report/index.js +18 -2
- package/build/rule_check_item/erc_item.js +2 -0
- package/build/rule_check_item/index.js +18 -2
- package/build/rule_check_item/rc_item.js +2 -0
- package/build/tester/erc_tester.js +9 -5
- package/build/tester/graph/connection_graphs_builder.js +33 -28
- package/build/tester/graph/graph_erc.js +8 -5
- package/build/tester/graph/index.js +19 -3
- package/build/tester/graph/ir_graph_converter.js +24 -20
- package/build/tester/index.js +18 -2
- package/build/utils/get_dependent_modules_definition.js +6 -3
- package/build/utils/index.js +17 -1
- package/package.json +4 -4
|
@@ -1,87 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PP_ILLEGAL_CONNECTION = exports.PP_REQUIRES_CONNECTED_SOURCE_OR_BIDIR = exports.PP_INCOMPATIBLE_DIGITAL_THRESHOLDS = exports.PP_OVERCURRENT = exports.PP_INCOMPATIBLE_SIGNAL_LEVELS = exports.PP_SIGNAL_LEVELS_NOT_CONTAINED_WITHIN_VOLTAGE = exports.PP_INCOMPATIBLE_VOLTAGE_LEVELS = exports.PP_IMPEDANCE_SIGNAL_INTEGRITY = exports.PP_OVER_DRIVEN = exports.PP_INSUFFICIENT_DRIVER = exports.PP_DUPLICATED_SOURCES = exports.PP_NOT_DRIVEN = exports.PP_INAPPROPRIATE_FUNC = exports.ERCE_DRIVER_CONFLICT = exports.ERCE_PIN_NOT_CONNECTED = exports.ERCE_PIN_TO_PIN_ERROR = exports.ERCE_UNANNOTATED = void 0;
|
|
4
|
+
const electronics_model_1 = require("@modular-circuit/electronics-model");
|
|
5
|
+
const erc_1 = require("../erc");
|
|
6
|
+
const ERCE_UNANNOTATED = (id) => ({
|
|
7
|
+
error_code: erc_1.ERCE_T.ERCE_UNANNOTATED,
|
|
5
8
|
error_message: 'Port has no electrical type specified.',
|
|
6
9
|
eda_item_ids: [id],
|
|
7
10
|
});
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
exports.ERCE_UNANNOTATED = ERCE_UNANNOTATED;
|
|
12
|
+
const ERCE_PIN_TO_PIN_ERROR = (a, b) => ({
|
|
13
|
+
error_code: erc_1.ERCE_T.ERCE_PIN_TO_PIN_ERROR,
|
|
14
|
+
error_message: `Port ${(0, electronics_model_1.get_electrical_pin_type)(a)} and port ${(0, electronics_model_1.get_electrical_pin_type)(b)} are not compatible.`,
|
|
11
15
|
eda_item_ids: [a.uuid, b.uuid],
|
|
12
16
|
});
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
exports.ERCE_PIN_TO_PIN_ERROR = ERCE_PIN_TO_PIN_ERROR;
|
|
18
|
+
const ERCE_PIN_NOT_CONNECTED = (id) => ({
|
|
19
|
+
error_code: erc_1.ERCE_T.ERCE_PIN_NOT_CONNECTED,
|
|
15
20
|
error_message: 'Port not connected.',
|
|
16
21
|
eda_item_ids: [id],
|
|
17
22
|
});
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
exports.ERCE_PIN_NOT_CONNECTED = ERCE_PIN_NOT_CONNECTED;
|
|
24
|
+
const ERCE_DRIVER_CONFLICT = (eda_item_ids, primaryName, secondaryName) => ({
|
|
25
|
+
error_code: erc_1.PP_ERROR.INAPPROPRIATE_FUNC,
|
|
20
26
|
error_message: `Both ${primaryName} and ${secondaryName} are attached to the same net. `,
|
|
21
27
|
eda_item_ids,
|
|
22
28
|
});
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
exports.ERCE_DRIVER_CONFLICT = ERCE_DRIVER_CONFLICT;
|
|
30
|
+
const PP_INAPPROPRIATE_FUNC = (eda_item_ids) => ({
|
|
31
|
+
error_code: erc_1.PP_ERROR.INAPPROPRIATE_FUNC,
|
|
25
32
|
error_message: 'Inappropriate ports functions.',
|
|
26
33
|
eda_item_ids,
|
|
27
34
|
});
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
exports.PP_INAPPROPRIATE_FUNC = PP_INAPPROPRIATE_FUNC;
|
|
36
|
+
const PP_NOT_DRIVEN = (eda_item_ids) => ({
|
|
37
|
+
error_code: erc_1.PP_ERROR.NOT_DRIVEN,
|
|
30
38
|
error_message: 'Net not driven.',
|
|
31
39
|
eda_item_ids,
|
|
32
40
|
});
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
exports.PP_NOT_DRIVEN = PP_NOT_DRIVEN;
|
|
42
|
+
const PP_DUPLICATED_SOURCES = (eda_item_ids) => ({
|
|
43
|
+
error_code: erc_1.PP_ERROR.DUPLICATED_PWR_SOURCES,
|
|
35
44
|
error_message: 'Net connected to multiple power sources.',
|
|
36
45
|
eda_item_ids,
|
|
37
46
|
});
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
exports.PP_DUPLICATED_SOURCES = PP_DUPLICATED_SOURCES;
|
|
48
|
+
const PP_INSUFFICIENT_DRIVER = (eda_item_ids, desc) => ({
|
|
49
|
+
error_code: erc_1.PP_ERROR.INSUFFICIENT_DRIVER,
|
|
40
50
|
error_message: `Insufficient ${desc} driver.`,
|
|
41
51
|
eda_item_ids,
|
|
42
52
|
});
|
|
43
|
-
|
|
44
|
-
|
|
53
|
+
exports.PP_INSUFFICIENT_DRIVER = PP_INSUFFICIENT_DRIVER;
|
|
54
|
+
const PP_OVER_DRIVEN = (eda_item_ids, desc) => ({
|
|
55
|
+
error_code: erc_1.PP_ERROR.OVER_DRIVEN,
|
|
45
56
|
error_message: `${desc} over driven.`,
|
|
46
57
|
eda_item_ids,
|
|
47
58
|
});
|
|
48
|
-
|
|
49
|
-
|
|
59
|
+
exports.PP_OVER_DRIVEN = PP_OVER_DRIVEN;
|
|
60
|
+
const PP_IMPEDANCE_SIGNAL_INTEGRITY = (eda_item_ids) => ({
|
|
61
|
+
error_code: erc_1.PP_ERROR.IMPEDANCE_SIGNAL_INTEGRITY,
|
|
50
62
|
error_message: 'Source impedance shall be 10x lower than sink impedance for signal integrity.',
|
|
51
63
|
eda_item_ids,
|
|
52
64
|
});
|
|
53
|
-
|
|
54
|
-
|
|
65
|
+
exports.PP_IMPEDANCE_SIGNAL_INTEGRITY = PP_IMPEDANCE_SIGNAL_INTEGRITY;
|
|
66
|
+
const PP_INCOMPATIBLE_VOLTAGE_LEVELS = (source) => ({
|
|
67
|
+
error_code: erc_1.PP_ERROR.IMPEDANCE_SIGNAL_INTEGRITY,
|
|
55
68
|
error_message: 'Incompatible voltage levels.',
|
|
56
69
|
eda_item_ids: [source],
|
|
57
70
|
});
|
|
58
|
-
|
|
59
|
-
|
|
71
|
+
exports.PP_INCOMPATIBLE_VOLTAGE_LEVELS = PP_INCOMPATIBLE_VOLTAGE_LEVELS;
|
|
72
|
+
const PP_SIGNAL_LEVELS_NOT_CONTAINED_WITHIN_VOLTAGE = (source) => ({
|
|
73
|
+
error_code: erc_1.PP_ERROR.SIGNAL_LEVELS_NOT_CONTAINED_WITHIN_VOLTAGE,
|
|
60
74
|
error_message: 'Signal levels not contained within voltage.',
|
|
61
75
|
eda_item_ids: [source],
|
|
62
76
|
});
|
|
63
|
-
|
|
64
|
-
|
|
77
|
+
exports.PP_SIGNAL_LEVELS_NOT_CONTAINED_WITHIN_VOLTAGE = PP_SIGNAL_LEVELS_NOT_CONTAINED_WITHIN_VOLTAGE;
|
|
78
|
+
const PP_INCOMPATIBLE_SIGNAL_LEVELS = (source) => ({
|
|
79
|
+
error_code: erc_1.PP_ERROR.INCOMPATIBLE_SIGNAL_LEVELS,
|
|
65
80
|
error_message: 'Incompatible signal levels.',
|
|
66
81
|
eda_item_ids: [source],
|
|
67
82
|
});
|
|
68
|
-
|
|
69
|
-
|
|
83
|
+
exports.PP_INCOMPATIBLE_SIGNAL_LEVELS = PP_INCOMPATIBLE_SIGNAL_LEVELS;
|
|
84
|
+
const PP_OVERCURRENT = (source) => ({
|
|
85
|
+
error_code: erc_1.PP_ERROR.OVERCURRENT,
|
|
70
86
|
error_message: 'overcurrent.',
|
|
71
87
|
eda_item_ids: [source],
|
|
72
88
|
});
|
|
73
|
-
|
|
74
|
-
|
|
89
|
+
exports.PP_OVERCURRENT = PP_OVERCURRENT;
|
|
90
|
+
const PP_INCOMPATIBLE_DIGITAL_THRESHOLDS = (eda_item_ids) => ({
|
|
91
|
+
error_code: erc_1.PP_ERROR.INCOMPATIBLE_DIGITAL_THRESHOLDS,
|
|
75
92
|
error_message: 'Incompatible digital thresholds.',
|
|
76
93
|
eda_item_ids,
|
|
77
94
|
});
|
|
78
|
-
|
|
79
|
-
|
|
95
|
+
exports.PP_INCOMPATIBLE_DIGITAL_THRESHOLDS = PP_INCOMPATIBLE_DIGITAL_THRESHOLDS;
|
|
96
|
+
const PP_REQUIRES_CONNECTED_SOURCE_OR_BIDIR = (eda_item_ids) => ({
|
|
97
|
+
error_code: erc_1.PP_ERROR.REQUIRES_CONNECTED_SOURCE_OR_BIDIR,
|
|
80
98
|
error_message: 'Requires connected source or bidir.',
|
|
81
99
|
eda_item_ids,
|
|
82
100
|
});
|
|
83
|
-
|
|
84
|
-
|
|
101
|
+
exports.PP_REQUIRES_CONNECTED_SOURCE_OR_BIDIR = PP_REQUIRES_CONNECTED_SOURCE_OR_BIDIR;
|
|
102
|
+
const PP_ILLEGAL_CONNECTION = (eda_item_ids, detail) => ({
|
|
103
|
+
error_code: erc_1.PP_ERROR.ILLEGAL_CONNECTION,
|
|
85
104
|
error_message: `Illegal connection: ${detail}`,
|
|
86
105
|
eda_item_ids,
|
|
87
106
|
});
|
|
107
|
+
exports.PP_ILLEGAL_CONNECTION = PP_ILLEGAL_CONNECTION;
|
package/build/report/index.js
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./erc_report"), exports);
|
|
18
|
+
__exportStar(require("./erc_reporter"), exports);
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./erc_item"), exports);
|
|
18
|
+
__exportStar(require("./rc_item"), exports);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ERC_TESTER = void 0;
|
|
4
|
+
const erc_1 = require("../erc");
|
|
5
|
+
class ERC_TESTER {
|
|
3
6
|
ctx;
|
|
4
7
|
constructor(ctx) {
|
|
5
8
|
this.ctx = ctx;
|
|
@@ -11,9 +14,9 @@ export class ERC_TESTER {
|
|
|
11
14
|
...this.ctx,
|
|
12
15
|
};
|
|
13
16
|
const visitors = [
|
|
14
|
-
new PIN_COMPATIBILITY_MATRIX_TESTER(tester_context),
|
|
15
|
-
new ParameterPropagationTester(tester_context),
|
|
16
|
-
new NetlistTester(tester_context),
|
|
17
|
+
new erc_1.PIN_COMPATIBILITY_MATRIX_TESTER(tester_context),
|
|
18
|
+
new erc_1.ParameterPropagationTester(tester_context),
|
|
19
|
+
new erc_1.NetlistTester(tester_context),
|
|
17
20
|
];
|
|
18
21
|
for (const cc of this.ctx.connection_graph.subgraphs) {
|
|
19
22
|
for (const visitor of visitors) {
|
|
@@ -26,3 +29,4 @@ export class ERC_TESTER {
|
|
|
26
29
|
};
|
|
27
30
|
}
|
|
28
31
|
}
|
|
32
|
+
exports.ERC_TESTER = ERC_TESTER;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectionGraphsBuilder = void 0;
|
|
4
|
+
exports.build_connection_graph = build_connection_graph;
|
|
5
|
+
const electronics_model_1 = require("@modular-circuit/electronics-model");
|
|
6
|
+
const utils_1 = require("@modular-circuit/utils");
|
|
7
|
+
const utils_2 = require("../../utils");
|
|
8
|
+
const ir_graph_converter_1 = require("./ir_graph_converter");
|
|
9
|
+
class ConnectionGraphsBuilder {
|
|
6
10
|
connection_node_map;
|
|
7
11
|
net_count = 0;
|
|
8
12
|
connection_graph;
|
|
@@ -27,41 +31,41 @@ export class ConnectionGraphsBuilder {
|
|
|
27
31
|
}
|
|
28
32
|
resolve_net_drive(nodes, sub_graph) {
|
|
29
33
|
const drivers = {
|
|
30
|
-
[PRIORITY.INVALID]: [],
|
|
31
|
-
[PRIORITY.NONE]: [],
|
|
32
|
-
[PRIORITY.PIN]: [],
|
|
33
|
-
[PRIORITY.SHEET_PIN]: [],
|
|
34
|
-
[PRIORITY.HIER_LABEL]: [],
|
|
35
|
-
[PRIORITY.LOCAL_LABEL]: [],
|
|
36
|
-
[PRIORITY.POWER_PIN]: [],
|
|
37
|
-
[PRIORITY.GLOBAL]: [],
|
|
34
|
+
[electronics_model_1.PRIORITY.INVALID]: [],
|
|
35
|
+
[electronics_model_1.PRIORITY.NONE]: [],
|
|
36
|
+
[electronics_model_1.PRIORITY.PIN]: [],
|
|
37
|
+
[electronics_model_1.PRIORITY.SHEET_PIN]: [],
|
|
38
|
+
[electronics_model_1.PRIORITY.HIER_LABEL]: [],
|
|
39
|
+
[electronics_model_1.PRIORITY.LOCAL_LABEL]: [],
|
|
40
|
+
[electronics_model_1.PRIORITY.POWER_PIN]: [],
|
|
41
|
+
[electronics_model_1.PRIORITY.GLOBAL]: [],
|
|
38
42
|
};
|
|
39
43
|
for (const node of nodes) {
|
|
40
|
-
drivers[get_connection_node_priority(node)] = drivers[get_connection_node_priority(node)] || [];
|
|
41
|
-
drivers[get_connection_node_priority(node)].push(node);
|
|
44
|
+
drivers[(0, electronics_model_1.get_connection_node_priority)(node)] = drivers[(0, electronics_model_1.get_connection_node_priority)(node)] || [];
|
|
45
|
+
drivers[(0, electronics_model_1.get_connection_node_priority)(node)].push(node);
|
|
42
46
|
}
|
|
43
47
|
sub_graph.name = (() => {
|
|
44
48
|
for (const priority of [
|
|
45
|
-
PRIORITY.GLOBAL,
|
|
46
|
-
PRIORITY.POWER_PIN,
|
|
47
|
-
PRIORITY.LOCAL_LABEL,
|
|
48
|
-
PRIORITY.HIER_LABEL,
|
|
49
|
-
PRIORITY.SHEET_PIN,
|
|
50
|
-
PRIORITY.PIN,
|
|
49
|
+
electronics_model_1.PRIORITY.GLOBAL,
|
|
50
|
+
electronics_model_1.PRIORITY.POWER_PIN,
|
|
51
|
+
electronics_model_1.PRIORITY.LOCAL_LABEL,
|
|
52
|
+
electronics_model_1.PRIORITY.HIER_LABEL,
|
|
53
|
+
electronics_model_1.PRIORITY.SHEET_PIN,
|
|
54
|
+
electronics_model_1.PRIORITY.PIN,
|
|
51
55
|
]) {
|
|
52
56
|
const driver_list = drivers[priority];
|
|
53
57
|
if (driver_list.length) {
|
|
54
58
|
switch (priority) {
|
|
55
|
-
case PRIORITY.POWER_PIN:
|
|
56
|
-
case PRIORITY.LOCAL_LABEL:
|
|
59
|
+
case electronics_model_1.PRIORITY.POWER_PIN:
|
|
60
|
+
case electronics_model_1.PRIORITY.LOCAL_LABEL:
|
|
57
61
|
switch (driver_list[0].type) {
|
|
58
|
-
case ConnectionNodeType.NetLabel:
|
|
62
|
+
case electronics_model_1.ConnectionNodeType.NetLabel:
|
|
59
63
|
sub_graph.net_drivers = {
|
|
60
64
|
primary_driver: driver_list[0].uuid,
|
|
61
65
|
drivers: driver_list.map((d) => d.uuid),
|
|
62
66
|
};
|
|
63
67
|
return driver_list[0].text;
|
|
64
|
-
case ConnectionNodeType.Power:
|
|
68
|
+
case electronics_model_1.ConnectionNodeType.Power:
|
|
65
69
|
sub_graph.net_drivers = {
|
|
66
70
|
primary_driver: driver_list[0].uuid,
|
|
67
71
|
drivers: driver_list.map((d) => d.uuid),
|
|
@@ -83,13 +87,14 @@ export class ConnectionGraphsBuilder {
|
|
|
83
87
|
return this.item_graphs;
|
|
84
88
|
}
|
|
85
89
|
}
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
exports.ConnectionGraphsBuilder = ConnectionGraphsBuilder;
|
|
91
|
+
async function build_connection_graph(ctx) {
|
|
92
|
+
const converter = new ir_graph_converter_1.IR_GRAPH_CONVERTER(await (0, utils_2.get_dependent_modules_definition)(ctx));
|
|
88
93
|
const res = converter.convert_to_graph(ctx.schematics);
|
|
89
94
|
if (res !== true)
|
|
90
95
|
throw new Error(`Failed to convert graph ${res.join(',')}`);
|
|
91
96
|
const cc_builder = new ConnectionGraphsBuilder(converter.get_connection_node_map());
|
|
92
|
-
test_connected_components(converter.get_graph(), [cc_builder]);
|
|
97
|
+
(0, utils_1.test_connected_components)(converter.get_graph(), [cc_builder]);
|
|
93
98
|
return {
|
|
94
99
|
...converter.get_report_context(),
|
|
95
100
|
connection_graph: cc_builder.get_connection_graph(),
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.graph_ecr = graph_ecr;
|
|
4
|
+
const erc_tester_1 = require("../erc_tester");
|
|
5
|
+
const connection_graphs_builder_1 = require("./connection_graphs_builder");
|
|
6
|
+
async function graph_ecr(ctx) {
|
|
4
7
|
// const tester = new ERC_TESTER(input )
|
|
5
|
-
const connection_graph = await build_connection_graph(ctx);
|
|
6
|
-
const tester = new ERC_TESTER({
|
|
8
|
+
const connection_graph = await (0, connection_graphs_builder_1.build_connection_graph)(ctx);
|
|
9
|
+
const tester = new erc_tester_1.ERC_TESTER({
|
|
7
10
|
...ctx,
|
|
8
11
|
connection_graph: connection_graph.connection_graph,
|
|
9
12
|
});
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ir_graph_converter"), exports);
|
|
18
|
+
__exportStar(require("./connection_graphs_builder"), exports);
|
|
19
|
+
__exportStar(require("./graph_erc"), exports);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IR_GRAPH_CONVERTER = void 0;
|
|
4
|
+
const electronics_model_1 = require("@modular-circuit/electronics-model");
|
|
5
|
+
const electronics_model_2 = require("@modular-circuit/electronics-model");
|
|
6
|
+
const utils_1 = require("@modular-circuit/utils");
|
|
7
|
+
class IR_GRAPH_CONVERTER {
|
|
5
8
|
circuits;
|
|
6
9
|
graph = {};
|
|
7
10
|
connection_node_map = {};
|
|
@@ -23,25 +26,25 @@ export class IR_GRAPH_CONVERTER {
|
|
|
23
26
|
}
|
|
24
27
|
// Blocks
|
|
25
28
|
for (const [sch_name, design] of Object.entries(designs)) {
|
|
26
|
-
this.schematics[sch_name] = { uuid: design.uuid ?? gen_uuid(), sheets: [], powers: [] };
|
|
29
|
+
this.schematics[sch_name] = { uuid: design.uuid ?? (0, utils_1.gen_uuid)(), sheets: [], powers: [] };
|
|
27
30
|
for (const block of design.blocks ?? []) {
|
|
28
|
-
const circuit = this.circuits[fmt_module_name(block.type)];
|
|
31
|
+
const circuit = this.circuits[(0, utils_1.fmt_module_name)(block.type)];
|
|
29
32
|
this.schematics[sch_name].sheets.push({
|
|
30
33
|
uuid: block.uuid,
|
|
31
34
|
sheet_name: design.name ?? circuit.name,
|
|
32
35
|
sheet_file_name: circuit.main,
|
|
33
36
|
ports: block.ports.map((p) => p.uuid),
|
|
34
37
|
});
|
|
35
|
-
const port_map = get_circuit_ports(circuit);
|
|
38
|
+
const port_map = (0, utils_1.get_circuit_ports)(circuit);
|
|
36
39
|
for (const port of block.ports) {
|
|
37
|
-
const param = deep_copy(port_map[port.index]);
|
|
40
|
+
const param = (0, utils_1.deep_copy)(port_map[port.index]);
|
|
38
41
|
const uuid = port.uuid;
|
|
39
42
|
this.add_node(uuid);
|
|
40
43
|
this.connection_node_map[uuid] = {
|
|
41
44
|
uuid,
|
|
42
|
-
type: ConnectionNodeType.Port,
|
|
45
|
+
type: electronics_model_1.ConnectionNodeType.Port,
|
|
43
46
|
param,
|
|
44
|
-
label_shapes: get_port_labels(param, circuit),
|
|
47
|
+
label_shapes: (0, utils_1.get_port_labels)(param, circuit),
|
|
45
48
|
};
|
|
46
49
|
this.reporter_context.pin_module_name_table[port.uuid] = block.type.name;
|
|
47
50
|
this.reporter_context.pin_name_table[port.uuid] = port.name;
|
|
@@ -55,7 +58,7 @@ export class IR_GRAPH_CONVERTER {
|
|
|
55
58
|
lb_map[lb.text] = [...(lb_map[lb.text] ?? []), lb.uuid];
|
|
56
59
|
switch (lb.type) {
|
|
57
60
|
case 'label':
|
|
58
|
-
this.connection_node_map[lb.uuid] = { uuid: lb.uuid, type: ConnectionNodeType.NetLabel, text: lb.text };
|
|
61
|
+
this.connection_node_map[lb.uuid] = { uuid: lb.uuid, type: electronics_model_1.ConnectionNodeType.NetLabel, text: lb.text };
|
|
59
62
|
break;
|
|
60
63
|
default:
|
|
61
64
|
throw new Error(`Unsupported label type ${lb.type}`);
|
|
@@ -68,20 +71,20 @@ export class IR_GRAPH_CONVERTER {
|
|
|
68
71
|
}
|
|
69
72
|
// POWER
|
|
70
73
|
for (const pwr of design.pwr ?? []) {
|
|
71
|
-
this.add_pwr(pwr, PowerShape.VCC, sch_name, {
|
|
72
|
-
type: PortType.VoltageSource,
|
|
74
|
+
this.add_pwr(pwr, electronics_model_2.PowerShape.VCC, sch_name, {
|
|
75
|
+
type: electronics_model_1.PortType.VoltageSource,
|
|
73
76
|
name: pwr.value,
|
|
74
|
-
link_type: LinkType.VoltageLink,
|
|
77
|
+
link_type: electronics_model_1.LinkType.VoltageLink,
|
|
75
78
|
label_associated: pwr.value,
|
|
76
79
|
voltage_out: pwr.param ? pwr.param.voltage_out : {},
|
|
77
80
|
current_limits: pwr.param ? pwr.param.current_limits : {},
|
|
78
81
|
});
|
|
79
82
|
}
|
|
80
83
|
for (const pwr of design.gnd ?? []) {
|
|
81
|
-
this.add_pwr(pwr, PowerShape.GND, sch_name, {
|
|
82
|
-
type: PortType.Ground,
|
|
84
|
+
this.add_pwr(pwr, electronics_model_2.PowerShape.GND, sch_name, {
|
|
85
|
+
type: electronics_model_1.PortType.Ground,
|
|
83
86
|
name: pwr.value,
|
|
84
|
-
link_type: LinkType.GroundLink,
|
|
87
|
+
link_type: electronics_model_1.LinkType.GroundLink,
|
|
85
88
|
label_associated: pwr.value,
|
|
86
89
|
voltage_limits: pwr.param ? pwr.param.voltage_limits : {},
|
|
87
90
|
});
|
|
@@ -90,13 +93,13 @@ export class IR_GRAPH_CONVERTER {
|
|
|
90
93
|
for (const j of design.junctions ?? []) {
|
|
91
94
|
const uuid = j.uuid;
|
|
92
95
|
this.add_node(uuid);
|
|
93
|
-
this.connection_node_map[uuid] = { uuid, type: ConnectionNodeType.Graphics };
|
|
96
|
+
this.connection_node_map[uuid] = { uuid, type: electronics_model_1.ConnectionNodeType.Graphics };
|
|
94
97
|
}
|
|
95
98
|
// Connections
|
|
96
99
|
for (const connection of design.wires ?? []) {
|
|
97
100
|
const uuid = connection.uuid;
|
|
98
101
|
this.add_connection(connection.from, connection.to);
|
|
99
|
-
this.connection_node_map[uuid] = { uuid, type: ConnectionNodeType.Graphics };
|
|
102
|
+
this.connection_node_map[uuid] = { uuid, type: electronics_model_1.ConnectionNodeType.Graphics };
|
|
100
103
|
}
|
|
101
104
|
}
|
|
102
105
|
return errors.length ? errors : true;
|
|
@@ -110,7 +113,7 @@ export class IR_GRAPH_CONVERTER {
|
|
|
110
113
|
const value = pwr.value;
|
|
111
114
|
this.add_node(uuid);
|
|
112
115
|
this.reporter_context.pin_name_table[uuid] = pwr.value;
|
|
113
|
-
this.connection_node_map[uuid] = { uuid, type: ConnectionNodeType.Power, value, param };
|
|
116
|
+
this.connection_node_map[uuid] = { uuid, type: electronics_model_1.ConnectionNodeType.Power, value, param };
|
|
114
117
|
this.schematics[sch_name].powers.push({
|
|
115
118
|
uuid,
|
|
116
119
|
value,
|
|
@@ -136,3 +139,4 @@ export class IR_GRAPH_CONVERTER {
|
|
|
136
139
|
return this.schematics;
|
|
137
140
|
}
|
|
138
141
|
}
|
|
142
|
+
exports.IR_GRAPH_CONVERTER = IR_GRAPH_CONVERTER;
|
package/build/tester/index.js
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./erc_tester"), exports);
|
|
18
|
+
__exportStar(require("./graph"), exports);
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.get_dependent_modules_definition = get_dependent_modules_definition;
|
|
4
|
+
const utils_1 = require("@modular-circuit/utils");
|
|
5
|
+
async function get_dependent_modules_definition(ctx) {
|
|
3
6
|
const circuits = {};
|
|
4
7
|
for (const [, v] of Object.entries(ctx.schematics)) {
|
|
5
8
|
for (const block of v.blocks ?? []) {
|
|
6
|
-
const module_name = fmt_module_name(block.type);
|
|
9
|
+
const module_name = (0, utils_1.fmt_module_name)(block.type);
|
|
7
10
|
const version = ctx.dependencies[module_name];
|
|
8
11
|
if (version === undefined) {
|
|
9
12
|
console.warn(`Module ${module_name} not found in dependencies`);
|
package/build/utils/index.js
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./get_dependent_modules_definition"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modular-circuit/perc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.54",
|
|
4
4
|
"description": "Programmable Electronic Circuit Check",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"files": [
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"typescript": "^5.4.5"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@modular-circuit/electronics-model": "0.0.
|
|
28
|
-
"@modular-circuit/utils": "0.0.
|
|
29
|
-
"@modular-circuit/ir": "0.0.
|
|
27
|
+
"@modular-circuit/electronics-model": "0.0.46",
|
|
28
|
+
"@modular-circuit/utils": "0.0.32",
|
|
29
|
+
"@modular-circuit/ir": "0.0.54"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"clean": "rimraf build",
|