@modular-circuit/transpiler 0.0.108 → 0.0.109
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/converter/netlist_to_kicad/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAMvE,eAAO,MAAM,SAAS,QAAiB,CAAA;AAEvC,eAAO,MAAM,SAAS,QAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/converter/netlist_to_kicad/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAMvE,eAAO,MAAM,SAAS,QAAiB,CAAA;AAEvC,eAAO,MAAM,SAAS,QAAY,CAAA;AAgBlC,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM;;;EAE/C;AAED,eAAO,MAAM,aAAa,QAAgB,CAAA;AAE1C,eAAO,MAAM,mBAAmB,QAAgB,CAAA;AAKhD,eAAO,MAAM,YAAY,QAAY,CAAA;AAIrC,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,YAAY,CAAA;IACtB,KAAK,EAAE,YAAY,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,IAAI,CAAA;IACT,YAAY,EAAE,IAAI,CAAA;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,OAAO,CAAA;IACb,aAAa,EAAE,OAAO,CAAA;IACtB,MAAM,EAAE,iBAAiB,CAAA;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,qBAAa,MAAM;IACjB,OAAO,CAAC,SAAS,CAAgC;IAEjD,OAAO,CAAC,GAAG,CAAY;IAEhB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB;IAIzC,QAAQ;IAmDrB,OAAO,CAAC,eAAe;CA+BxB"}
|
|
@@ -1,14 +1,3 @@
|
|
|
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
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -83,7 +72,6 @@ var POWER_Y_STEP = 16 * GRID_SIZE;
|
|
|
83
72
|
var BLOCK_V_SPACE = 8 * GRID_SIZE;
|
|
84
73
|
var BLOCK_H_SPACE = 14 * GRID_SIZE - BLOCK_V_SPACE;
|
|
85
74
|
var PADDING = 10 * GRID_SIZE;
|
|
86
|
-
var PADDING_LEFT = 30 * GRID_SIZE;
|
|
87
75
|
var PADDING_TOP = 21 * GRID_SIZE;
|
|
88
76
|
export function get_power_pos(pwr_number) {
|
|
89
77
|
return { x: POWER_START_X, y: POWER_START_Y + POWER_Y_STEP * pwr_number };
|
|
@@ -93,13 +81,14 @@ export var BLOCK_PIN_TB_MARGIN = 2 * GRID_SIZE;
|
|
|
93
81
|
var MIN_BLOCK_WIDTH = 8 * GRID_SIZE;
|
|
94
82
|
var INTERNAL_LABEL_MARGIN = 8 * FONT_SIZE;
|
|
95
83
|
export var WIRE_PADDING = GRID_SIZE;
|
|
84
|
+
var SIDE_MARGIN = WIRE_PADDING * 2 + BLOCK_H_SPACE / 2;
|
|
96
85
|
var Layout = /** @class */ (function () {
|
|
97
86
|
function Layout() {
|
|
98
87
|
this.block_geo = {};
|
|
99
88
|
this.elk = new ELK();
|
|
100
89
|
}
|
|
101
90
|
Layout.prototype.add_block = function (id, factor) {
|
|
102
|
-
this.block_geo[id] =
|
|
91
|
+
this.block_geo[id] = this.calc_block_size(factor);
|
|
103
92
|
};
|
|
104
93
|
Layout.prototype.finalize = function () {
|
|
105
94
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -122,7 +111,7 @@ var Layout = /** @class */ (function () {
|
|
|
122
111
|
'org.eclipse.elk.rectpacking.packing.compaction.iterations': '5',
|
|
123
112
|
'org.eclipse.elk.aspectRatio': '1.414',
|
|
124
113
|
'elk.spacing.nodeNode': "".concat(BLOCK_V_SPACE),
|
|
125
|
-
'elk.padding': "[top=".concat(PADDING_TOP, ",left=").concat(
|
|
114
|
+
'elk.padding': "[top=".concat(PADDING_TOP, ",left=").concat(PADDING, ",bottom=").concat(PADDING, ",right=").concat(PADDING, "]"),
|
|
126
115
|
'elk.childAreaWidth': "".concat(PAPER_SIZE.A4.height),
|
|
127
116
|
'elk.childAreaHeight': "".concat(PAPER_SIZE.A4.width),
|
|
128
117
|
},
|
|
@@ -156,7 +145,7 @@ var Layout = /** @class */ (function () {
|
|
|
156
145
|
child = _e.value;
|
|
157
146
|
geo = this.block_geo[child.id];
|
|
158
147
|
pos = {
|
|
159
|
-
x: ((_h = child.x) !== null && _h !== void 0 ? _h : 0) + geo.
|
|
148
|
+
x: ((_h = child.x) !== null && _h !== void 0 ? _h : 0) + geo.l_margin,
|
|
160
149
|
y: (_j = child.y) !== null && _j !== void 0 ? _j : 0,
|
|
161
150
|
};
|
|
162
151
|
bbox[child.id] = {
|
|
@@ -181,7 +170,9 @@ var Layout = /** @class */ (function () {
|
|
|
181
170
|
Layout.prototype.calc_block_size = function (factor) {
|
|
182
171
|
var block_height = Math.floor(factor.total_pin_num / 2) * BLOCK_PIN_GAP + 2 * BLOCK_PIN_TB_MARGIN;
|
|
183
172
|
var block_width = Math.max(MIN_BLOCK_WIDTH, factor.internal.l_side + factor.internal.r_side + INTERNAL_LABEL_MARGIN);
|
|
184
|
-
var
|
|
173
|
+
var l_margin = factor.outer.l_side + SIDE_MARGIN;
|
|
174
|
+
var r_margin = factor.outer.r_side + SIDE_MARGIN;
|
|
175
|
+
var block_bounding_width = block_width + l_margin + r_margin;
|
|
185
176
|
var size = {
|
|
186
177
|
x: block_width,
|
|
187
178
|
y: block_height,
|
|
@@ -193,6 +184,9 @@ var Layout = /** @class */ (function () {
|
|
|
193
184
|
return {
|
|
194
185
|
size: size,
|
|
195
186
|
bounding_size: bounding_size,
|
|
187
|
+
l_margin: l_margin,
|
|
188
|
+
r_margin: r_margin,
|
|
189
|
+
factor: factor,
|
|
196
190
|
};
|
|
197
191
|
};
|
|
198
192
|
return Layout;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modular-circuit/transpiler",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.109",
|
|
4
4
|
"description": "Intermediate representation of the modular circuit",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"files": [
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"js-base64": "^3.7.7",
|
|
29
29
|
"jszip": "^3.10.1",
|
|
30
30
|
"@modular-circuit/electronics-model": "0.0.54",
|
|
31
|
-
"@modular-circuit/ir": "0.0.63",
|
|
32
31
|
"@modular-circuit/perc": "0.0.61",
|
|
33
|
-
"@modular-circuit/utils": "0.0.41"
|
|
32
|
+
"@modular-circuit/utils": "0.0.41",
|
|
33
|
+
"@modular-circuit/ir": "0.0.63"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"clean": "rimraf build",
|