@modular-circuit/perc 0.0.51 → 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 +35 -54
- package/build/erc/parameter_propagation/error_code.js +39 -37
- 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 +33 -101
- package/build/erc/parameter_propagation/link_testers/tester_impl.js +511 -953
- package/build/erc/parameter_propagation/tester.js +131 -195
- package/build/erc/pin_compatibility_matrix/erc_setting.js +82 -80
- 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 +21 -18
- 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 +12 -9
- package/build/report/erc_reporter.js +88 -68
- 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 +27 -61
- package/build/tester/graph/connection_graphs_builder.js +84 -167
- package/build/tester/graph/graph_erc.js +12 -61
- package/build/tester/graph/index.js +19 -3
- package/build/tester/graph/ir_graph_converter.js +117 -254
- package/build/tester/index.js +18 -2
- package/build/utils/get_dependent_modules_definition.js +17 -141
- package/build/utils/index.js +17 -1
- package/package.json +4 -4
|
@@ -1,279 +1,142 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 {
|
|
8
|
+
circuits;
|
|
9
|
+
graph = {};
|
|
10
|
+
connection_node_map = {};
|
|
11
|
+
schematics = {};
|
|
12
|
+
reporter_context = {
|
|
13
|
+
pin_name_table: {},
|
|
14
|
+
pin_module_name_table: {},
|
|
9
15
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
13
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
14
|
-
if (!m) return o;
|
|
15
|
-
var i = m.call(o), r, ar = [], e;
|
|
16
|
-
try {
|
|
17
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
18
|
-
}
|
|
19
|
-
catch (error) { e = { error: error }; }
|
|
20
|
-
finally {
|
|
21
|
-
try {
|
|
22
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
23
|
-
}
|
|
24
|
-
finally { if (e) throw e.error; }
|
|
25
|
-
}
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
29
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
30
|
-
if (ar || !(i in from)) {
|
|
31
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
32
|
-
ar[i] = from[i];
|
|
33
|
-
}
|
|
16
|
+
get_report_context() {
|
|
17
|
+
return this.reporter_context;
|
|
34
18
|
}
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
import { ConnectionNodeType, LinkType, PortType, } from '@modular-circuit/electronics-model';
|
|
38
|
-
import { PowerShape, } from '@modular-circuit/electronics-model';
|
|
39
|
-
import { deep_copy, fmt_module_name, gen_uuid, get_circuit_ports, get_port_labels } from '@modular-circuit/utils';
|
|
40
|
-
var IR_GRAPH_CONVERTER = /** @class */ (function () {
|
|
41
|
-
function IR_GRAPH_CONVERTER(circuits) {
|
|
19
|
+
constructor(circuits) {
|
|
42
20
|
this.circuits = circuits;
|
|
43
|
-
this.graph = {};
|
|
44
|
-
this.connection_node_map = {};
|
|
45
|
-
this.schematics = {};
|
|
46
|
-
this.reporter_context = {
|
|
47
|
-
pin_name_table: {},
|
|
48
|
-
pin_module_name_table: {},
|
|
49
|
-
};
|
|
50
21
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
IR_GRAPH_CONVERTER.prototype.convert_to_graph = function (designs) {
|
|
55
|
-
var e_1, _a, e_2, _b, e_3, _c, e_4, _d, e_5, _e, e_6, _f, e_7, _g, e_8, _h, e_9, _j;
|
|
56
|
-
var _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
57
|
-
var errors = [];
|
|
22
|
+
convert_to_graph(designs) {
|
|
23
|
+
const errors = [];
|
|
58
24
|
if (Object.keys(designs).length > 1) {
|
|
59
25
|
throw new Error('Multiple designs are not supported');
|
|
60
26
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
this.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
type: ConnectionNodeType.Port,
|
|
86
|
-
param: param,
|
|
87
|
-
label_shapes: get_port_labels(param, circuit),
|
|
88
|
-
};
|
|
89
|
-
this.reporter_context.pin_module_name_table[port.uuid] = block.type.name;
|
|
90
|
-
this.reporter_context.pin_name_table[port.uuid] = port.name;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
94
|
-
finally {
|
|
95
|
-
try {
|
|
96
|
-
if (_0 && !_0.done && (_c = _z.return)) _c.call(_z);
|
|
97
|
-
}
|
|
98
|
-
finally { if (e_3) throw e_3.error; }
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
103
|
-
finally {
|
|
104
|
-
try {
|
|
105
|
-
if (_y && !_y.done && (_b = _x.return)) _b.call(_x);
|
|
106
|
-
}
|
|
107
|
-
finally { if (e_2) throw e_2.error; }
|
|
108
|
-
}
|
|
109
|
-
// Labels
|
|
110
|
-
var lb_map = {};
|
|
111
|
-
try {
|
|
112
|
-
for (var _1 = (e_4 = void 0, __values((_o = design.labels) !== null && _o !== void 0 ? _o : [])), _2 = _1.next(); !_2.done; _2 = _1.next()) {
|
|
113
|
-
var lb = _2.value;
|
|
114
|
-
this.add_node(lb.uuid);
|
|
115
|
-
this.reporter_context.pin_name_table[lb.uuid] = lb.text;
|
|
116
|
-
lb_map[lb.text] = __spreadArray(__spreadArray([], __read(((_p = lb_map[lb.text]) !== null && _p !== void 0 ? _p : [])), false), [lb.uuid], false);
|
|
117
|
-
switch (lb.type) {
|
|
118
|
-
case 'label':
|
|
119
|
-
this.connection_node_map[lb.uuid] = { uuid: lb.uuid, type: ConnectionNodeType.NetLabel, text: lb.text };
|
|
120
|
-
break;
|
|
121
|
-
default:
|
|
122
|
-
throw new Error("Unsupported label type ".concat(lb.type));
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
127
|
-
finally {
|
|
128
|
-
try {
|
|
129
|
-
if (_2 && !_2.done && (_d = _1.return)) _d.call(_1);
|
|
130
|
-
}
|
|
131
|
-
finally { if (e_4) throw e_4.error; }
|
|
132
|
-
}
|
|
133
|
-
try {
|
|
134
|
-
for (var _3 = (e_5 = void 0, __values(Object.values(lb_map))), _4 = _3.next(); !_4.done; _4 = _3.next()) {
|
|
135
|
-
var labels = _4.value;
|
|
136
|
-
for (var i = 0; i < labels.length - 1; i++) {
|
|
137
|
-
this.add_connection(labels[i], labels[i + 1]);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
27
|
+
// Blocks
|
|
28
|
+
for (const [sch_name, design] of Object.entries(designs)) {
|
|
29
|
+
this.schematics[sch_name] = { uuid: design.uuid ?? (0, utils_1.gen_uuid)(), sheets: [], powers: [] };
|
|
30
|
+
for (const block of design.blocks ?? []) {
|
|
31
|
+
const circuit = this.circuits[(0, utils_1.fmt_module_name)(block.type)];
|
|
32
|
+
this.schematics[sch_name].sheets.push({
|
|
33
|
+
uuid: block.uuid,
|
|
34
|
+
sheet_name: design.name ?? circuit.name,
|
|
35
|
+
sheet_file_name: circuit.main,
|
|
36
|
+
ports: block.ports.map((p) => p.uuid),
|
|
37
|
+
});
|
|
38
|
+
const port_map = (0, utils_1.get_circuit_ports)(circuit);
|
|
39
|
+
for (const port of block.ports) {
|
|
40
|
+
const param = (0, utils_1.deep_copy)(port_map[port.index]);
|
|
41
|
+
const uuid = port.uuid;
|
|
42
|
+
this.add_node(uuid);
|
|
43
|
+
this.connection_node_map[uuid] = {
|
|
44
|
+
uuid,
|
|
45
|
+
type: electronics_model_1.ConnectionNodeType.Port,
|
|
46
|
+
param,
|
|
47
|
+
label_shapes: (0, utils_1.get_port_labels)(param, circuit),
|
|
48
|
+
};
|
|
49
|
+
this.reporter_context.pin_module_name_table[port.uuid] = block.type.name;
|
|
50
|
+
this.reporter_context.pin_name_table[port.uuid] = port.name;
|
|
140
51
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
name: pwr.value,
|
|
155
|
-
link_type: LinkType.VoltageLink,
|
|
156
|
-
label_associated: pwr.value,
|
|
157
|
-
voltage_out: pwr.param ? pwr.param.voltage_out : {},
|
|
158
|
-
current_limits: pwr.param ? pwr.param.current_limits : {},
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
163
|
-
finally {
|
|
164
|
-
try {
|
|
165
|
-
if (_6 && !_6.done && (_f = _5.return)) _f.call(_5);
|
|
166
|
-
}
|
|
167
|
-
finally { if (e_6) throw e_6.error; }
|
|
168
|
-
}
|
|
169
|
-
try {
|
|
170
|
-
for (var _7 = (e_7 = void 0, __values((_r = design.gnd) !== null && _r !== void 0 ? _r : [])), _8 = _7.next(); !_8.done; _8 = _7.next()) {
|
|
171
|
-
var pwr = _8.value;
|
|
172
|
-
this.add_pwr(pwr, PowerShape.GND, sch_name, {
|
|
173
|
-
type: PortType.Ground,
|
|
174
|
-
name: pwr.value,
|
|
175
|
-
link_type: LinkType.GroundLink,
|
|
176
|
-
label_associated: pwr.value,
|
|
177
|
-
voltage_limits: pwr.param ? pwr.param.voltage_limits : {},
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
182
|
-
finally {
|
|
183
|
-
try {
|
|
184
|
-
if (_8 && !_8.done && (_g = _7.return)) _g.call(_7);
|
|
185
|
-
}
|
|
186
|
-
finally { if (e_7) throw e_7.error; }
|
|
187
|
-
}
|
|
188
|
-
try {
|
|
189
|
-
// Junctions
|
|
190
|
-
for (var _9 = (e_8 = void 0, __values((_s = design.junctions) !== null && _s !== void 0 ? _s : [])), _10 = _9.next(); !_10.done; _10 = _9.next()) {
|
|
191
|
-
var j = _10.value;
|
|
192
|
-
var uuid = j.uuid;
|
|
193
|
-
this.add_node(uuid);
|
|
194
|
-
this.connection_node_map[uuid] = { uuid: uuid, type: ConnectionNodeType.Graphics };
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
198
|
-
finally {
|
|
199
|
-
try {
|
|
200
|
-
if (_10 && !_10.done && (_h = _9.return)) _h.call(_9);
|
|
201
|
-
}
|
|
202
|
-
finally { if (e_8) throw e_8.error; }
|
|
203
|
-
}
|
|
204
|
-
try {
|
|
205
|
-
// Connections
|
|
206
|
-
for (var _11 = (e_9 = void 0, __values((_t = design.wires) !== null && _t !== void 0 ? _t : [])), _12 = _11.next(); !_12.done; _12 = _11.next()) {
|
|
207
|
-
var connection = _12.value;
|
|
208
|
-
var uuid = connection.uuid;
|
|
209
|
-
this.add_connection(connection.from, connection.to);
|
|
210
|
-
this.connection_node_map[uuid] = { uuid: uuid, type: ConnectionNodeType.Graphics };
|
|
211
|
-
}
|
|
52
|
+
}
|
|
53
|
+
// Labels
|
|
54
|
+
const lb_map = {};
|
|
55
|
+
for (const lb of design.labels ?? []) {
|
|
56
|
+
this.add_node(lb.uuid);
|
|
57
|
+
this.reporter_context.pin_name_table[lb.uuid] = lb.text;
|
|
58
|
+
lb_map[lb.text] = [...(lb_map[lb.text] ?? []), lb.uuid];
|
|
59
|
+
switch (lb.type) {
|
|
60
|
+
case 'label':
|
|
61
|
+
this.connection_node_map[lb.uuid] = { uuid: lb.uuid, type: electronics_model_1.ConnectionNodeType.NetLabel, text: lb.text };
|
|
62
|
+
break;
|
|
63
|
+
default:
|
|
64
|
+
throw new Error(`Unsupported label type ${lb.type}`);
|
|
212
65
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
finally { if (e_9) throw e_9.error; }
|
|
66
|
+
}
|
|
67
|
+
for (const labels of Object.values(lb_map)) {
|
|
68
|
+
for (let i = 0; i < labels.length - 1; i++) {
|
|
69
|
+
this.add_connection(labels[i], labels[i + 1]);
|
|
219
70
|
}
|
|
220
71
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
72
|
+
// POWER
|
|
73
|
+
for (const pwr of design.pwr ?? []) {
|
|
74
|
+
this.add_pwr(pwr, electronics_model_2.PowerShape.VCC, sch_name, {
|
|
75
|
+
type: electronics_model_1.PortType.VoltageSource,
|
|
76
|
+
name: pwr.value,
|
|
77
|
+
link_type: electronics_model_1.LinkType.VoltageLink,
|
|
78
|
+
label_associated: pwr.value,
|
|
79
|
+
voltage_out: pwr.param ? pwr.param.voltage_out : {},
|
|
80
|
+
current_limits: pwr.param ? pwr.param.current_limits : {},
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
for (const pwr of design.gnd ?? []) {
|
|
84
|
+
this.add_pwr(pwr, electronics_model_2.PowerShape.GND, sch_name, {
|
|
85
|
+
type: electronics_model_1.PortType.Ground,
|
|
86
|
+
name: pwr.value,
|
|
87
|
+
link_type: electronics_model_1.LinkType.GroundLink,
|
|
88
|
+
label_associated: pwr.value,
|
|
89
|
+
voltage_limits: pwr.param ? pwr.param.voltage_limits : {},
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
// Junctions
|
|
93
|
+
for (const j of design.junctions ?? []) {
|
|
94
|
+
const uuid = j.uuid;
|
|
95
|
+
this.add_node(uuid);
|
|
96
|
+
this.connection_node_map[uuid] = { uuid, type: electronics_model_1.ConnectionNodeType.Graphics };
|
|
97
|
+
}
|
|
98
|
+
// Connections
|
|
99
|
+
for (const connection of design.wires ?? []) {
|
|
100
|
+
const uuid = connection.uuid;
|
|
101
|
+
this.add_connection(connection.from, connection.to);
|
|
102
|
+
this.connection_node_map[uuid] = { uuid, type: electronics_model_1.ConnectionNodeType.Graphics };
|
|
226
103
|
}
|
|
227
|
-
finally { if (e_1) throw e_1.error; }
|
|
228
104
|
}
|
|
229
105
|
return errors.length ? errors : true;
|
|
230
|
-
}
|
|
231
|
-
|
|
106
|
+
}
|
|
107
|
+
add_node(id) {
|
|
232
108
|
if (!this.graph[id])
|
|
233
109
|
this.graph[id] = new Set();
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
110
|
+
}
|
|
111
|
+
add_pwr(pwr, shape, sch_name, param) {
|
|
112
|
+
const uuid = pwr.uuid;
|
|
113
|
+
const value = pwr.value;
|
|
238
114
|
this.add_node(uuid);
|
|
239
115
|
this.reporter_context.pin_name_table[uuid] = pwr.value;
|
|
240
|
-
this.connection_node_map[uuid] = { uuid
|
|
116
|
+
this.connection_node_map[uuid] = { uuid, type: electronics_model_1.ConnectionNodeType.Power, value, param };
|
|
241
117
|
this.schematics[sch_name].powers.push({
|
|
242
|
-
uuid
|
|
243
|
-
value
|
|
244
|
-
shape
|
|
118
|
+
uuid,
|
|
119
|
+
value,
|
|
120
|
+
shape,
|
|
245
121
|
});
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
this.do_add_connection({ from
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
for (var _b = __values([conn.from, conn.to]), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
254
|
-
var p = _c.value;
|
|
255
|
-
this.add_node(p);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
259
|
-
finally {
|
|
260
|
-
try {
|
|
261
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
262
|
-
}
|
|
263
|
-
finally { if (e_10) throw e_10.error; }
|
|
264
|
-
}
|
|
122
|
+
}
|
|
123
|
+
add_connection(from, to) {
|
|
124
|
+
this.do_add_connection({ from, to });
|
|
125
|
+
}
|
|
126
|
+
do_add_connection(conn) {
|
|
127
|
+
for (const p of [conn.from, conn.to])
|
|
128
|
+
this.add_node(p);
|
|
265
129
|
this.graph[conn.from].add(conn.to);
|
|
266
130
|
this.graph[conn.to].add(conn.from);
|
|
267
|
-
}
|
|
268
|
-
|
|
131
|
+
}
|
|
132
|
+
get_connection_node_map() {
|
|
269
133
|
return this.connection_node_map;
|
|
270
|
-
}
|
|
271
|
-
|
|
134
|
+
}
|
|
135
|
+
get_graph() {
|
|
272
136
|
return this.graph;
|
|
273
|
-
}
|
|
274
|
-
|
|
137
|
+
}
|
|
138
|
+
get_schematics() {
|
|
275
139
|
return this.schematics;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
export { IR_GRAPH_CONVERTER };
|
|
140
|
+
}
|
|
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,145 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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;
|
|
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) {
|
|
6
|
+
const circuits = {};
|
|
7
|
+
for (const [, v] of Object.entries(ctx.schematics)) {
|
|
8
|
+
for (const block of v.blocks ?? []) {
|
|
9
|
+
const module_name = (0, utils_1.fmt_module_name)(block.type);
|
|
10
|
+
const version = ctx.dependencies[module_name];
|
|
11
|
+
if (version === undefined) {
|
|
12
|
+
console.warn(`Module ${module_name} not found in dependencies`);
|
|
13
|
+
continue;
|
|
42
14
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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 };
|
|
15
|
+
const def = await ctx.module_resolver.get_module_circuit({ ...block.type, version });
|
|
16
|
+
if (def)
|
|
17
|
+
circuits[module_name] = def;
|
|
55
18
|
}
|
|
56
|
-
};
|
|
57
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
58
|
-
};
|
|
59
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
60
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
61
|
-
if (!m) return o;
|
|
62
|
-
var i = m.call(o), r, ar = [], e;
|
|
63
|
-
try {
|
|
64
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
65
19
|
}
|
|
66
|
-
|
|
67
|
-
finally {
|
|
68
|
-
try {
|
|
69
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
70
|
-
}
|
|
71
|
-
finally { if (e) throw e.error; }
|
|
72
|
-
}
|
|
73
|
-
return ar;
|
|
74
|
-
};
|
|
75
|
-
import { fmt_module_name } from '@modular-circuit/utils';
|
|
76
|
-
export function get_dependent_modules_definition(ctx) {
|
|
77
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
-
var circuits, _a, _b, _c, v, _d, _e, block, module_name, version, def, e_1_1, e_2_1;
|
|
79
|
-
var e_2, _f, e_1, _g;
|
|
80
|
-
var _h;
|
|
81
|
-
return __generator(this, function (_j) {
|
|
82
|
-
switch (_j.label) {
|
|
83
|
-
case 0:
|
|
84
|
-
circuits = {};
|
|
85
|
-
_j.label = 1;
|
|
86
|
-
case 1:
|
|
87
|
-
_j.trys.push([1, 12, 13, 14]);
|
|
88
|
-
_a = __values(Object.entries(ctx.schematics)), _b = _a.next();
|
|
89
|
-
_j.label = 2;
|
|
90
|
-
case 2:
|
|
91
|
-
if (!!_b.done) return [3 /*break*/, 11];
|
|
92
|
-
_c = __read(_b.value, 2), v = _c[1];
|
|
93
|
-
_j.label = 3;
|
|
94
|
-
case 3:
|
|
95
|
-
_j.trys.push([3, 8, 9, 10]);
|
|
96
|
-
_d = (e_1 = void 0, __values((_h = v.blocks) !== null && _h !== void 0 ? _h : [])), _e = _d.next();
|
|
97
|
-
_j.label = 4;
|
|
98
|
-
case 4:
|
|
99
|
-
if (!!_e.done) return [3 /*break*/, 7];
|
|
100
|
-
block = _e.value;
|
|
101
|
-
module_name = fmt_module_name(block.type);
|
|
102
|
-
version = ctx.dependencies[module_name];
|
|
103
|
-
if (version === undefined) {
|
|
104
|
-
console.warn("Module ".concat(module_name, " not found in dependencies"));
|
|
105
|
-
return [3 /*break*/, 6];
|
|
106
|
-
}
|
|
107
|
-
return [4 /*yield*/, ctx.module_resolver.get_module_circuit(__assign(__assign({}, block.type), { version: version }))];
|
|
108
|
-
case 5:
|
|
109
|
-
def = _j.sent();
|
|
110
|
-
if (def)
|
|
111
|
-
circuits[module_name] = def;
|
|
112
|
-
_j.label = 6;
|
|
113
|
-
case 6:
|
|
114
|
-
_e = _d.next();
|
|
115
|
-
return [3 /*break*/, 4];
|
|
116
|
-
case 7: return [3 /*break*/, 10];
|
|
117
|
-
case 8:
|
|
118
|
-
e_1_1 = _j.sent();
|
|
119
|
-
e_1 = { error: e_1_1 };
|
|
120
|
-
return [3 /*break*/, 10];
|
|
121
|
-
case 9:
|
|
122
|
-
try {
|
|
123
|
-
if (_e && !_e.done && (_g = _d.return)) _g.call(_d);
|
|
124
|
-
}
|
|
125
|
-
finally { if (e_1) throw e_1.error; }
|
|
126
|
-
return [7 /*endfinally*/];
|
|
127
|
-
case 10:
|
|
128
|
-
_b = _a.next();
|
|
129
|
-
return [3 /*break*/, 2];
|
|
130
|
-
case 11: return [3 /*break*/, 14];
|
|
131
|
-
case 12:
|
|
132
|
-
e_2_1 = _j.sent();
|
|
133
|
-
e_2 = { error: e_2_1 };
|
|
134
|
-
return [3 /*break*/, 14];
|
|
135
|
-
case 13:
|
|
136
|
-
try {
|
|
137
|
-
if (_b && !_b.done && (_f = _a.return)) _f.call(_a);
|
|
138
|
-
}
|
|
139
|
-
finally { if (e_2) throw e_2.error; }
|
|
140
|
-
return [7 /*endfinally*/];
|
|
141
|
-
case 14: return [2 /*return*/, circuits];
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
});
|
|
20
|
+
return circuits;
|
|
145
21
|
}
|
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",
|