@modular-circuit/perc 0.0.56 → 0.0.57

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/build/erc/connect_graph_visitor/index.js +1 -17
  2. package/build/erc/connect_graph_visitor/visitor.js +0 -2
  3. package/build/erc/context/connection_graph_builder_ctx.js +0 -2
  4. package/build/erc/context/error_severity.js +2 -5
  5. package/build/erc/context/graph.js +0 -2
  6. package/build/erc/context/graph_converter.js +0 -2
  7. package/build/erc/context/index.js +5 -21
  8. package/build/erc/context/pin_to_pin_test_ctx.js +0 -2
  9. package/build/erc/index.js +4 -20
  10. package/build/erc/netlist/constraints.js +9 -12
  11. package/build/erc/netlist/index.js +2 -18
  12. package/build/erc/netlist/tester.js +54 -35
  13. package/build/erc/parameter_propagation/error_code.js +37 -39
  14. package/build/erc/parameter_propagation/index.js +2 -18
  15. package/build/erc/parameter_propagation/link_testers/index.js +1 -17
  16. package/build/erc/parameter_propagation/link_testers/link_tester_base.js +101 -33
  17. package/build/erc/parameter_propagation/link_testers/tester_impl.js +953 -511
  18. package/build/erc/parameter_propagation/tester.js +195 -131
  19. package/build/erc/pin_compatibility_matrix/erc_setting.js +80 -82
  20. package/build/erc/pin_compatibility_matrix/error_code.js +2 -5
  21. package/build/erc/pin_compatibility_matrix/index.js +4 -20
  22. package/build/erc/pin_compatibility_matrix/pin_error.js +2 -5
  23. package/build/erc/pin_compatibility_matrix/tester.js +18 -21
  24. package/build/graphics/index.js +2 -18
  25. package/build/graphics/maker/index.js +3 -19
  26. package/build/graphics/maker/maker_base.js +0 -2
  27. package/build/graphics/maker/maker_type.js +2 -5
  28. package/build/graphics/maker/sch_maker.js +0 -2
  29. package/build/graphics/sch_erc_item.js +0 -2
  30. package/build/index.js +5 -21
  31. package/build/report/erc_report.js +9 -12
  32. package/build/report/erc_reporter.js +68 -88
  33. package/build/report/index.js +2 -18
  34. package/build/rule_check_item/erc_item.js +0 -2
  35. package/build/rule_check_item/index.js +2 -18
  36. package/build/rule_check_item/rc_item.js +0 -2
  37. package/build/tester/erc_tester.js +61 -27
  38. package/build/tester/graph/connection_graphs_builder.js +167 -84
  39. package/build/tester/graph/graph_erc.js +61 -12
  40. package/build/tester/graph/index.js +3 -19
  41. package/build/tester/graph/ir_graph_converter.js +254 -117
  42. package/build/tester/index.js +2 -18
  43. package/build/utils/get_dependent_modules_definition.js +141 -17
  44. package/build/utils/index.js +1 -17
  45. package/package.json +4 -4
@@ -1,104 +1,187 @@
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 {
10
- connection_node_map;
11
- net_count = 0;
12
- connection_graph;
13
- item_graphs = {};
14
- constructor(connection_node_map) {
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
23
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ var __values = (this && this.__values) || function(o) {
49
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
50
+ if (m) return m.call(o);
51
+ if (o && typeof o.length === "number") return {
52
+ next: function () {
53
+ if (o && i >= o.length) o = void 0;
54
+ return { value: o && o[i++], done: !o };
55
+ }
56
+ };
57
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
58
+ };
59
+ import { ConnectionNodeType, PRIORITY, get_connection_node_priority, } from '@modular-circuit/electronics-model';
60
+ import { test_connected_components } from '@modular-circuit/utils';
61
+ import { get_dependent_modules_definition } from '../../utils';
62
+ import { IR_GRAPH_CONVERTER } from './ir_graph_converter';
63
+ var ConnectionGraphsBuilder = /** @class */ (function () {
64
+ function ConnectionGraphsBuilder(connection_node_map) {
15
65
  this.connection_node_map = connection_node_map;
66
+ this.net_count = 0;
67
+ this.item_graphs = {};
16
68
  this.connection_graph = {
17
69
  subgraphs: [],
18
70
  };
19
71
  }
20
- end_visit_component(cc) {
21
- const sub_graph = {};
72
+ ConnectionGraphsBuilder.prototype.end_visit_component = function (cc) {
73
+ var _this = this;
74
+ var sub_graph = {};
22
75
  sub_graph.is_global_pwr = false;
23
76
  sub_graph.is_isolated = cc.length < 2;
24
- const nodes = cc.map((id) => {
25
- this.item_graphs[id] = sub_graph;
26
- return this.connection_node_map[id];
77
+ var nodes = cc.map(function (id) {
78
+ _this.item_graphs[id] = sub_graph;
79
+ return _this.connection_node_map[id];
27
80
  });
28
81
  sub_graph.nodes = nodes;
29
82
  this.resolve_net_drive(nodes, sub_graph);
30
83
  this.connection_graph.subgraphs.push(sub_graph);
31
- }
32
- resolve_net_drive(nodes, sub_graph) {
33
- const drivers = {
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]: [],
42
- };
43
- for (const node of nodes) {
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);
84
+ };
85
+ ConnectionGraphsBuilder.prototype.resolve_net_drive = function (nodes, sub_graph) {
86
+ var _a, e_1, _b;
87
+ var _this = this;
88
+ var drivers = (_a = {},
89
+ _a[PRIORITY.INVALID] = [],
90
+ _a[PRIORITY.NONE] = [],
91
+ _a[PRIORITY.PIN] = [],
92
+ _a[PRIORITY.SHEET_PIN] = [],
93
+ _a[PRIORITY.HIER_LABEL] = [],
94
+ _a[PRIORITY.LOCAL_LABEL] = [],
95
+ _a[PRIORITY.POWER_PIN] = [],
96
+ _a[PRIORITY.GLOBAL] = [],
97
+ _a);
98
+ try {
99
+ for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
100
+ var node = nodes_1_1.value;
101
+ drivers[get_connection_node_priority(node)] = drivers[get_connection_node_priority(node)] || [];
102
+ drivers[get_connection_node_priority(node)].push(node);
103
+ }
104
+ }
105
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
106
+ finally {
107
+ try {
108
+ if (nodes_1_1 && !nodes_1_1.done && (_b = nodes_1.return)) _b.call(nodes_1);
109
+ }
110
+ finally { if (e_1) throw e_1.error; }
46
111
  }
47
- sub_graph.name = (() => {
48
- for (const priority of [
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,
55
- ]) {
56
- const driver_list = drivers[priority];
57
- if (driver_list.length) {
58
- switch (priority) {
59
- case electronics_model_1.PRIORITY.POWER_PIN:
60
- case electronics_model_1.PRIORITY.LOCAL_LABEL:
61
- switch (driver_list[0].type) {
62
- case electronics_model_1.ConnectionNodeType.NetLabel:
63
- sub_graph.net_drivers = {
64
- primary_driver: driver_list[0].uuid,
65
- drivers: driver_list.map((d) => d.uuid),
66
- };
67
- return driver_list[0].text;
68
- case electronics_model_1.ConnectionNodeType.Power:
69
- sub_graph.net_drivers = {
70
- primary_driver: driver_list[0].uuid,
71
- drivers: driver_list.map((d) => d.uuid),
72
- };
73
- sub_graph.is_global_pwr = true;
74
- return driver_list[0].value;
75
- }
76
- break;
112
+ sub_graph.name = (function () {
113
+ var e_2, _a;
114
+ try {
115
+ for (var _b = __values([
116
+ PRIORITY.GLOBAL,
117
+ PRIORITY.POWER_PIN,
118
+ PRIORITY.LOCAL_LABEL,
119
+ PRIORITY.HIER_LABEL,
120
+ PRIORITY.SHEET_PIN,
121
+ PRIORITY.PIN,
122
+ ]), _c = _b.next(); !_c.done; _c = _b.next()) {
123
+ var priority = _c.value;
124
+ var driver_list = drivers[priority];
125
+ if (driver_list.length) {
126
+ switch (priority) {
127
+ case PRIORITY.POWER_PIN:
128
+ case PRIORITY.LOCAL_LABEL:
129
+ switch (driver_list[0].type) {
130
+ case ConnectionNodeType.NetLabel:
131
+ sub_graph.net_drivers = {
132
+ primary_driver: driver_list[0].uuid,
133
+ drivers: driver_list.map(function (d) { return d.uuid; }),
134
+ };
135
+ return driver_list[0].text;
136
+ case ConnectionNodeType.Power:
137
+ sub_graph.net_drivers = {
138
+ primary_driver: driver_list[0].uuid,
139
+ drivers: driver_list.map(function (d) { return d.uuid; }),
140
+ };
141
+ sub_graph.is_global_pwr = true;
142
+ return driver_list[0].value;
143
+ }
144
+ break;
145
+ }
77
146
  }
78
147
  }
79
148
  }
80
- return `Net-${this.net_count++}`;
149
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
150
+ finally {
151
+ try {
152
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
153
+ }
154
+ finally { if (e_2) throw e_2.error; }
155
+ }
156
+ return "Net-".concat(_this.net_count++);
81
157
  })();
82
- }
83
- get_connection_graph() {
158
+ };
159
+ ConnectionGraphsBuilder.prototype.get_connection_graph = function () {
84
160
  return this.connection_graph;
85
- }
86
- get_item_graphs() {
161
+ };
162
+ ConnectionGraphsBuilder.prototype.get_item_graphs = function () {
87
163
  return this.item_graphs;
88
- }
89
- }
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));
93
- const res = converter.convert_to_graph(ctx.schematics);
94
- if (res !== true)
95
- throw new Error(`Failed to convert graph ${res.join(',')}`);
96
- const cc_builder = new ConnectionGraphsBuilder(converter.get_connection_node_map());
97
- (0, utils_1.test_connected_components)(converter.get_graph(), [cc_builder]);
98
- return {
99
- ...converter.get_report_context(),
100
- connection_graph: cc_builder.get_connection_graph(),
101
- item_graphs: cc_builder.get_item_graphs(),
102
- cg_schematics: converter.get_schematics(),
103
164
  };
165
+ return ConnectionGraphsBuilder;
166
+ }());
167
+ export { ConnectionGraphsBuilder };
168
+ export function build_connection_graph(ctx) {
169
+ return __awaiter(this, void 0, void 0, function () {
170
+ var converter, _a, res, cc_builder;
171
+ return __generator(this, function (_b) {
172
+ switch (_b.label) {
173
+ case 0:
174
+ _a = IR_GRAPH_CONVERTER.bind;
175
+ return [4 /*yield*/, get_dependent_modules_definition(ctx)];
176
+ case 1:
177
+ converter = new (_a.apply(IR_GRAPH_CONVERTER, [void 0, _b.sent()]))();
178
+ res = converter.convert_to_graph(ctx.schematics);
179
+ if (res !== true)
180
+ throw new Error("Failed to convert graph ".concat(res.join(',')));
181
+ cc_builder = new ConnectionGraphsBuilder(converter.get_connection_node_map());
182
+ test_connected_components(converter.get_graph(), [cc_builder]);
183
+ return [2 /*return*/, __assign(__assign({}, converter.get_report_context()), { connection_graph: cc_builder.get_connection_graph(), item_graphs: cc_builder.get_item_graphs(), cg_schematics: converter.get_schematics() })];
184
+ }
185
+ });
186
+ });
104
187
  }
@@ -1,14 +1,63 @@
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) {
7
- // const tester = new ERC_TESTER(input )
8
- const connection_graph = await (0, connection_graphs_builder_1.build_connection_graph)(ctx);
9
- const tester = new erc_tester_1.ERC_TESTER({
10
- ...ctx,
11
- connection_graph: connection_graph.connection_graph,
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
23
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ import { ERC_TESTER } from '../erc_tester';
49
+ import { build_connection_graph } from './connection_graphs_builder';
50
+ export function graph_ecr(ctx) {
51
+ return __awaiter(this, void 0, void 0, function () {
52
+ var connection_graph, tester;
53
+ return __generator(this, function (_a) {
54
+ switch (_a.label) {
55
+ case 0: return [4 /*yield*/, build_connection_graph(ctx)];
56
+ case 1:
57
+ connection_graph = _a.sent();
58
+ tester = new ERC_TESTER(__assign(__assign({}, ctx), { connection_graph: connection_graph.connection_graph }));
59
+ return [2 /*return*/, __assign(__assign({}, tester.run_test()), connection_graph)];
60
+ }
61
+ });
12
62
  });
13
- return { ...tester.run_test(), ...connection_graph };
14
63
  }
@@ -1,19 +1,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
+ export * from './ir_graph_converter';
2
+ export * from './connection_graphs_builder';
3
+ export * from './graph_erc';