siliconcompiler 0.28.0__py3-none-any.whl → 0.28.2__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.
Files changed (94) hide show
  1. siliconcompiler/_metadata.py +1 -1
  2. siliconcompiler/apps/sc_install.py +192 -0
  3. siliconcompiler/core.py +15 -0
  4. siliconcompiler/flows/dvflow.py +51 -14
  5. siliconcompiler/libs/sg13g2_stdcell.py +8 -0
  6. siliconcompiler/pdks/ihp130.py +8 -0
  7. siliconcompiler/schema/schema_cfg.py +2 -2
  8. siliconcompiler/targets/ihp130_demo.py +68 -0
  9. siliconcompiler/tools/_common/tcl/sc_pin_constraints.tcl +6 -5
  10. siliconcompiler/tools/openroad/scripts/sc_floorplan.tcl +1 -5
  11. siliconcompiler/tools/openroad/scripts/sc_metrics.tcl +1 -1
  12. siliconcompiler/tools/openroad/scripts/sc_procs.tcl +42 -16
  13. siliconcompiler/tools/openroad/scripts/sc_route.tcl +1 -1
  14. siliconcompiler/tools/openroad/scripts/sc_write_images.tcl +10 -10
  15. siliconcompiler/tools/opensta/scripts/sc_procs.tcl +3 -3
  16. siliconcompiler/tools/xdm/__init__.py +28 -0
  17. siliconcompiler/tools/xdm/convert.py +71 -0
  18. siliconcompiler/tools/xyce/__init__.py +40 -0
  19. siliconcompiler/tools/xyce/simulate.py +70 -0
  20. siliconcompiler/tools/yosys/syn_asic.tcl +1 -1
  21. siliconcompiler/toolscripts/_tools.json +131 -0
  22. siliconcompiler/toolscripts/_tools.py +222 -0
  23. siliconcompiler/toolscripts/ubuntu20/install-bambu.sh +49 -0
  24. siliconcompiler/toolscripts/ubuntu20/install-bluespec.sh +35 -0
  25. siliconcompiler/toolscripts/ubuntu20/install-chisel.sh +26 -0
  26. siliconcompiler/toolscripts/ubuntu20/install-ghdl.sh +25 -0
  27. siliconcompiler/toolscripts/ubuntu20/install-icarus.sh +25 -0
  28. siliconcompiler/toolscripts/ubuntu20/install-icepack.sh +22 -0
  29. siliconcompiler/toolscripts/ubuntu20/install-klayout.sh +29 -0
  30. siliconcompiler/toolscripts/ubuntu20/install-magic.sh +24 -0
  31. siliconcompiler/toolscripts/ubuntu20/install-montage.sh +5 -0
  32. siliconcompiler/toolscripts/ubuntu20/install-netgen.sh +24 -0
  33. siliconcompiler/toolscripts/ubuntu20/install-nextpnr.sh +32 -0
  34. siliconcompiler/toolscripts/ubuntu20/install-openroad.sh +31 -0
  35. siliconcompiler/toolscripts/ubuntu20/install-slang.sh +38 -0
  36. siliconcompiler/toolscripts/ubuntu20/install-slurm.sh +32 -0
  37. siliconcompiler/toolscripts/ubuntu20/install-surelog.sh +30 -0
  38. siliconcompiler/toolscripts/ubuntu20/install-sv2v.sh +26 -0
  39. siliconcompiler/toolscripts/ubuntu20/install-verible.sh +24 -0
  40. siliconcompiler/toolscripts/ubuntu20/install-verilator.sh +34 -0
  41. siliconcompiler/toolscripts/ubuntu20/install-vpr.sh +27 -0
  42. siliconcompiler/toolscripts/ubuntu20/install-xyce.sh +65 -0
  43. siliconcompiler/toolscripts/ubuntu20/install-yosys.sh +24 -0
  44. siliconcompiler/toolscripts/ubuntu22/install-bambu.sh +49 -0
  45. siliconcompiler/toolscripts/ubuntu22/install-bluespec.sh +35 -0
  46. siliconcompiler/toolscripts/ubuntu22/install-chisel.sh +26 -0
  47. siliconcompiler/toolscripts/ubuntu22/install-ghdl.sh +25 -0
  48. siliconcompiler/toolscripts/ubuntu22/install-icarus.sh +25 -0
  49. siliconcompiler/toolscripts/ubuntu22/install-icepack.sh +22 -0
  50. siliconcompiler/toolscripts/ubuntu22/install-klayout.sh +29 -0
  51. siliconcompiler/toolscripts/ubuntu22/install-magic.sh +24 -0
  52. siliconcompiler/toolscripts/ubuntu22/install-montage.sh +5 -0
  53. siliconcompiler/toolscripts/ubuntu22/install-netgen.sh +24 -0
  54. siliconcompiler/toolscripts/ubuntu22/install-nextpnr.sh +32 -0
  55. siliconcompiler/toolscripts/ubuntu22/install-openroad.sh +31 -0
  56. siliconcompiler/toolscripts/ubuntu22/install-slang.sh +28 -0
  57. siliconcompiler/toolscripts/ubuntu22/install-slurm.sh +32 -0
  58. siliconcompiler/toolscripts/ubuntu22/install-surelog.sh +25 -0
  59. siliconcompiler/toolscripts/ubuntu22/install-sv2v.sh +26 -0
  60. siliconcompiler/toolscripts/ubuntu22/install-verible.sh +24 -0
  61. siliconcompiler/toolscripts/ubuntu22/install-verilator.sh +34 -0
  62. siliconcompiler/toolscripts/ubuntu22/install-vpr.sh +27 -0
  63. siliconcompiler/toolscripts/ubuntu22/install-xyce.sh +65 -0
  64. siliconcompiler/toolscripts/ubuntu22/install-yosys.sh +24 -0
  65. siliconcompiler/toolscripts/ubuntu24/install-bambu.sh +49 -0
  66. siliconcompiler/toolscripts/ubuntu24/install-bluespec.sh +35 -0
  67. siliconcompiler/toolscripts/ubuntu24/install-chisel.sh +26 -0
  68. siliconcompiler/toolscripts/ubuntu24/install-ghdl.sh +25 -0
  69. siliconcompiler/toolscripts/ubuntu24/install-icarus.sh +25 -0
  70. siliconcompiler/toolscripts/ubuntu24/install-icepack.sh +22 -0
  71. siliconcompiler/toolscripts/ubuntu24/install-klayout.sh +29 -0
  72. siliconcompiler/toolscripts/ubuntu24/install-magic.sh +24 -0
  73. siliconcompiler/toolscripts/ubuntu24/install-montage.sh +5 -0
  74. siliconcompiler/toolscripts/ubuntu24/install-netgen.sh +24 -0
  75. siliconcompiler/toolscripts/ubuntu24/install-nextpnr.sh +32 -0
  76. siliconcompiler/toolscripts/ubuntu24/install-openroad.sh +31 -0
  77. siliconcompiler/toolscripts/ubuntu24/install-slang.sh +28 -0
  78. siliconcompiler/toolscripts/ubuntu24/install-slurm.sh +32 -0
  79. siliconcompiler/toolscripts/ubuntu24/install-surelog.sh +25 -0
  80. siliconcompiler/toolscripts/ubuntu24/install-sv2v.sh +26 -0
  81. siliconcompiler/toolscripts/ubuntu24/install-verible.sh +24 -0
  82. siliconcompiler/toolscripts/ubuntu24/install-verilator.sh +34 -0
  83. siliconcompiler/toolscripts/ubuntu24/install-vpr.sh +27 -0
  84. siliconcompiler/toolscripts/ubuntu24/install-xyce.sh +65 -0
  85. siliconcompiler/toolscripts/ubuntu24/install-yosys.sh +24 -0
  86. {siliconcompiler-0.28.0.dist-info → siliconcompiler-0.28.2.dist-info}/METADATA +5 -5
  87. {siliconcompiler-0.28.0.dist-info → siliconcompiler-0.28.2.dist-info}/RECORD +91 -22
  88. {siliconcompiler-0.28.0.dist-info → siliconcompiler-0.28.2.dist-info}/entry_points.txt +1 -0
  89. siliconcompiler/tools/openfpgaloader/__init__.py +0 -0
  90. siliconcompiler/tools/openfpgaloader/openfpgaloader.py +0 -39
  91. siliconcompiler/tools/xyce/xyce.py +0 -36
  92. {siliconcompiler-0.28.0.dist-info → siliconcompiler-0.28.2.dist-info}/LICENSE +0 -0
  93. {siliconcompiler-0.28.0.dist-info → siliconcompiler-0.28.2.dist-info}/WHEEL +0 -0
  94. {siliconcompiler-0.28.0.dist-info → siliconcompiler-0.28.2.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  # Version number following semver standard.
2
- version = '0.28.0'
2
+ version = '0.28.2'
3
3
 
4
4
  # Default server address for remote runs, if unspecified.
5
5
  default_server = 'https://server.siliconcompiler.com'
@@ -0,0 +1,192 @@
1
+ # Copyright 2024 Silicon Compiler Authors. All Rights Reserved.
2
+
3
+ import argparse
4
+ import glob
5
+ import subprocess
6
+ import sys
7
+ import shutil
8
+ import re
9
+ import os.path
10
+ from collections.abc import Container
11
+ from pathlib import Path
12
+ import siliconcompiler
13
+ from siliconcompiler.scheduler import _get_machine_info
14
+
15
+
16
+ class ChoiceOptional(Container):
17
+ def __init__(self, choices):
18
+ super().__init__()
19
+
20
+ self.__choices = set(choices)
21
+
22
+ def __contains__(self, item):
23
+ if not item:
24
+ # allow empty value
25
+ return True
26
+ return item in self.__choices
27
+
28
+ def __iter__(self):
29
+ return self.__choices.__iter__()
30
+
31
+ def get_items(self, choices):
32
+ items = set(choices)
33
+ return sorted(list(items))
34
+
35
+
36
+ def install_tool(tool, script, build_dir, prefix):
37
+ # Ensure build dir is available
38
+ build_dir = Path(build_dir) / tool
39
+ shutil.rmtree(str(build_dir), ignore_errors=True)
40
+ build_dir.mkdir(parents=True, exist_ok=True)
41
+
42
+ # setup environment
43
+ env = os.environ.copy()
44
+ env["PREFIX"] = prefix
45
+
46
+ # run
47
+ ret = subprocess.call(script, env=env, cwd=build_dir)
48
+ if ret != 0:
49
+ print(f"Error occurred while building/installing {tool}")
50
+ return False
51
+ return True
52
+
53
+
54
+ def show_tool(tool, script):
55
+ def print_header(head):
56
+ border_len = max(80, len(script) + 2)
57
+ border = border_len*"#"
58
+ print(border)
59
+ print(f"# {tool} script / {head}")
60
+ if head == "start":
61
+ print(f"# {script}")
62
+ print(border)
63
+
64
+ print_header("start")
65
+
66
+ with open(script) as f:
67
+ for line in f:
68
+ print(line.rstrip())
69
+
70
+ print_header("end")
71
+
72
+
73
+ def _get_tools_list():
74
+ tools_root = Path(siliconcompiler.__file__).parent / "toolscripts"
75
+
76
+ machine_info = _get_machine_info()
77
+ script_dir = None
78
+ if machine_info['system'].lower() == 'linux':
79
+ if machine_info['distro'].lower() == 'ubuntu':
80
+ version, _ = machine_info['osversion'].split('.')
81
+ script_dir = f"{machine_info['distro'].lower()}{version}"
82
+ if script_dir:
83
+ script_dir = tools_root / script_dir
84
+ if not script_dir.exists():
85
+ script_dir = None
86
+
87
+ tools = {}
88
+ if script_dir:
89
+ for script in glob.glob(str(script_dir / "install-*.sh")):
90
+ tool = re.match(r"install-(.*)\.sh", os.path.basename(script).lower())
91
+ tools[tool.group(1)] = script
92
+
93
+ return tools
94
+
95
+
96
+ def _recommended_tool_groups():
97
+ return {
98
+ "asic": {"surelog", "sv2v", "yosys", "openroad", "klayout"},
99
+ "fpga": {"surelog", "sv2v", "yosys", "vpr"},
100
+ "digital-simulation": {"verilator", "icarus"},
101
+ "analog-simulation": {"xyce"}
102
+ }
103
+
104
+
105
+ def main():
106
+ progname = "sc-install"
107
+ description = """
108
+ -----------------------------------------------------------
109
+ SC app install supported tools.
110
+
111
+ To install a single tool:
112
+ sc-install openroad
113
+
114
+ To install multiple tools:
115
+ sc-install openroad yosys klayout
116
+
117
+ To install a group of tools:
118
+ sc-install -group asic
119
+
120
+ To install tools in a different location:
121
+ sc-install -prefix /usr/local yosys
122
+
123
+ To build tools in a different location:
124
+ sc-install -build_dir /tmp yosys
125
+
126
+ To show the install script:
127
+ sc-install -show openroad
128
+ -----------------------------------------------------------
129
+ """
130
+ parser = argparse.ArgumentParser(
131
+ prog=progname,
132
+ description=description,
133
+ formatter_class=argparse.RawDescriptionHelpFormatter)
134
+
135
+ tools = _get_tools_list()
136
+
137
+ tool_choices = ChoiceOptional(tools.keys())
138
+ parser.add_argument(
139
+ "tool",
140
+ nargs="*",
141
+ choices=tool_choices,
142
+ help="tool to install")
143
+
144
+ parser.add_argument(
145
+ "-group",
146
+ nargs="+",
147
+ choices=_recommended_tool_groups().keys(),
148
+ help="tool group to install")
149
+
150
+ parser.add_argument(
151
+ "-prefix",
152
+ default=Path.home() / ".local",
153
+ help="Prefix to use when installing tool",
154
+ metavar="<path>")
155
+
156
+ parser.add_argument(
157
+ "-build_dir",
158
+ default=Path.home() / ".sc" / "tool_build",
159
+ help="Directory to build the tool in",
160
+ metavar="<path>")
161
+
162
+ parser.add_argument(
163
+ "-show",
164
+ action="store_true",
165
+ help="Show the install script and exit")
166
+
167
+ args = parser.parse_args()
168
+
169
+ if not args.tool:
170
+ args.tool = []
171
+
172
+ args.tool = list(args.tool)
173
+ if args.group:
174
+ for group in args.group:
175
+ args.tool.extend(_recommended_tool_groups()[group])
176
+
177
+ tools_handled = set()
178
+ for tool in args.tool:
179
+ if tool in tools_handled:
180
+ continue
181
+ tools_handled.add(tool)
182
+ if args.show:
183
+ show_tool(tool, tools[tool])
184
+ else:
185
+ if not install_tool(tool, tools[tool], args.build_dir, args.prefix):
186
+ return 1
187
+
188
+ return 0
189
+
190
+
191
+ if __name__ == "__main__":
192
+ sys.exit(main())
siliconcompiler/core.py CHANGED
@@ -1108,6 +1108,21 @@ class Chip:
1108
1108
  Performs a lookup in the io map for the fileset and filetype
1109
1109
  and will use those if they are not provided in the arguments
1110
1110
  '''
1111
+ # Handle list inputs
1112
+ if isinstance(filename, (list, tuple)):
1113
+ for file in filename:
1114
+ self._add_input_output(
1115
+ category,
1116
+ file,
1117
+ fileset=fileset,
1118
+ filetype=filetype,
1119
+ iomap=iomap,
1120
+ step=step,
1121
+ index=index,
1122
+ package=package,
1123
+ quiet=quiet)
1124
+ return
1125
+
1111
1126
  # Normalize value to string in case we receive a pathlib.Path
1112
1127
  filename = str(filename)
1113
1128
 
@@ -3,6 +3,8 @@ import siliconcompiler
3
3
  from siliconcompiler.tools.icarus import compile as icarus_compile
4
4
  from siliconcompiler.tools.verilator import compile as verilator_compile
5
5
  from siliconcompiler.tools.execute import exec_input
6
+ from siliconcompiler.tools.xyce import simulate as xyce_simulate
7
+ from siliconcompiler.tools.xdm import convert as xdm_convert
6
8
 
7
9
 
8
10
  ############################################################################
@@ -31,33 +33,68 @@ def setup(flowname='dvflow',
31
33
  Setting 'np' > 1 results in multiple independent verification
32
34
  pipelines to be launched.
33
35
 
36
+ Supported tools are:
37
+
38
+ * icarus
39
+ * verilator
40
+ * xyce
41
+ * xdm-xyce
42
+
34
43
  This flow is a WIP
35
44
  '''
36
45
 
37
46
  flow = siliconcompiler.Flow(flowname)
38
47
 
39
- tasks = {
40
- 'compile': None,
41
- 'sim': None
42
- }
48
+ tasks = {}
49
+ flow_np = {}
43
50
 
44
51
  if tool == 'icarus':
45
52
  tasks['compile'] = icarus_compile
46
53
  tasks['sim'] = exec_input
54
+
55
+ flowpipe = [
56
+ 'compile',
57
+ 'sim'
58
+ ]
59
+ flow_np = {
60
+ 'compile': 1,
61
+ 'sim': np
62
+ }
47
63
  elif tool == 'verilator':
48
64
  tasks['compile'] = verilator_compile
49
65
  tasks['sim'] = exec_input
66
+
67
+ flowpipe = [
68
+ 'compile',
69
+ 'sim'
70
+ ]
71
+ flow_np = {
72
+ 'compile': 1,
73
+ 'sim': np
74
+ }
75
+ elif tool == 'xyce':
76
+ tasks['sim'] = xyce_simulate
77
+
78
+ flowpipe = [
79
+ 'sim'
80
+ ]
81
+ flow_np = {
82
+ 'sim': np
83
+ }
84
+ elif tool == 'xdm-xyce':
85
+ tasks['compile'] = xdm_convert
86
+ tasks['sim'] = xyce_simulate
87
+
88
+ flowpipe = [
89
+ 'compile',
90
+ 'sim'
91
+ ]
92
+ flow_np = {
93
+ 'compile': 1,
94
+ 'sim': np
95
+ }
50
96
  else:
51
- raise ValueError(f'{tool} is not a supported tool for {flowname}: icarus')
52
-
53
- flowpipe = [
54
- 'compile',
55
- 'sim'
56
- ]
57
- flow_np = {
58
- 'compile': 1,
59
- 'sim': np
60
- }
97
+ raise ValueError(f'{tool} is not a supported tool for {flowname}')
61
98
 
62
99
  prevstep = None
63
100
  # Flow setup
@@ -0,0 +1,8 @@
1
+ import siliconcompiler
2
+ from lambdapdk.ihp130.libs.sg13g2_stdcell import setup
3
+
4
+
5
+ #########################
6
+ if __name__ == "__main__":
7
+ lib = setup(siliconcompiler.Chip('<lib>'))
8
+ lib.write_manifest(f'{lib.top()}.json')
@@ -0,0 +1,8 @@
1
+ import siliconcompiler
2
+ from lambdapdk.ihp130 import setup
3
+
4
+
5
+ #########################
6
+ if __name__ == "__main__":
7
+ pdk = setup(siliconcompiler.Chip('<pdk>'))
8
+ pdk.write_manifest(f'{pdk.top()}.json')
@@ -10,7 +10,7 @@ try:
10
10
  except ImportError:
11
11
  from siliconcompiler.schema.utils import trim
12
12
 
13
- SCHEMA_VERSION = '0.48.1'
13
+ SCHEMA_VERSION = '0.48.2'
14
14
 
15
15
  #############################################################################
16
16
  # PARAM DEFINITION
@@ -3767,7 +3767,7 @@ def schema_constraint(cfg):
3767
3767
  defvalue='R0',
3768
3768
  enum=['R0', 'R90', 'R180', 'R270',
3769
3769
  'MX', 'MX_R90', 'MX_R180', 'MX_R270',
3770
- 'MY_R90', 'MY_R180', 'MY_R270',
3770
+ 'MY', 'MY_R90', 'MY_R180', 'MY_R270',
3771
3771
  'MZ', 'MZ_R90', 'MZ_R180', 'MZ_R270',
3772
3772
  'MZ_MX', 'MZ_MX_R90', 'MZ_MX_R180', 'MZ_MX_R270',
3773
3773
  'MZ_MY', 'MZ_MY_R90', 'MZ_MY_R180', 'MZ_MY_R270'],
@@ -0,0 +1,68 @@
1
+ import siliconcompiler
2
+ from siliconcompiler.flows import asicflow, asictopflow, signoffflow, synflow
3
+ from siliconcompiler.checklists import oh_tapeout
4
+ from lambdapdk import ihp130
5
+ from lambdapdk.ihp130.libs import sg13g2_stdcell
6
+
7
+
8
+ ####################################################
9
+ # Target Setup
10
+ ####################################################
11
+ def setup(chip, syn_np=1, floorplan_np=1, physyn_np=1, place_np=1, cts_np=1, route_np=1,
12
+ timing_np=1):
13
+ '''
14
+ IHP130 Demo Target
15
+ '''
16
+
17
+ asic_flow_args = {
18
+ "syn_np": syn_np,
19
+ "floorplan_np": floorplan_np,
20
+ "physyn_np": physyn_np,
21
+ "place_np": place_np,
22
+ "cts_np": cts_np,
23
+ "route_np": route_np
24
+ }
25
+ # 1. Load PDK, flow, libs
26
+ chip.use(ihp130)
27
+ chip.use(sg13g2_stdcell)
28
+ chip.use(asicflow, **asic_flow_args)
29
+ chip.use(synflow, syn_np=syn_np, timing_np=timing_np)
30
+ chip.use(asictopflow)
31
+ chip.use(signoffflow)
32
+ chip.use(oh_tapeout)
33
+
34
+ # 2. Set default targets
35
+ chip.set('option', 'flow', 'asicflow', clobber=False)
36
+ chip.set('option', 'pdk', 'ihp130', clobber=False)
37
+ chip.set('option', 'stackup', '5M2TL', clobber=False)
38
+
39
+ # 3. Set project specific design choices
40
+ chip.set('asic', 'logiclib', 'sg13g2_stdcell', clobber=False)
41
+
42
+ # 4. get project specific design choices
43
+ chip.set('asic', 'delaymodel', 'nldm', clobber=False)
44
+ chip.set('constraint', 'density', 40, clobber=False)
45
+ chip.set('constraint', 'coremargin', 4.8, clobber=False)
46
+
47
+ # 5. Timing corners
48
+ chip.set('constraint', 'timing', 'slow', 'libcorner', 'slow', clobber=False)
49
+ chip.set('constraint', 'timing', 'slow', 'pexcorner', 'typical', clobber=False)
50
+ chip.set('constraint', 'timing', 'slow', 'mode', 'func', clobber=False)
51
+ chip.set('constraint', 'timing', 'slow', 'check', ['setup', 'hold'], clobber=False)
52
+
53
+ chip.set('constraint', 'timing', 'fast', 'libcorner', 'fast', clobber=False)
54
+ chip.set('constraint', 'timing', 'fast', 'pexcorner', 'typical', clobber=False)
55
+ chip.set('constraint', 'timing', 'fast', 'mode', 'func', clobber=False)
56
+ chip.set('constraint', 'timing', 'fast', 'check', ['setup', 'hold'], clobber=False)
57
+
58
+ chip.set('constraint', 'timing', 'typical', 'libcorner', 'typ', clobber=False)
59
+ chip.set('constraint', 'timing', 'typical', 'pexcorner', 'typical', clobber=False)
60
+ chip.set('constraint', 'timing', 'typical', 'mode', 'func', clobber=False)
61
+ chip.set('constraint', 'timing', 'typical', 'check', ['power'], clobber=False)
62
+
63
+
64
+ #########################
65
+ if __name__ == "__main__":
66
+ target = siliconcompiler.Chip('<target>')
67
+ setup(target)
68
+ target.write_manifest('ihp130_demo.json')
@@ -1,8 +1,9 @@
1
- proc sc_collect_pin_constraints { \
2
- placement_pins_arg \
3
- ordered_pins_arg \
4
- sc_side_layer_func \
5
- { print_func puts } } {
1
+ proc sc_collect_pin_constraints {
2
+ placement_pins_arg
3
+ ordered_pins_arg
4
+ sc_side_layer_func
5
+ { print_func puts }
6
+ } {
6
7
  upvar 1 $placement_pins_arg placement_pins
7
8
  upvar 1 $ordered_pins_arg ordered_pins
8
9
 
@@ -240,11 +240,7 @@ if { [sc_cfg_exists constraint component] } {
240
240
 
241
241
  dict for {name params} [sc_cfg_get constraint component] {
242
242
  set location [dict get $params placement]
243
- set rotation [dict get $params rotation]
244
- if { [string match "*MZ*" $rotation] } {
245
- utl::error FLW 1 "Z mirroring is not supported in OpenROAD"
246
- }
247
- set rotation [string map {"_" ""} $rotation]
243
+ set rotation [sc_convert_rotation [dict get $params rotation]]
248
244
 
249
245
  if { [dict exists $params partname] } {
250
246
  set cell [dict get $params partname]
@@ -2,7 +2,7 @@
2
2
  # Report Metrics
3
3
  ###############################
4
4
 
5
- proc sc_display_report {report} {
5
+ proc sc_display_report { report } {
6
6
  if { ![file exists $report] } {
7
7
  return
8
8
  }
@@ -2,7 +2,7 @@
2
2
  # Global Placement
3
3
  #######################
4
4
 
5
- proc sc_global_placement_density {} {
5
+ proc sc_global_placement_density { } {
6
6
  global openroad_gpl_padding
7
7
  global openroad_gpl_place_density
8
8
  global openroad_gpl_uniform_placement_adjustment
@@ -82,7 +82,7 @@ proc sc_global_placement { args } {
82
82
  # Detailed Placement
83
83
  ###########################
84
84
 
85
- proc sc_detailed_placement {} {
85
+ proc sc_detailed_placement { } {
86
86
  global openroad_dpl_padding
87
87
  global openroad_dpl_padding
88
88
  global openroad_dpl_disallow_one_site
@@ -149,7 +149,7 @@ proc sc_pin_placement { args } {
149
149
  # Check if OR has a GUI
150
150
  ###########################
151
151
 
152
- proc sc_has_gui {} {
152
+ proc sc_has_gui { } {
153
153
  return [gui::supported]
154
154
  }
155
155
 
@@ -157,7 +157,7 @@ proc sc_has_gui {} {
157
157
  # Check if design has placed instances
158
158
  ###########################
159
159
 
160
- proc sc_has_placed_instances {} {
160
+ proc sc_has_placed_instances { } {
161
161
  foreach inst [[ord::get_db_block] getInsts] {
162
162
  if { [$inst isPlaced] } {
163
163
  return true
@@ -170,7 +170,7 @@ proc sc_has_placed_instances {} {
170
170
  # Check if design has unplaced instances
171
171
  ###########################
172
172
 
173
- proc sc_has_unplaced_instances {} {
173
+ proc sc_has_unplaced_instances { } {
174
174
  foreach inst [[ord::get_db_block] getInsts] {
175
175
  if { ![$inst isPlaced] } {
176
176
  return true
@@ -183,7 +183,7 @@ proc sc_has_unplaced_instances {} {
183
183
  # Check if design has routing
184
184
  ###########################
185
185
 
186
- proc sc_has_routing {} {
186
+ proc sc_has_routing { } {
187
187
  foreach net [[ord::get_db_block] getNets] {
188
188
  if { [$net getWire] != "NULL" } {
189
189
  return true
@@ -196,7 +196,7 @@ proc sc_has_routing {} {
196
196
  # Check if design has global routing
197
197
  ###########################
198
198
 
199
- proc sc_has_global_routing {} {
199
+ proc sc_has_global_routing { } {
200
200
  foreach net [[ord::get_db_block] getNets] {
201
201
  if { [llength [$net getGuides]] != 0 } {
202
202
  return true
@@ -211,7 +211,7 @@ proc sc_has_global_routing {} {
211
211
 
212
212
  # Function adapted from OpenROAD:
213
213
  # https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/ca3004b85e0d4fbee3470115e63b83c498cfed85/flow/scripts/macro_place.tcl#L26
214
- proc sc_design_has_unplaced_macros {} {
214
+ proc sc_design_has_unplaced_macros { } {
215
215
  foreach inst [[ord::get_db_block] getInsts] {
216
216
  if { [$inst isBlock] && ![$inst isFixed] } {
217
217
  return true
@@ -224,7 +224,7 @@ proc sc_design_has_unplaced_macros {} {
224
224
  # Design has unplaced pads
225
225
  ###########################
226
226
 
227
- proc sc_design_has_unplaced_pads {} {
227
+ proc sc_design_has_unplaced_pads { } {
228
228
  foreach inst [[ord::get_db_block] getInsts] {
229
229
  if { [$inst isPad] && ![$inst isFixed] } {
230
230
  return true
@@ -237,7 +237,7 @@ proc sc_design_has_unplaced_pads {} {
237
237
  # Design has placable IOs
238
238
  ###########################
239
239
 
240
- proc sc_design_has_placeable_ios {} {
240
+ proc sc_design_has_placeable_ios { } {
241
241
  foreach bterm [[ord::get_db_block] getBTerms] {
242
242
  if {
243
243
  [$bterm getFirstPinPlacementStatus] != "FIXED" &&
@@ -284,7 +284,7 @@ proc sc_find_net_regex { net_name } {
284
284
  # Get supply nets in design
285
285
  ###########################
286
286
 
287
- proc sc_supply_nets {} {
287
+ proc sc_supply_nets { } {
288
288
  set nets []
289
289
 
290
290
  foreach net [[ord::get_db_block] getNets] {
@@ -301,7 +301,7 @@ proc sc_supply_nets {} {
301
301
  # Get nets for PSM to check
302
302
  ###########################
303
303
 
304
- proc sc_psm_check_nets {} {
304
+ proc sc_psm_check_nets { } {
305
305
  global openroad_psm_enable
306
306
  global openroad_psm_skip_nets
307
307
 
@@ -343,7 +343,7 @@ proc sc_save_image { title path { pixels 1000 } } {
343
343
  # Get the image bounding box
344
344
  ###########################
345
345
 
346
- proc sc_image_area {} {
346
+ proc sc_image_area { } {
347
347
  set box [[ord::get_db_block] getDieArea]
348
348
  set width [$box dx]
349
349
  set height [$box dy]
@@ -373,7 +373,7 @@ proc sc_image_resolution { pixels } {
373
373
  # Clear gui selections
374
374
  ###########################
375
375
 
376
- proc sc_image_clear_selection {} {
376
+ proc sc_image_clear_selection { } {
377
377
  gui::clear_highlights -1
378
378
  gui::clear_selections
379
379
  }
@@ -382,7 +382,7 @@ proc sc_image_clear_selection {} {
382
382
  # Setup default GUI setting for images
383
383
  ###########################
384
384
 
385
- proc sc_image_setup_default {} {
385
+ proc sc_image_setup_default { } {
386
386
  gui::restore_display_controls
387
387
 
388
388
  sc_image_clear_selection
@@ -406,7 +406,7 @@ proc sc_image_setup_default {} {
406
406
  # Count the logic depth of the critical path
407
407
  ###########################
408
408
 
409
- proc count_logic_depth {} {
409
+ proc count_logic_depth { } {
410
410
  set count 0
411
411
  set paths [find_timing_paths -sort_by_slack]
412
412
  if { [llength $paths] == 0 } {
@@ -427,3 +427,29 @@ proc count_logic_depth {} {
427
427
  # Subtract 1 to account for initial launch
428
428
  return [expr { $count - 1 }]
429
429
  }
430
+
431
+ ###########################
432
+ # Translate schema rotation
433
+ ###########################
434
+
435
+ proc sc_convert_rotation { rot } {
436
+ if { [string match "MZ*" $rot] } {
437
+ utl::error FLW 1 "Z mirroring is not supported in OpenROAD"
438
+ }
439
+
440
+ switch $rot {
441
+ "R0" { return "R0" }
442
+ "R90" { return "R90" }
443
+ "R180" { return "R180" }
444
+ "R270" { return "R270" }
445
+ "MX" { return "MX" }
446
+ "MX_R90" { return "MXR90" }
447
+ "MX_R180" { return "MY" }
448
+ "MX_R270" { return "MYR90" }
449
+ "MY" { return "MY" }
450
+ "MY_R90" { return "MYR90" }
451
+ "MY_R180" { return "MX" }
452
+ "MY_R270" { return "MXR90" }
453
+ default { utl::error FLW 1 "$rot not recognized" }
454
+ }
455
+ }
@@ -6,7 +6,7 @@
6
6
  # Helper functions
7
7
  #######################
8
8
 
9
- proc insert_fillers {} {
9
+ proc insert_fillers { } {
10
10
  upvar sc_filler sc_filler
11
11
  if { $sc_filler != "" } {
12
12
  filler_placement $sc_filler