@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.
Files changed (45) hide show
  1. package/build/erc/connect_graph_visitor/index.js +17 -1
  2. package/build/erc/connect_graph_visitor/visitor.js +2 -0
  3. package/build/erc/context/connection_graph_builder_ctx.js +2 -0
  4. package/build/erc/context/error_severity.js +5 -2
  5. package/build/erc/context/graph.js +2 -0
  6. package/build/erc/context/graph_converter.js +2 -0
  7. package/build/erc/context/index.js +21 -5
  8. package/build/erc/context/pin_to_pin_test_ctx.js +2 -0
  9. package/build/erc/index.js +20 -4
  10. package/build/erc/netlist/constraints.js +12 -9
  11. package/build/erc/netlist/index.js +18 -2
  12. package/build/erc/netlist/tester.js +35 -54
  13. package/build/erc/parameter_propagation/error_code.js +39 -37
  14. package/build/erc/parameter_propagation/index.js +18 -2
  15. package/build/erc/parameter_propagation/link_testers/index.js +17 -1
  16. package/build/erc/parameter_propagation/link_testers/link_tester_base.js +33 -101
  17. package/build/erc/parameter_propagation/link_testers/tester_impl.js +511 -953
  18. package/build/erc/parameter_propagation/tester.js +131 -195
  19. package/build/erc/pin_compatibility_matrix/erc_setting.js +82 -80
  20. package/build/erc/pin_compatibility_matrix/error_code.js +5 -2
  21. package/build/erc/pin_compatibility_matrix/index.js +20 -4
  22. package/build/erc/pin_compatibility_matrix/pin_error.js +5 -2
  23. package/build/erc/pin_compatibility_matrix/tester.js +21 -18
  24. package/build/graphics/index.js +18 -2
  25. package/build/graphics/maker/index.js +19 -3
  26. package/build/graphics/maker/maker_base.js +2 -0
  27. package/build/graphics/maker/maker_type.js +5 -2
  28. package/build/graphics/maker/sch_maker.js +2 -0
  29. package/build/graphics/sch_erc_item.js +2 -0
  30. package/build/index.js +21 -5
  31. package/build/report/erc_report.js +12 -9
  32. package/build/report/erc_reporter.js +88 -68
  33. package/build/report/index.js +18 -2
  34. package/build/rule_check_item/erc_item.js +2 -0
  35. package/build/rule_check_item/index.js +18 -2
  36. package/build/rule_check_item/rc_item.js +2 -0
  37. package/build/tester/erc_tester.js +27 -61
  38. package/build/tester/graph/connection_graphs_builder.js +84 -167
  39. package/build/tester/graph/graph_erc.js +12 -61
  40. package/build/tester/graph/index.js +19 -3
  41. package/build/tester/graph/ir_graph_converter.js +117 -254
  42. package/build/tester/index.js +18 -2
  43. package/build/utils/get_dependent_modules_definition.js +17 -141
  44. package/build/utils/index.js +17 -1
  45. package/package.json +4 -4
@@ -1 +1,17 @@
1
- export * from './visitor';
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("./visitor"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SEVERITY = void 0;
1
4
  // Note: On windows, SEVERITY_ERROR collides with a system declaration,
2
5
  // so we used RPT_SEVERITY_xxx instead of SEVERITY_xxx
3
- export var SEVERITY;
6
+ var SEVERITY;
4
7
  (function (SEVERITY) {
5
8
  SEVERITY[SEVERITY["RPT_SEVERITY_UNDEFINED"] = 1] = "RPT_SEVERITY_UNDEFINED";
6
9
  SEVERITY[SEVERITY["RPT_SEVERITY_INFO"] = 2] = "RPT_SEVERITY_INFO";
@@ -10,4 +13,4 @@ export var SEVERITY;
10
13
  SEVERITY[SEVERITY["RPT_SEVERITY_ERROR"] = 32] = "RPT_SEVERITY_ERROR";
11
14
  SEVERITY[SEVERITY["RPT_SEVERITY_IGNORE"] = 64] = "RPT_SEVERITY_IGNORE";
12
15
  SEVERITY[SEVERITY["RPT_SEVERITY_DEBUG"] = 128] = "RPT_SEVERITY_DEBUG";
13
- })(SEVERITY || (SEVERITY = {}));
16
+ })(SEVERITY || (exports.SEVERITY = SEVERITY = {}));
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,21 @@
1
- export * from './error_severity';
2
- export * from './pin_to_pin_test_ctx';
3
- export * from './graph';
4
- export * from './graph_converter';
5
- export * from './connection_graph_builder_ctx';
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("./error_severity"), exports);
18
+ __exportStar(require("./pin_to_pin_test_ctx"), exports);
19
+ __exportStar(require("./graph"), exports);
20
+ __exportStar(require("./graph_converter"), exports);
21
+ __exportStar(require("./connection_graph_builder_ctx"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,20 @@
1
- export * from './context';
2
- export * from './parameter_propagation';
3
- export * from './pin_compatibility_matrix';
4
- export * from './netlist';
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("./context"), exports);
18
+ __exportStar(require("./parameter_propagation"), exports);
19
+ __exportStar(require("./pin_compatibility_matrix"), exports);
20
+ __exportStar(require("./netlist"), exports);
@@ -1,4 +1,7 @@
1
- import { ELECTRICAL_PINTYPE } from '@modular-circuit/electronics-model';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DrivenPinTypes = exports.PowerDrivingPinTypes = exports.DrivingPinTypes = void 0;
4
+ const electronics_model_1 = require("@modular-circuit/electronics-model");
2
5
  //NOTE https://gitlab.com/kicad/code/kicad/-/blob/8.0.6/eeschema/erc/erc.cpp
3
6
  /* ERC tests :
4
7
  * 1 - conflicts between connected pins ( example: 2 connected outputs )
@@ -15,16 +18,16 @@ import { ELECTRICAL_PINTYPE } from '@modular-circuit/electronics-model';
15
18
  // List of pin types that are considered drivers for usual input pins
16
19
  // i.e. pin type = ELECTRICAL_PINTYPE::PT_INPUT, but not PT_POWER_IN
17
20
  // that need only a PT_POWER_OUT pin type to be driven
18
- export var DrivingPinTypes = new Set([
19
- ELECTRICAL_PINTYPE.PT_OUTPUT,
20
- ELECTRICAL_PINTYPE.PT_POWER_OUT,
21
- ELECTRICAL_PINTYPE.PT_PASSIVE,
22
- ELECTRICAL_PINTYPE.PT_TRISTATE,
23
- ELECTRICAL_PINTYPE.PT_BIDI,
21
+ exports.DrivingPinTypes = new Set([
22
+ electronics_model_1.ELECTRICAL_PINTYPE.PT_OUTPUT,
23
+ electronics_model_1.ELECTRICAL_PINTYPE.PT_POWER_OUT,
24
+ electronics_model_1.ELECTRICAL_PINTYPE.PT_PASSIVE,
25
+ electronics_model_1.ELECTRICAL_PINTYPE.PT_TRISTATE,
26
+ electronics_model_1.ELECTRICAL_PINTYPE.PT_BIDI,
24
27
  ]);
25
28
  // List of pin types that are considered drivers for power pins
26
29
  // In fact only a ELECTRICAL_PINTYPE::PT_POWER_OUT pin type can drive
27
30
  // power input pins
28
- export var PowerDrivingPinTypes = new Set([ELECTRICAL_PINTYPE.PT_POWER_OUT]);
31
+ exports.PowerDrivingPinTypes = new Set([electronics_model_1.ELECTRICAL_PINTYPE.PT_POWER_OUT]);
29
32
  // List of pin types that require a driver elsewhere on the net
30
- export var DrivenPinTypes = new Set([ELECTRICAL_PINTYPE.PT_INPUT, ELECTRICAL_PINTYPE.PT_POWER_IN]);
33
+ exports.DrivenPinTypes = new Set([electronics_model_1.ELECTRICAL_PINTYPE.PT_INPUT, electronics_model_1.ELECTRICAL_PINTYPE.PT_POWER_IN]);
@@ -1,2 +1,18 @@
1
- export * from './constraints';
2
- export * from './tester';
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("./constraints"), exports);
18
+ __exportStar(require("./tester"), exports);
@@ -1,67 +1,48 @@
1
- var __values = (this && this.__values) || function(o) {
2
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
3
- if (m) return m.call(o);
4
- if (o && typeof o.length === "number") return {
5
- next: function () {
6
- if (o && i >= o.length) o = void 0;
7
- return { value: o && o[i++], done: !o };
8
- }
9
- };
10
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
11
- };
12
- import { ConnectionNodeType } from '@modular-circuit/electronics-model';
13
- import { ERCE_DRIVER_CONFLICT, ERCE_PIN_NOT_CONNECTED } from '../../report';
14
- var NetlistTester = /** @class */ (function () {
15
- function NetlistTester(ctx) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NetlistTester = void 0;
4
+ const electronics_model_1 = require("@modular-circuit/electronics-model");
5
+ const report_1 = require("../../report");
6
+ class NetlistTester {
7
+ ctx;
8
+ constructor(ctx) {
16
9
  this.ctx = ctx;
17
10
  }
18
- NetlistTester.prototype.visit_cc = function (cc) {
19
- if (cc.nodes.length === 1 && cc.nodes[0].type === ConnectionNodeType.Port) {
20
- this.ctx.report.erc_errors.push(ERCE_PIN_NOT_CONNECTED(cc.nodes[0].uuid));
11
+ visit_cc(cc) {
12
+ if (cc.nodes.length === 1 && cc.nodes[0].type === electronics_model_1.ConnectionNodeType.Port) {
13
+ this.ctx.report.erc_errors.push((0, report_1.ERCE_PIN_NOT_CONNECTED)(cc.nodes[0].uuid));
21
14
  return;
22
15
  }
23
16
  this.ercCheckMultipleDrivers(cc);
24
- };
25
- NetlistTester.prototype.ercCheckMultipleDrivers = function (cc) {
26
- var e_1, _a;
17
+ }
18
+ ercCheckMultipleDrivers(cc) {
27
19
  if (!cc.net_drivers)
28
20
  return;
29
- var node_map = cc.nodes.reduce(function (map, node) {
21
+ const node_map = cc.nodes.reduce((map, node) => {
30
22
  map[node.uuid] = node;
31
23
  return map;
32
24
  }, {});
33
- try {
34
- for (var _b = __values(cc.net_drivers.drivers), _c = _b.next(); !_c.done; _c = _b.next()) {
35
- var driver = _c.value;
36
- if (driver === cc.net_drivers.primary_driver)
37
- continue;
38
- var node = node_map[driver];
39
- var net_name = cc.name;
40
- switch (node.type) {
41
- case ConnectionNodeType.Port:
42
- case ConnectionNodeType.Graphics:
43
- break;
44
- case ConnectionNodeType.NetLabel:
45
- if (net_name !== node.text) {
46
- this.ctx.report.erc_errors.push(ERCE_DRIVER_CONFLICT([cc.net_drivers.primary_driver, driver], cc.name, node.text));
47
- }
25
+ for (const driver of cc.net_drivers.drivers) {
26
+ if (driver === cc.net_drivers.primary_driver)
27
+ continue;
28
+ const node = node_map[driver];
29
+ const net_name = cc.name;
30
+ switch (node.type) {
31
+ case electronics_model_1.ConnectionNodeType.Port:
32
+ case electronics_model_1.ConnectionNodeType.Graphics:
33
+ break;
34
+ case electronics_model_1.ConnectionNodeType.NetLabel:
35
+ if (net_name !== node.text) {
36
+ this.ctx.report.erc_errors.push((0, report_1.ERCE_DRIVER_CONFLICT)([cc.net_drivers.primary_driver, driver], cc.name, node.text));
37
+ }
38
+ break;
39
+ case electronics_model_1.ConnectionNodeType.Power:
40
+ if (net_name !== node.value) {
41
+ this.ctx.report.erc_errors.push((0, report_1.ERCE_DRIVER_CONFLICT)([cc.net_drivers.primary_driver, driver], cc.name, node.value));
48
42
  break;
49
- case ConnectionNodeType.Power:
50
- if (net_name !== node.value) {
51
- this.ctx.report.erc_errors.push(ERCE_DRIVER_CONFLICT([cc.net_drivers.primary_driver, driver], cc.name, node.value));
52
- break;
53
- }
54
- }
43
+ }
55
44
  }
56
45
  }
57
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
58
- finally {
59
- try {
60
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
61
- }
62
- finally { if (e_1) throw e_1.error; }
63
- }
64
- };
65
- return NetlistTester;
66
- }());
67
- export { NetlistTester };
46
+ }
47
+ }
48
+ exports.NetlistTester = NetlistTester;
@@ -1,11 +1,13 @@
1
+ "use strict";
1
2
  /**
2
3
  * PolymorphicBlocks blocks error codes start here.
3
4
  *
4
5
  * See https://github.com/BerkeleyHCI/PolymorphicBlocks/blob/master/compiler/src/main/scala/edg/compiler/CompilerError.scala
5
6
  */
6
- var _a;
7
- import { SEVERITY } from '../context';
8
- export var PP_ERROR;
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.DEFAULT_PP_ERROR_SEVERITY = exports.PP_ERROR = void 0;
9
+ const context_1 = require("../context");
10
+ var PP_ERROR;
9
11
  (function (PP_ERROR) {
10
12
  PP_ERROR["UN_COMPILED_BLOCK"] = "un_compiled_block";
11
13
  PP_ERROR["UN_COMPILED_LINK"] = "un_compiled_link";
@@ -38,37 +40,37 @@ export var PP_ERROR;
38
40
  PP_ERROR["INCOMPATIBLE_DIGITAL_THRESHOLDS"] = "incompatible_digital_thresholds";
39
41
  PP_ERROR["REQUIRES_CONNECTED_SOURCE_OR_BIDIR"] = "requires_connected_source_or_bidir";
40
42
  PP_ERROR["ILLEGAL_CONNECTION"] = "Illegal_connection";
41
- })(PP_ERROR || (PP_ERROR = {}));
42
- export var DEFAULT_PP_ERROR_SEVERITY = (_a = {},
43
- _a[PP_ERROR.UN_COMPILED_BLOCK] = SEVERITY.RPT_SEVERITY_WARNING,
44
- _a[PP_ERROR.UN_COMPILED_LINK] = SEVERITY.RPT_SEVERITY_WARNING,
45
- _a[PP_ERROR.UN_COMPILED_LINK_ARRAY] = SEVERITY.RPT_SEVERITY_WARNING,
46
- _a[PP_ERROR.UN_COMPILED_PARAMETER] = SEVERITY.RPT_SEVERITY_WARNING,
47
- _a[PP_ERROR.UN_COMPILED_INTERNAL_ELEMENT] = SEVERITY.RPT_SEVERITY_WARNING,
48
- _a[PP_ERROR.UN_COMPILED_LIBRARY_ELEMENT] = SEVERITY.RPT_SEVERITY_WARNING,
49
- _a[PP_ERROR.UNDEFINED_PORT_ARRAY] = SEVERITY.RPT_SEVERITY_WARNING,
50
- _a[PP_ERROR.LIBRARY_ERROR] = SEVERITY.RPT_SEVERITY_WARNING,
51
- _a[PP_ERROR.GENERATOR_ERROR] = SEVERITY.RPT_SEVERITY_WARNING,
52
- _a[PP_ERROR.REFINEMENT_SUBCLASS_ERROR] = SEVERITY.RPT_SEVERITY_WARNING,
53
- _a[PP_ERROR.OVER_ASSIGN] = SEVERITY.RPT_SEVERITY_ERROR,
54
- _a[PP_ERROR.BAD_REFERENCE] = SEVERITY.RPT_SEVERITY_WARNING,
55
- _a[PP_ERROR.ABSTRACT_BLOCK] = SEVERITY.RPT_SEVERITY_WARNING,
56
- _a[PP_ERROR.FAILED_ASSERTION] = SEVERITY.RPT_SEVERITY_ERROR,
57
- _a[PP_ERROR.UN_EVALUATED_ASSERTION] = SEVERITY.RPT_SEVERITY_ERROR,
58
- _a[PP_ERROR.INCONSISTENT_LINK_ARRAY_ELEMENTS] = SEVERITY.RPT_SEVERITY_WARNING,
59
- _a[PP_ERROR.PP_UNANNOTATED] = SEVERITY.RPT_SEVERITY_WARNING,
60
- _a[PP_ERROR.PP_UNKNOWN_PORT_TYPE] = SEVERITY.RPT_SEVERITY_ERROR,
61
- _a[PP_ERROR.INAPPROPRIATE_FUNC] = SEVERITY.RPT_SEVERITY_ERROR,
62
- _a[PP_ERROR.NOT_DRIVEN] = SEVERITY.RPT_SEVERITY_WARNING,
63
- _a[PP_ERROR.DUPLICATED_PWR_SOURCES] = SEVERITY.RPT_SEVERITY_WARNING,
64
- _a[PP_ERROR.INSUFFICIENT_DRIVER] = SEVERITY.RPT_SEVERITY_WARNING,
65
- _a[PP_ERROR.OVER_DRIVEN] = SEVERITY.RPT_SEVERITY_WARNING,
66
- _a[PP_ERROR.IMPEDANCE_SIGNAL_INTEGRITY] = SEVERITY.RPT_SEVERITY_WARNING,
67
- _a[PP_ERROR.INCOMPATIBLE_VOLTAGE_LEVELS] = SEVERITY.RPT_SEVERITY_WARNING,
68
- _a[PP_ERROR.SIGNAL_LEVELS_NOT_CONTAINED_WITHIN_VOLTAGE] = SEVERITY.RPT_SEVERITY_WARNING,
69
- _a[PP_ERROR.INCOMPATIBLE_SIGNAL_LEVELS] = SEVERITY.RPT_SEVERITY_WARNING,
70
- _a[PP_ERROR.OVERCURRENT] = SEVERITY.RPT_SEVERITY_WARNING,
71
- _a[PP_ERROR.INCOMPATIBLE_DIGITAL_THRESHOLDS] = SEVERITY.RPT_SEVERITY_WARNING,
72
- _a[PP_ERROR.REQUIRES_CONNECTED_SOURCE_OR_BIDIR] = SEVERITY.RPT_SEVERITY_WARNING,
73
- _a[PP_ERROR.ILLEGAL_CONNECTION] = SEVERITY.RPT_SEVERITY_ERROR,
74
- _a);
43
+ })(PP_ERROR || (exports.PP_ERROR = PP_ERROR = {}));
44
+ exports.DEFAULT_PP_ERROR_SEVERITY = {
45
+ [PP_ERROR.UN_COMPILED_BLOCK]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
46
+ [PP_ERROR.UN_COMPILED_LINK]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
47
+ [PP_ERROR.UN_COMPILED_LINK_ARRAY]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
48
+ [PP_ERROR.UN_COMPILED_PARAMETER]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
49
+ [PP_ERROR.UN_COMPILED_INTERNAL_ELEMENT]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
50
+ [PP_ERROR.UN_COMPILED_LIBRARY_ELEMENT]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
51
+ [PP_ERROR.UNDEFINED_PORT_ARRAY]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
52
+ [PP_ERROR.LIBRARY_ERROR]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
53
+ [PP_ERROR.GENERATOR_ERROR]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
54
+ [PP_ERROR.REFINEMENT_SUBCLASS_ERROR]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
55
+ [PP_ERROR.OVER_ASSIGN]: context_1.SEVERITY.RPT_SEVERITY_ERROR,
56
+ [PP_ERROR.BAD_REFERENCE]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
57
+ [PP_ERROR.ABSTRACT_BLOCK]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
58
+ [PP_ERROR.FAILED_ASSERTION]: context_1.SEVERITY.RPT_SEVERITY_ERROR,
59
+ [PP_ERROR.UN_EVALUATED_ASSERTION]: context_1.SEVERITY.RPT_SEVERITY_ERROR,
60
+ [PP_ERROR.INCONSISTENT_LINK_ARRAY_ELEMENTS]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
61
+ [PP_ERROR.PP_UNANNOTATED]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
62
+ [PP_ERROR.PP_UNKNOWN_PORT_TYPE]: context_1.SEVERITY.RPT_SEVERITY_ERROR,
63
+ [PP_ERROR.INAPPROPRIATE_FUNC]: context_1.SEVERITY.RPT_SEVERITY_ERROR,
64
+ [PP_ERROR.NOT_DRIVEN]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
65
+ [PP_ERROR.DUPLICATED_PWR_SOURCES]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
66
+ [PP_ERROR.INSUFFICIENT_DRIVER]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
67
+ [PP_ERROR.OVER_DRIVEN]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
68
+ [PP_ERROR.IMPEDANCE_SIGNAL_INTEGRITY]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
69
+ [PP_ERROR.INCOMPATIBLE_VOLTAGE_LEVELS]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
70
+ [PP_ERROR.SIGNAL_LEVELS_NOT_CONTAINED_WITHIN_VOLTAGE]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
71
+ [PP_ERROR.INCOMPATIBLE_SIGNAL_LEVELS]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
72
+ [PP_ERROR.OVERCURRENT]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
73
+ [PP_ERROR.INCOMPATIBLE_DIGITAL_THRESHOLDS]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
74
+ [PP_ERROR.REQUIRES_CONNECTED_SOURCE_OR_BIDIR]: context_1.SEVERITY.RPT_SEVERITY_WARNING,
75
+ [PP_ERROR.ILLEGAL_CONNECTION]: context_1.SEVERITY.RPT_SEVERITY_ERROR,
76
+ };
@@ -1,2 +1,18 @@
1
- export * from './error_code';
2
- export * from './tester';
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("./error_code"), exports);
18
+ __exportStar(require("./tester"), exports);
@@ -1 +1,17 @@
1
- export * from './tester_impl';
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("./tester_impl"), exports);
@@ -1,112 +1,44 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- var __values = (this && this.__values) || function(o) {
17
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
18
- if (m) return m.call(o);
19
- if (o && typeof o.length === "number") return {
20
- next: function () {
21
- if (o && i >= o.length) o = void 0;
22
- return { value: o && o[i++], done: !o };
23
- }
24
- };
25
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
26
- };
27
- var __read = (this && this.__read) || function (o, n) {
28
- var m = typeof Symbol === "function" && o[Symbol.iterator];
29
- if (!m) return o;
30
- var i = m.call(o), r, ar = [], e;
31
- try {
32
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
33
- }
34
- catch (error) { e = { error: error }; }
35
- finally {
36
- try {
37
- if (r && !r.done && (m = i["return"])) m.call(i);
38
- }
39
- finally { if (e) throw e.error; }
40
- }
41
- return ar;
42
- };
43
- import { LABEL_ASSOCIATED } from '@modular-circuit/electronics-model';
44
- var LinkTesterBase = /** @class */ (function () {
45
- function LinkTesterBase(ctx, ports) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CompositePortLinkTesterBase = exports.LinkTesterBase = void 0;
4
+ const electronics_model_1 = require("@modular-circuit/electronics-model");
5
+ class LinkTesterBase {
6
+ ctx;
7
+ ports;
8
+ link;
9
+ _all_port_ids;
10
+ constructor(ctx, ports) {
46
11
  this.ctx = ctx;
47
12
  this.ports = ports;
48
13
  }
49
- LinkTesterBase.prototype.test = function () {
14
+ test() {
50
15
  if (!this.init_link())
51
16
  return;
52
17
  this.check_parameter_propagation();
53
- };
54
- Object.defineProperty(LinkTesterBase.prototype, "all_port_ids", {
55
- get: function () {
56
- var _this = this;
57
- if (!this._all_port_ids)
58
- this._all_port_ids = this.ports.map(function (v) { return _this.ctx.port_id.get(v); });
59
- return this._all_port_ids;
60
- },
61
- enumerable: false,
62
- configurable: true
63
- });
64
- return LinkTesterBase;
65
- }());
66
- export { LinkTesterBase };
67
- var CompositePortLinkTesterBase = /** @class */ (function (_super) {
68
- __extends(CompositePortLinkTesterBase, _super);
69
- function CompositePortLinkTesterBase() {
70
- return _super !== null && _super.apply(this, arguments) || this;
71
18
  }
72
- CompositePortLinkTesterBase.prototype.test = function () {
73
- var e_1, _a;
74
- try {
75
- for (var _b = __values(this.ports), _c = _b.next(); !_c.done; _c = _b.next()) {
76
- var port = _c.value;
77
- this.annot_composite_port(port, this.ctx.port_id.get(port));
78
- }
79
- }
80
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
81
- finally {
82
- try {
83
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
84
- }
85
- finally { if (e_1) throw e_1.error; }
19
+ get all_port_ids() {
20
+ if (!this._all_port_ids)
21
+ this._all_port_ids = this.ports.map((v) => this.ctx.port_id.get(v));
22
+ return this._all_port_ids;
23
+ }
24
+ }
25
+ exports.LinkTesterBase = LinkTesterBase;
26
+ class CompositePortLinkTesterBase extends LinkTesterBase {
27
+ test() {
28
+ for (const port of this.ports) {
29
+ this.annot_composite_port(port, this.ctx.port_id.get(port));
86
30
  }
87
- _super.prototype.test.call(this);
88
- };
89
- CompositePortLinkTesterBase.prototype.annot_composite_port = function (port, uuid) {
90
- var e_2, _a;
91
- try {
92
- for (var _b = __values(Object.entries(port)), _c = _b.next(); !_c.done; _c = _b.next()) {
93
- var _d = __read(_c.value, 2), k = _d[0], v = _d[1];
94
- if (k === LABEL_ASSOCIATED && typeof v === 'string') {
95
- this.ctx.port_id.set(port, v);
96
- }
97
- else if (typeof v === 'object' && !Array.isArray(v) && v !== null) {
98
- this.annot_composite_port(v, uuid);
99
- }
31
+ super.test();
32
+ }
33
+ annot_composite_port(port, uuid) {
34
+ for (const [k, v] of Object.entries(port)) {
35
+ if (k === electronics_model_1.LABEL_ASSOCIATED && typeof v === 'string') {
36
+ this.ctx.port_id.set(port, v);
100
37
  }
101
- }
102
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
103
- finally {
104
- try {
105
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
38
+ else if (typeof v === 'object' && !Array.isArray(v) && v !== null) {
39
+ this.annot_composite_port(v, uuid);
106
40
  }
107
- finally { if (e_2) throw e_2.error; }
108
41
  }
109
- };
110
- return CompositePortLinkTesterBase;
111
- }(LinkTesterBase));
112
- export { CompositePortLinkTesterBase };
42
+ }
43
+ }
44
+ exports.CompositePortLinkTesterBase = CompositePortLinkTesterBase;