librelane 3.1.0.dev4__py3-none-any.whl → 3.1.0.dev6__py3-none-any.whl
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.
- librelane/common/drc.py +2 -0
- librelane/config/variable.py +2 -0
- librelane/scripts/odbpy/apply_def_template.py +2 -3
- librelane/scripts/odbpy/cell_frequency.py +3 -3
- librelane/scripts/odbpy/check_antenna_properties.py +4 -3
- librelane/scripts/odbpy/contextualize.py +1 -1
- librelane/scripts/odbpy/defutil.py +8 -8
- librelane/scripts/odbpy/diodes.py +7 -6
- librelane/scripts/odbpy/disconnected_pins.py +9 -8
- librelane/scripts/odbpy/eco_buffer.py +10 -8
- librelane/scripts/odbpy/eco_diode.py +9 -7
- librelane/scripts/odbpy/filter_unannotated.py +7 -7
- librelane/scripts/odbpy/io_place.py +23 -33
- librelane/scripts/odbpy/ioplace_parser/__init__.py +3 -1
- librelane/scripts/odbpy/ioplace_parser/parse.py +3 -4
- librelane/scripts/odbpy/label_macro_pins.py +1 -1
- librelane/scripts/odbpy/placers.py +7 -7
- librelane/scripts/odbpy/power_utils.py +14 -13
- librelane/scripts/odbpy/random_place.py +1 -1
- librelane/scripts/odbpy/reader.py +25 -6
- librelane/scripts/odbpy/remove_buffers.py +7 -6
- librelane/scripts/odbpy/wire_lengths.py +2 -4
- librelane/scripts/openroad/common/io.tcl +40 -66
- librelane/scripts/openroad/common/set_routing_layers.tcl +1 -4
- librelane/scripts/openroad/drt.tcl +2 -0
- librelane/scripts/openroad/gui.tcl +4 -4
- librelane/scripts/openroad/rcx.tcl +2 -3
- librelane/scripts/openroad/sta/corner.tcl +3 -3
- librelane/scripts/pyosys/synthesize.py +26 -3
- librelane/steps/magic.py +10 -10
- librelane/steps/openroad.py +49 -35
- librelane/steps/pyosys.py +2 -2
- librelane/steps/step.py +8 -5
- {librelane-3.1.0.dev4.dist-info → librelane-3.1.0.dev6.dist-info}/METADATA +7 -5
- {librelane-3.1.0.dev4.dist-info → librelane-3.1.0.dev6.dist-info}/RECORD +37 -37
- {librelane-3.1.0.dev4.dist-info → librelane-3.1.0.dev6.dist-info}/WHEEL +0 -0
- {librelane-3.1.0.dev4.dist-info → librelane-3.1.0.dev6.dist-info}/entry_points.txt +0 -0
librelane/common/drc.py
CHANGED
|
@@ -289,6 +289,8 @@ class DRC:
|
|
|
289
289
|
|
|
290
290
|
with ET.xmlfile(out, encoding="utf8", buffered=False) as xf:
|
|
291
291
|
xf.write_declaration()
|
|
292
|
+
xf.write(ET.Comment(" KLayout Marker Database "))
|
|
293
|
+
xf.write(ET.Comment(" Created using LibreLane DRC Rosetta "))
|
|
292
294
|
with xf.element("report-database"):
|
|
293
295
|
# 1. Cells
|
|
294
296
|
with xf.element("cells"):
|
librelane/config/variable.py
CHANGED
|
@@ -245,6 +245,8 @@ class Macro:
|
|
|
245
245
|
|
|
246
246
|
# we need to make a copy here, as we're modifying the dictionary as we iterate
|
|
247
247
|
for instance_name, instance in self.instances.copy().items():
|
|
248
|
+
if not isinstance(instance, Instance):
|
|
249
|
+
instance = Instance(**instance)
|
|
248
250
|
if (array := instance.array) is not None:
|
|
249
251
|
# we have a macro to expand
|
|
250
252
|
# first, check it's valid
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
import defutil
|
|
16
|
-
import utl
|
|
17
16
|
|
|
18
|
-
from reader import click_odb,
|
|
17
|
+
from reader import click, click_odb, lln_metric
|
|
19
18
|
|
|
20
19
|
|
|
21
20
|
@click.command()
|
|
@@ -42,7 +41,7 @@ def cli(reader, input_lefs, permissive, copy_def_power, def_template):
|
|
|
42
41
|
)
|
|
43
42
|
area = defutil.get_die_area(def_template, input_lefs)
|
|
44
43
|
area_metric = f"{area[0]} {area[1]} {area[2]} {area[3]}"
|
|
45
|
-
|
|
44
|
+
lln_metric("design__die__bbox", area_metric)
|
|
46
45
|
|
|
47
46
|
|
|
48
47
|
if __name__ == "__main__":
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
import os
|
|
15
15
|
import re
|
|
16
|
-
|
|
17
16
|
from collections import Counter
|
|
18
|
-
from reader import click, click_odb, OdbReader
|
|
19
17
|
|
|
20
18
|
import rich
|
|
21
|
-
from rich.table import Table
|
|
22
19
|
from rich.console import Console
|
|
20
|
+
from rich.table import Table
|
|
21
|
+
|
|
22
|
+
from reader import OdbReader, click, click_odb
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
@click.command()
|
|
@@ -12,11 +12,12 @@
|
|
|
12
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
|
-
import yaml
|
|
16
|
-
|
|
17
15
|
from tempfile import NamedTemporaryFile
|
|
18
16
|
from textwrap import dedent
|
|
19
|
-
|
|
17
|
+
|
|
18
|
+
import yaml
|
|
19
|
+
|
|
20
|
+
from reader import click, click_odb, odb
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
def check_cells(odb_cells):
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
|
-
import odb
|
|
16
|
-
|
|
17
15
|
import os
|
|
18
16
|
import re
|
|
19
17
|
import sys
|
|
20
18
|
from decimal import Decimal
|
|
19
|
+
from typing import List, Tuple
|
|
20
|
+
|
|
21
|
+
import odb
|
|
21
22
|
|
|
22
|
-
from reader import
|
|
23
|
-
from typing import Tuple, List
|
|
23
|
+
from reader import click, click_odb
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
@click.group()
|
|
@@ -238,7 +238,7 @@ def relocate_pins(db, input_lefs, template_def, permissive, copy_def_power=False
|
|
|
238
238
|
)
|
|
239
239
|
|
|
240
240
|
if mismatches_found and not permissive:
|
|
241
|
-
exit(os.EX_DATAERR)
|
|
241
|
+
sys.exit(os.EX_DATAERR)
|
|
242
242
|
|
|
243
243
|
if copy_def_power:
|
|
244
244
|
# If asked, we copy power pins from template
|
|
@@ -339,7 +339,7 @@ def relocate_pins(db, input_lefs, template_def, permissive, copy_def_power=False
|
|
|
339
339
|
"[ERROR] Some pins were grid-misaligned. Please check the log.",
|
|
340
340
|
file=sys.stderr,
|
|
341
341
|
)
|
|
342
|
-
exit(os.EX_DATAERR)
|
|
342
|
+
sys.exit(os.EX_DATAERR)
|
|
343
343
|
|
|
344
344
|
|
|
345
345
|
@click.command("relocate_pins")
|
|
@@ -478,8 +478,8 @@ def parse_obstructions(obstructions) -> List[Tuple[str, List[int]]]:
|
|
|
478
478
|
)
|
|
479
479
|
|
|
480
480
|
obs_list = []
|
|
481
|
-
for
|
|
482
|
-
obs =
|
|
481
|
+
for obs_raw in obstructions:
|
|
482
|
+
obs = obs_raw.strip()
|
|
483
483
|
m = re.match(RE_OBS, obs)
|
|
484
484
|
if m is None:
|
|
485
485
|
print(
|
|
@@ -14,14 +14,15 @@
|
|
|
14
14
|
# See the License for the specific language governing permissions and
|
|
15
15
|
# limitations under the License.
|
|
16
16
|
|
|
17
|
-
import odb
|
|
18
|
-
|
|
19
|
-
import sys
|
|
20
|
-
import click
|
|
21
17
|
import random
|
|
18
|
+
import sys
|
|
22
19
|
from decimal import Decimal
|
|
23
|
-
from typing import
|
|
24
|
-
|
|
20
|
+
from typing import List, Optional
|
|
21
|
+
|
|
22
|
+
import click
|
|
23
|
+
import odb
|
|
24
|
+
|
|
25
|
+
from reader import OdbReader, click_odb
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
@click.group()
|
|
@@ -16,13 +16,10 @@ from dataclasses import dataclass
|
|
|
16
16
|
from typing import Dict, Literal, Optional, Sequence, Union
|
|
17
17
|
|
|
18
18
|
import odb
|
|
19
|
-
import utl
|
|
20
|
-
|
|
21
|
-
from reader import click, click_odb, OdbReader
|
|
22
|
-
from reader import rich
|
|
23
|
-
from reader import Table
|
|
24
19
|
from rich.console import Console
|
|
25
20
|
|
|
21
|
+
from reader import OdbReader, Table, click, click_odb, lln_metric_i, rich
|
|
22
|
+
|
|
26
23
|
|
|
27
24
|
def is_connected(term: Union[odb.dbITerm, odb.dbBTerm]) -> bool:
|
|
28
25
|
if isinstance(term, odb.dbITerm):
|
|
@@ -295,9 +292,13 @@ def main(
|
|
|
295
292
|
)
|
|
296
293
|
console.print(full_table)
|
|
297
294
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
295
|
+
lln_metric_i(
|
|
296
|
+
"design__disconnected_pin__count",
|
|
297
|
+
disconnected_pin_count,
|
|
298
|
+
)
|
|
299
|
+
lln_metric_i(
|
|
300
|
+
"design__critical_disconnected_pin__count",
|
|
301
|
+
critical_disconnected_pin_count,
|
|
301
302
|
)
|
|
302
303
|
|
|
303
304
|
|
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
import sys
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
import grt as GRT
|
|
18
18
|
|
|
19
|
+
from reader import click, click_odb, odb
|
|
20
|
+
|
|
19
21
|
|
|
20
22
|
def average_location(instances):
|
|
21
23
|
locations = [instance.getLocation() for instance in instances]
|
|
@@ -55,12 +57,12 @@ def cli(reader):
|
|
|
55
57
|
f"[ERROR] Buffer type '{buffer_master}' not found.",
|
|
56
58
|
file=sys.stderr,
|
|
57
59
|
)
|
|
58
|
-
exit(-1)
|
|
60
|
+
sys.exit(-1)
|
|
59
61
|
|
|
60
62
|
target = reader.block.findInst(name_escaped)
|
|
61
63
|
if target is None:
|
|
62
64
|
print(f"[ERROR] Instance '{target_name}' not found.", file=sys.stderr)
|
|
63
|
-
exit(-1)
|
|
65
|
+
sys.exit(-1)
|
|
64
66
|
|
|
65
67
|
target_iterm = target.findITerm(target_pin)
|
|
66
68
|
if target_iterm is None:
|
|
@@ -68,7 +70,7 @@ def cli(reader):
|
|
|
68
70
|
f"[ERROR] Pin '{target_pin}' not found for instance '{target_name}'.",
|
|
69
71
|
file=sys.stderr,
|
|
70
72
|
)
|
|
71
|
-
exit(-1)
|
|
73
|
+
sys.exit(-1)
|
|
72
74
|
|
|
73
75
|
net = target_iterm.getNet()
|
|
74
76
|
if net is None:
|
|
@@ -76,7 +78,7 @@ def cli(reader):
|
|
|
76
78
|
f"[ERROR] Net not found on pin '{target_pin}' of instance '{target_name}'.",
|
|
77
79
|
file=sys.stderr,
|
|
78
80
|
)
|
|
79
|
-
exit(-1)
|
|
81
|
+
sys.exit(-1)
|
|
80
82
|
|
|
81
83
|
new_buf_name = f"eco_buffer_{i}"
|
|
82
84
|
new_net_name = f"eco_buffer_{i}_net"
|
|
@@ -102,7 +104,7 @@ def cli(reader):
|
|
|
102
104
|
f"[ERROR] Buffer {buffer_master} has no input signals.",
|
|
103
105
|
file=sys.stderr,
|
|
104
106
|
)
|
|
105
|
-
exit(-1)
|
|
107
|
+
sys.exit(-1)
|
|
106
108
|
|
|
107
109
|
buffer_x = None
|
|
108
110
|
for iterm in buffer_iterms:
|
|
@@ -114,7 +116,7 @@ def cli(reader):
|
|
|
114
116
|
f"[ERROR] Buffer {buffer_master} has no output signals.",
|
|
115
117
|
file=sys.stderr,
|
|
116
118
|
)
|
|
117
|
-
exit(-1)
|
|
119
|
+
sys.exit(-1)
|
|
118
120
|
|
|
119
121
|
location_instances = [target]
|
|
120
122
|
net_iterms = net.getITerms()
|
|
@@ -145,7 +147,7 @@ def cli(reader):
|
|
|
145
147
|
f"[ERROR] {target_name}/{target_pin} is neither an INPUT or an OUTPUT and is unsupported by this script. To buffer an INOUT port, buffer its drivers instead.",
|
|
146
148
|
file=sys.stderr,
|
|
147
149
|
)
|
|
148
|
-
exit(-1)
|
|
150
|
+
sys.exit(-1)
|
|
149
151
|
|
|
150
152
|
if target_info.get("placement") is not None:
|
|
151
153
|
eco_x, eco_y = target_info["placement"]
|
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
import sys
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
import grt as GRT
|
|
18
18
|
|
|
19
|
+
from reader import click, click_odb, odb
|
|
20
|
+
|
|
19
21
|
|
|
20
22
|
@click.command()
|
|
21
23
|
@click_odb
|
|
@@ -49,7 +51,7 @@ def cli(reader):
|
|
|
49
51
|
f"[ERROR] Instance '{target_name}' not found.",
|
|
50
52
|
file=sys.stderr,
|
|
51
53
|
)
|
|
52
|
-
exit(-1)
|
|
54
|
+
sys.exit(-1)
|
|
53
55
|
|
|
54
56
|
master = reader.db.findMaster(diode_master)
|
|
55
57
|
if master is None:
|
|
@@ -57,7 +59,7 @@ def cli(reader):
|
|
|
57
59
|
f"[ERROR] Cell kind '{diode_master}' not found.",
|
|
58
60
|
file=sys.stderr,
|
|
59
61
|
)
|
|
60
|
-
exit(-1)
|
|
62
|
+
sys.exit(-1)
|
|
61
63
|
|
|
62
64
|
target_iterm = target.findITerm(target_pin)
|
|
63
65
|
if target_iterm is None:
|
|
@@ -65,14 +67,14 @@ def cli(reader):
|
|
|
65
67
|
f"[ERROR] Pin '{target_pin}' not found for instance {target_name}.",
|
|
66
68
|
file=sys.stderr,
|
|
67
69
|
)
|
|
68
|
-
exit(-1)
|
|
70
|
+
sys.exit(-1)
|
|
69
71
|
|
|
70
72
|
if target_iterm.getIoType() not in ["INPUT", "INOUT"]:
|
|
71
73
|
print(
|
|
72
74
|
f"[ERROR] Pin {target_info['target']} is an OUTPUT pin.",
|
|
73
75
|
file=sys.stderr,
|
|
74
76
|
)
|
|
75
|
-
exit(-1)
|
|
77
|
+
sys.exit(-1)
|
|
76
78
|
|
|
77
79
|
net = target_iterm.getNet()
|
|
78
80
|
if net is None:
|
|
@@ -80,7 +82,7 @@ def cli(reader):
|
|
|
80
82
|
f"[ERROR] Pin {target_info['target']} has no nets connected.",
|
|
81
83
|
file=sys.stderr,
|
|
82
84
|
)
|
|
83
|
-
exit(-1)
|
|
85
|
+
sys.exit(-1)
|
|
84
86
|
|
|
85
87
|
eco_diode_name = f"eco_diode_{i}"
|
|
86
88
|
while reader.block.findInst(eco_diode_name) is not None:
|
|
@@ -99,7 +101,7 @@ def cli(reader):
|
|
|
99
101
|
f"[ERROR] Pin '{diode_pin}' on ECO diode not found- invalid DIODE_CELL definition.",
|
|
100
102
|
file=sys.stderr,
|
|
101
103
|
)
|
|
102
|
-
exit(-1)
|
|
104
|
+
sys.exit(-1)
|
|
103
105
|
|
|
104
106
|
sys.stdout.flush()
|
|
105
107
|
|
|
@@ -12,14 +12,13 @@
|
|
|
12
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
|
-
import re
|
|
16
15
|
import pprint
|
|
16
|
+
import re
|
|
17
17
|
from collections import namedtuple
|
|
18
18
|
|
|
19
|
-
from reader import click_odb, click
|
|
20
|
-
|
|
21
19
|
import odb
|
|
22
|
-
|
|
20
|
+
|
|
21
|
+
from reader import click, click_odb, lln_metric_i
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
def filter_net(net: odb.dbNet) -> bool:
|
|
@@ -86,10 +85,11 @@ def main(reader, corner, checks_report):
|
|
|
86
85
|
]
|
|
87
86
|
print("Filtered nets:")
|
|
88
87
|
pprint.pprint(connected_nets)
|
|
89
|
-
|
|
90
|
-
f"timing__unannotated_net__count__corner:{corner}",
|
|
88
|
+
lln_metric_i(
|
|
89
|
+
f"timing__unannotated_net__count__corner:{corner}",
|
|
90
|
+
len(reported_nets),
|
|
91
91
|
)
|
|
92
|
-
|
|
92
|
+
lln_metric_i(
|
|
93
93
|
f"timing__unannotated_net_filtered__count__corner:{corner}",
|
|
94
94
|
len(connected_nets),
|
|
95
95
|
)
|
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
import odb
|
|
16
|
-
|
|
14
|
+
import math
|
|
17
15
|
import os
|
|
16
|
+
import random
|
|
18
17
|
import re
|
|
19
18
|
import sys
|
|
20
|
-
import math
|
|
21
|
-
import click
|
|
22
|
-
import random
|
|
23
19
|
from decimal import Decimal
|
|
20
|
+
from functools import partial
|
|
24
21
|
|
|
25
|
-
|
|
22
|
+
import click
|
|
26
23
|
import ioplace_parser
|
|
24
|
+
import odb
|
|
25
|
+
|
|
26
|
+
from reader import click_odb
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
def grid_to_tracks(origin, count, step):
|
|
@@ -246,16 +246,14 @@ def io_place(
|
|
|
246
246
|
#S|#N|#E|#W
|
|
247
247
|
"""
|
|
248
248
|
config_file_name = config
|
|
249
|
-
|
|
249
|
+
dbus_per_micron = reader.dbunits
|
|
250
250
|
|
|
251
|
-
H_EXTENSION = int(
|
|
252
|
-
V_EXTENSION = int(
|
|
251
|
+
H_EXTENSION = int(dbus_per_micron * hor_extension)
|
|
252
|
+
V_EXTENSION = int(dbus_per_micron * ver_extension)
|
|
253
253
|
|
|
254
|
-
|
|
255
|
-
H_EXTENSION = 0
|
|
254
|
+
H_EXTENSION = max(H_EXTENSION, 0)
|
|
256
255
|
|
|
257
|
-
|
|
258
|
-
V_EXTENSION = 0
|
|
256
|
+
V_EXTENSION = max(V_EXTENSION, 0)
|
|
259
257
|
|
|
260
258
|
H_LAYER = reader.tech.findLayer(hor_layer)
|
|
261
259
|
V_LAYER = reader.tech.findLayer(ver_layer)
|
|
@@ -264,26 +262,18 @@ def io_place(
|
|
|
264
262
|
V_WIDTH = int(Decimal(ver_width_mult) * V_LAYER.getWidth())
|
|
265
263
|
|
|
266
264
|
if hor_length is not None:
|
|
267
|
-
H_LENGTH = int(
|
|
265
|
+
H_LENGTH = int(dbus_per_micron * hor_length)
|
|
268
266
|
else:
|
|
269
267
|
H_LENGTH = max(
|
|
270
|
-
int(
|
|
271
|
-
math.ceil(
|
|
272
|
-
H_LAYER.getArea() * micron_in_units * micron_in_units / H_WIDTH
|
|
273
|
-
)
|
|
274
|
-
),
|
|
268
|
+
int(math.ceil(H_LAYER.getArea() / H_WIDTH)),
|
|
275
269
|
H_WIDTH,
|
|
276
270
|
)
|
|
277
271
|
|
|
278
272
|
if ver_length is not None:
|
|
279
|
-
V_LENGTH = int(
|
|
273
|
+
V_LENGTH = int(dbus_per_micron * ver_length)
|
|
280
274
|
else:
|
|
281
275
|
V_LENGTH = max(
|
|
282
|
-
int(
|
|
283
|
-
math.ceil(
|
|
284
|
-
V_LAYER.getArea() * micron_in_units * micron_in_units / V_WIDTH
|
|
285
|
-
)
|
|
286
|
-
),
|
|
276
|
+
int(math.ceil(V_LAYER.getArea() / V_WIDTH)),
|
|
287
277
|
V_WIDTH,
|
|
288
278
|
)
|
|
289
279
|
|
|
@@ -294,7 +284,7 @@ def io_place(
|
|
|
294
284
|
info_by_side = ioplace_parser.parse(config_file_str)
|
|
295
285
|
except ValueError as e:
|
|
296
286
|
print(f"An exception occurred: {e}")
|
|
297
|
-
exit(os.EX_DATAERR)
|
|
287
|
+
sys.exit(os.EX_DATAERR)
|
|
298
288
|
|
|
299
289
|
print("Top-level design name:", reader.name)
|
|
300
290
|
|
|
@@ -309,7 +299,7 @@ def io_place(
|
|
|
309
299
|
(V_WIDTH + V_LAYER.getSpacing())
|
|
310
300
|
if side in ["N", "S"]
|
|
311
301
|
else (H_WIDTH + H_LAYER.getSpacing())
|
|
312
|
-
) /
|
|
302
|
+
) / dbus_per_micron
|
|
313
303
|
if side_info.min_distance is None:
|
|
314
304
|
side_info.min_distance = min
|
|
315
305
|
if side_info.min_distance < min:
|
|
@@ -381,7 +371,7 @@ def io_place(
|
|
|
381
371
|
|
|
382
372
|
if mismatches_found:
|
|
383
373
|
print("Critical mismatches found.")
|
|
384
|
-
exit(os.EX_DATAERR)
|
|
374
|
+
sys.exit(os.EX_DATAERR)
|
|
385
375
|
|
|
386
376
|
if len(not_in_config) > 0:
|
|
387
377
|
print("Assigning random sides to unmatched pins…")
|
|
@@ -409,7 +399,7 @@ def io_place(
|
|
|
409
399
|
pin_tracks = {}
|
|
410
400
|
for side in pin_placement:
|
|
411
401
|
if side in ["N", "S"]:
|
|
412
|
-
min_distance = info_by_side[side].min_distance *
|
|
402
|
+
min_distance = info_by_side[side].min_distance * dbus_per_micron
|
|
413
403
|
pin_tracks[side] = [
|
|
414
404
|
v_tracks[i]
|
|
415
405
|
for i in range(len(v_tracks))
|
|
@@ -423,7 +413,7 @@ def io_place(
|
|
|
423
413
|
i
|
|
424
414
|
% (
|
|
425
415
|
math.ceil(
|
|
426
|
-
info_by_side[side].min_distance *
|
|
416
|
+
info_by_side[side].min_distance * dbus_per_micron / h_step
|
|
427
417
|
)
|
|
428
418
|
)
|
|
429
419
|
)
|
|
@@ -436,9 +426,9 @@ def io_place(
|
|
|
436
426
|
pin_placement[side].reverse()
|
|
437
427
|
|
|
438
428
|
# create the pins
|
|
439
|
-
for side in pin_placement:
|
|
429
|
+
for side, side_pin_placement in pin_placement.items():
|
|
440
430
|
slots, pin_placement[side] = equally_spaced_sequence(
|
|
441
|
-
side,
|
|
431
|
+
side, side_pin_placement, pin_tracks[side]
|
|
442
432
|
)
|
|
443
433
|
|
|
444
434
|
assert len(slots) == len(pin_placement[side])
|
|
@@ -20,4 +20,6 @@ This is a modified version of https://github.com/efabless/ioplace_parser that
|
|
|
20
20
|
does NOT use Antlr4 and instead uses a custom parser that is faster and
|
|
21
21
|
dependency-free.
|
|
22
22
|
"""
|
|
23
|
-
from .parse import
|
|
23
|
+
from .parse import Order, Side, parse
|
|
24
|
+
|
|
25
|
+
__all__ = ["Order", "Side", "parse"]
|
|
@@ -16,12 +16,11 @@
|
|
|
16
16
|
# See the License for the specific language governing permissions and
|
|
17
17
|
# limitations under the License.
|
|
18
18
|
import re
|
|
19
|
-
from enum import IntEnum
|
|
20
|
-
from typing import Literal, Optional, Dict, List, Union
|
|
21
|
-
from decimal import Decimal
|
|
22
19
|
import warnings
|
|
23
|
-
|
|
24
20
|
from dataclasses import dataclass, field
|
|
21
|
+
from decimal import Decimal
|
|
22
|
+
from enum import IntEnum
|
|
23
|
+
from typing import Dict, List, Literal, Optional, Union
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
class Order(IntEnum):
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import sys
|
|
16
16
|
from decimal import Decimal
|
|
17
17
|
|
|
18
|
-
from reader import
|
|
18
|
+
from reader import click, click_odb
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
@click.group
|
|
@@ -72,10 +72,10 @@ def manual_macro_placement(reader, config, fixed):
|
|
|
72
72
|
with open(config, "r") as config_file:
|
|
73
73
|
for line in config_file:
|
|
74
74
|
# Discard comments and empty lines
|
|
75
|
-
line = line.split("#")[0].strip()
|
|
75
|
+
line = line.split("#")[0].strip() # noqa: PLW2901
|
|
76
76
|
if not line:
|
|
77
77
|
continue
|
|
78
|
-
line = line.split()
|
|
78
|
+
line = line.split() # noqa: PLW2901
|
|
79
79
|
name, x, y, orientation = line
|
|
80
80
|
macro_data = [
|
|
81
81
|
name,
|
|
@@ -111,11 +111,11 @@ def manual_macro_placement(reader, config, fixed):
|
|
|
111
111
|
inst.setPlacementStatus("PLACED")
|
|
112
112
|
del macros[inst_name]
|
|
113
113
|
|
|
114
|
-
if
|
|
114
|
+
if macros:
|
|
115
115
|
print("Declared macros not instantiated in design:", file=sys.stderr)
|
|
116
116
|
for macro in macros.values():
|
|
117
117
|
print(f"* {macro[0]}", file=sys.stderr)
|
|
118
|
-
exit(1)
|
|
118
|
+
sys.exit(1)
|
|
119
119
|
|
|
120
120
|
print(f"Successfully placed {macros_cnt} instances.")
|
|
121
121
|
|
|
@@ -147,13 +147,13 @@ def manual_global_placement(reader):
|
|
|
147
147
|
if not found:
|
|
148
148
|
not_found.append(instance)
|
|
149
149
|
|
|
150
|
-
if
|
|
150
|
+
if not_found:
|
|
151
151
|
print(
|
|
152
152
|
"[ERROR] One or more instances not found. Make sure you use their Verilog and not their LEF names."
|
|
153
153
|
)
|
|
154
154
|
for instance in not_found:
|
|
155
155
|
print(f"* {instance}")
|
|
156
|
-
exit(1)
|
|
156
|
+
sys.exit(1)
|
|
157
157
|
|
|
158
158
|
|
|
159
159
|
cli.add_command(manual_global_placement)
|
|
@@ -12,15 +12,16 @@
|
|
|
12
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
|
-
import odb
|
|
16
|
-
import utl
|
|
17
|
-
|
|
18
|
-
import re
|
|
19
15
|
import json
|
|
16
|
+
import re
|
|
17
|
+
import sys
|
|
20
18
|
from dataclasses import dataclass
|
|
21
19
|
from typing import Dict, List, Optional
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
import odb
|
|
22
|
+
import utl
|
|
23
|
+
|
|
24
|
+
from reader import OdbReader, click, click_odb
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
@click.group()
|
|
@@ -72,7 +73,7 @@ class Design(object):
|
|
|
72
73
|
print(
|
|
73
74
|
f"[ERROR] No LEF view for {module_name} was found in the database even though it is declared in the Verilog."
|
|
74
75
|
)
|
|
75
|
-
exit(-1)
|
|
76
|
+
sys.exit(-1)
|
|
76
77
|
pins = {pin.getName(): pin for pin in master.getMTerms()}
|
|
77
78
|
self.pins_by_module_name[module_name] = pins
|
|
78
79
|
return self.pins_by_module_name[module_name]
|
|
@@ -83,7 +84,7 @@ class Design(object):
|
|
|
83
84
|
print(
|
|
84
85
|
f"[ERROR] No pin {pin_name} found in the module {module_name}'s LEF view: the LEF and Verilog views of the module may be mismatched."
|
|
85
86
|
)
|
|
86
|
-
exit(-1)
|
|
87
|
+
sys.exit(-1)
|
|
87
88
|
|
|
88
89
|
return module_pins[pin_name].getSigType() == "POWER"
|
|
89
90
|
|
|
@@ -93,7 +94,7 @@ class Design(object):
|
|
|
93
94
|
print(
|
|
94
95
|
f"[ERROR] No pin {pin_name} found in the module {module_name}'s LEF view: the LEF and Verilog views of the module may be mismatched."
|
|
95
96
|
)
|
|
96
|
-
exit(-1)
|
|
97
|
+
sys.exit(-1)
|
|
97
98
|
|
|
98
99
|
return module_pins[pin_name].getSigType() == "GROUND"
|
|
99
100
|
|
|
@@ -106,7 +107,7 @@ class Design(object):
|
|
|
106
107
|
print(
|
|
107
108
|
f"[ERROR] Could not find master for cell type '{module_name}' in the database."
|
|
108
109
|
)
|
|
109
|
-
exit(-1)
|
|
110
|
+
sys.exit(-1)
|
|
110
111
|
|
|
111
112
|
lef_pg_pins = []
|
|
112
113
|
for pin in master.getMTerms():
|
|
@@ -125,7 +126,7 @@ class Design(object):
|
|
|
125
126
|
print(
|
|
126
127
|
f"[ERROR] Unexpectedly found more than one bit connected to {sigtype} pin {module_name}/{pin_name}."
|
|
127
128
|
)
|
|
128
|
-
exit(-1)
|
|
129
|
+
sys.exit(-1)
|
|
129
130
|
if len(connection_bits) == 1:
|
|
130
131
|
connection_bit = connection_bits[0]
|
|
131
132
|
connected_to_v = self.get_verilog_net_name_by_bit(
|
|
@@ -234,7 +235,7 @@ class Design(object):
|
|
|
234
235
|
region = design.getBlock().findRegion(region)
|
|
235
236
|
if region is None:
|
|
236
237
|
utl.error(utl.PDN, 1504, f"Region {region} not defined")
|
|
237
|
-
exit(-1)
|
|
238
|
+
sys.exit(-1)
|
|
238
239
|
|
|
239
240
|
inst_def_name = self.reader.escape_verilog_name(inst_name)
|
|
240
241
|
pin_def_name = self.reader.escape_verilog_name(pin_name)
|
|
@@ -262,12 +263,12 @@ class Design(object):
|
|
|
262
263
|
print(
|
|
263
264
|
f"[ERROR] add_global_connections failed to make any connections for '{inst_name}/{pin_name}' to {net_name}."
|
|
264
265
|
)
|
|
265
|
-
exit(-1)
|
|
266
|
+
sys.exit(-1)
|
|
266
267
|
elif connected_items > 1:
|
|
267
268
|
print(
|
|
268
269
|
f"[ERROR] add_global_connections somehow made {connected_items} connections for '{inst_name}/{pin_name}' to {net_name} -- please report this as a bug"
|
|
269
270
|
)
|
|
270
|
-
exit(-1)
|
|
271
|
+
sys.exit(-1)
|
|
271
272
|
|
|
272
273
|
|
|
273
274
|
@click.command()
|