siliconcompiler 0.26.5__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 (251) hide show
  1. siliconcompiler/__init__.py +24 -0
  2. siliconcompiler/__main__.py +12 -0
  3. siliconcompiler/_common.py +49 -0
  4. siliconcompiler/_metadata.py +36 -0
  5. siliconcompiler/apps/__init__.py +0 -0
  6. siliconcompiler/apps/_common.py +76 -0
  7. siliconcompiler/apps/sc.py +92 -0
  8. siliconcompiler/apps/sc_dashboard.py +94 -0
  9. siliconcompiler/apps/sc_issue.py +178 -0
  10. siliconcompiler/apps/sc_remote.py +199 -0
  11. siliconcompiler/apps/sc_server.py +39 -0
  12. siliconcompiler/apps/sc_show.py +142 -0
  13. siliconcompiler/apps/smake.py +232 -0
  14. siliconcompiler/checklists/__init__.py +0 -0
  15. siliconcompiler/checklists/oh_tapeout.py +41 -0
  16. siliconcompiler/core.py +3221 -0
  17. siliconcompiler/data/RobotoMono/LICENSE.txt +202 -0
  18. siliconcompiler/data/RobotoMono/RobotoMono-Regular.ttf +0 -0
  19. siliconcompiler/data/heartbeat.v +18 -0
  20. siliconcompiler/data/logo.png +0 -0
  21. siliconcompiler/flowgraph.py +570 -0
  22. siliconcompiler/flows/__init__.py +0 -0
  23. siliconcompiler/flows/_common.py +67 -0
  24. siliconcompiler/flows/asicflow.py +180 -0
  25. siliconcompiler/flows/asictopflow.py +38 -0
  26. siliconcompiler/flows/dvflow.py +86 -0
  27. siliconcompiler/flows/fpgaflow.py +202 -0
  28. siliconcompiler/flows/generate_openroad_rcx.py +66 -0
  29. siliconcompiler/flows/lintflow.py +35 -0
  30. siliconcompiler/flows/screenshotflow.py +51 -0
  31. siliconcompiler/flows/showflow.py +59 -0
  32. siliconcompiler/flows/signoffflow.py +53 -0
  33. siliconcompiler/flows/synflow.py +128 -0
  34. siliconcompiler/fpgas/__init__.py +0 -0
  35. siliconcompiler/fpgas/lattice_ice40.py +42 -0
  36. siliconcompiler/fpgas/vpr_example.py +109 -0
  37. siliconcompiler/issue.py +300 -0
  38. siliconcompiler/libs/__init__.py +0 -0
  39. siliconcompiler/libs/asap7sc7p5t.py +8 -0
  40. siliconcompiler/libs/gf180mcu.py +8 -0
  41. siliconcompiler/libs/nangate45.py +8 -0
  42. siliconcompiler/libs/sky130hd.py +8 -0
  43. siliconcompiler/libs/sky130io.py +8 -0
  44. siliconcompiler/package.py +412 -0
  45. siliconcompiler/pdks/__init__.py +0 -0
  46. siliconcompiler/pdks/asap7.py +8 -0
  47. siliconcompiler/pdks/freepdk45.py +8 -0
  48. siliconcompiler/pdks/gf180.py +8 -0
  49. siliconcompiler/pdks/skywater130.py +8 -0
  50. siliconcompiler/remote/__init__.py +36 -0
  51. siliconcompiler/remote/client.py +891 -0
  52. siliconcompiler/remote/schema.py +106 -0
  53. siliconcompiler/remote/server.py +507 -0
  54. siliconcompiler/remote/server_schema/requests/cancel_job.json +51 -0
  55. siliconcompiler/remote/server_schema/requests/check_progress.json +61 -0
  56. siliconcompiler/remote/server_schema/requests/check_server.json +38 -0
  57. siliconcompiler/remote/server_schema/requests/delete_job.json +51 -0
  58. siliconcompiler/remote/server_schema/requests/get_results.json +48 -0
  59. siliconcompiler/remote/server_schema/requests/remote_run.json +40 -0
  60. siliconcompiler/remote/server_schema/responses/cancel_job.json +18 -0
  61. siliconcompiler/remote/server_schema/responses/check_progress.json +30 -0
  62. siliconcompiler/remote/server_schema/responses/check_server.json +32 -0
  63. siliconcompiler/remote/server_schema/responses/delete_job.json +18 -0
  64. siliconcompiler/remote/server_schema/responses/get_results.json +21 -0
  65. siliconcompiler/remote/server_schema/responses/remote_run.json +25 -0
  66. siliconcompiler/report/__init__.py +13 -0
  67. siliconcompiler/report/html_report.py +74 -0
  68. siliconcompiler/report/report.py +355 -0
  69. siliconcompiler/report/streamlit_report.py +137 -0
  70. siliconcompiler/report/streamlit_viewer.py +944 -0
  71. siliconcompiler/report/summary_image.py +117 -0
  72. siliconcompiler/report/summary_table.py +105 -0
  73. siliconcompiler/report/utils.py +163 -0
  74. siliconcompiler/scheduler/__init__.py +2092 -0
  75. siliconcompiler/scheduler/docker_runner.py +253 -0
  76. siliconcompiler/scheduler/run_node.py +138 -0
  77. siliconcompiler/scheduler/send_messages.py +178 -0
  78. siliconcompiler/scheduler/slurm.py +208 -0
  79. siliconcompiler/scheduler/validation/email_credentials.json +54 -0
  80. siliconcompiler/schema/__init__.py +7 -0
  81. siliconcompiler/schema/schema_cfg.py +4014 -0
  82. siliconcompiler/schema/schema_obj.py +1841 -0
  83. siliconcompiler/schema/utils.py +93 -0
  84. siliconcompiler/sphinx_ext/__init__.py +0 -0
  85. siliconcompiler/sphinx_ext/dynamicgen.py +1006 -0
  86. siliconcompiler/sphinx_ext/schemagen.py +221 -0
  87. siliconcompiler/sphinx_ext/utils.py +166 -0
  88. siliconcompiler/targets/__init__.py +0 -0
  89. siliconcompiler/targets/asap7_demo.py +68 -0
  90. siliconcompiler/targets/asic_demo.py +38 -0
  91. siliconcompiler/targets/fpgaflow_demo.py +47 -0
  92. siliconcompiler/targets/freepdk45_demo.py +59 -0
  93. siliconcompiler/targets/gf180_demo.py +77 -0
  94. siliconcompiler/targets/skywater130_demo.py +70 -0
  95. siliconcompiler/templates/email/general.j2 +66 -0
  96. siliconcompiler/templates/email/summary.j2 +43 -0
  97. siliconcompiler/templates/issue/README.txt +26 -0
  98. siliconcompiler/templates/issue/run.sh +6 -0
  99. siliconcompiler/templates/report/bootstrap.min.css +7 -0
  100. siliconcompiler/templates/report/bootstrap.min.js +7 -0
  101. siliconcompiler/templates/report/bootstrap_LICENSE.md +24 -0
  102. siliconcompiler/templates/report/sc_report.j2 +427 -0
  103. siliconcompiler/templates/slurm/run.sh +9 -0
  104. siliconcompiler/templates/tcl/manifest.tcl.j2 +137 -0
  105. siliconcompiler/tools/__init__.py +0 -0
  106. siliconcompiler/tools/_common/__init__.py +432 -0
  107. siliconcompiler/tools/_common/asic.py +115 -0
  108. siliconcompiler/tools/_common/sdc/sc_constraints.sdc +76 -0
  109. siliconcompiler/tools/_common/tcl/sc_pin_constraints.tcl +63 -0
  110. siliconcompiler/tools/bambu/bambu.py +32 -0
  111. siliconcompiler/tools/bambu/convert.py +77 -0
  112. siliconcompiler/tools/bluespec/bluespec.py +40 -0
  113. siliconcompiler/tools/bluespec/convert.py +103 -0
  114. siliconcompiler/tools/builtin/_common.py +155 -0
  115. siliconcompiler/tools/builtin/builtin.py +26 -0
  116. siliconcompiler/tools/builtin/concatenate.py +85 -0
  117. siliconcompiler/tools/builtin/join.py +27 -0
  118. siliconcompiler/tools/builtin/maximum.py +46 -0
  119. siliconcompiler/tools/builtin/minimum.py +57 -0
  120. siliconcompiler/tools/builtin/mux.py +70 -0
  121. siliconcompiler/tools/builtin/nop.py +38 -0
  122. siliconcompiler/tools/builtin/verify.py +83 -0
  123. siliconcompiler/tools/chisel/SCDriver.scala +10 -0
  124. siliconcompiler/tools/chisel/build.sbt +27 -0
  125. siliconcompiler/tools/chisel/chisel.py +37 -0
  126. siliconcompiler/tools/chisel/convert.py +140 -0
  127. siliconcompiler/tools/execute/exec_input.py +41 -0
  128. siliconcompiler/tools/execute/execute.py +17 -0
  129. siliconcompiler/tools/genfasm/bitstream.py +61 -0
  130. siliconcompiler/tools/genfasm/genfasm.py +40 -0
  131. siliconcompiler/tools/ghdl/convert.py +87 -0
  132. siliconcompiler/tools/ghdl/ghdl.py +41 -0
  133. siliconcompiler/tools/icarus/compile.py +87 -0
  134. siliconcompiler/tools/icarus/icarus.py +36 -0
  135. siliconcompiler/tools/icepack/bitstream.py +20 -0
  136. siliconcompiler/tools/icepack/icepack.py +43 -0
  137. siliconcompiler/tools/klayout/export.py +117 -0
  138. siliconcompiler/tools/klayout/klayout.py +119 -0
  139. siliconcompiler/tools/klayout/klayout_export.py +205 -0
  140. siliconcompiler/tools/klayout/klayout_operations.py +363 -0
  141. siliconcompiler/tools/klayout/klayout_show.py +242 -0
  142. siliconcompiler/tools/klayout/klayout_utils.py +176 -0
  143. siliconcompiler/tools/klayout/operations.py +194 -0
  144. siliconcompiler/tools/klayout/screenshot.py +98 -0
  145. siliconcompiler/tools/klayout/show.py +101 -0
  146. siliconcompiler/tools/magic/drc.py +49 -0
  147. siliconcompiler/tools/magic/extspice.py +19 -0
  148. siliconcompiler/tools/magic/magic.py +85 -0
  149. siliconcompiler/tools/magic/sc_drc.tcl +96 -0
  150. siliconcompiler/tools/magic/sc_extspice.tcl +54 -0
  151. siliconcompiler/tools/magic/sc_magic.tcl +47 -0
  152. siliconcompiler/tools/montage/montage.py +30 -0
  153. siliconcompiler/tools/montage/tile.py +66 -0
  154. siliconcompiler/tools/netgen/count_lvs.py +132 -0
  155. siliconcompiler/tools/netgen/lvs.py +90 -0
  156. siliconcompiler/tools/netgen/netgen.py +36 -0
  157. siliconcompiler/tools/netgen/sc_lvs.tcl +46 -0
  158. siliconcompiler/tools/nextpnr/apr.py +24 -0
  159. siliconcompiler/tools/nextpnr/nextpnr.py +59 -0
  160. siliconcompiler/tools/openfpgaloader/openfpgaloader.py +39 -0
  161. siliconcompiler/tools/openroad/__init__.py +0 -0
  162. siliconcompiler/tools/openroad/cts.py +45 -0
  163. siliconcompiler/tools/openroad/dfm.py +66 -0
  164. siliconcompiler/tools/openroad/export.py +131 -0
  165. siliconcompiler/tools/openroad/floorplan.py +70 -0
  166. siliconcompiler/tools/openroad/openroad.py +977 -0
  167. siliconcompiler/tools/openroad/physyn.py +27 -0
  168. siliconcompiler/tools/openroad/place.py +41 -0
  169. siliconcompiler/tools/openroad/rcx_bench.py +95 -0
  170. siliconcompiler/tools/openroad/rcx_extract.py +34 -0
  171. siliconcompiler/tools/openroad/route.py +45 -0
  172. siliconcompiler/tools/openroad/screenshot.py +60 -0
  173. siliconcompiler/tools/openroad/scripts/sc_apr.tcl +499 -0
  174. siliconcompiler/tools/openroad/scripts/sc_cts.tcl +64 -0
  175. siliconcompiler/tools/openroad/scripts/sc_dfm.tcl +20 -0
  176. siliconcompiler/tools/openroad/scripts/sc_export.tcl +98 -0
  177. siliconcompiler/tools/openroad/scripts/sc_floorplan.tcl +413 -0
  178. siliconcompiler/tools/openroad/scripts/sc_metrics.tcl +158 -0
  179. siliconcompiler/tools/openroad/scripts/sc_physyn.tcl +7 -0
  180. siliconcompiler/tools/openroad/scripts/sc_place.tcl +84 -0
  181. siliconcompiler/tools/openroad/scripts/sc_procs.tcl +423 -0
  182. siliconcompiler/tools/openroad/scripts/sc_rcx.tcl +63 -0
  183. siliconcompiler/tools/openroad/scripts/sc_rcx_bench.tcl +20 -0
  184. siliconcompiler/tools/openroad/scripts/sc_rcx_extract.tcl +12 -0
  185. siliconcompiler/tools/openroad/scripts/sc_route.tcl +133 -0
  186. siliconcompiler/tools/openroad/scripts/sc_screenshot.tcl +21 -0
  187. siliconcompiler/tools/openroad/scripts/sc_write.tcl +5 -0
  188. siliconcompiler/tools/openroad/scripts/sc_write_images.tcl +361 -0
  189. siliconcompiler/tools/openroad/show.py +94 -0
  190. siliconcompiler/tools/openroad/templates/pex.tcl +8 -0
  191. siliconcompiler/tools/opensta/__init__.py +101 -0
  192. siliconcompiler/tools/opensta/report_libraries.py +28 -0
  193. siliconcompiler/tools/opensta/scripts/sc_procs.tcl +47 -0
  194. siliconcompiler/tools/opensta/scripts/sc_report_libraries.tcl +74 -0
  195. siliconcompiler/tools/opensta/scripts/sc_timing.tcl +268 -0
  196. siliconcompiler/tools/opensta/timing.py +214 -0
  197. siliconcompiler/tools/slang/__init__.py +49 -0
  198. siliconcompiler/tools/slang/lint.py +101 -0
  199. siliconcompiler/tools/surelog/__init__.py +123 -0
  200. siliconcompiler/tools/surelog/parse.py +183 -0
  201. siliconcompiler/tools/surelog/templates/output.v +7 -0
  202. siliconcompiler/tools/sv2v/convert.py +46 -0
  203. siliconcompiler/tools/sv2v/sv2v.py +37 -0
  204. siliconcompiler/tools/template/template.py +125 -0
  205. siliconcompiler/tools/verilator/compile.py +139 -0
  206. siliconcompiler/tools/verilator/lint.py +19 -0
  207. siliconcompiler/tools/verilator/parse.py +27 -0
  208. siliconcompiler/tools/verilator/verilator.py +172 -0
  209. siliconcompiler/tools/vivado/__init__.py +7 -0
  210. siliconcompiler/tools/vivado/bitstream.py +21 -0
  211. siliconcompiler/tools/vivado/place.py +21 -0
  212. siliconcompiler/tools/vivado/route.py +21 -0
  213. siliconcompiler/tools/vivado/scripts/sc_bitstream.tcl +6 -0
  214. siliconcompiler/tools/vivado/scripts/sc_place.tcl +2 -0
  215. siliconcompiler/tools/vivado/scripts/sc_route.tcl +4 -0
  216. siliconcompiler/tools/vivado/scripts/sc_run.tcl +45 -0
  217. siliconcompiler/tools/vivado/scripts/sc_syn_fpga.tcl +25 -0
  218. siliconcompiler/tools/vivado/syn_fpga.py +20 -0
  219. siliconcompiler/tools/vivado/vivado.py +147 -0
  220. siliconcompiler/tools/vpr/_json_constraint.py +63 -0
  221. siliconcompiler/tools/vpr/_xml_constraint.py +109 -0
  222. siliconcompiler/tools/vpr/place.py +137 -0
  223. siliconcompiler/tools/vpr/route.py +124 -0
  224. siliconcompiler/tools/vpr/screenshot.py +54 -0
  225. siliconcompiler/tools/vpr/show.py +88 -0
  226. siliconcompiler/tools/vpr/vpr.py +357 -0
  227. siliconcompiler/tools/xyce/xyce.py +36 -0
  228. siliconcompiler/tools/yosys/lec.py +56 -0
  229. siliconcompiler/tools/yosys/prepareLib.py +59 -0
  230. siliconcompiler/tools/yosys/sc_lec.tcl +84 -0
  231. siliconcompiler/tools/yosys/sc_syn.tcl +79 -0
  232. siliconcompiler/tools/yosys/syn_asic.py +565 -0
  233. siliconcompiler/tools/yosys/syn_asic.tcl +377 -0
  234. siliconcompiler/tools/yosys/syn_asic_fpga_shared.tcl +31 -0
  235. siliconcompiler/tools/yosys/syn_fpga.py +146 -0
  236. siliconcompiler/tools/yosys/syn_fpga.tcl +233 -0
  237. siliconcompiler/tools/yosys/syn_strategies.tcl +81 -0
  238. siliconcompiler/tools/yosys/techmaps/lcu_kogge_stone.v +39 -0
  239. siliconcompiler/tools/yosys/templates/abc.const +2 -0
  240. siliconcompiler/tools/yosys/yosys.py +147 -0
  241. siliconcompiler/units.py +259 -0
  242. siliconcompiler/use.py +177 -0
  243. siliconcompiler/utils/__init__.py +423 -0
  244. siliconcompiler/utils/asic.py +158 -0
  245. siliconcompiler/utils/showtools.py +25 -0
  246. siliconcompiler-0.26.5.dist-info/LICENSE +190 -0
  247. siliconcompiler-0.26.5.dist-info/METADATA +195 -0
  248. siliconcompiler-0.26.5.dist-info/RECORD +251 -0
  249. siliconcompiler-0.26.5.dist-info/WHEEL +5 -0
  250. siliconcompiler-0.26.5.dist-info/entry_points.txt +12 -0
  251. siliconcompiler-0.26.5.dist-info/top_level.txt +1 -0
@@ -0,0 +1,4014 @@
1
+ # Copyright 2022 Silicon Compiler Authors. All Rights Reserved.
2
+
3
+ import json
4
+
5
+ # Default import must be relative, to facilitate tools with Python interfaces
6
+ # (such as KLayout) directly importing the schema package. However, the fallback
7
+ # allows running this script directly to generate defaults.json.
8
+ try:
9
+ from .utils import trim
10
+ except ImportError:
11
+ from siliconcompiler.schema.utils import trim
12
+
13
+ SCHEMA_VERSION = '0.44.3'
14
+
15
+ #############################################################################
16
+ # PARAM DEFINITION
17
+ #############################################################################
18
+
19
+
20
+ def scparam(cfg,
21
+ keypath,
22
+ sctype=None,
23
+ require=False,
24
+ defvalue=None,
25
+ scope='job',
26
+ copy=False,
27
+ lock=False,
28
+ hashalgo='sha256',
29
+ signature=None,
30
+ notes=None,
31
+ unit=None,
32
+ shorthelp=None,
33
+ switch=None,
34
+ example=None,
35
+ schelp=None,
36
+ enum=None,
37
+ pernode='never'):
38
+
39
+ # 1. descend keypath until done
40
+ # 2. create key if missing
41
+ # 3. populate leaf cell when keypath empty
42
+ if keypath:
43
+ key = keypath[0]
44
+ keypath.pop(0)
45
+ if key not in cfg.keys():
46
+ cfg[key] = {}
47
+ scparam(cfg[key],
48
+ keypath,
49
+ sctype=sctype,
50
+ scope=scope,
51
+ require=require,
52
+ defvalue=defvalue,
53
+ copy=copy,
54
+ lock=lock,
55
+ hashalgo=hashalgo,
56
+ signature=signature,
57
+ notes=notes,
58
+ unit=unit,
59
+ shorthelp=shorthelp,
60
+ switch=switch,
61
+ example=example,
62
+ schelp=schelp,
63
+ enum=enum,
64
+ pernode=pernode)
65
+ else:
66
+
67
+ # removing leading spaces as if schelp were a docstring
68
+ schelp = trim(schelp)
69
+
70
+ # setting values based on types
71
+ # note (bools are never lists)
72
+ if sctype == 'bool':
73
+ if defvalue is None:
74
+ defvalue = False
75
+ if '[' in sctype:
76
+ if signature is None:
77
+ signature = []
78
+ if defvalue is None:
79
+ defvalue = []
80
+
81
+ # mandatory for all
82
+ cfg['type'] = sctype
83
+ cfg['scope'] = scope
84
+ cfg['require'] = require
85
+ cfg['lock'] = lock
86
+ if switch and not isinstance(switch, list):
87
+ switch = [switch]
88
+ cfg['switch'] = switch
89
+ cfg['shorthelp'] = shorthelp
90
+ cfg['example'] = example
91
+ cfg['help'] = schelp
92
+ cfg['notes'] = notes
93
+ # never, optional, required
94
+ cfg['pernode'] = pernode
95
+ cfg['node'] = {}
96
+ cfg['node']['default'] = {}
97
+ cfg['node']['default']['default'] = {}
98
+ cfg['node']['default']['default']['value'] = defvalue
99
+ cfg['node']['default']['default']['signature'] = signature
100
+
101
+ if enum is not None:
102
+ cfg['enum'] = enum
103
+
104
+ # unit for floats/ints
105
+ if unit is not None:
106
+ cfg['unit'] = unit
107
+
108
+ # file only values
109
+ if 'file' in sctype:
110
+ cfg['hashalgo'] = hashalgo
111
+ cfg['copy'] = copy
112
+ cfg['node']['default']['default']['date'] = []
113
+ cfg['node']['default']['default']['author'] = []
114
+ cfg['node']['default']['default']['filehash'] = []
115
+ cfg['node']['default']['default']['package'] = []
116
+
117
+ if 'dir' in sctype:
118
+ cfg['hashalgo'] = hashalgo
119
+ cfg['copy'] = copy
120
+ cfg['node']['default']['default']['filehash'] = []
121
+ cfg['node']['default']['default']['package'] = []
122
+
123
+
124
+ #############################################################################
125
+ # CHIP CONFIGURATION
126
+ #############################################################################
127
+ def schema_cfg():
128
+ '''Method for defining Chip configuration schema
129
+ All the keys defined in this dictionary are reserved words.
130
+ '''
131
+
132
+ # SC version number (bump on every non trivial change)
133
+ # Version number following semver standard.
134
+ # Software version syncs with SC releases (from _metadata)
135
+
136
+ # Basic schema setup
137
+ cfg = {}
138
+
139
+ # Place holder dictionaries updated by core methods()
140
+ cfg['history'] = {}
141
+ cfg['library'] = {}
142
+
143
+ scparam(cfg, ['schemaversion'],
144
+ sctype='str',
145
+ scope='global',
146
+ defvalue=SCHEMA_VERSION,
147
+ require=True,
148
+ shorthelp="Schema version number",
149
+ lock=True,
150
+ switch="-schemaversion <str>",
151
+ example=["api: chip.get('schemaversion')"],
152
+ schelp="""SiliconCompiler schema version number.""")
153
+
154
+ # Design topmodule/entrypoint
155
+ scparam(cfg, ['design'],
156
+ sctype='str',
157
+ scope='global',
158
+ require=True,
159
+ shorthelp="Design top module name",
160
+ switch="-design <str>",
161
+ example=["cli: -design hello_world",
162
+ "api: chip.set('design', 'hello_world')"],
163
+ schelp="""Name of the top level module or library. Required for all
164
+ chip objects.""")
165
+
166
+ # input/output
167
+ io = {'input': ['Input', True],
168
+ 'output': ['Output', False]}
169
+
170
+ filetype = 'default'
171
+ fileset = 'default'
172
+
173
+ for item, val in io.items():
174
+ scparam(cfg, [item, fileset, filetype],
175
+ sctype='[file]',
176
+ pernode='optional',
177
+ copy=val[1],
178
+ shorthelp=f"{val[0]}: files",
179
+ switch=f"-{item} 'fileset filetype <file>'",
180
+ example=[
181
+ f"cli: -{item} 'rtl verilog hello_world.v'",
182
+ f"api: chip.set('{item}', 'rtl', 'verilog', 'hello_world.v')"],
183
+ schelp="""
184
+ List of files of type ('filetype') grouped as a named set ('fileset').
185
+ The exact names of filetypes and filesets must match the string names
186
+ used by the tasks called during flowgraph execution. By convention,
187
+ the fileset names should match the the name of the flowgraph being
188
+ executed.""")
189
+
190
+ # Constraints
191
+ cfg = schema_constraint(cfg)
192
+
193
+ # Options
194
+ cfg = schema_option(cfg)
195
+ cfg = schema_arg(cfg)
196
+
197
+ # Technology configuration
198
+ cfg = schema_fpga(cfg)
199
+ cfg = schema_asic(cfg)
200
+ cfg = schema_pdk(cfg)
201
+
202
+ # Tool flows
203
+ cfg = schema_tool(cfg)
204
+ cfg = schema_task(cfg)
205
+ cfg = schema_flowgraph(cfg)
206
+
207
+ # Metrics
208
+ cfg = schema_checklist(cfg)
209
+ cfg = schema_metric(cfg)
210
+ cfg = schema_record(cfg)
211
+
212
+ # Datasheet
213
+ cfg = schema_datasheet(cfg)
214
+
215
+ # Packaging
216
+ cfg = schema_package(cfg)
217
+
218
+ return cfg
219
+
220
+
221
+ ###############################################################################
222
+ # FPGA
223
+ ###############################################################################
224
+ def schema_fpga(cfg):
225
+ ''' FPGA configuration
226
+ '''
227
+
228
+ partname = 'default'
229
+ key = 'default'
230
+
231
+ scparam(cfg, ['fpga', 'partname'],
232
+ sctype='str',
233
+ shorthelp="FPGA: part name",
234
+ switch="-fpga_partname <str>",
235
+ example=["cli: -fpga_partname fpga64k",
236
+ "api: chip.set('fpga', 'partname', 'fpga64k')"],
237
+ schelp="""
238
+ Complete part name used as a device target by the FPGA compilation
239
+ tool. The part name must be an exact string match to the partname
240
+ hard coded within the FPGA EDA tool.""")
241
+
242
+ scparam(cfg, ['fpga', partname, 'vendor'],
243
+ sctype='str',
244
+ shorthelp="FPGA: vendor name",
245
+ switch="-fpga_vendor 'partname <str>'",
246
+ example=["cli: -fpga_vendor 'fpga64k acme'",
247
+ "api: chip.set('fpga', 'fpga64k', 'vendor', 'acme')"],
248
+ schelp="""
249
+ Name of the FPGA vendor for the FPGA partname.""")
250
+
251
+ scparam(cfg, ['fpga', partname, 'lutsize'],
252
+ sctype='int',
253
+ shorthelp="FPGA: lutsize",
254
+ switch="-fpga_lutsize 'partname <int>'",
255
+ example=["cli: -fpga_lutsize 'fpga64k 4'",
256
+ "api: chip.set('fpga', 'fpga64k', 'lutsize', '4')"],
257
+ schelp="""
258
+ Specify the number of inputs in each lookup table (LUT) for the
259
+ FPGA partname. For architectures with fracturable LUTs, this is
260
+ the number of inputs of the unfractured LUT.""")
261
+
262
+ scparam(cfg, ['fpga', partname, 'file', key],
263
+ sctype='[file]',
264
+ scope='global',
265
+ shorthelp="FPGA: file",
266
+ switch="-fpga_file 'partname key <file>'",
267
+ example=["cli: -fpga_file 'fpga64k file archfile my_arch.xml'",
268
+ "api: chip.set('fpga', 'fpga64k', 'file', 'archfile', 'my_arch.xml')"],
269
+ schelp="""
270
+ Specify a file for the FPGA partname.""")
271
+
272
+ scparam(cfg, ['fpga', partname, 'var', key],
273
+ sctype='[str]',
274
+ shorthelp="FPGA: var",
275
+ switch="-fpga_var 'partname key <str>'",
276
+ example=["cli: -fpga_var 'fpga64k channelwidth 100'",
277
+ "api: chip.set('fpga', 'fpga64k', 'var', 'channelwidth', '100')"],
278
+ schelp="""
279
+ Specify a variable value for the FPGA partname.""")
280
+
281
+ return cfg
282
+
283
+
284
+ ###############################################################################
285
+ # PDK
286
+ ###############################################################################
287
+ def schema_pdk(cfg, stackup='default'):
288
+ ''' Process design kit configuration
289
+ '''
290
+
291
+ tool = 'default'
292
+ filetype = 'default'
293
+ pdkname = 'default'
294
+
295
+ scparam(cfg, ['pdk', pdkname, 'foundry'],
296
+ sctype='str',
297
+ scope='global',
298
+ shorthelp="PDK: foundry name",
299
+ switch="-pdk_foundry 'pdkname <str>'",
300
+ example=["cli: -pdk_foundry 'asap7 virtual'",
301
+ "api: chip.set('pdk', 'asap7', 'foundry', 'virtual')"],
302
+ schelp="""
303
+ Name of foundry corporation. Examples include intel, gf, tsmc,
304
+ samsung, skywater, virtual. The \'virtual\' keyword is reserved for
305
+ simulated non-manufacturable processes.""")
306
+
307
+ scparam(cfg, ['pdk', pdkname, 'node'],
308
+ sctype='float',
309
+ scope='global',
310
+ shorthelp="PDK: process node",
311
+ switch="-pdk_node 'pdkname <float>'",
312
+ example=["cli: -pdk_node 'asap7 130'",
313
+ "api: chip.set('pdk', 'asap7', 'node', 130)"],
314
+ schelp="""
315
+ Approximate relative minimum dimension of the process target specified
316
+ in nanometers. The parameter is required for flows and tools that
317
+ leverage the value to drive technology dependent synthesis and APR
318
+ optimization. Node examples include 180, 130, 90, 65, 45, 32, 22 14,
319
+ 10, 7, 5, 3.""")
320
+
321
+ scparam(cfg, ['pdk', pdkname, 'version'],
322
+ sctype='str',
323
+ scope='global',
324
+ shorthelp="PDK: version",
325
+ switch="-pdk_version 'pdkname <str>'",
326
+ example=["cli: -pdk_version 'asap7 1.0'",
327
+ "api: chip.set('pdk', 'asap7', 'version', '1.0')"],
328
+ schelp="""
329
+ Alphanumeric string specifying the version of the PDK. Verification of
330
+ correct PDK and IP versions is a hard ASIC tapeout require in all
331
+ commercial foundries. The version number can be used for design manifest
332
+ tracking and tapeout checklists.""")
333
+
334
+ scparam(cfg, ['pdk', pdkname, 'stackup'],
335
+ sctype='[str]',
336
+ scope='global',
337
+ shorthelp="PDK: metal stackups",
338
+ switch="-pdk_stackup 'pdkname <str>'",
339
+ example=["cli: -pdk_stackup 'asap7 2MA4MB2MC'",
340
+ "api: chip.add('pdk', 'asap7', 'stackup', '2MA4MB2MC')"],
341
+ schelp="""
342
+ List of all metal stackups offered in the process node. Older process
343
+ nodes may only offer a single metal stackup, while advanced nodes
344
+ offer a large but finite list of metal stacks with varying combinations
345
+ of metal line pitches and thicknesses. Stackup naming is unique to a
346
+ foundry, but is generally a long string or code. For example, a 10
347
+ metal stackup with two 1x wide, four 2x wide, and 4x wide metals,
348
+ might be identified as 2MA4MB2MC, where MA, MB, and MC denote wiring
349
+ layers with different properties (thickness, width, space). Each
350
+ stackup will come with its own set of routing technology files and
351
+ parasitic models specified in the pdk_pexmodel and pdk_aprtech
352
+ parameters.""")
353
+
354
+ scparam(cfg, ['pdk', pdkname, 'minlayer', stackup],
355
+ sctype='str',
356
+ scope='global',
357
+ shorthelp="PDK: minimum routing layer",
358
+ switch="-pdk_minlayer 'pdk stackup <str>'",
359
+ example=[
360
+ "cli: -pdk_minlayer 'asap7 2MA4MB2MC M2'",
361
+ "api: chip.set('pdk', 'asap7', 'minlayer', '2MA4MB2MC', 'M2')"],
362
+ schelp="""
363
+ Minimum metal layer to be used for automated place and route
364
+ specified on a per stackup basis.""")
365
+
366
+ scparam(cfg, ['pdk', pdkname, 'maxlayer', stackup],
367
+ sctype='str',
368
+ scope='global',
369
+ shorthelp="PDK: maximum routing layer",
370
+ switch="-pdk_maxlayer 'pdk stackup <str>'",
371
+ example=[
372
+ "cli: -pdk_maxlayer 'asap7 2MA4MB2MC M8'",
373
+ "api: chip.set('pdk', 'asap7', 'maxlayer', 'MA4MB2MC', 'M8')"],
374
+ schelp="""
375
+ Maximum metal layer to be used for automated place and route
376
+ specified on a per stackup basis.""")
377
+
378
+ scparam(cfg, ['pdk', pdkname, 'wafersize'],
379
+ sctype='float',
380
+ scope='global',
381
+ unit='mm',
382
+ shorthelp="PDK: wafer size",
383
+ switch="-pdk_wafersize 'pdkname <float>'",
384
+ example=["cli: -pdk_wafersize 'asap7 300'",
385
+ "api: chip.set('pdk', 'asap7', 'wafersize', 300)"],
386
+ schelp="""
387
+ Wafer diameter used in wafer based manufacturing process.
388
+ The standard diameter for leading edge manufacturing is 300mm. For
389
+ older process technologies and specialty fabs, smaller diameters
390
+ such as 200, 100, 125, 100 are common. The value is used to
391
+ calculate dies per wafer and full factory chip costs.""")
392
+
393
+ scparam(cfg, ['pdk', pdkname, 'panelsize'],
394
+ sctype='[(float,float)]',
395
+ scope='global',
396
+ unit='mm',
397
+ shorthelp="PDK: panel size",
398
+ switch="-pdk_panelsize 'pdkname <(float,float)>'",
399
+ example=[
400
+ "cli: -pdk_panelsize 'asap7 (45.72,60.96)'",
401
+ "api: chip.set('pdk', 'asap7', 'panelsize', (45.72, 60.96))"],
402
+ schelp="""
403
+ List of panel sizes supported in the manufacturing process.
404
+ """)
405
+
406
+ scparam(cfg, ['pdk', pdkname, 'unitcost'],
407
+ sctype='float',
408
+ scope='global',
409
+ unit='USD',
410
+ shorthelp="PDK: unit cost",
411
+ switch="-pdk_unitcost 'pdkname <float>'",
412
+ example=["cli: -pdk_unitcost 'asap7 10000'",
413
+ "api: chip.set('pdk', 'asap7', 'unitcost', 10000)"],
414
+ schelp="""
415
+ Raw cost per unit shipped by the factory, not accounting for yield
416
+ loss.""")
417
+
418
+ scparam(cfg, ['pdk', pdkname, 'd0'],
419
+ sctype='float',
420
+ scope='global',
421
+ shorthelp="PDK: process defect density",
422
+ switch="-pdk_d0 'pdkname <float>'",
423
+ example=["cli: -pdk_d0 'asap7 0.1'",
424
+ "api: chip.set('pdk', 'asap7', 'd0', 0.1)"],
425
+ schelp="""
426
+ Process defect density (d0) expressed as random defects per cm^2. The
427
+ value is used to calculate yield losses as a function of area, which in
428
+ turn affects the chip full factory costs. Two yield models are
429
+ supported: Poisson (default), and Murphy. The Poisson based yield is
430
+ calculated as dy = exp(-area * d0/100). The Murphy based yield is
431
+ calculated as dy = ((1-exp(-area * d0/100))/(area * d0/100))^2.""")
432
+
433
+ scparam(cfg, ['pdk', pdkname, 'scribe'],
434
+ sctype='(float,float)',
435
+ scope='global',
436
+ unit='mm',
437
+ shorthelp="PDK: horizontal scribe line width",
438
+ switch="-pdk_scribe 'pdkname <(float,float)>'",
439
+ example=["cli: -pdk_scribe 'asap7 (0.1,0.1)'",
440
+ "api: chip.set('pdk', 'asap7', 'scribe', (0.1, 0.1))"],
441
+ schelp="""
442
+ Width of the horizontal and vertical scribe line used during die separation.
443
+ The process is generally completed using a mechanical saw, but can be
444
+ done through combinations of mechanical saws, lasers, wafer thinning,
445
+ and chemical etching in more advanced technologies. The value is used
446
+ to calculate effective dies per wafer and full factory cost.""")
447
+
448
+ scparam(cfg, ['pdk', pdkname, 'edgemargin'],
449
+ sctype='float',
450
+ scope='global',
451
+ unit='mm',
452
+ shorthelp="PDK: wafer edge keep-out margin",
453
+ switch="-pdk_edgemargin 'pdkname <float>'",
454
+ example=[
455
+ "cli: -pdk_edgemargin 'asap7 1'",
456
+ "api: chip.set('pdk', 'asap7', 'edgemargin', 1)"],
457
+ schelp="""
458
+ Keep-out distance/margin from the edge inwards. The edge
459
+ is prone to chipping and need special treatment that preclude
460
+ placement of designs in this area. The edge value is used to
461
+ calculate effective units per wafer/panel and full factory cost.""")
462
+
463
+ simtype = 'default'
464
+ scparam(cfg, ['pdk', pdkname, 'devmodel', tool, simtype, stackup],
465
+ sctype='[file]',
466
+ scope='global',
467
+ shorthelp="PDK: device models",
468
+ switch="-pdk_devmodel 'pdkname tool simtype stackup <file>'",
469
+ example=[
470
+ "cli: -pdk_devmodel 'asap7 xyce spice M10 asap7.sp'",
471
+ "api: chip.set('pdk', 'asap7', 'devmodel', 'xyce', 'spice', 'M10', 'asap7.sp')"],
472
+ schelp="""
473
+ List of filepaths to PDK device models for different simulation
474
+ purposes and for different tools. Examples of device model types
475
+ include spice, aging, electromigration, radiation. An example of a
476
+ 'spice' tool is xyce. Device models are specified on a per metal stack
477
+ basis. Process nodes with a single device model across all stacks will
478
+ have a unique parameter record per metal stack pointing to the same
479
+ device model file. Device types and tools are dynamic entries
480
+ that depend on the tool setup and device technology. Pseudo-standardized
481
+ device types include spice, em (electromigration), and aging.""")
482
+
483
+ corner = 'default'
484
+ scparam(cfg, ['pdk', pdkname, 'pexmodel', tool, stackup, corner],
485
+ sctype='[file]',
486
+ scope='global',
487
+ shorthelp="PDK: parasitic TCAD models",
488
+ switch="-pdk_pexmodel 'pdkname tool stackup corner <file>'",
489
+ example=[
490
+ "cli: -pdk_pexmodel 'asap7 fastcap M10 max wire.mod'",
491
+ "api: chip.set('pdk', 'asap7', 'pexmodel', 'fastcap', 'M10', 'max', 'wire.mod')"],
492
+ schelp="""
493
+ List of filepaths to PDK wire TCAD models used during automated
494
+ synthesis, APR, and signoff verification. Pexmodels are specified on
495
+ a per metal stack basis. Corner values depend on the process being
496
+ used, but typically include nomenclature such as min, max, nominal.
497
+ For exact names, refer to the DRM. Pexmodels are generally not
498
+ standardized and specified on a per tool basis. An example of pexmodel
499
+ type is 'fastcap'.""")
500
+
501
+ src = 'default'
502
+ dst = 'default'
503
+ scparam(cfg, ['pdk', pdkname, 'layermap', tool, src, dst, stackup],
504
+ sctype='[file]',
505
+ scope='global',
506
+ shorthelp="PDK: layer map file",
507
+ switch="-pdk_layermap 'pdkname tool src dst stackup <file>'",
508
+ example=[
509
+ "cli: -pdk_layermap 'asap7 klayout db gds M10 asap7.map'",
510
+ "api: chip.set('pdk', 'asap7', 'layermap', 'klayout', 'db', 'gds', 'M10', "
511
+ "'asap7.map')"],
512
+ schelp="""
513
+ Files describing input/output mapping for streaming layout data from
514
+ one format to another. A foundry PDK will include an official layer
515
+ list for all user entered and generated layers supported in the GDS
516
+ accepted by the foundry for processing, but there is no standardized
517
+ layer definition format that can be read and written by all EDA tools.
518
+ To ensure mask layer matching, key/value type mapping files are needed
519
+ to convert EDA databases to/from GDS and to convert between different
520
+ types of EDA databases. Layer maps are specified on a per metal
521
+ stackup basis. The 'src' and 'dst' can be names of SC supported tools
522
+ or file formats (like 'gds').""")
523
+
524
+ scparam(cfg, ['pdk', pdkname, 'display', tool, stackup],
525
+ sctype='[file]',
526
+ scope='global',
527
+ shorthelp="PDK: display file",
528
+ switch="-pdk_display 'pdkname tool stackup <file>'",
529
+ example=[
530
+ "cli: -pdk_display 'asap7 klayout M10 display.lyt'",
531
+ "api: chip.set('pdk', 'asap7', 'display', 'klayout', 'M10', 'display.cfg')"],
532
+ schelp="""
533
+ Display configuration files describing colors and pattern schemes for
534
+ all layers in the PDK. The display configuration file is entered on a
535
+ stackup and tool basis.""")
536
+
537
+ # TODO: create firm list of accepted files
538
+ libarch = 'default'
539
+ scparam(cfg, ['pdk', pdkname, 'aprtech', tool, stackup, libarch, filetype],
540
+ sctype='[file]',
541
+ scope='global',
542
+ shorthelp="PDK: APR technology files",
543
+ switch="-pdk_aprtech 'pdkname tool stackup libarch filetype <file>'",
544
+ example=[
545
+ "cli: -pdk_aprtech 'asap7 openroad M10 12t lef tech.lef'",
546
+ "api: chip.set('pdk', 'asap7', 'aprtech', 'openroad', 'M10', '12t', 'lef', "
547
+ "'tech.lef')"],
548
+ schelp="""
549
+ Technology file containing setup information needed to enable DRC clean APR
550
+ for the specified stackup, libarch, and format. The 'libarch' specifies the
551
+ library architecture (e.g. library height). For example a PDK with support
552
+ for 9 and 12 track libraries might have 'libarchs' called 9t and 12t.
553
+ The standard filetype for specifying place and route design rules for a
554
+ process node is through a 'lef' format technology file. The
555
+ 'filetype' used in the aprtech is used by the tool specific APR TCL scripts
556
+ to set up the technology parameters. Some tools may require additional
557
+ files beyond the tech.lef file. Examples of extra file types include
558
+ antenna, tracks, tapcell, viarules, em.""")
559
+
560
+ checks = ['lvs', 'drc', 'erc', 'fill']
561
+ name = 'default'
562
+ for item in checks:
563
+ scparam(cfg, ['pdk', pdkname, item, 'runset', tool, stackup, name],
564
+ sctype='[file]',
565
+ scope='global',
566
+ shorthelp=f"PDK: {item.upper()} runset files",
567
+ switch=f"-pdk_{item}_runset 'pdkname tool stackup name <file>'",
568
+ example=[
569
+ f"cli: -pdk_{item}_runset 'asap7 magic M10 basic $PDK/{item}.rs'",
570
+ f"api: chip.set('pdk', 'asap7', '{item}', 'runset', 'magic', 'M10', 'basic', "
571
+ f"'$PDK/{item}.rs')"],
572
+ schelp=f"""Runset files for {item.upper()} task.""")
573
+
574
+ scparam(cfg, ['pdk', pdkname, item, 'waiver', tool, stackup, name],
575
+ sctype='[file]',
576
+ scope='global',
577
+ shorthelp=f"PDK: {item.upper()} waiver files",
578
+ switch=f"-pdk_{item}_waiver 'pdkname tool stackup name <file>'",
579
+ example=[
580
+ f"cli: -pdk_{item}_waiver 'asap7 magic M10 basic $PDK/{item}.txt'",
581
+ f"api: chip.set('pdk', 'asap7', '{item}', 'waiver', 'magic', 'M10', 'basic', "
582
+ f"'$PDK/{item}.txt')"],
583
+ schelp=f"""Waiver files for {item.upper()} task.""")
584
+
585
+ ###############
586
+ # EDA vars
587
+ ###############
588
+
589
+ key = 'default'
590
+ scparam(cfg, ['pdk', pdkname, 'file', tool, key, stackup],
591
+ sctype='[file]',
592
+ scope='global',
593
+ shorthelp="PDK: special file",
594
+ switch="-pdk_file 'pdkname tool key stackup <file>'",
595
+ example=[
596
+ "cli: -pdk_file 'asap7 xyce spice M10 asap7.sp'",
597
+ "api: chip.set('pdk', 'asap7', 'file', 'xyce', 'spice', 'M10', 'asap7.sp')"],
598
+ schelp="""
599
+ List of named files specified on a per tool and per stackup basis.
600
+ The parameter should only be used for specifying files that are
601
+ not directly supported by the SiliconCompiler PDK schema.""")
602
+
603
+ scparam(cfg, ['pdk', pdkname, 'dir', tool, key, stackup],
604
+ sctype='[dir]',
605
+ scope='global',
606
+ shorthelp="PDK: special directory",
607
+ switch="-pdk_dir 'pdkname tool key stackup <dir>'",
608
+ example=[
609
+ "cli: -pdk_dir 'asap7 xyce rfmodel M10 rftechdir'",
610
+ "api: chip.set('pdk', 'asap7', 'dir', 'xyce', 'rfmodel', 'M10', "
611
+ "'rftechdir')"],
612
+ schelp="""
613
+ List of named directories specified on a per tool and per stackup basis.
614
+ The parameter should only be used for specifying files that are
615
+ not directly supported by the SiliconCompiler PDK schema.""")
616
+
617
+ scparam(cfg, ['pdk', pdkname, 'var', tool, key, stackup],
618
+ sctype='[str]',
619
+ scope='global',
620
+ shorthelp="PDK: special variable",
621
+ switch="-pdk_var 'pdkname tool stackup key <str>'",
622
+ example=[
623
+ "cli: -pdk_var 'asap7 xyce modeltype M10 bsim4'",
624
+ "api: chip.set('pdk', 'asap7', 'var', 'xyce', 'modeltype', 'M10', 'bsim4')"],
625
+ schelp="""
626
+ List of key/value strings specified on a per tool and per stackup basis.
627
+ The parameter should only be used for specifying variables that are
628
+ not directly supported by the SiliconCompiler PDK schema.""")
629
+
630
+ ###############
631
+ # Docs
632
+ ###############
633
+
634
+ doctype = 'default'
635
+ scparam(cfg, ['pdk', pdkname, 'doc', doctype],
636
+ sctype='[file]',
637
+ scope='global',
638
+ shorthelp="PDK: documentation",
639
+ switch="-pdk_doc 'pdkname doctype <file>'",
640
+ example=["cli: -pdk_doc 'asap7 reference reference.pdf'",
641
+ "api: chip.set('pdk', 'asap7', 'doc', 'reference', 'reference.pdf')"],
642
+ schelp="""
643
+ Filepath to pdk documentation.""")
644
+
645
+ return cfg
646
+
647
+
648
+ ###############################################################################
649
+ # Datasheet ("specification/contract")
650
+ ###############################################################################
651
+ def schema_datasheet(cfg, name='default', mode='default'):
652
+
653
+ # Part type
654
+ scparam(cfg, ['datasheet', 'type'],
655
+ sctype='enum',
656
+ enum=['digital', 'analog', 'ams', 'passive',
657
+ 'soc', 'fpga',
658
+ 'adc', 'dac',
659
+ 'pmic', 'buck', 'boost', 'ldo',
660
+ 'sram', 'dram', 'flash', 'rom',
661
+ 'interface', 'clock', 'amplifier',
662
+ 'filter', 'mixer', 'modulator', 'lna'],
663
+ shorthelp="Datasheet: part type",
664
+ switch="-datasheet_type '<str>'",
665
+ example=[
666
+ "cli: -datasheet_type 'digital'",
667
+ "api: chip.set('datasheet', 'type', 'digital')"],
668
+ schelp="""Part type.""")
669
+
670
+ # Documentation
671
+ scparam(cfg, ['datasheet', 'doc'],
672
+ sctype='[file]',
673
+ shorthelp="Datasheet: part documentation",
674
+ switch="-datasheet_doc '<file>'",
675
+ example=[
676
+ "cli: -datasheet_doc 'za001.pdf'",
677
+ "api: chip.set('datasheet', 'doc', 'za001.pdf)"],
678
+ schelp="""Device datasheet document.""")
679
+
680
+ # Series
681
+ scparam(cfg, ['datasheet', 'series'],
682
+ sctype='str',
683
+ shorthelp="Datasheet: device series",
684
+ switch="-datasheet_series '<str>'",
685
+ example=[
686
+ "cli: -datasheet_series 'ZA0'",
687
+ "api: chip.set('datasheet', 'series', 'ZA0)"],
688
+ schelp="""Device series describing a family of devices or
689
+ a singular device with multiple packages and/or qualification
690
+ SKUs.""")
691
+
692
+ # Manufacturer
693
+ scparam(cfg, ['datasheet', 'manufacturer'],
694
+ sctype='str',
695
+ shorthelp="Datasheet: part manufacturer",
696
+ switch="-datasheet_manufacturer '<str>'",
697
+ example=[
698
+ "cli: -datasheet_manufacturer 'Acme'",
699
+ "api: chip.set('datasheet', 'manufacturer', 'Acme')"],
700
+ schelp="""Device manufacturer/vendor.""")
701
+
702
+ # Device description
703
+ scparam(cfg, ['datasheet', 'description'],
704
+ sctype='str',
705
+ shorthelp="Datasheet: description",
706
+ switch="-datasheet_description '<str>'",
707
+ example=[
708
+ "cli: -datasheet_description 'Yet another CPU'",
709
+ "api: chip.set('datasheet', 'description', 'Yet another CPU')"],
710
+ schelp="""Free text device description""")
711
+
712
+ # Features
713
+ scparam(cfg, ['datasheet', 'features'],
714
+ sctype='[str]',
715
+ shorthelp="Datasheet: part features",
716
+ switch="-datasheet_features '<str>'",
717
+ example=[
718
+ "cli: -datasheet_features 'usb3.0'",
719
+ "api: chip.set('datasheet', 'features', 'usb3.0')"],
720
+ schelp="""List of manufacturer specified device features""")
721
+
722
+ # Grade
723
+ scparam(cfg, ['datasheet', 'grade'],
724
+ sctype='enum',
725
+ enum=['consumer', 'industrial',
726
+ 'medical', 'automotive',
727
+ 'military', 'space'],
728
+ shorthelp="Datasheet: part manufacturing grade",
729
+ switch="-datasheet_grade '<str>'",
730
+ example=[
731
+ "cli: -datasheet_grade 'automotive'",
732
+ "api: chip.set('datasheet', 'grade', 'automotive')"],
733
+ schelp="""Device end application qualification grade.""")
734
+
735
+ # Qualification
736
+ scparam(cfg, ['datasheet', 'qual'],
737
+ sctype='[str]',
738
+ shorthelp="Datasheet: qualification",
739
+ switch="-datasheet_qual '<str>'",
740
+ example=[
741
+ "cli: -datasheet_qual 'AEC-Q100'",
742
+ "api: chip.set('datasheet', 'qual', 'AEC-Q100')"],
743
+ schelp="""List of qualification standards passed by device.""")
744
+
745
+ # TRL
746
+ scparam(cfg, ['datasheet', 'trl'],
747
+ sctype='int',
748
+ shorthelp="Datasheet: technology readiness level",
749
+ switch="-datasheet_trl '<int>'",
750
+ example=[
751
+ "cli: -datasheet_trl 9",
752
+ "api: chip.set('datasheet', 'trl', 9)"],
753
+ schelp="""Technology readiness level (TRL) of device. For more
754
+ information, see:
755
+ https://en.wikipedia.org/wiki/Technology_readiness_level""")
756
+
757
+ # Status
758
+ scparam(cfg, ['datasheet', 'status'],
759
+ sctype='enum',
760
+ enum=['preview', 'active', 'deprecated',
761
+ 'last time buy', 'obsolete'],
762
+ shorthelp="Datasheet: product status",
763
+ switch="-datasheet_status '<str>'",
764
+ example=[
765
+ "cli: -datasheet_status 'active'",
766
+ "api: chip.set('datasheet', 'status', 'active')"],
767
+ schelp="""Device production status.""")
768
+
769
+ # Maximum Frequency
770
+ scparam(cfg, ['datasheet', 'fmax'],
771
+ sctype='float',
772
+ unit='MHz',
773
+ shorthelp="Datasheet: device maximum frequency",
774
+ switch="-datasheet_fmax '<float>'",
775
+ example=[
776
+ "cli: -datasheet_fmax 100'",
777
+ "api: chip.set('datasheet', 'fmax', 100')"],
778
+ schelp="""Device maximum operating frequency.""")
779
+
780
+ # Total OPS
781
+ scparam(cfg, ['datasheet', 'ops'],
782
+ sctype='float',
783
+ shorthelp="Datasheet: total device operations per second",
784
+ switch="-datasheet_ops '<float>'",
785
+ example=[
786
+ "cli: -datasheet_ops 1e18'",
787
+ "api: chip.set('datasheet', 'ops', 1e18)"],
788
+ schelp="""Device peak total operations per second, describing
789
+ the total mathematical operations performed by all on-device
790
+ processing units.""")
791
+
792
+ # Total I/O bandwidth
793
+ scparam(cfg, ['datasheet', 'iobw'],
794
+ sctype='float',
795
+ unit='bps',
796
+ shorthelp="Datasheet: total I/O bandwidth",
797
+ switch="-datasheet_iobw '<float>'",
798
+ example=[
799
+ "cli: -datasheet_iobw 1e18'",
800
+ "api: chip.set('datasheet', 'iobw', 1e18)"],
801
+ schelp="""Device peak off-device bandwidth in bits per second.""")
802
+
803
+ # Total I/O count
804
+ scparam(cfg, ['datasheet', 'iocount'],
805
+ sctype='int',
806
+ shorthelp="Datasheet: total number of I/Os",
807
+ switch="-datasheet_iocount '<int>'",
808
+ example=[
809
+ "cli: -datasheet_iocount 100'",
810
+ "api: chip.set('datasheet', 'iocount', 100)"],
811
+ schelp="""Device total number of I/Os (not counting supplies).""")
812
+
813
+ # Total on-device RAM
814
+ scparam(cfg, ['datasheet', 'ram'],
815
+ sctype='float',
816
+ unit='bits',
817
+ shorthelp="Datasheet: total device RAM",
818
+ switch="-datasheet_ram '<float>'",
819
+ example=[
820
+ "cli: -datasheet_ram 128'",
821
+ "api: chip.set('datasheet', 'ram', 128)"],
822
+ schelp="""Device total RAM.""")
823
+
824
+ # Total power
825
+ scparam(cfg, ['datasheet', 'peakpower'],
826
+ sctype='float',
827
+ unit='W',
828
+ shorthelp="Datasheet: peak power",
829
+ switch="-datasheet_peakpower '<float>'",
830
+ example=[
831
+ "cli: -datasheet_peakpower 1'",
832
+ "api: chip.set('datasheet', 'peakpower', 1)"],
833
+ schelp="""Device total peak power.""")
834
+
835
+ ######################
836
+ # IO
837
+ ######################
838
+
839
+ scparam(cfg, ['datasheet', 'io', name, 'arch'],
840
+ sctype='enum',
841
+ enum=['spi', 'uart', 'i2c', 'pwm', 'qspi', 'sdio', 'can', 'jtag',
842
+ 'spdif', 'i2s',
843
+ 'gpio', 'lvds', 'serdes', 'pio',
844
+ 'ddr3', 'ddr4', 'ddr5',
845
+ 'lpddr4', 'lpddr5',
846
+ 'hbm2', 'hbm3', 'hbm4',
847
+ 'onfi', 'sram',
848
+ 'hdmi', 'mipi-csi', 'mipi-dsi', 'slvs',
849
+ 'sata',
850
+ 'usb1', 'usb2', 'usb3',
851
+ 'pcie3', 'pcie4', 'pcie5', 'pcie6',
852
+ 'cxl',
853
+ 'ethernet', 'rmii', 'rgmii', 'sgmii', 'xaui',
854
+ '10gbase-kr', '25gbase-kr', 'xfi', 'cei28g',
855
+ 'jesd204', 'cpri'],
856
+ shorthelp="Datasheet: io standard",
857
+ switch="-datasheet_io_arch 'name <str>'",
858
+ example=[
859
+ "cli: -datasheet_io_arch 'pio spi'",
860
+ "api: chip.set('datasheet', 'io', 'pio', 'arch', 'spi')"],
861
+ schelp="""Datasheet: List of IO standard architectures supported
862
+ by the named port.""")
863
+
864
+ metrics = {'fmax': ['maximum frequency', 100, 'float', 'MHz'],
865
+ 'width': ['width', 4, 'int', None],
866
+ 'channels': ['channels', 4, 'int', None]
867
+ }
868
+
869
+ for i, v in metrics.items():
870
+ scparam(cfg, ['datasheet', 'io', name, i],
871
+ unit=v[3],
872
+ sctype=v[2],
873
+ shorthelp=f"Datasheet: io {v[0]}",
874
+ switch=f"-datasheet_io_{i} 'name <{v[2]}>'",
875
+ example=[
876
+ f"cli: -datasheet_io_{i} 'name {v[1]}'",
877
+ f"api: chip.set('datasheet', 'io', name, '{i}', {v[1]})"],
878
+ schelp=f"""Datasheet: IO {v[1]} metrics specified on a named port basis.
879
+ """)
880
+
881
+ ######################
882
+ # Processor
883
+ ######################
884
+
885
+ scparam(cfg, ['datasheet', 'proc', name, 'arch'],
886
+ sctype='str',
887
+ shorthelp="Datasheet: processor architecture",
888
+ switch="-datasheet_proc_arch 'name <str>'",
889
+ example=[
890
+ "cli: -datasheet_proc_arch '0 RV64GC'",
891
+ "api: chip.set('datasheet', 'proc', name, 'arch', 'openfpga')"],
892
+ schelp="""Processor architecture.""")
893
+
894
+ scparam(cfg, ['datasheet', 'proc', name, 'features'],
895
+ sctype='[str]',
896
+ shorthelp="Datasheet: processor features",
897
+ switch="-datasheet_proc_features 'name <str>'",
898
+ example=[
899
+ "cli: -datasheet_proc_features '0 SIMD'",
900
+ "api: chip.set('datasheet','proc','cpu','features', 'SIMD')"],
901
+ schelp="""List of maker specified processor features.""")
902
+
903
+ scparam(cfg, ['datasheet', 'proc', name, 'datatypes'],
904
+ sctype='[enum]',
905
+ enum=['int4', 'int8', 'int16', 'int32', 'int64', 'int128',
906
+ 'uint4', 'uint8', 'uint16', 'uint32', 'uint64', 'uint128',
907
+ 'bfloat16', 'fp16', 'fp32', 'fp64', 'fp128'],
908
+ shorthelp="Datasheet: processor datatypes",
909
+ switch="-datasheet_proc_datatypes 'name <str>'",
910
+ example=[
911
+ "cli: -datasheet_proc_datatypes '0 int8'",
912
+ "api: chip.set('datasheet', 'proc', 'cpu', 'datatypes', 'int8')"],
913
+ schelp="""List of datatypes supported by the processor.""")
914
+
915
+ metrics = {'archsize': ['architecture size', 64, None],
916
+ 'cores': ['number of cores', 4, None],
917
+ 'fmax': ['maximum frequency', 100, 'MHz'],
918
+ 'ops': ['operations per cycle per core', 4, None],
919
+ 'mults': ['hard multiplier units per core', 100, None],
920
+ 'icache': ['l1 icache size', 32, 'KB'],
921
+ 'dcache': ['l1 dcache size', 32, 'KB'],
922
+ 'l2cache': ['l2 cache size', 1024, 'KB'],
923
+ 'l3cache': ['l3 cache size', 1024, 'KB'],
924
+ 'sram': ['local sram', 128, 'KB'],
925
+ 'nvm': ['local non-volatile memory', 128, 'KB']}
926
+
927
+ for i, v in metrics.items():
928
+ scparam(cfg, ['datasheet', 'proc', name, i],
929
+ unit=v[2],
930
+ sctype='int',
931
+ shorthelp=f"Datasheet: processor {v[0]}",
932
+ switch=f"-datasheet_proc_{i} 'name <int>'",
933
+ example=[
934
+ f"cli: -datasheet_proc_{i} 'cpu {v[1]}'",
935
+ f"api: chip.set('datasheet', 'proc', 'cpu', '{i}', {v[1]})"],
936
+ schelp=f"""Processor metric: {v[0]}.""")
937
+
938
+ ######################
939
+ # Memory
940
+ ######################
941
+
942
+ scparam(cfg, ['datasheet', 'memory', name, 'bits'],
943
+ sctype='int',
944
+ shorthelp="Datasheet: memory total bits",
945
+ switch="-datasheet_memory_bits 'name <int>'",
946
+ example=[
947
+ "cli: -datasheet_memory_bits 'm0 1024'",
948
+ "api: chip.set('datasheet', 'memory', 'm0', 'bits', 1024)"],
949
+ schelp="""Memory total number of bits.""")
950
+
951
+ scparam(cfg, ['datasheet', 'memory', name, 'width'],
952
+ sctype='int',
953
+ shorthelp="Datasheet: memory width",
954
+ switch="-datasheet_memory_width 'name <int>'",
955
+ example=[
956
+ "cli: -datasheet_memory_width 'm0 16'",
957
+ "api: chip.set('datasheet', 'memory', 'm0', 'width', 16)"],
958
+ schelp="""Memory width.""")
959
+
960
+ scparam(cfg, ['datasheet', 'memory', name, 'depth'],
961
+ sctype='int',
962
+ shorthelp="Datasheet: memory depth",
963
+ switch="-datasheet_memory_depth 'name <int>'",
964
+ example=[
965
+ "cli: -datasheet_memory_depth 'm0 128'",
966
+ "api: chip.set('datasheet', 'memory', 'm0', 'depth', 128)"],
967
+ schelp="""Memory depth.""")
968
+
969
+ scparam(cfg, ['datasheet', 'memory', name, 'banks'],
970
+ sctype='int',
971
+ shorthelp="Datasheet: memory banks",
972
+ switch="-datasheet_memory_banks 'name <int>'",
973
+ example=[
974
+ "cli: -datasheet_memory_banks 'm0 4'",
975
+ "api: chip.set('datasheet', 'memory', 'm0', 'banks', 4)"],
976
+ schelp="""Memory banks.""")
977
+
978
+ # Timing
979
+ metrics = {'fmax': ['max frequency', (1e9, 1e9, 1e9), 'Hz'],
980
+ 'tcycle': ['access clock cycle', (9.0, 10.0, 11.0), 'ns'],
981
+ 'twr': ['write clock cycle', (0.9, 1, 1.1), 'ns'],
982
+ 'trd': ['read clock cycle', (0.9, 1, 1.1), 'ns'],
983
+ 'trefresh': ['refresh time', (99, 100, 101), 'ns'],
984
+ 'terase': ['erase time', (1e-6, 1e-6, 1e-6), 's'],
985
+ 'bwrd': ['maximum read bandwidth', (1e9, 1e9, 1e9), 'bps'],
986
+ 'bwwr': ['maximum write bandwidth', (1e9, 1e9, 1e9), 'bps'],
987
+ 'erd': ['read energy', (1e-12, 2e-12, 3e-12), 'J'],
988
+ 'ewr': ['write energy', (1e-12, 2e-12, 3e-12), 'J'],
989
+ 'twearout': ['write/erase wear-out', (100e3, 100e4, 100e5), 'cycles']
990
+ }
991
+
992
+ for i, v in metrics.items():
993
+ scparam(cfg, ['datasheet', 'memory', name, i],
994
+ unit=v[2],
995
+ sctype='(float,float,float)',
996
+ shorthelp=f"Datasheet: memory {v[0]}",
997
+ switch=f"-datasheet_memory_{i} 'name <(float,float,float)>'",
998
+ example=[
999
+ f"cli: -datasheet_memory_{i} 'name {v[1]}'",
1000
+ f"api: chip.set('datasheet', 'memory', name, '{i}', {v[1]})"],
1001
+ schelp=f"""Memory {v[1]}.""")
1002
+
1003
+ # Latency (cycles)
1004
+ metrics = {'tcl': ['column address latency', (100, 100, 100), 'cycles'],
1005
+ 'trcd': ['row address latency', (100, 100, 100), 'cycles'],
1006
+ 'trp': ['row precharge time latency', (100, 100, 100), 'cycles'],
1007
+ 'tras': ['row active time latency', (100, 100, 100), 'cycles']
1008
+ }
1009
+
1010
+ for i, v in metrics.items():
1011
+ scparam(cfg, ['datasheet', 'memory', name, i],
1012
+ unit=v[2],
1013
+ sctype='(int,int,int)',
1014
+ shorthelp=f"Datasheet: memory {v[0]}",
1015
+ switch=f"-datasheet_memory_{i} 'name <(int,int,int)>'",
1016
+ example=[
1017
+ f"cli: -datasheet_memory_{i} 'name {v[1]}'",
1018
+ f"api: chip.set('datasheet', 'memory', name, '{i}', {v[1]})"],
1019
+ schelp=f"""Memory {v[1]}.""")
1020
+
1021
+ ######################
1022
+ # FPGA
1023
+ ######################
1024
+
1025
+ scparam(cfg, ['datasheet', 'fpga', name, 'arch'],
1026
+ sctype='str',
1027
+ shorthelp="Datasheet: fpga architecture",
1028
+ switch="-datasheet_fpga_arch 'name <str>'",
1029
+ example=[
1030
+ "cli: -datasheet_fpga_arch 'i0 openfpga'",
1031
+ "api: chip.set('datasheet', 'fpga', 'i0', 'arch', 'openfpga')"],
1032
+ schelp="""FPGA architecture.
1033
+ """)
1034
+
1035
+ metrics = {'luts': ['LUTs (4 input)', 32000, None],
1036
+ 'registers': ['registers', 100, None],
1037
+ 'plls': ['pll blocks', 1, None],
1038
+ 'mults': ['multiplier/dsp elements', 100, None],
1039
+ 'totalram': ['total ram', 128, 'Kb'],
1040
+ 'distram': ['distributed ram', 128, 'Kb'],
1041
+ 'blockram': ['block ram', 128, 'Kb']}
1042
+
1043
+ for i, v in metrics.items():
1044
+ scparam(cfg, ['datasheet', 'fpga', name, i],
1045
+ unit=v[2],
1046
+ sctype='int',
1047
+ shorthelp=f"Datasheet: fpga {v[0]}",
1048
+ switch=f"-datasheet_fpga_{i} 'name <int>'",
1049
+ example=[
1050
+ f"cli: -datasheet_fpga_{i} 'i0 {v[1]}'",
1051
+ f"api: chip.set('datasheet', 'fpga', 'i0', '{i}', {v[1]})"],
1052
+ schelp=f"""FPGA {v[1]}.""")
1053
+
1054
+ ######################
1055
+ # Analog
1056
+ ######################
1057
+
1058
+ scparam(cfg, ['datasheet', 'analog', name, 'arch'],
1059
+ sctype='str',
1060
+ shorthelp="Datasheet: analog architecture",
1061
+ switch="-datasheet_analog_arch 'name <str>'",
1062
+ example=[
1063
+ "cli: -datasheet_analog_arch 'adc0 pipelined'",
1064
+ "api: chip.set('datasheet', 'analog', 'adc0', 'arch', 'pipelined')"],
1065
+ schelp="""Analog component architecture.""")
1066
+
1067
+ scparam(cfg, ['datasheet', 'analog', name, 'features'],
1068
+ sctype='[str]',
1069
+ shorthelp="Datasheet: analog features",
1070
+ switch="-datasheet_analog_features 'name <str>'",
1071
+ example=[
1072
+ "cli: -datasheet_analog_features '0 differential input'",
1073
+ "api: chip.set('datasheet','analog','adc0','features', 'differential input')"],
1074
+ schelp="""List of maker specified analog features.""")
1075
+
1076
+ metrics = {'resolution': ['architecture resolution', 8],
1077
+ 'channels': ['parallel channels', 8]}
1078
+
1079
+ for i, v in metrics.items():
1080
+ scparam(cfg, ['datasheet', 'analog', name, i],
1081
+ sctype='int',
1082
+ shorthelp=f"Datasheet: Analog {v[0]}",
1083
+ switch=f"-datasheet_analog_{i} 'name <int>'",
1084
+ example=[
1085
+ f"cli: -datasheet_analog_{i} 'i0 {v[1]}'",
1086
+ f"api: chip.set('datasheet', 'analog', 'abc123', '{i}', {v[1]})"],
1087
+ schelp=f"""Analog {v[1]}.""")
1088
+
1089
+ metrics = {'samplerate': ['sample rate', (1e9, 1e9, 1e9), 'Hz'],
1090
+ 'enob': ['effective number of bits', (8, 9, 10), 'bits'],
1091
+ 'inl': ['integral nonlinearity', (-7, 0.0, 7), 'LSB'],
1092
+ 'dnl': ['differential nonlinearity', (-1.0, 0.0, +1.0), 'LSB'],
1093
+ 'snr': ['signal to noise ratio', (70, 72, 74), 'dB'],
1094
+ 'sinad': ['signal to noise and distortion ratio', (71, 72, 73), 'dB'],
1095
+ 'sfdr': ['spurious-free dynamic range', (82, 88, 98), 'dBc'],
1096
+ 'thd': ['total harmonic distortion', (82, 88, 98), 'dB'],
1097
+ 'imd3': ['3rd order intermodulation distortion', (82, 88, 98), 'dBc'],
1098
+ 'hd2': ['2nd order harmonic distortion', (62, 64, 66), 'dBc'],
1099
+ 'hd3': ['3rd order harmonic distortion', (62, 64, 66), 'dBc'],
1100
+ 'hd4': ['4th order harmonic distortion', (62, 64, 66), 'dBc'],
1101
+ 'nsd': ['noise spectral density', (-158, -158, -158), 'dBFS/Hz'],
1102
+ 'phasenoise': ['phase noise', (-158, -158, -158), 'dBc/Hz'],
1103
+ 'gain': ['gain', (11.4, 11.4, 11.4), 'dB'],
1104
+ 'pout': ['output power', (12.2, 12.2, 12.2), 'dBm'],
1105
+ 'pout2': ['2nd harmonic power', (-14, -14, -14), 'dBm'],
1106
+ 'pout3': ['3rd harmonic power', (-28, -28, -28), 'dBm'],
1107
+ 'vofferror': ['offset error', (-1.0, 0.0, +1.0), 'mV'],
1108
+ 'vgainerror': ['gain error', (-1.0, 0.0, +1.0), 'mV'],
1109
+ 'cmrr': ['common mode rejection ratio', (70, 80, 90), 'dB'],
1110
+ 'psnr': ['power supply noise rejection', (61, 61, 61), 'dB'],
1111
+ 's21': ['rf gain', (10, 11, 12), 'dB'],
1112
+ 's11': ['rf input return loss', (7, 7, 7), 'dB'],
1113
+ 's22': ['rf output return loss', (10, 10, 10), 'dB'],
1114
+ 's12': ['rf reverse isolation', (-20, -20, -20), 'dB'],
1115
+ 'noisefigure': ['rf noise figure', (4.6, 4.6, 4.6), 'dB'],
1116
+ 'ib1db': ['rf in band 1 dB compression point', (-1, 1, 1), 'dBm'],
1117
+ 'oob1db': ['rf out of band 1 dB compression point', (3, 3, 3), 'dBm'],
1118
+ 'iip3': ['rf 3rd order input intercept point', (3, 3, 3), 'dBm']
1119
+ }
1120
+
1121
+ for i, v in metrics.items():
1122
+ scparam(cfg, ['datasheet', 'analog', name, i],
1123
+ unit=v[2],
1124
+ sctype='(float,float,float)',
1125
+ shorthelp=f"Datasheet: Analog {v[0]}",
1126
+ switch=f"-datasheet_analog_{i} 'name <(float,float,float)>'",
1127
+ example=[
1128
+ f"cli: -datasheet_analog_{i} 'i0 {v[1]}'",
1129
+ f"api: chip.set('datasheet', 'analog', 'abc123', '{i}', {v[1]})"],
1130
+ schelp=f"""Analog {v[1]}.""")
1131
+
1132
+ ######################
1133
+ # Absolute Limits
1134
+ ######################
1135
+
1136
+ metrics = {'tstorage': ['storage temperature limits', (-40, 125), 'C'],
1137
+ 'tsolder': ['solder temperature limits', (-40, 125), 'C'],
1138
+ 'tj': ['junction temperature limits', (-40, 125), 'C'],
1139
+ 'ta': ['ambient temperature limits', (-40, 125), 'C'],
1140
+ 'tid': ['total ionizing dose threshold', (3e5, 3e5), 'rad'],
1141
+ 'sel': ['single event latchup threshold', (75, 75), 'MeV-cm2/mg'],
1142
+ 'seb': ['single event burnout threshold', (75, 75), 'MeV-cm2/mg'],
1143
+ 'segr': ['single event gate rupture threshold', (75, 75), 'MeV-cm2/mg'],
1144
+ 'set': ['single event transient threshold', (75, 75), 'MeV-cm2/mg'],
1145
+ 'seu': ['single event upset threshold', (75, 75), 'MeV-cm2/mg'],
1146
+ 'vhbm': ['ESD human body model voltage level', (200, 250), 'V'],
1147
+ 'vcdm': ['ESD charge device model voltage level', (150, 150), 'V'],
1148
+ 'vmm': ['ESD machine model voltage level', (125, 125), 'V']
1149
+ }
1150
+
1151
+ for i, v in metrics.items():
1152
+ scparam(cfg, ['datasheet', 'limit', i],
1153
+ unit=v[2],
1154
+ sctype='(float,float)',
1155
+ shorthelp=f"Datasheet: limit {v[0]}",
1156
+ switch=f"-datasheet_limit_{i} '<(float,float)>'",
1157
+ example=[
1158
+ f"cli: -datasheet_limit_{i} '{v[1]}'",
1159
+ f"api: chip.set('datasheet', 'limit', '{i}', {v[1]}"],
1160
+ schelp=f"""Limit {v[0]}. Values are tuples of (min, max).
1161
+ """)
1162
+
1163
+ ######################
1164
+ # Thermal Model
1165
+ ######################
1166
+
1167
+ metrics = {'rja': 'thermal junction to ambient resistance',
1168
+ 'rjct': 'thermal junction to case (top) resistance',
1169
+ 'rjcb': 'thermal junction to case (bottom) resistance',
1170
+ 'rjb': 'thermal junction to board resistance',
1171
+ 'tjt': 'thermal junction to top model',
1172
+ 'tjb': 'thermal junction to bottom model'}
1173
+
1174
+ for item, val in metrics.items():
1175
+ scparam(cfg, ['datasheet', 'thermal', item],
1176
+ unit='C/W',
1177
+ sctype='float',
1178
+ shorthelp=f"Datasheet: {val}",
1179
+ switch=f"-datasheet_thermal_{item} '<float>'",
1180
+ example=[
1181
+ f"cli: -datasheet_thermal_{item} '30.4'",
1182
+ f"api: chip.set('datasheet', 'thermal', '{item}', 30.4)"],
1183
+ schelp=f"""Device {item}.""")
1184
+
1185
+ #########################
1186
+ # Package Description
1187
+ #########################
1188
+
1189
+ scparam(cfg, ['datasheet', 'package', name, 'type'],
1190
+ sctype='enum',
1191
+ enum=['bga', 'lga', 'csp', 'qfn', 'qfp', 'sop', 'die', 'wafer'],
1192
+ shorthelp="Datasheet: package type",
1193
+ switch="-datasheet_package_type 'name <str>'",
1194
+ example=[
1195
+ "cli: -datasheet_package_type 'abcd bga'",
1196
+ "api: chip.set('datasheet', 'package', 'abcd', 'type', 'bga')"],
1197
+ schelp="""Datasheet: package type.""")
1198
+
1199
+ scparam(cfg, ['datasheet', 'package', name, 'drawing'],
1200
+ sctype='[file]',
1201
+ shorthelp="Datasheet: package drawing",
1202
+ switch="-datasheet_package_drawing 'name <file>'",
1203
+ example=[
1204
+ "cli: -datasheet_package_drawing 'abcd p484.pdf'",
1205
+ "api: chip.set('datasheet', 'package', 'abcd', 'drawing', 'p484.pdf')"],
1206
+ schelp="""Datasheet: package drawing""")
1207
+
1208
+ scparam(cfg, ['datasheet', 'package', name, 'pincount'],
1209
+ sctype='int',
1210
+ shorthelp="Datasheet: package pincount",
1211
+ switch="-datasheet_package_pincount 'name <int>'",
1212
+ example=[
1213
+ "cli: -datasheet_package_pincount 'abcd 484'",
1214
+ "api: chip.set('datasheet', 'package', 'abcd', 'pincount', '484')"],
1215
+ schelp="""Datasheet: package pincount""")
1216
+
1217
+ metrics = {'length': ['length', (20, 20, 20), 'mm'],
1218
+ 'width': ['width', (20, 20, 20), 'mm'],
1219
+ 'thickness': ['thickness', (1.0, 1.1, 1.2), 'mm'],
1220
+ 'pitch': ['pitch', (0.8, 0.85, 0.9), 'mm']
1221
+ }
1222
+
1223
+ for i, v in metrics.items():
1224
+ scparam(cfg, ['datasheet', 'package', name, i],
1225
+ unit=v[2],
1226
+ sctype='(float,float,float)',
1227
+ shorthelp=f"Datasheet: package {v[0]}",
1228
+ switch=f"-datasheet_package_{i} 'name <(float,float,float)>'",
1229
+ example=[
1230
+ f"cli: -datasheet_package_{i} 'abcd {v[1]}'",
1231
+ f"api: chip.set('datasheet', 'package', 'abcd', '{i}', {v[1]}"],
1232
+ schelp=f"""Datasheet: package {v[0]}. Values are tuples of
1233
+ (min, nominal, max).""")
1234
+
1235
+ scparam(cfg, ['datasheet', 'package', name, 'pinshape', name],
1236
+ sctype='enum',
1237
+ enum=['circle', 'rectangle'],
1238
+ shorthelp="Datasheet: package pin shape",
1239
+ switch="-datasheet_package_pinshape 'name name <str>'",
1240
+ example=[
1241
+ "cli: -datasheet_package_pinshape 'abcd B1 circle'",
1242
+ "api: chip.set('datasheet', 'package', 'abcd', 'pinshape', 'B1', 'circle')"],
1243
+ schelp="""Datasheet: pin shape (rectangle or circle) specified on a per package
1244
+ and per pin basis.""")
1245
+
1246
+ metrics = {'pinwidth': ['pinwidth', (0.2, 0.25, 0.3), 'mm'],
1247
+ 'pinlength': ['pinlength', (0.2, 0.25, 0.3), 'mm']
1248
+ }
1249
+
1250
+ for i, v in metrics.items():
1251
+ scparam(cfg, ['datasheet', 'package', name, i, name],
1252
+ unit=v[2],
1253
+ sctype='(float,float,float)',
1254
+ shorthelp=f"Datasheet: package pin {v[0]}",
1255
+ switch=f"-datasheet_package_{i} 'name name <(float,float,float)>'",
1256
+ example=[
1257
+ f"cli: -datasheet_package_{i} 'abcd B1 {v[1]}'",
1258
+ f"api: chip.set('datasheet', 'package', 'abcd', '{i}', 'B1', {v[1]}"],
1259
+ schelp=f"""Datsheet: {v[0]} specified on a per package and per pin basis.
1260
+ Values are tuples of (min, nominal, max).""")
1261
+
1262
+ scparam(cfg, ['datasheet', 'package', name, 'pinloc', name],
1263
+ sctype='(float,float)',
1264
+ unit='mm',
1265
+ shorthelp="Datasheet: package pin location",
1266
+ switch="-datasheet_package_pinloc 'name name <(float,float)>'",
1267
+ example=[
1268
+ "cli: -datasheet_package_pinloc 'abcd B1 (0.5,0.5)'",
1269
+ "api: chip.set('datasheet', 'package', 'abcd', 'pinloc', 'B1', (0.5,0.5)"],
1270
+ schelp="""Datsheet: Pin location specified as an (x,y) tuple. Locations
1271
+ specify the center of the pin with respect to the center of the package.
1272
+ """)
1273
+
1274
+ scparam(cfg, ['datasheet', 'package', name, 'netname', name],
1275
+ sctype='str',
1276
+ shorthelp="Datasheet: package pin net name",
1277
+ switch="-datasheet_package_netname 'name name <str>'",
1278
+ example=[
1279
+ "cli: -datasheet_package_netname 'abcd B1 VDD'",
1280
+ "api: chip.set('datasheet', 'package', 'abcd', 'netname', 'B1', 'VDD')"],
1281
+ schelp="""Datsheet: Device net connected to the pin.""")
1282
+
1283
+ scparam(cfg, ['datasheet', 'package', name, 'portname', name],
1284
+ sctype='str',
1285
+ shorthelp="Datasheet: package pin port name",
1286
+ switch="-datasheet_package_portname 'name name <str>'",
1287
+ example=[
1288
+ "cli: -datasheet_package_portname 'abcd B1 VDD'",
1289
+ "api: chip.set('datasheet', 'package', 'abcd', 'portname', 'B1', 'VDD')"],
1290
+ schelp="""Datsheet: Device port connected to the pin.""")
1291
+
1292
+ ######################
1293
+ # Pin Specifications
1294
+ ######################
1295
+
1296
+ # Pin type
1297
+ scparam(cfg, ['datasheet', 'pin', name, 'type', mode],
1298
+ sctype='enum',
1299
+ enum=['digital', 'analog', 'clock', 'supply', 'ground'],
1300
+ shorthelp="Datasheet: pin type",
1301
+ switch="-datasheet_pin_type 'name mode <str>'",
1302
+ example=[
1303
+ "cli: -datasheet_pin_type 'vdd global supply'",
1304
+ "api: chip.set('datasheet', 'pin', 'vdd', 'type', 'global', 'supply')"],
1305
+ schelp="""Pin type specified on a per mode basis.""")
1306
+
1307
+ # Pin direction
1308
+ scparam(cfg, ['datasheet', 'pin', name, 'dir', mode],
1309
+ sctype='enum',
1310
+ enum=['input', 'output', 'inout'],
1311
+ shorthelp="Datasheet: pin direction",
1312
+ switch="-datasheet_pin_dir 'name mode <str>'",
1313
+ example=[
1314
+ "cli: -datasheet_pin_dir 'clk global input'",
1315
+ "api: chip.set('datasheet', 'pin', 'clk', 'dir', 'global', 'input')"],
1316
+ schelp="""Pin direction specified on a per mode basis. Acceptable pin
1317
+ directions include: input, output, inout.""")
1318
+
1319
+ # Pin complement (for differential pair)
1320
+ scparam(cfg, ['datasheet', 'pin', name, 'complement', mode],
1321
+ sctype='str',
1322
+ shorthelp="Datasheet: pin complement",
1323
+ switch="-datasheet_pin_complement 'name mode <str>'",
1324
+ example=[
1325
+ "cli: -datasheet_pin_complement 'ina global inb'",
1326
+ "api: chip.set('datasheet', 'pin', 'ina', 'complement', 'global', 'inb')"],
1327
+ schelp="""Pin complement specified on a per mode basis for differential
1328
+ signals.""")
1329
+
1330
+ # Pin standard
1331
+ scparam(cfg, ['datasheet', 'pin', name, 'standard', mode],
1332
+ sctype='[str]',
1333
+ shorthelp="Datasheet: pin standard",
1334
+ switch="-datasheet_pin_standard 'name mode <str>'",
1335
+ example=[
1336
+ "cli: -datasheet_pin_standard 'clk def LVCMOS'",
1337
+ "api: chip.set('datasheet', 'pin', 'clk', 'standard', 'def', 'LVCMOS')"],
1338
+ schelp="""Pin electrical signaling standard (LVDS, LVCMOS, TTL, ...).""")
1339
+
1340
+ # Pin interface map
1341
+ scparam(cfg, ['datasheet', 'pin', name, 'interface', mode],
1342
+ sctype='[str]',
1343
+ shorthelp="Datasheet: pin interface map",
1344
+ switch="-datasheet_pin_interface 'name mode <str>'",
1345
+ example=[
1346
+ "cli: -datasheet_pin_interface 'clk0 ddr4 CLKN'",
1347
+ "api: chip.set('datasheet', 'pin', 'clk0', 'interface', 'ddr4', 'CLKN')"],
1348
+ schelp="""Pin mapping to standardized interface names.""")
1349
+
1350
+ # Pin reset value
1351
+ scparam(cfg, ['datasheet', 'pin', name, 'resetvalue', mode],
1352
+ sctype='enum',
1353
+ enum=['weak1', 'weak0', 'strong0', 'strong1', 'highz'],
1354
+ shorthelp="Datasheet: pin reset value",
1355
+ switch="-datasheet_pin_resetvalue 'name mode <str>'",
1356
+ example=[
1357
+ "cli: -datasheet_pin_resetvalue 'clk global weak1'",
1358
+ "api: chip.set('datasheet', 'pin', 'clk', 'resetvalue', 'global', 'weak1')"],
1359
+ schelp="""Pin reset value specified on a per mode basis.""")
1360
+
1361
+ # Per pin specifications
1362
+ metrics = {'vmax': ['absolute maximum voltage', (0.2, 0.3, 0.9), 'V'],
1363
+ 'vnominal': ['nominal operating voltage', (1.72, 1.80, 1.92), 'V'],
1364
+ 'vol': ['low output voltage level', (-0.2, 0, 0.2), 'V'],
1365
+ 'voh': ['high output voltage level', (4.6, 4.8, 5.2), 'V'],
1366
+ 'vil': ['low input voltage level', (-0.2, 0, 1.0), 'V'],
1367
+ 'vih': ['high input voltage level', (1.4, 1.8, 2.2), 'V'],
1368
+ 'vcm': ['common mode voltage', (0.3, 1.2, 1.6), 'V'],
1369
+ 'vdiff': ['differential voltage', (0.2, 0.3, 0.9), 'V'],
1370
+ 'voffset': ['offset voltage', (0.2, 0.3, 0.9), 'V'],
1371
+ 'vnoise': ['random voltage noise', (0, 0.01, 0.1), 'V'],
1372
+ 'vslew': ['slew rate', (1e-9, 2e-9, 4e-9), 'V/s'],
1373
+ # ESD
1374
+ 'vhbm': ['ESD human body model voltage level', (200, 250, 300), 'V'],
1375
+ 'vcdm': ['ESD charge device model voltage level', (125, 150, 175), 'V'],
1376
+ 'vmm': ['ESD machine model voltage level', (100, 125, 150), 'V'],
1377
+ # RC
1378
+ 'cap': ['capacitance', (1e-12, 1.2e-12, 1.5e-12), 'F'],
1379
+ 'rdiff': ['differential pair resistance', (45, 50, 55), 'Ohm'],
1380
+ 'rin': ['input resistance', (1000, 1200, 3000), 'Ohm'],
1381
+ 'rup': ['output pullup resistance', (1000, 1200, 3000), 'Ohm'],
1382
+ 'rdown': ['output pulldown resistance', (1000, 1200, 3000), 'Ohm'],
1383
+ 'rweakup': ['weak pullup resistance', (1000, 1200, 3000), 'Ohm'],
1384
+ 'rweakdown': ['weak pulldown resistance', (1000, 1200, 3000), 'Ohm'],
1385
+ # Power (per supply)
1386
+ 'power': ['power consumption', (1, 2, 3), 'W'],
1387
+ # Current
1388
+ 'isupply': ['supply current', (1e-3, 12e-3, 15e-3), 'A'],
1389
+ 'ioh': ['output high current', (10e-3, 12e-3, 15e-3), 'A'],
1390
+ 'iol': ['output low current', (10e-3, 12e-3, 15e-3), 'A'],
1391
+ 'iinject': ['injection current', (1e-3, 1.2e-3, 1.5e-3), 'A'],
1392
+ 'ishort': ['short circuit current', (1e-3, 1.2e-3, 1.5e-3), 'A'],
1393
+ 'ioffset': ['offset current', (1e-3, 1.2e-3, 1.5e-3), 'A'],
1394
+ 'ibias': ['bias current', (1e-3, 1.2e-3, 1.5e-3), 'A'],
1395
+ 'ileakage': ['leakage current', (1e-6, 1.2e-6, 1.5e-6), 'A'],
1396
+ # Clocking
1397
+ 'tperiod': ['minimum period', (1e-9, 2e-9, 4e-9), 's'],
1398
+ 'tpulse': ['pulse width', (1e-9, 2e-9, 4e-9), 's'],
1399
+ 'tjitter': ['rms jitter', (1e-9, 2e-9, 4e-9), 's'],
1400
+ 'thigh': ['pulse width high', (1e-9, 2e-9, 4e-9), 's'],
1401
+ 'tlow': ['pulse width low', (1e-9, 2e-9, 4e-9), 's'],
1402
+ 'tduty': ['duty cycle', (45, 50, 55), '%']
1403
+ }
1404
+
1405
+ for item, val in metrics.items():
1406
+ scparam(cfg, ['datasheet', 'pin', name, item, mode],
1407
+ unit=val[2],
1408
+ sctype='(float,float,float)',
1409
+ shorthelp=f"Datasheet: pin {val[0]}",
1410
+ switch=f"-datasheet_pin_{item} 'pin mode <(float,float,float)>'",
1411
+ example=[
1412
+ f"cli: -datasheet_pin_{item} 'sclk global {val[1]}'",
1413
+ f"api: chip.set('datasheet', 'pin', 'sclk', '{item}', "
1414
+ f"'global', {val[1]}"],
1415
+ schelp=f"""Pin {val[0]}. Values are tuples of (min, typical, max).""")
1416
+
1417
+ # Timing
1418
+ metrics = {'tsetup': ['setup time', (1e-9, 2e-9, 4e-9), 's'],
1419
+ 'thold': ['hold time', (1e-9, 2e-9, 4e-9), 's'],
1420
+ 'tskew': ['timing skew', (1e-9, 2e-9, 4e-9), 's'],
1421
+ 'tdelayr': ['propagation delay (rise)', (1e-9, 2e-9, 4e-9), 's'],
1422
+ 'tdelayf': ['propagation delay (fall)', (1e-9, 2e-9, 4e-9), 's'],
1423
+ 'trise': ['rise transition', (1e-9, 2e-9, 4e-9), 's'],
1424
+ 'tfall': ['fall transition', (1e-9, 2e-9, 4e-9), 's']}
1425
+
1426
+ relpin = 'default'
1427
+
1428
+ for i, v in metrics.items():
1429
+ scparam(cfg, ['datasheet', 'pin', name, i, mode, relpin],
1430
+ unit=v[2],
1431
+ sctype='(float,float,float)',
1432
+ shorthelp=f"Datasheet: pin {v[0]}",
1433
+ switch=f"-datasheet_pin_{i} 'pin mode relpin <(float,float,float)>'",
1434
+ example=[
1435
+ f"cli: -datasheet_pin_{i} 'a glob clock {v[1]}'",
1436
+ f"api: chip.set('datasheet', 'pin', 'a', '{i}', 'glob', 'ck', {v[1]}"],
1437
+ schelp=f"""Pin {v[0]} specified on a per pin, mode, and relpin basis.
1438
+ Values are tuples of (min, typical, max).""")
1439
+
1440
+ return cfg
1441
+
1442
+
1443
+ ###############################################################################
1444
+ # Flow Configuration
1445
+ ###############################################################################
1446
+ def schema_flowgraph(cfg, flow='default', step='default', index='default'):
1447
+
1448
+ # flowgraph input
1449
+ scparam(cfg, ['flowgraph', flow, step, index, 'input'],
1450
+ sctype='[(str,str)]',
1451
+ shorthelp="Flowgraph: step input",
1452
+ switch="-flowgraph_input 'flow step index <(str,str)>'",
1453
+ example=[
1454
+ "cli: -flowgraph_input 'asicflow cts 0 (place,0)'",
1455
+ "api: chip.set('flowgraph', 'asicflow', 'cts', '0', 'input', ('place', '0'))"],
1456
+ schelp="""A list of inputs for the current step and index, specified as a
1457
+ (step, index) tuple.""")
1458
+
1459
+ # flowgraph metric weights
1460
+ metric = 'default'
1461
+ scparam(cfg, ['flowgraph', flow, step, index, 'weight', metric],
1462
+ sctype='float',
1463
+ shorthelp="Flowgraph: metric weights",
1464
+ switch="-flowgraph_weight 'flow step index metric <float>'",
1465
+ example=[
1466
+ "cli: -flowgraph_weight 'asicflow cts 0 area_cells 1.0'",
1467
+ "api: chip.set('flowgraph', 'asicflow', 'cts', '0', 'weight', 'area_cells', 1.0)"],
1468
+ schelp="""Weights specified on a per step and per metric basis used to give
1469
+ effective "goodness" score for a step by calculating the sum all step
1470
+ real metrics results by the corresponding per step weights.""")
1471
+
1472
+ scparam(cfg, ['flowgraph', flow, step, index, 'goal', metric],
1473
+ sctype='float',
1474
+ shorthelp="Flowgraph: metric goals",
1475
+ switch="-flowgraph_goal 'flow step index metric <float>'",
1476
+ example=[
1477
+ "cli: -flowgraph_goal 'asicflow cts 0 area_cells 1.0'",
1478
+ "api: chip.set('flowgraph', 'asicflow', 'cts', '0', 'goal', 'errors', 0)"],
1479
+ schelp="""Goals specified on a per step and per metric basis used to
1480
+ determine whether a certain task can be considered when merging
1481
+ multiple tasks at a minimum or maximum node. A task is considered
1482
+ failing if the absolute value of any of its metrics are larger than
1483
+ the goal for that metric, if set.""")
1484
+
1485
+ # flowgraph tool
1486
+ scparam(cfg, ['flowgraph', flow, step, index, 'tool'],
1487
+ sctype='str',
1488
+ shorthelp="Flowgraph: tool selection",
1489
+ switch="-flowgraph_tool 'flow step index <str>'",
1490
+ example=[
1491
+ "cli: -flowgraph_tool 'asicflow place 0 openroad'",
1492
+ "api: chip.set('flowgraph', 'asicflow', 'place', '0', 'tool', 'openroad')"],
1493
+ schelp="""Name of the tool name used for task execution. The 'tool' parameter
1494
+ is ignored for builtin tasks.""")
1495
+
1496
+ # task (belonging to tool)
1497
+ scparam(cfg, ['flowgraph', flow, step, index, 'task'],
1498
+ sctype='str',
1499
+ shorthelp="Flowgraph: task selection",
1500
+ switch="-flowgraph_task 'flow step index <str>'",
1501
+ example=[
1502
+ "cli: -flowgraph_task 'asicflow myplace 0 place'",
1503
+ "api: chip.set('flowgraph', 'asicflow', 'myplace', '0', 'task', 'place')"],
1504
+ schelp="""Name of the tool associated task used for step execution. Builtin
1505
+ task names include: minimum, maximum, join, verify, mux. """)
1506
+
1507
+ scparam(cfg, ['flowgraph', flow, step, index, 'taskmodule'],
1508
+ sctype='str',
1509
+ shorthelp="Flowgraph: task module",
1510
+ switch="-flowgraph_taskmodule 'flow step index <str>'",
1511
+ example=[
1512
+ "cli: -flowgraph_taskmodule 'asicflow place 0 "
1513
+ "siliconcompiler.tools.openroad.place'",
1514
+ "api: chip.set('flowgraph', 'asicflow', 'place', '0', 'taskmodule', "
1515
+ "'siliconcompiler.tools.openroad.place')"],
1516
+ schelp="""
1517
+ Full python module name of the task module used for task setup and execution.
1518
+ """)
1519
+
1520
+ # flowgraph arguments
1521
+ scparam(cfg, ['flowgraph', flow, step, index, 'args'],
1522
+ sctype='[str]',
1523
+ shorthelp="Flowgraph: setup arguments",
1524
+ switch="-flowgraph_args 'flow step index <str>'",
1525
+ example=[
1526
+ "cli: -flowgraph_args 'asicflow cts 0 0'",
1527
+ "api: chip.add('flowgraph', 'asicflow', 'cts', '0', 'args', '0')"],
1528
+ schelp="""User specified flowgraph string arguments specified on a per
1529
+ step and per index basis.""")
1530
+
1531
+ return cfg
1532
+
1533
+
1534
+ ###########################################################################
1535
+ # Tool Setup
1536
+ ###########################################################################
1537
+
1538
+ def schema_tool(cfg, tool='default'):
1539
+
1540
+ version = 'default'
1541
+
1542
+ scparam(cfg, ['tool', tool, 'exe'],
1543
+ sctype='str',
1544
+ shorthelp="Tool: executable name",
1545
+ switch="-tool_exe 'tool <str>'",
1546
+ example=["cli: -tool_exe 'openroad openroad'",
1547
+ "api: chip.set('tool', 'openroad', 'exe', 'openroad')"],
1548
+ schelp="""Tool executable name.""")
1549
+
1550
+ scparam(cfg, ['tool', tool, 'sbom', version],
1551
+ sctype='[file]',
1552
+ pernode='optional',
1553
+ shorthelp="Tool: software BOM",
1554
+ switch="-tool_sbom 'tool version <file>'",
1555
+ example=[
1556
+ "cli: -tool_sbom 'yosys 1.0.1 ys_sbom.json'",
1557
+ "api: chip.set('tool', 'yosys', 'sbom', '1.0', 'ys_sbom.json')"],
1558
+ schelp="""
1559
+ Paths to software bill of material (SBOM) document file of the tool
1560
+ specified on a per version basis. The SBOM includes critical
1561
+ package information about the tool including the list of included
1562
+ components, licenses, and copyright. The SBOM file is generally
1563
+ provided as in a a standardized open data format such as SPDX.""")
1564
+
1565
+ scparam(cfg, ['tool', tool, 'path'],
1566
+ sctype='dir',
1567
+ pernode='optional',
1568
+ shorthelp="Tool: executable path",
1569
+ switch="-tool_path 'tool <dir>'",
1570
+ example=[
1571
+ "cli: -tool_path 'openroad /usr/local/bin'",
1572
+ "api: chip.set('tool', 'openroad', 'path', '/usr/local/bin')"],
1573
+ schelp="""
1574
+ File system path to tool executable. The path is prepended to the
1575
+ system PATH environment variable for batch and interactive runs. The
1576
+ path parameter can be left blank if the 'exe' is already in the
1577
+ environment search path.""")
1578
+
1579
+ scparam(cfg, ['tool', tool, 'vswitch'],
1580
+ sctype='[str]',
1581
+ shorthelp="Tool: executable version switch",
1582
+ switch="-tool_vswitch 'tool <str>'",
1583
+ example=["cli: -tool_vswitch 'openroad -version'",
1584
+ "api: chip.set('tool', 'openroad', 'vswitch', '-version')"],
1585
+ schelp="""
1586
+ Command line switch to use with executable used to print out
1587
+ the version number. Common switches include -v, -version,
1588
+ --version. Some tools may require extra flags to run in batch mode.""")
1589
+
1590
+ scparam(cfg, ['tool', tool, 'vendor'],
1591
+ sctype='str',
1592
+ shorthelp="Tool: vendor",
1593
+ switch="-tool_vendor 'tool <str>'",
1594
+ example=["cli: -tool_vendor 'yosys yosys'",
1595
+ "api: chip.set('tool', 'yosys', 'vendor', 'yosys')"],
1596
+ schelp="""
1597
+ Name of the tool vendor. Parameter can be used to set vendor
1598
+ specific technology variables in the PDK and libraries. For
1599
+ open source projects, the project name should be used in
1600
+ place of vendor.""")
1601
+
1602
+ scparam(cfg, ['tool', tool, 'version'],
1603
+ sctype='[str]',
1604
+ pernode='optional',
1605
+ shorthelp="Tool: version",
1606
+ switch="-tool_version 'tool <str>'",
1607
+ example=["cli: -tool_version 'openroad >=v2.0'",
1608
+ "api: chip.set('tool', 'openroad', 'version', '>=v2.0')"],
1609
+ schelp="""
1610
+ List of acceptable versions of the tool executable to be used. Each
1611
+ entry in this list must be a version specifier as described by Python
1612
+ `PEP-440 <https://peps.python.org/pep-0440/#version-specifiers>`_.
1613
+ During task execution, the tool is called with the 'vswitch' to
1614
+ check the runtime executable version. If the version of the system
1615
+ executable is not allowed by any of the specifiers in 'version',
1616
+ then the job is halted pre-execution. For backwards compatibility,
1617
+ entries that do not conform to the standard will be interpreted as a
1618
+ version with an '==' specifier. This check can be disabled by
1619
+ setting 'novercheck' to True.""")
1620
+
1621
+ scparam(cfg, ['tool', tool, 'format'],
1622
+ sctype='enum',
1623
+ enum=["json", "tcl", "yaml"],
1624
+ shorthelp="Tool: file format",
1625
+ switch="-tool_format 'tool <str>'",
1626
+ example=["cli: -tool_format 'yosys tcl'",
1627
+ "api: chip.set('tool', 'yosys', 'format', 'tcl')"],
1628
+ schelp="""
1629
+ File format for tool manifest handoff.""")
1630
+
1631
+ key = 'default'
1632
+ scparam(cfg, ['tool', tool, 'licenseserver', key],
1633
+ sctype='[str]',
1634
+ pernode='optional',
1635
+ shorthelp="Tool: license servers",
1636
+ switch="-tool_licenseserver 'name key <str>'",
1637
+ example=[
1638
+ "cli: -tool_licenseserver 'atask ACME_LICENSE 1700@server'",
1639
+ "api: chip.set('tool', 'acme', 'licenseserver', 'ACME_LICENSE', '1700@server')"],
1640
+ schelp="""
1641
+ Defines a set of tool specific environment variables used by the executable
1642
+ that depend on license key servers to control access. For multiple servers,
1643
+ separate each server by a 'colon'. The named license variable are read at
1644
+ runtime (run()) and the environment variables are set.
1645
+ """)
1646
+
1647
+ return cfg
1648
+
1649
+
1650
+ def schema_task(cfg, tool='default', task='default', step='default', index='default'):
1651
+
1652
+ key = 'default'
1653
+ suffix = 'default'
1654
+
1655
+ scparam(cfg, ['tool', tool, 'task', task, 'warningoff'],
1656
+ sctype='[str]',
1657
+ pernode='optional',
1658
+ shorthelp="Task: warning filter",
1659
+ switch="-tool_task_warningoff 'tool task <str>'",
1660
+ example=[
1661
+ "cli: -tool_task_warningoff 'verilator lint COMBDLY'",
1662
+ "api: chip.set('tool', 'verilator', 'task', 'lint', 'warningoff', 'COMBDLY')"],
1663
+ schelp="""
1664
+ A list of tool warnings for which printing should be suppressed.
1665
+ Generally this is done on a per design basis after review has
1666
+ determined that warning can be safely ignored The code for turning
1667
+ off warnings can be found in the specific task reference manual.
1668
+ """)
1669
+
1670
+ scparam(cfg, ['tool', tool, 'task', task, 'regex', suffix],
1671
+ sctype='[str]',
1672
+ pernode='optional',
1673
+ shorthelp="Task: regex filter",
1674
+ switch="-tool_task_regex 'tool task suffix <str>'",
1675
+ example=[
1676
+ "cli: -tool_task_regex 'openroad place errors \"-v ERROR\"'",
1677
+ "api: chip.set('tool', 'openroad', 'task', 'place', 'regex', 'errors', "
1678
+ "'-v ERROR')"],
1679
+ schelp="""
1680
+ A list of piped together grep commands. Each entry represents a set
1681
+ of command line arguments for grep including the regex pattern to
1682
+ match. Starting with the first list entry, each grep output is piped
1683
+ into the following grep command in the list. Supported grep options
1684
+ include ``-v`` and ``-e``. Patterns starting with "-" should be
1685
+ directly preceded by the ``-e`` option. The following example
1686
+ illustrates the concept.
1687
+
1688
+ UNIX grep:
1689
+
1690
+ .. code-block:: bash
1691
+
1692
+ $ grep WARNING place.log | grep -v "bbox" > place.warnings
1693
+
1694
+ SiliconCompiler::
1695
+
1696
+ chip.set('task', 'openroad', 'regex', 'place', '0', 'warnings',
1697
+ ["WARNING", "-v bbox"])
1698
+
1699
+ The "errors" and "warnings" suffixes are special cases. When set,
1700
+ the number of matches found for these regexes will be added to the
1701
+ errors and warnings metrics for the task, respectively. This will
1702
+ also cause the logfile to be added to the :keypath:`tool, <tool>,
1703
+ task, <task>, report` parameter for those metrics, if not already present.""")
1704
+
1705
+ # Configuration: cli-option, tcl var, env var, file
1706
+ scparam(cfg, ['tool', tool, 'task', task, 'option'],
1707
+ sctype='[str]',
1708
+ pernode='optional',
1709
+ shorthelp="Task: executable options",
1710
+ switch="-tool_task_option 'tool task <str>'",
1711
+ example=[
1712
+ "cli: -tool_task_option 'openroad cts -no_init'",
1713
+ "api: chip.set('tool', 'openroad', 'task', 'cts', 'option', '-no_init')"],
1714
+ schelp="""
1715
+ List of command line options for the task executable, specified on
1716
+ a per task and per step basis. Options must not include spaces.
1717
+ For multiple argument options, each option is a separate list element.
1718
+ """)
1719
+
1720
+ scparam(cfg, ['tool', tool, 'task', task, 'var', key],
1721
+ sctype='[str]',
1722
+ pernode='optional',
1723
+ shorthelp="Task: script variables",
1724
+ switch="-tool_task_var 'tool task key <str>'",
1725
+ example=[
1726
+ "cli: -tool_task_var 'openroad cts myvar 42'",
1727
+ "api: chip.set('tool', 'openroad', 'task', 'cts', 'var', 'myvar', '42')"],
1728
+ schelp="""
1729
+ Task script variables specified as key value pairs. Variable
1730
+ names and value types must match the name and type of task and reference
1731
+ script consuming the variable.""")
1732
+
1733
+ scparam(cfg, ['tool', tool, 'task', task, 'env', key],
1734
+ sctype='str',
1735
+ pernode='optional',
1736
+ shorthelp="Task: environment variables",
1737
+ switch="-tool_task_env 'tool task env <str>'",
1738
+ example=[
1739
+ "cli: -tool_task_env 'openroad cts MYVAR 42'",
1740
+ "api: chip.set('tool', 'openroad', 'task', 'cts', 'env', 'MYVAR', '42')"],
1741
+ schelp="""
1742
+ Environment variables to set for individual tasks. Keys and values
1743
+ should be set in accordance with the task's documentation. Most
1744
+ tasks do not require extra environment variables to function.""")
1745
+
1746
+ scparam(cfg, ['tool', tool, 'task', task, 'file', key],
1747
+ sctype='[file]',
1748
+ pernode='optional',
1749
+ copy=True,
1750
+ shorthelp="Task: setup files",
1751
+ switch="-tool_task_file 'tool task key <file>'",
1752
+ example=[
1753
+ "cli: -tool_task_file 'openroad floorplan macroplace macroplace.tcl'",
1754
+ "api: chip.set('tool', 'openroad', 'task', 'floorplan', 'file', 'macroplace', "
1755
+ "'macroplace.tcl')"],
1756
+ schelp="""
1757
+ Paths to user supplied files mapped to keys. Keys and filetypes must
1758
+ match what's expected by the task/reference script consuming the
1759
+ file.
1760
+ """)
1761
+
1762
+ scparam(cfg, ['tool', tool, 'task', task, 'dir', key],
1763
+ sctype='[dir]',
1764
+ pernode='optional',
1765
+ copy=True,
1766
+ shorthelp="Task: setup directories",
1767
+ switch="-tool_task_dir 'tool task key <dir>'",
1768
+ example=[
1769
+ "cli: -tool_task_dir 'verilator compile cincludes include'",
1770
+ "api: chip.set('tool', 'verilator', 'task', 'compile', 'dir', 'cincludes', "
1771
+ "'include')"],
1772
+ schelp="""
1773
+ Paths to user supplied directories mapped to keys. Keys must match
1774
+ what's expected by the task/reference script consuming the
1775
+ directory.
1776
+ """)
1777
+
1778
+ # Definitions of inputs, outputs, requirements
1779
+ scparam(cfg, ['tool', tool, 'task', task, 'input'],
1780
+ sctype='[file]',
1781
+ pernode='required',
1782
+ shorthelp="Task: inputs",
1783
+ switch="-tool_task_input 'tool task <file>'",
1784
+ example=[
1785
+ "cli: -tool_task_input 'openroad place place 0 oh_add.def'",
1786
+ "api: chip.set('tool', 'openroad', 'task', 'place', 'input', 'oh_add.def', "
1787
+ "step='place', index='0')"],
1788
+ schelp="""
1789
+ List of data files to be copied from previous flowgraph steps 'output'
1790
+ directory. The list of steps to copy files from is defined by the
1791
+ list defined by the dictionary key ['flowgraph', step, index, 'input'].
1792
+ All files must be available for flow to continue. If a file
1793
+ is missing, the program exists on an error.""")
1794
+
1795
+ scparam(cfg, ['tool', tool, 'task', task, 'output'],
1796
+ sctype='[file]',
1797
+ pernode='required',
1798
+ shorthelp="Task: outputs",
1799
+ switch="-tool_task_output 'tool task <file>'",
1800
+ example=[
1801
+ "cli: -tool_task_output 'openroad place place 0 oh_add.def'",
1802
+ "api: chip.set('tool', 'openroad', 'task', 'place', 'output', 'oh_add.def', "
1803
+ "step='place', index='0')"],
1804
+ schelp="""
1805
+ List of data files written to the 'output' directory of the
1806
+ tool/task/step/index used in the keypath. All files must be available
1807
+ for flow to continue. If a file is missing, the program exists on an error.""")
1808
+
1809
+ dest_enum = ['log', 'output', 'none']
1810
+ scparam(cfg, ['tool', tool, 'task', task, 'stdout', 'destination'],
1811
+ sctype='enum',
1812
+ enum=dest_enum,
1813
+ defvalue='log',
1814
+ scope='job',
1815
+ pernode='optional',
1816
+ shorthelp="Task: Destination for stdout",
1817
+ switch="-tool_task_stdout_destination 'tool task <str>'",
1818
+ example=["cli: -tool_task_stdout_destination 'ghdl import log'",
1819
+ "api: chip.set('tool', 'ghdl', 'task', 'import', 'stdout', 'destination', "
1820
+ "'log')"],
1821
+ schelp="""
1822
+ Defines where to direct the output generated over stdout.
1823
+ Supported options are:
1824
+ none: the stream generated to STDOUT is ignored.
1825
+ log: the generated stream is stored in <step>.<suffix>; if not in quiet mode,
1826
+ it is additionally dumped to the display.
1827
+ output: the generated stream is stored in outputs/<design>.<suffix>.""")
1828
+
1829
+ scparam(cfg, ['tool', tool, 'task', task, 'stdout', 'suffix'],
1830
+ sctype='str',
1831
+ defvalue='log',
1832
+ scope='job',
1833
+ pernode='optional',
1834
+ shorthelp="Task: File suffix for redirected stdout",
1835
+ switch="-tool_task_stdout_suffix 'tool task <str>'",
1836
+ example=["cli: -tool_task_stdout_suffix 'ghdl import log'",
1837
+ "api: chip.set('tool', ghdl', 'task', 'import', 'stdout', 'suffix', 'log')"],
1838
+ schelp="""
1839
+ Specifies the file extension for the content redirected from stdout.""")
1840
+
1841
+ scparam(cfg, ['tool', tool, 'task', task, 'stderr', 'destination'],
1842
+ sctype='enum',
1843
+ enum=dest_enum,
1844
+ defvalue='log',
1845
+ scope='job',
1846
+ pernode='optional',
1847
+ shorthelp="Task: Destination for stderr",
1848
+ switch="-tool_task_stderr_destination 'tool task <str>'",
1849
+ example=["cli: -tool_task_stderr_destination 'ghdl import log'",
1850
+ "api: chip.set('tool', ghdl', 'task', 'import', 'stderr', 'destination', "
1851
+ "'log')"],
1852
+ schelp="""
1853
+ Defines where to direct the output generated over stderr.
1854
+ Supported options are:
1855
+ none: the stream generated to STDERR is ignored
1856
+ log: the generated stream is stored in <step>.<suffix>; if not in quiet mode,
1857
+ it is additionally dumped to the display.
1858
+ output: the generated stream is stored in outputs/<design>.<suffix>""")
1859
+
1860
+ scparam(cfg, ['tool', tool, 'task', task, 'stderr', 'suffix'],
1861
+ sctype='str',
1862
+ defvalue='log',
1863
+ scope='job',
1864
+ pernode='optional',
1865
+ shorthelp="Task: File suffix for redirected stderr",
1866
+ switch="-tool_task_stderr_suffix 'tool task <str>'",
1867
+ example=["cli: -tool_task_stderr_suffix 'ghdl import log'",
1868
+ "api: chip.set('tool', 'ghdl', 'task', 'import', 'stderr', 'suffix', 'log')"],
1869
+ schelp="""
1870
+ Specifies the file extension for the content redirected from stderr.""")
1871
+
1872
+ scparam(cfg, ['tool', tool, 'task', task, 'require'],
1873
+ sctype='[str]',
1874
+ pernode='optional',
1875
+ shorthelp="Task: parameter requirements",
1876
+ switch="-tool_task_require 'tool task <str>'",
1877
+ example=[
1878
+ "cli: -tool_task_require 'openroad cts design'",
1879
+ "api: chip.set('tool', 'openroad', 'task', 'cts', 'require', 'design')"],
1880
+ schelp="""
1881
+ List of keypaths to required task parameters. The list is used
1882
+ by check_manifest() to verify that all parameters have been set up before
1883
+ step execution begins.""")
1884
+
1885
+ metric = 'default'
1886
+ scparam(cfg, ['tool', tool, 'task', task, 'report', metric],
1887
+ sctype='[file]',
1888
+ pernode='required',
1889
+ shorthelp="Task: reports",
1890
+ switch="-tool_task_report 'tool task metric <file>'",
1891
+ example=[
1892
+ "cli: -tool_task_report 'openroad place holdtns place 0 place.log'",
1893
+ "api: chip.set('tool', 'openroad', 'task', 'place', 'report', 'holdtns', "
1894
+ "'place.log', step='place', index='0')"],
1895
+ schelp="""
1896
+ List of report files associated with a specific 'metric'. The file path
1897
+ specified is relative to the run directory of the current task.""")
1898
+
1899
+ scparam(cfg, ['tool', tool, 'task', task, 'refdir'],
1900
+ sctype='[dir]',
1901
+ pernode='optional',
1902
+ shorthelp="Task: script directory",
1903
+ switch="-tool_task_refdir 'tool task <dir>'",
1904
+ example=[
1905
+ "cli: -tool_task_refdir 'yosys syn ./myref'",
1906
+ "api: chip.set('tool', 'yosys', 'task', 'syn_asic', 'refdir', './myref')"],
1907
+ schelp="""
1908
+ Path to directories containing reference flow scripts, specified
1909
+ on a per step and index basis.""")
1910
+
1911
+ scparam(cfg, ['tool', tool, 'task', task, 'script'],
1912
+ sctype='[file]',
1913
+ pernode='optional',
1914
+ shorthelp="Task: entry script",
1915
+ switch="-tool_task_script 'tool task <file>'",
1916
+ example=[
1917
+ "cli: -tool_task_script 'yosys syn syn.tcl'",
1918
+ "api: chip.set('tool', 'yosys', 'task', 'syn_asic', 'script', 'syn.tcl')"],
1919
+ schelp="""
1920
+ Path to the entry script called by the executable specified
1921
+ on a per task and per step basis.""")
1922
+
1923
+ scparam(cfg, ['tool', tool, 'task', task, 'prescript'],
1924
+ sctype='[file]',
1925
+ pernode='optional',
1926
+ copy=True,
1927
+ shorthelp="Task: pre-step script",
1928
+ switch="-tool_task_prescript 'tool task <file>'",
1929
+ example=[
1930
+ "cli: -tool_task_prescript 'yosys syn syn_pre.tcl'",
1931
+ "api: chip.set('tool', 'yosys', 'task', 'syn_asic', 'prescript', 'syn_pre.tcl')"],
1932
+ schelp="""
1933
+ Path to a user supplied script to execute after reading in the design
1934
+ but before the main execution stage of the step. Exact entry point
1935
+ depends on the step and main script being executed. An example
1936
+ of a prescript entry point would be immediately before global
1937
+ placement.""")
1938
+
1939
+ scparam(cfg, ['tool', tool, 'task', task, 'postscript'],
1940
+ sctype='[file]',
1941
+ pernode='optional',
1942
+ copy=True,
1943
+ shorthelp="Task: post-step script",
1944
+ switch="-tool_task_postscript 'tool task <file>'",
1945
+ example=[
1946
+ "cli: -tool_task_postscript 'yosys syn syn_post.tcl'",
1947
+ "api: chip.set('tool', 'yosys', 'task', 'syn_asic', 'postscript', 'syn_post.tcl')"],
1948
+ schelp="""
1949
+ Path to a user supplied script to execute after the main execution
1950
+ stage of the step but before the design is saved.
1951
+ Exact entry point depends on the step and main script being
1952
+ executed. An example of a postscript entry point would be immediately
1953
+ after global placement.""")
1954
+
1955
+ scparam(cfg, ['tool', tool, 'task', task, 'threads'],
1956
+ sctype='int',
1957
+ pernode='optional',
1958
+ shorthelp="Task: thread parallelism",
1959
+ switch="-tool_task_threads 'tool task <int>'",
1960
+ example=["cli: -tool_task_threads 'magic drc 64'",
1961
+ "api: chip.set('tool', 'magic', 'task', 'drc', 'threads', '64')"],
1962
+ schelp="""
1963
+ Thread parallelism to use for execution specified on a per task and per
1964
+ step basis. If not specified, SC queries the operating system and sets
1965
+ the threads based on the maximum thread count supported by the
1966
+ hardware.""")
1967
+
1968
+ return cfg
1969
+
1970
+
1971
+ ###########################################################################
1972
+ # Function arguments
1973
+ ###########################################################################
1974
+ def schema_arg(cfg):
1975
+
1976
+ scparam(cfg, ['arg', 'step'],
1977
+ sctype='str',
1978
+ scope='scratch',
1979
+ shorthelp="ARG: Step argument",
1980
+ switch="-arg_step <str>",
1981
+ example=["cli: -arg_step 'route'",
1982
+ "api: chip.set('arg', 'step', 'route')"],
1983
+ schelp="""
1984
+ Dynamic parameter passed in by the SC runtime as an argument to
1985
+ a runtime task. The parameter enables configuration code
1986
+ (usually TCL) to use control flow that depend on the current
1987
+ 'step'. The parameter is used the run() function and
1988
+ is not intended for external use.""")
1989
+
1990
+ scparam(cfg, ['arg', 'index'],
1991
+ sctype='str',
1992
+ scope='scratch',
1993
+ shorthelp="ARG: Index argument",
1994
+ switch="-arg_index <str>",
1995
+ example=["cli: -arg_index 0",
1996
+ "api: chip.set('arg', 'index', '0')"],
1997
+ schelp="""
1998
+ Dynamic parameter passed in by the SC runtime as an argument to
1999
+ a runtime task. The parameter enables configuration code
2000
+ (usually TCL) to use control flow that depend on the current
2001
+ 'index'. The parameter is used the run() function and
2002
+ is not intended for external use.""")
2003
+
2004
+ return cfg
2005
+
2006
+
2007
+ ###########################################################################
2008
+ # Metrics to Track
2009
+ ###########################################################################
2010
+ def schema_metric(cfg, step='default', index='default'):
2011
+
2012
+ metrics = {'errors': 'errors',
2013
+ 'warnings': 'warnings',
2014
+ 'drvs': 'design rule violations',
2015
+ 'drcs': 'physical design rule violations',
2016
+ 'unconstrained': 'unconstrained timing paths'}
2017
+
2018
+ for item, val in metrics.items():
2019
+ scparam(cfg, ['metric', item],
2020
+ sctype='int',
2021
+ shorthelp=f"Metric: total {item}",
2022
+ switch=f"-metric_{item} 'step index <int>'",
2023
+ example=[
2024
+ f"cli: -metric_{item} 'dfm 0 0'",
2025
+ f"api: chip.set('metric', '{item}', 0, step='dfm', index=0)"],
2026
+ pernode='required',
2027
+ schelp=f"""Metric tracking the total number of {val} on a
2028
+ per step and index basis.""")
2029
+
2030
+ scparam(cfg, ['metric', 'coverage'],
2031
+ sctype='float',
2032
+ unit='%',
2033
+ shorthelp="Metric: coverage",
2034
+ switch="-metric_coverage 'step index <float>'",
2035
+ example=[
2036
+ "cli: -metric_coverage 'place 0 99.9'",
2037
+ "api: chip.set('metric', 'coverage', 99.9, step='place', index=0)"],
2038
+ pernode='required',
2039
+ schelp="""
2040
+ Metric tracking the test coverage in the design expressed as a percentage
2041
+ with 100 meaning full coverage. The meaning of the metric depends on the
2042
+ task being executed. It can refer to code coverage, feature coverage,
2043
+ stuck at fault coverage.""")
2044
+
2045
+ scparam(cfg, ['metric', 'security'],
2046
+ sctype='float',
2047
+ unit='%',
2048
+ shorthelp="Metric: security",
2049
+ switch="-metric_security 'step index <float>'",
2050
+ example=[
2051
+ "cli: -metric_security 'place 0 100'",
2052
+ "api: chip.set('metric', 'security', 100, step='place', index=0)"],
2053
+ pernode='required',
2054
+ schelp="""
2055
+ Metric tracking the level of security (1/vulnerability) of the design.
2056
+ A completely secure design would have a score of 100. There is no
2057
+ absolute scale for the security metrics (like with power, area, etc)
2058
+ so the metric will be task and tool dependent.""")
2059
+
2060
+ metrics = {'luts': 'FPGA LUTs used',
2061
+ 'dsps': 'FPGA DSP slices used',
2062
+ 'brams': 'FPGA BRAM tiles used'}
2063
+
2064
+ for item, val in metrics.items():
2065
+ scparam(cfg, ['metric', item],
2066
+ sctype='int',
2067
+
2068
+ shorthelp=f"Metric: {val}",
2069
+ switch=f"-metric_{item} 'step index <int>'",
2070
+ example=[
2071
+ f"cli: -metric_{item} 'place 0 100'",
2072
+ f"api: chip.set('metric', '{item}', 100, step='place', index=0)"],
2073
+ pernode='required',
2074
+ schelp=f"""
2075
+ Metric tracking the total {val} used by the design as reported
2076
+ by the implementation tool. There is no standardized definition
2077
+ for this metric across vendors, so metric comparisons can
2078
+ generally only be done between runs on identical tools and
2079
+ device families.""")
2080
+
2081
+ metrics = {'cellarea': 'cell area (ignoring fillers)',
2082
+ 'totalarea': 'physical die area'}
2083
+
2084
+ for item, val in metrics.items():
2085
+ scparam(cfg, ['metric', item],
2086
+ sctype='float',
2087
+ unit='um^2',
2088
+ shorthelp=f"Metric: {item}",
2089
+ switch=f"-metric_{item} 'step index <float>'",
2090
+ example=[
2091
+ f"cli: -metric_{item} 'place 0 100.00'",
2092
+ f"api: chip.set('metric', '{item}', 100.00, step='place', index=0)"],
2093
+ pernode='required',
2094
+ schelp=f"""
2095
+ Metric tracking the total {val} occupied by the design.""")
2096
+
2097
+ scparam(cfg, ['metric', 'utilization'],
2098
+ sctype='float',
2099
+ unit='%',
2100
+ shorthelp="Metric: area utilization",
2101
+ switch="-metric_utilization step index <float>",
2102
+ example=[
2103
+ "cli: -metric_utilization 'place 0 50.00'",
2104
+ "api: chip.set('metric', 'utilization', 50.00, step='place', index=0)"],
2105
+ pernode='required',
2106
+ schelp="""
2107
+ Metric tracking the area utilization of the design calculated as
2108
+ 100 * (cellarea/totalarea).""")
2109
+
2110
+ scparam(cfg, ['metric', 'logicdepth'],
2111
+ sctype='int',
2112
+ shorthelp="Metric: logic depth",
2113
+ switch="-metric_logicdepth step index <int>",
2114
+ example=[
2115
+ "cli: -metric_logicdepth 'place 0 8'",
2116
+ "api: chip.set('metric', 'logicdepth', 8, step='place', index=0)"],
2117
+ pernode='required',
2118
+ schelp="""
2119
+ Metric tracking the logic depth of the design. This is determined
2120
+ by the number of logic gates between the start of the critital timing
2121
+ path to the end of the path.""")
2122
+
2123
+ metrics = {'peakpower': 'worst case total peak power',
2124
+ 'averagepower': 'average workload power',
2125
+ 'leakagepower': 'leakage power with rails active but without any dynamic '
2126
+ 'switching activity'}
2127
+
2128
+ for item, val in metrics.items():
2129
+ scparam(cfg, ['metric', item],
2130
+ sctype='float',
2131
+ unit='mw',
2132
+ shorthelp=f"Metric: {item}",
2133
+ switch=f"-metric_{item} 'step index <float>'",
2134
+ example=[
2135
+ f"cli: -metric_{item} 'place 0 0.01'",
2136
+ f"api: chip.set('metric', '{item}', 0.01, step='place', index=0)"],
2137
+ pernode='required',
2138
+ schelp=f"""
2139
+ Metric tracking the {val} of the design specified on a per step
2140
+ and index basis. Power metric depend heavily on the method
2141
+ being used for extraction: dynamic vs static, workload
2142
+ specification (vcd vs saif), power models, process/voltage/temperature.
2143
+ The power {item} metric tries to capture the data that would
2144
+ usually be reflected inside a datasheet given the appropriate
2145
+ footnote conditions.""")
2146
+
2147
+ scparam(cfg, ['metric', 'irdrop'],
2148
+ sctype='float',
2149
+ unit='mv',
2150
+ shorthelp="Metric: peak IR drop",
2151
+ switch="-metric_irdrop 'step index <float>'",
2152
+ example=[
2153
+ "cli: -metric_irdrop 'place 0 0.05'",
2154
+ "api: chip.set('metric', 'irdrop', 0.05, step='place', index=0)"],
2155
+ pernode='required',
2156
+ schelp="""
2157
+ Metric tracking the peak IR drop in the design based on extracted
2158
+ power and ground rail parasitics, library power models, and
2159
+ switching activity. The switching activity calculated on a per
2160
+ node basis is taken from one of three possible sources, in order
2161
+ of priority: VCD file, SAIF file, 'activityfactor' parameter.""")
2162
+
2163
+ metrics = {'holdpaths': 'hold',
2164
+ 'setuppaths': 'setup'}
2165
+
2166
+ for item, val in metrics.items():
2167
+ scparam(cfg, ['metric', item],
2168
+ sctype='int',
2169
+ shorthelp=f"Metric: {item}",
2170
+ switch=f"-metric_{item} 'step index <int>'",
2171
+ example=[
2172
+ f"cli: -metric_{item} 'place 0 10'",
2173
+ f"api: chip.set('metric', '{item}', 10, step='place', index=0)"],
2174
+ pernode='required',
2175
+ schelp=f"""
2176
+ Metric tracking the total number of timing paths violating {val}
2177
+ constraints.""")
2178
+
2179
+ metrics = {'holdslack': 'worst hold slack (positive or negative)',
2180
+ 'holdwns': 'worst negative hold slack (positive values truncated to zero)',
2181
+ 'holdtns': 'total negative hold slack (TNS)',
2182
+ 'holdskew': 'hold clock skew',
2183
+ 'setupslack': 'worst setup slack (positive or negative)',
2184
+ 'setupwns': 'worst negative setup slack (positive values truncated to zero)',
2185
+ 'setuptns': 'total negative setup slack (TNS)',
2186
+ 'setupskew': 'setup clock skew'}
2187
+
2188
+ for item, val in metrics.items():
2189
+ scparam(cfg, ['metric', item],
2190
+ sctype='float',
2191
+ unit='ns',
2192
+ shorthelp=f"Metric: {item}",
2193
+ switch=f"-metric_{item} 'step index <float>'",
2194
+ example=[
2195
+ f"cli: -metric_{item} 'place 0 0.01'",
2196
+ f"api: chip.set('metric', '{item}', 0.01, step='place', index=0)"],
2197
+ pernode='required',
2198
+ schelp=f"""
2199
+ Metric tracking the {val} on a per step and index basis.""")
2200
+
2201
+ metrics = {'fmax': 'maximum clock frequency'}
2202
+
2203
+ for item, val in metrics.items():
2204
+ scparam(cfg, ['metric', item],
2205
+ sctype='float',
2206
+ unit='Hz',
2207
+ shorthelp=f"Metric: {item}",
2208
+ switch=f"-metric_{item} 'step index <float>'",
2209
+ example=[
2210
+ f"cli: -metric_{item} 'place 0 100e6'",
2211
+ f"api: chip.set('metric', '{item}', 100e6, step='place', index=0)"],
2212
+ pernode='required',
2213
+ schelp=f"""
2214
+ Metric tracking the {val} on a per step and index basis.""")
2215
+
2216
+ metrics = {'macros': 'macros',
2217
+ 'cells': 'cell instances',
2218
+ 'registers': 'register instances',
2219
+ 'buffers': 'buffer instances',
2220
+ 'inverters': 'inverter instances',
2221
+ 'transistors': 'transistors',
2222
+ 'pins': 'pins',
2223
+ 'nets': 'nets',
2224
+ 'vias': 'vias'}
2225
+
2226
+ for item, val in metrics.items():
2227
+ scparam(cfg, ['metric', item],
2228
+ sctype='int',
2229
+ shorthelp=f"Metric: {item}",
2230
+ switch=f"-metric_{item} 'step index <int>'",
2231
+ example=[
2232
+ f"cli: -metric_{item} 'place 0 100'",
2233
+ f"api: chip.set('metric', '{item}', 50, step='place', index=0)"],
2234
+ pernode='required',
2235
+ schelp=f"""
2236
+ Metric tracking the total number of {val} in the design
2237
+ on a per step and index basis.""")
2238
+
2239
+ item = 'wirelength'
2240
+ scparam(cfg, ['metric', item],
2241
+ sctype='float',
2242
+ unit='um',
2243
+ shorthelp=f"Metric: {item}",
2244
+ switch=f"-metric_{item} 'step index <float>'",
2245
+ example=[
2246
+ f"cli: -metric_{item} 'place 0 100.0'",
2247
+ f"api: chip.set('metric', '{item}', 50.0, step='place', index=0)"],
2248
+ pernode='required',
2249
+ schelp=f"""
2250
+ Metric tracking the total {item} of the design on a per step
2251
+ and index basis.""")
2252
+
2253
+ item = 'overflow'
2254
+ scparam(cfg, ['metric', item],
2255
+ sctype='int',
2256
+ shorthelp=f"Metric: {item}",
2257
+ switch=f"-metric_{item} 'step index <int>'",
2258
+ example=[
2259
+ f"cli: -metric_{item} 'place 0 0'",
2260
+ f"api: chip.set('metric', '{item}', 50, step='place', index=0)"],
2261
+ pernode='required',
2262
+ schelp="""
2263
+ Metric tracking the total number of overflow tracks for the routing
2264
+ on per step and index basis. Any non-zero number suggests an over
2265
+ congested design. To analyze where the congestion is occurring
2266
+ inspect the router log files for detailed per metal overflow
2267
+ reporting and open up the design to find routing hotspots.""")
2268
+
2269
+ item = 'memory'
2270
+ scparam(cfg, ['metric', item],
2271
+ sctype='float',
2272
+ unit='B',
2273
+ scope='job',
2274
+ shorthelp=f"Metric: {item}",
2275
+ switch=f"-metric_{item} 'step index <float>'",
2276
+ example=[
2277
+ f"cli: -metric_{item} 'dfm 0 10e9'",
2278
+ f"api: chip.set('metric', '{item}', 10e9, step='dfm', index=0)"],
2279
+ pernode='required',
2280
+ schelp="""
2281
+ Metric tracking total peak program memory footprint on a per
2282
+ step and index basis.""")
2283
+
2284
+ item = 'exetime'
2285
+ scparam(cfg, ['metric', item],
2286
+ sctype='float',
2287
+ unit='s',
2288
+ shorthelp=f"Metric: {item}",
2289
+ switch=f"-metric_{item} 'step index <float>'",
2290
+ example=[
2291
+ f"cli: -metric_{item} 'dfm 0 10.0'",
2292
+ f"api: chip.set('metric', '{item}', 10.0, step='dfm', index=0)"],
2293
+ pernode='required',
2294
+ schelp="""
2295
+ Metric tracking time spent by the EDA executable 'exe' on a
2296
+ per step and index basis. It does not include the SiliconCompiler
2297
+ runtime overhead or time waiting for I/O operations and
2298
+ inter-processor communication to complete.""")
2299
+
2300
+ item = 'tasktime'
2301
+ scparam(cfg, ['metric', item],
2302
+ sctype='float',
2303
+ unit='s',
2304
+ shorthelp=f"Metric: {item}",
2305
+ switch=f"-metric_{item} 'step index <float>'",
2306
+ example=[
2307
+ f"cli: -metric_{item} 'dfm 0 10.0'",
2308
+ f"api: chip.set('metric', '{item}', 10.0, step='dfm', index=0)"],
2309
+ pernode='required',
2310
+ schelp="""
2311
+ Metric tracking the total amount of time spent on a task from
2312
+ beginning to end, including data transfers and pre/post
2313
+ processing.""")
2314
+
2315
+ item = 'totaltime'
2316
+ scparam(cfg, ['metric', item],
2317
+ sctype='float',
2318
+ unit='s',
2319
+ shorthelp=f"Metric: {item}",
2320
+ switch=f"-metric_{item} 'step index <float>'",
2321
+ example=[
2322
+ f"cli: -metric_{item} 'dfm 0 10.0'",
2323
+ f"api: chip.set('metric', '{item}', 10.0, step='dfm', index=0)"],
2324
+ pernode='required',
2325
+ schelp="""
2326
+ Metric tracking the total amount of time spent from the beginning
2327
+ of the run up to and including the current step and index.""")
2328
+
2329
+ return cfg
2330
+
2331
+
2332
+ ###########################################################################
2333
+ # Design Tracking
2334
+ ###########################################################################
2335
+ def schema_record(cfg, step='default', index='default'):
2336
+
2337
+ # setting up local data structure
2338
+ # <key> : ['short help', 'example' 'extended help']
2339
+
2340
+ records = {'userid': ['userid',
2341
+ 'wiley',
2342
+ ''],
2343
+ 'publickey': ['public key',
2344
+ '<key>',
2345
+ ''],
2346
+ 'machine': ['machine name',
2347
+ 'carbon',
2348
+ '(myhost, localhost, ...'],
2349
+ 'macaddr': ['MAC address',
2350
+ '<addr>',
2351
+ ''],
2352
+ 'ipaddr': ['IP address',
2353
+ '<addr>',
2354
+ ''],
2355
+ 'platform': ['platform name',
2356
+ 'linux',
2357
+ '(linux, windows, freebsd)'],
2358
+ 'distro': ['distro name',
2359
+ 'ubuntu',
2360
+ '(ubuntu, redhat, centos)'],
2361
+ 'arch': ['hardware architecture',
2362
+ 'x86_64',
2363
+ '(x86_64, rv64imafdc)'],
2364
+ 'starttime': ['start time',
2365
+ '2021-09-06 12:20:20',
2366
+ 'Time is reported in the ISO 8601 format YYYY-MM-DD HR:MIN:SEC'],
2367
+ 'endtime': ['end time',
2368
+ '2021-09-06 12:20:20',
2369
+ 'Time is reported in the ISO 8601 format YYYY-MM-DD HR:MIN:SEC'],
2370
+ 'region': ['cloud region',
2371
+ 'US Gov Boston',
2372
+ """Recommended naming methodology:
2373
+
2374
+ * local: node is the local machine
2375
+ * onprem: node in on-premises IT infrastructure
2376
+ * public: generic public cloud
2377
+ * govcloud: generic US government cloud
2378
+ * <region>: cloud and entity specific region string name
2379
+ """],
2380
+ 'scversion': ['software version',
2381
+ '1.0',
2382
+ """Version number for the SiliconCompiler software."""],
2383
+ 'toolversion': ['tool version',
2384
+ '1.0',
2385
+ """The tool version captured corresponds to the 'tool'
2386
+ parameter within the 'tool' dictionary."""],
2387
+ 'toolpath': ['tool path',
2388
+ '/usr/bin/openroad',
2389
+ """Full path to tool executable used to run this
2390
+ task."""],
2391
+ 'toolargs': ['tool CLI arguments',
2392
+ '-I include/ foo.v',
2393
+ 'Arguments passed to tool via CLI.'],
2394
+ 'osversion': ['O/S version',
2395
+ '20.04.1-Ubuntu',
2396
+ """Since there is not standard version system for operating
2397
+ systems, extracting information from is platform dependent.
2398
+ For Linux based operating systems, the 'osversion' is the
2399
+ version of the distro."""],
2400
+ 'kernelversion': ['O/S kernel version',
2401
+ '5.11.0-34-generic',
2402
+ """Used for platforms that support a distinction
2403
+ between os kernels and os distributions."""]}
2404
+
2405
+ for item, val in records.items():
2406
+ helpext = trim(val[2])
2407
+ scparam(cfg, ['record', item],
2408
+ sctype='str',
2409
+ shorthelp=f"Record: {val[0]}",
2410
+ switch=f"-record_{item} 'step index <str>'",
2411
+ example=[
2412
+ f"cli: -record_{item} 'dfm 0 {val[1]}'",
2413
+ f"api: chip.set('record', '{item}', '{val[1]}', step='dfm', index=0)"],
2414
+ pernode='required',
2415
+ schelp=f'Record tracking the {val[0]} per step and index basis. {helpext}')
2416
+
2417
+ scparam(cfg, ['record', 'toolexitcode'],
2418
+ sctype='int',
2419
+ shorthelp="Record: tool exit code",
2420
+ switch="-record_toolexitcode 'step index <int>'",
2421
+ example=[
2422
+ "cli: -record_toolexitcode 'dfm 0 0'",
2423
+ "api: chip.set('record', 'toolexitcode', 0, step='dfm', index=0)"],
2424
+ pernode='required',
2425
+ schelp='Record tracking the tool exit code per step and index basis.')
2426
+
2427
+ # Unlike most other 'record' fields, job ID is not set per-node.
2428
+ scparam(cfg, ['record', 'remoteid'],
2429
+ sctype='str',
2430
+ shorthelp="Record: remote job ID",
2431
+ switch="-record_remoteid 'step index <str>'",
2432
+ example=[
2433
+ "cli: -record_remoteid '0123456789abcdeffedcba9876543210'",
2434
+ "api: chip.set('record', 'remoteid', '0123456789abcdeffedcba9876543210')"],
2435
+ schelp='Record tracking the job ID for a remote run.')
2436
+
2437
+ # flowgraph status
2438
+ scparam(cfg, ['record', 'status'],
2439
+ sctype='enum',
2440
+ pernode='required',
2441
+ enum=[ # keep in sync with NodeStatus
2442
+ "pending",
2443
+ "queued",
2444
+ "running",
2445
+ "success",
2446
+ "error",
2447
+ "skipped",
2448
+ "timeout"],
2449
+ shorthelp="Record: node execution status",
2450
+ switch="-record_status 'step index <str>'",
2451
+ example=[
2452
+ "cli: -record_status 'syn 0 success'",
2453
+ "api: chip.set('record', 'status', 'success', step='syn', index='0')"],
2454
+ schelp="""Record tracking for the status of a node.""")
2455
+
2456
+ # flowgraph select
2457
+ scparam(cfg, ['record', 'inputnode'],
2458
+ sctype='[(str,str)]',
2459
+ pernode='required',
2460
+ shorthelp="Record: node inputs",
2461
+ switch="-record_inputnode 'step index <(str,str)>'",
2462
+ example=[
2463
+ "cli: -record_inputnode 'cts 0 (place,42)'",
2464
+ "api: chip.set('record', 'inputnode', ('place', '42'), step='syn', index='0')"],
2465
+ schelp="""
2466
+ List of selected inputs for the current step/index specified as
2467
+ (in_step, in_index) tuple.""")
2468
+
2469
+ return cfg
2470
+
2471
+
2472
+ ###########################################################################
2473
+ # Run Options
2474
+ ###########################################################################
2475
+ def schema_option(cfg):
2476
+ ''' Technology agnostic run time options
2477
+ '''
2478
+
2479
+ scparam(cfg, ['option', 'remote'],
2480
+ sctype='bool',
2481
+ scope='job',
2482
+ shorthelp="Enable remote processing",
2483
+ switch="-remote <bool>",
2484
+ example=[
2485
+ "cli: -remote",
2486
+ "api: chip.set('option', 'remote', True)"],
2487
+ schelp="""
2488
+ Sends job for remote processing if set to true. The remote
2489
+ option requires a credentials file to be placed in the home
2490
+ directory. Fore more information, see the credentials
2491
+ parameter.""")
2492
+
2493
+ scparam(cfg, ['option', 'credentials'],
2494
+ sctype='file',
2495
+ scope='job',
2496
+ shorthelp="User credentials file",
2497
+ switch="-credentials <file>",
2498
+ example=[
2499
+ "cli: -credentials /home/user/.sc/credentials",
2500
+ "api: chip.set('option', 'credentials', '/home/user/.sc/credentials')"],
2501
+ schelp="""
2502
+ Filepath to credentials used for remote processing. If the
2503
+ credentials parameter is empty, the remote processing client program
2504
+ tries to access the ".sc/credentials" file in the user's home
2505
+ directory. The file supports the following fields:
2506
+
2507
+ address=<server address>
2508
+
2509
+ port=<server port> (optional)
2510
+
2511
+ username=<user id> (optional)
2512
+
2513
+ password=<password / key used for authentication> (optional)""")
2514
+
2515
+ scparam(cfg, ['option', 'cachedir'],
2516
+ sctype='file',
2517
+ scope='job',
2518
+ shorthelp="User cache directory",
2519
+ switch="-cachedir <file>",
2520
+ example=[
2521
+ "cli: -cachedir /home/user/.sc/cache",
2522
+ "api: chip.set('option', 'cachedir', '/home/user/.sc/cache')"],
2523
+ schelp="""
2524
+ Filepath to cache used for package data sources. If the
2525
+ cache parameter is empty, ".sc/cache" directory in the user's home
2526
+ directory will be used.""")
2527
+
2528
+ scparam(cfg, ['option', 'nice'],
2529
+ sctype='int',
2530
+ scope='job',
2531
+ pernode='optional',
2532
+ shorthelp="Tool execution scheduling priority",
2533
+ switch="-nice <int>",
2534
+ example=[
2535
+ "cli: -nice 5",
2536
+ "api: chip.set('option', 'nice', 5)"],
2537
+ schelp="""
2538
+ Sets the type of execution priority of each individual flowgraph steps.
2539
+ If the parameter is undefined, nice will not be used. For more information see
2540
+ `Unix 'nice' <https://en.wikipedia.org/wiki/Nice_(Unix)>`_.""")
2541
+
2542
+ # Compilation
2543
+ scparam(cfg, ['option', 'target'],
2544
+ sctype='str',
2545
+ scope='job',
2546
+ shorthelp="Compilation target",
2547
+ switch="-target <str>",
2548
+ example=["cli: -target freepdk45_demo",
2549
+ "api: chip.set('option', 'target', 'freepdk45_demo')"],
2550
+ schelp="""
2551
+ Sets a target module to be used for compilation. The target
2552
+ module must set up all parameters needed. The target module
2553
+ may load multiple flows and libraries.
2554
+ """)
2555
+
2556
+ scparam(cfg, ['option', 'pdk'],
2557
+ sctype='str',
2558
+ scope='job',
2559
+ shorthelp="PDK target",
2560
+ switch="-pdk <str>",
2561
+ example=["cli: -pdk freepdk45",
2562
+ "api: chip.set('option', 'pdk', 'freepdk45')"],
2563
+ schelp="""
2564
+ Target PDK used during compilation.""")
2565
+
2566
+ scparam(cfg, ['option', 'stackup'],
2567
+ sctype='str',
2568
+ scope='job',
2569
+ shorthelp="Stackup target",
2570
+ switch="-stackup <str>",
2571
+ example=["cli: -stackup 2MA4MB2MC",
2572
+ "api: chip.set('option', 'stackup', '2MA4MB2MC')"],
2573
+ schelp="""
2574
+ Target stackup used during compilation. The stackup is required
2575
+ parameter for PDKs with multiple metal stackups.""")
2576
+
2577
+ scparam(cfg, ['option', 'flow'],
2578
+ sctype='str',
2579
+ scope='job',
2580
+ shorthelp="Flow target",
2581
+ switch="-flow <str>",
2582
+ example=["cli: -flow asicflow",
2583
+ "api: chip.set('option', 'flow', 'asicflow')"],
2584
+ schelp="""
2585
+ Sets the flow for the current run. The flow name
2586
+ must match up with a 'flow' in the flowgraph""")
2587
+
2588
+ scparam(cfg, ['option', 'optmode'],
2589
+ sctype='str',
2590
+ pernode='optional',
2591
+ scope='job',
2592
+ defvalue='O0',
2593
+ shorthelp="Optimization mode",
2594
+ switch=["-O<str>",
2595
+ "-optmode <str>"],
2596
+ example=["cli: -O3",
2597
+ "cli: -optmode O3",
2598
+ "api: chip.set('option', 'optmode', 'O3')"],
2599
+ schelp="""
2600
+ The compiler has modes to prioritize run time and ppa. Modes
2601
+ include.
2602
+
2603
+ (O0) = Exploration mode for debugging setup
2604
+ (O1) = Higher effort and better PPA than O0
2605
+ (O2) = Higher effort and better PPA than O1
2606
+ (O3) = Signoff quality. Better PPA and higher run times than O2
2607
+ (O4-O98) = Reserved (compiler/target dependent)
2608
+ (O99) = Experimental highest possible effort, may be unstable
2609
+ """)
2610
+
2611
+ scparam(cfg, ['option', 'cfg'],
2612
+ sctype='[file]',
2613
+ scope='job',
2614
+ shorthelp="Configuration manifest",
2615
+ switch="-cfg <file>",
2616
+ example=["cli: -cfg mypdk.json",
2617
+ "api: chip.set('option', 'cfg', 'mypdk.json')"],
2618
+ schelp="""
2619
+ List of filepaths to JSON formatted schema configuration
2620
+ manifests. The files are read in automatically when using the
2621
+ 'sc' command line application. In Python programs, JSON manifests
2622
+ can be merged into the current working manifest using the
2623
+ read_manifest() method.""")
2624
+
2625
+ key = 'default'
2626
+ scparam(cfg, ['option', 'env', key],
2627
+ sctype='str',
2628
+ scope='job',
2629
+ shorthelp="Environment variables",
2630
+ switch="-env 'key <str>'",
2631
+ example=[
2632
+ "cli: -env 'PDK_HOME /disk/mypdk'",
2633
+ "api: chip.set('option', 'env', 'PDK_HOME', '/disk/mypdk')"],
2634
+ schelp="""
2635
+ Certain tools and reference flows require global environment
2636
+ variables to be set. These variables can be managed externally or
2637
+ specified through the env variable.""")
2638
+
2639
+ scparam(cfg, ['option', 'var', key],
2640
+ sctype='[str]',
2641
+ scope='job',
2642
+ shorthelp="Custom variables",
2643
+ switch="-var 'key <str>'",
2644
+ example=[
2645
+ "cli: -var 'openroad_place_density 0.4'",
2646
+ "api: chip.set('option', 'var', 'openroad_place_density', '0.4')"],
2647
+ schelp="""
2648
+ List of key/value strings specified. Certain tools and
2649
+ reference flows require special parameters, this
2650
+ should only be used for specifying variables that are
2651
+ not directly supported by the SiliconCompiler schema.""")
2652
+
2653
+ scparam(cfg, ['option', 'file', key],
2654
+ sctype='[file]',
2655
+ scope='job',
2656
+ copy=True,
2657
+ shorthelp="Custom files",
2658
+ switch="-file 'key <file>'",
2659
+ example=[
2660
+ "cli: -file 'openroad_tapcell ./tapcell.tcl'",
2661
+ "api: chip.set('option', 'file', 'openroad_tapcell', './tapcell.tcl')"],
2662
+ schelp="""
2663
+ List of named files specified. Certain tools and
2664
+ reference flows require special parameters, this
2665
+ parameter should only be used for specifying files that are
2666
+ not directly supported by the schema.""")
2667
+
2668
+ scparam(cfg, ['option', 'dir', key],
2669
+ sctype='[dir]',
2670
+ scope='job',
2671
+ copy=True,
2672
+ shorthelp="Custom directories",
2673
+ switch="-dir 'key <dir>'",
2674
+ example=[
2675
+ "cli: -dir 'openroad_tapcell ./tapcell.tcl'",
2676
+ "api: chip.set('option', 'dir', 'openroad_files', './openroad_support/')"],
2677
+ schelp="""
2678
+ List of named directories specified. Certain tools and
2679
+ reference flows require special parameters, this
2680
+ parameter should only be used for specifying directories that are
2681
+ not directly supported by the schema.""")
2682
+
2683
+ scparam(cfg, ['option', 'loglevel'],
2684
+ sctype='enum',
2685
+ enum=["info", "warning", "error", "critical", "debug"],
2686
+ pernode='optional',
2687
+ scope='job',
2688
+ defvalue='info',
2689
+ shorthelp="Logging level",
2690
+ switch="-loglevel <str>",
2691
+ example=[
2692
+ "cli: -loglevel info",
2693
+ "api: chip.set('option', 'loglevel', 'info')"],
2694
+ schelp="""
2695
+ Provides explicit control over the level of debug logging printed.""")
2696
+
2697
+ scparam(cfg, ['option', 'builddir'],
2698
+ sctype='dir',
2699
+ scope='job',
2700
+ defvalue='build',
2701
+ shorthelp="Build directory",
2702
+ switch="-builddir <dir>",
2703
+ example=[
2704
+ "cli: -builddir ./build_the_future",
2705
+ "api: chip.set('option', 'builddir', './build_the_future')"],
2706
+ schelp="""
2707
+ The default build directory is in the local './build' where SC was
2708
+ executed. The 'builddir' parameter can be used to set an alternate
2709
+ compilation directory path.""")
2710
+
2711
+ scparam(cfg, ['option', 'jobname'],
2712
+ sctype='str',
2713
+ scope='job',
2714
+ defvalue='job0',
2715
+ shorthelp="Job name",
2716
+ switch="-jobname <str>",
2717
+ example=[
2718
+ "cli: -jobname may1",
2719
+ "api: chip.set('option', 'jobname', 'may1')"],
2720
+ schelp="""
2721
+ Jobname during invocation of run(). The jobname combined with a
2722
+ defined director structure (<dir>/<design>/<jobname>/<step>/<index>)
2723
+ enables multiple levels of transparent job, step, and index
2724
+ introspection.""")
2725
+
2726
+ scparam(cfg, ['option', 'from'],
2727
+ sctype='[str]',
2728
+ scope='job',
2729
+ shorthelp="Start flowgraph execution from",
2730
+ switch="-from <str>",
2731
+ example=[
2732
+ "cli: -from 'import'",
2733
+ "api: chip.set('option', 'from', 'import')"],
2734
+ schelp="""
2735
+ Inclusive list of steps to start execution from. The default is to start
2736
+ at all entry steps in the flow graph.""")
2737
+
2738
+ scparam(cfg, ['option', 'to'],
2739
+ sctype='[str]',
2740
+ scope='job',
2741
+ shorthelp="End flowgraph execution with",
2742
+ switch="-to <str>",
2743
+ example=[
2744
+ "cli: -to 'syn'",
2745
+ "api: chip.set('option', 'to', 'syn')"],
2746
+ schelp="""
2747
+ Inclusive list of steps to end execution with. The default is to go
2748
+ to all exit steps in the flow graph.""")
2749
+
2750
+ scparam(cfg, ['option', 'prune'],
2751
+ sctype='[(str,str)]',
2752
+ scope='job',
2753
+ shorthelp="Prune flowgraph branches starting with",
2754
+ switch="-prune 'node <(str,str)>'",
2755
+ example=[
2756
+ "cli: -prune (syn,0)",
2757
+ "api: chip.set('option', 'prune', ('syn', '0'))"],
2758
+ schelp="""
2759
+ List of starting nodes for branches to be pruned.
2760
+ The default is to not prune any nodes/branches.""")
2761
+
2762
+ scparam(cfg, ['option', 'breakpoint'],
2763
+ sctype='bool',
2764
+ scope='job',
2765
+ pernode='optional',
2766
+ shorthelp="Breakpoint list",
2767
+ switch="-breakpoint <bool>",
2768
+ example=[
2769
+ "cli: -breakpoint true",
2770
+ "api: chip.set('option, 'breakpoint', True)"],
2771
+ schelp="""
2772
+ Set a breakpoint on specific steps. If the step is a TCL
2773
+ based tool, then the breakpoints stops the flow inside the
2774
+ EDA tool. If the step is a command line tool, then the flow
2775
+ drops into a Python interpreter.""")
2776
+
2777
+ scparam(cfg, ['option', 'library'],
2778
+ sctype='[str]',
2779
+ scope='job',
2780
+ pernode='optional',
2781
+ shorthelp="Soft libraries",
2782
+ switch="-library <str>",
2783
+ example=["cli: -library lambdalib_asap7",
2784
+ "api: chip.set('option', 'library', 'lambdalib_asap7')"],
2785
+ schelp="""
2786
+ List of soft libraries to be linked in during import.""")
2787
+
2788
+ # Booleans
2789
+ scparam(cfg, ['option', 'clean'],
2790
+ sctype='bool',
2791
+ scope='job',
2792
+ shorthelp="Start a job from the beginning",
2793
+ switch="-clean <bool>",
2794
+ example=["cli: -clean",
2795
+ "api: chip.set('option', 'clean', True)"],
2796
+ schelp="""
2797
+ Run a job from the start and do not use any of the previous job.
2798
+ If :keypath:`option, jobincr` is True, the old job is preserved and
2799
+ a new job number is assigned.
2800
+ """)
2801
+
2802
+ scparam(cfg, ['option', 'hash'],
2803
+ sctype='bool',
2804
+ scope='job',
2805
+ shorthelp="Enable file hashing",
2806
+ switch="-hash <bool>",
2807
+ example=["cli: -hash",
2808
+ "api: chip.set('option', 'hash', True)"],
2809
+ schelp="""
2810
+ Enables hashing of all inputs and outputs during
2811
+ compilation. The hash values are stored in the hashvalue
2812
+ field of the individual parameters.""")
2813
+
2814
+ scparam(cfg, ['option', 'nodisplay'],
2815
+ sctype='bool',
2816
+ scope='job',
2817
+ shorthelp="Headless execution",
2818
+ switch="-nodisplay <bool>",
2819
+ example=["cli: -nodisplay",
2820
+ "api: chip.set('option', 'nodisplay', True)"],
2821
+ schelp="""
2822
+ The '-nodisplay' flag prevents SiliconCompiler from
2823
+ opening GUI windows such as the final metrics report.""")
2824
+
2825
+ scparam(cfg, ['option', 'quiet'],
2826
+ sctype='bool',
2827
+ pernode='optional',
2828
+ scope='job',
2829
+ shorthelp="Quiet execution",
2830
+ switch="-quiet <bool>",
2831
+ example=["cli: -quiet",
2832
+ "api: chip.set('option', 'quiet', True)"],
2833
+ schelp="""
2834
+ The -quiet option forces all steps to print to a log file.
2835
+ This can be useful with Modern EDA tools which print
2836
+ significant content to the screen.""")
2837
+
2838
+ scparam(cfg, ['option', 'jobincr'],
2839
+ sctype='bool',
2840
+ scope='job',
2841
+ shorthelp="Autoincrement jobname",
2842
+ switch="-jobincr <bool>",
2843
+ example=["cli: -jobincr",
2844
+ "api: chip.set('option', 'jobincr', True)"],
2845
+ schelp="""
2846
+ Forces an auto-update of the jobname parameter if a directory
2847
+ matching the jobname is found in the build directory. If the
2848
+ jobname does not include a trailing digit, then the number
2849
+ '1' is added to the jobname before updating the jobname
2850
+ parameter.""")
2851
+
2852
+ scparam(cfg, ['option', 'novercheck'],
2853
+ sctype='bool',
2854
+ pernode='optional',
2855
+ defvalue=False,
2856
+ scope='job',
2857
+ shorthelp="Disable version checking",
2858
+ switch="-novercheck <bool>",
2859
+ example=["cli: -novercheck",
2860
+ "api: chip.set('option', 'novercheck', True)"],
2861
+ schelp="""
2862
+ Disables strict version checking on all invoked tools if True.
2863
+ The list of supported version numbers is defined in the
2864
+ 'version' parameter in the 'tool' dictionary for each tool.""")
2865
+
2866
+ scparam(cfg, ['option', 'track'],
2867
+ sctype='bool',
2868
+ pernode='optional',
2869
+ scope='job',
2870
+ shorthelp="Enable provenance tracking",
2871
+ switch="-track <bool>",
2872
+ example=["cli: -track",
2873
+ "api: chip.set('option', 'track', True)"],
2874
+ schelp="""
2875
+ Turns on tracking of all 'record' parameters during each
2876
+ task, otherwise only tool and runtime information will be recorded.
2877
+ Tracking will result in potentially sensitive data
2878
+ being recorded in the manifest so only turn on this feature
2879
+ if you have control of the final manifest.""")
2880
+
2881
+ scparam(cfg, ['option', 'entrypoint'],
2882
+ sctype='str',
2883
+ pernode='optional',
2884
+ shorthelp="Program entry point",
2885
+ switch="-entrypoint <str>",
2886
+ example=["cli: -entrypoint top",
2887
+ "api: chip.set('option', 'entrypoint', 'top')"],
2888
+ schelp="""Alternative entrypoint for compilation and
2889
+ simulation. The default entry point is 'design'.""")
2890
+
2891
+ scparam(cfg, ['option', 'idir'],
2892
+ sctype='[dir]',
2893
+ shorthelp="Design search paths",
2894
+ copy=True,
2895
+ switch=['+incdir+<dir>',
2896
+ '-I <dir>',
2897
+ '-idir <dir>'],
2898
+ example=[
2899
+ "cli: +incdir+./mylib",
2900
+ "cli: -I ./mylib",
2901
+ "cli: -idir ./mylib",
2902
+ "api: chip.set('option', 'idir', './mylib')"],
2903
+ schelp="""
2904
+ Search paths to look for files included in the design using
2905
+ the ```include`` statement.""")
2906
+
2907
+ scparam(cfg, ['option', 'ydir'],
2908
+ sctype='[dir]',
2909
+ shorthelp="Design module search paths",
2910
+ copy=True,
2911
+ switch=['-y <dir>',
2912
+ '-ydir <dir>'],
2913
+ example=[
2914
+ "cli: -y './mylib'",
2915
+ "cli: -ydir './mylib'",
2916
+ "api: chip.set('option', 'ydir', './mylib')"],
2917
+ schelp="""
2918
+ Search paths to look for verilog modules found in the the
2919
+ source list. The import engine will look for modules inside
2920
+ files with the specified +libext+ param suffix.""")
2921
+
2922
+ scparam(cfg, ['option', 'vlib'],
2923
+ sctype='[file]',
2924
+ shorthelp="Design libraries",
2925
+ copy=True,
2926
+ switch=['-v <file>',
2927
+ '-vlib <file>'],
2928
+ example=["cli: -v './mylib.v'",
2929
+ "cli: -vlib './mylib.v'",
2930
+ "api: chip.set('option', 'vlib', './mylib.v')"],
2931
+ schelp="""
2932
+ List of library files to be read in. Modules found in the
2933
+ libraries are not interpreted as root modules.""")
2934
+
2935
+ scparam(cfg, ['option', 'define'],
2936
+ sctype='[str]',
2937
+ shorthelp="Design pre-processor symbol",
2938
+ switch=["-D<str>",
2939
+ "-define <str>"],
2940
+ example=["cli: -DCFG_ASIC=1",
2941
+ "cli: -define CFG_ASIC=1",
2942
+ "api: chip.set('option', 'define', 'CFG_ASIC=1')"],
2943
+ schelp="""Symbol definition for source preprocessor.""")
2944
+
2945
+ scparam(cfg, ['option', 'libext'],
2946
+ sctype='[str]',
2947
+ shorthelp="Design file extensions",
2948
+ switch=["+libext+<str>",
2949
+ "-libext <str>"],
2950
+ example=[
2951
+ "cli: +libext+sv",
2952
+ "cli: -libext sv",
2953
+ "api: chip.set('option', 'libext', 'sv')"],
2954
+ schelp="""
2955
+ List of file extensions that should be used for finding modules.
2956
+ For example, if -y is specified as ./lib", and '.v' is specified as
2957
+ libext then the files ./lib/\\*.v ", will be searched for
2958
+ module matches.""")
2959
+
2960
+ name = 'default'
2961
+ scparam(cfg, ['option', 'param', name],
2962
+ sctype='str',
2963
+ shorthelp="Design parameter",
2964
+ switch="-param 'name <str>'",
2965
+ example=[
2966
+ "cli: -param 'N 64'",
2967
+ "api: chip.set('option', 'param', 'N', '64')"],
2968
+ schelp="""
2969
+ Sets a top verilog level design module parameter. The value
2970
+ is limited to basic data literals. The parameter override is
2971
+ passed into tools such as Verilator and Yosys. The parameters
2972
+ support Verilog integer literals (64'h4, 2'b0, 4) and strings.
2973
+ Name of the top level module to compile.""")
2974
+
2975
+ scparam(cfg, ['option', 'continue'],
2976
+ sctype='bool',
2977
+ pernode='optional',
2978
+ shorthelp='continue-on-error',
2979
+ switch='-continue <bool>',
2980
+ example=["cli: -continue",
2981
+ "api: chip.set('option', 'continue', True)"],
2982
+ schelp="""
2983
+ Attempt to continue even when errors are encountered in the SC
2984
+ implementation. The default behavior is to quit executing the flow
2985
+ if a task ends and the errors metric is greater than 0. Note that
2986
+ the flow will always cease executing if the tool returns a nonzero
2987
+ status code.
2988
+ """)
2989
+
2990
+ scparam(cfg, ['option', 'timeout'],
2991
+ sctype='float',
2992
+ pernode='optional',
2993
+ scope='job',
2994
+ unit='s',
2995
+ shorthelp="Option: Timeout value",
2996
+ switch="-timeout <float>",
2997
+ example=["cli: -timeout 3600",
2998
+ "api: chip.set('option', 'timeout', 3600)"],
2999
+ schelp="""
3000
+ Timeout value in seconds. The timeout value is compared
3001
+ against the wall time tracked by the SC runtime to determine
3002
+ if an operation should continue. The timeout value is also
3003
+ used by the jobscheduler to automatically kill jobs.""")
3004
+
3005
+ scparam(cfg, ['option', 'strict'],
3006
+ sctype='bool',
3007
+ shorthelp="Option: Strict checking",
3008
+ switch="-strict <bool>",
3009
+ example=["cli: -strict true",
3010
+ "api: chip.set('option', 'strict', True)"],
3011
+ schelp="""
3012
+ Enable additional strict checking in the SC Python API. When this
3013
+ parameter is set to True, users must provide step and index keyword
3014
+ arguments when reading from parameters with the pernode field set to
3015
+ 'optional'.""")
3016
+
3017
+ # job scheduler
3018
+ scparam(cfg, ['option', 'scheduler', 'name'],
3019
+ sctype='enum',
3020
+ enum=["slurm", "lsf", "sge", "docker"],
3021
+ scope='job',
3022
+ pernode='optional',
3023
+ shorthelp="Option: Scheduler platform",
3024
+ switch="-scheduler <str>",
3025
+ example=[
3026
+ "cli: -scheduler slurm",
3027
+ "api: chip.set('option', 'scheduler', 'name', 'slurm')"],
3028
+ schelp="""
3029
+ Sets the type of job scheduler to be used for each individual
3030
+ flowgraph steps. If the parameter is undefined, the steps are executed
3031
+ on the same machine that the SC was launched on. If 'slurm' is used,
3032
+ the host running the 'sc' command must be running a 'slurmctld' daemon
3033
+ managing a Slurm cluster. Additionally, the build directory ('-dir')
3034
+ must be located in shared storage which can be accessed by all hosts
3035
+ in the cluster.""")
3036
+
3037
+ scparam(cfg, ['option', 'scheduler', 'cores'],
3038
+ sctype='int',
3039
+ scope='job',
3040
+ pernode='optional',
3041
+ shorthelp="Option: Scheduler core constraint",
3042
+ switch="-cores <int>",
3043
+ example=["cli: -cores 48",
3044
+ "api: chip.set('option', 'scheduler', 'cores', '48')"],
3045
+ schelp="""
3046
+ Specifies the number CPU cores required to run the job.
3047
+ For the slurm scheduler, this translates to the '-c'
3048
+ switch. For more information, see the job scheduler
3049
+ documentation""")
3050
+
3051
+ scparam(cfg, ['option', 'scheduler', 'memory'],
3052
+ sctype='int',
3053
+ unit='MB',
3054
+ scope='job',
3055
+ pernode='optional',
3056
+ shorthelp="Option: Scheduler memory constraint",
3057
+ switch="-memory <int>",
3058
+ example=["cli: -memory 8000",
3059
+ "api: chip.set('option', 'scheduler', 'memory', '8000')"],
3060
+ schelp="""
3061
+ Specifies the amount of memory required to run the job,
3062
+ specified in MB. For the slurm scheduler, this translates to
3063
+ the '--mem' switch. For more information, see the job
3064
+ scheduler documentation""")
3065
+
3066
+ scparam(cfg, ['option', 'scheduler', 'queue'],
3067
+ sctype='str',
3068
+ scope='job',
3069
+ pernode='optional',
3070
+ shorthelp="Option: Scheduler queue",
3071
+ switch="-queue <str>",
3072
+ example=["cli: -queue nightrun",
3073
+ "api: chip.set('option', 'scheduler', 'queue', 'nightrun')"],
3074
+ schelp="""
3075
+ Send the job to the specified queue. With slurm, this
3076
+ translates to 'partition'. The queue name must match
3077
+ the name of an existing job scheduler queue. For more information,
3078
+ see the job scheduler documentation""")
3079
+
3080
+ scparam(cfg, ['option', 'scheduler', 'defer'],
3081
+ sctype='str',
3082
+ scope='job',
3083
+ pernode='optional',
3084
+ shorthelp="Option: Scheduler start time",
3085
+ switch="-defer <str>",
3086
+ example=["cli: -defer 16:00",
3087
+ "api: chip.set('option', 'scheduler', 'defer', '16:00')"],
3088
+ schelp="""
3089
+ Defer initiation of job until the specified time. The parameter
3090
+ is pass through string for remote job scheduler such as slurm.
3091
+ For more information about the exact format specification, see
3092
+ the job scheduler documentation. Examples of valid slurm specific
3093
+ values include: now+1hour, 16:00, 010-01-20T12:34:00. For more
3094
+ information, see the job scheduler documentation.""")
3095
+
3096
+ scparam(cfg, ['option', 'scheduler', 'options'],
3097
+ sctype='[str]',
3098
+ pernode='optional',
3099
+ shorthelp="Option: Scheduler arguments",
3100
+ switch="-scheduler_options <str>",
3101
+ example=[
3102
+ "cli: -scheduler_options \"--pty\"",
3103
+ "api: chip.set('option', 'scheduler', 'options', \"--pty\")"],
3104
+ schelp="""
3105
+ Advanced/export options passed through unchanged to the job
3106
+ scheduler as-is. (The user specified options must be compatible
3107
+ with the rest of the scheduler parameters entered.(memory etc).
3108
+ For more information, see the job scheduler documentation.""")
3109
+
3110
+ scparam(cfg, ['option', 'scheduler', 'msgevent'],
3111
+ sctype='[enum]',
3112
+ enum=['all', 'summary', 'begin', 'end', 'timeout', 'fail'],
3113
+ scope='job',
3114
+ pernode='optional',
3115
+ shorthelp="Option: Message event trigger",
3116
+ switch="-msgevent <str>",
3117
+ example=[
3118
+ "cli: -msgevent all",
3119
+ "api: chip.set('option', 'scheduler', 'msgevent', 'all')"],
3120
+ schelp="""
3121
+ Directs job scheduler to send a message to the user in
3122
+ ['optoion', 'scheduler', 'msgcontact'] when certain events occur
3123
+ during a task.
3124
+
3125
+ * fail: send an email on failures
3126
+ * timeout: send an email on timeouts
3127
+ * begin: send an email at the start of a node task
3128
+ * end: send an email at the end of a node task
3129
+ * summary: send a summary email at the end of the run
3130
+ * all: send an email on any event
3131
+ """)
3132
+
3133
+ scparam(cfg, ['option', 'scheduler', 'msgcontact'],
3134
+ sctype='[str]',
3135
+ scope='job',
3136
+ pernode='optional',
3137
+ shorthelp="Option: Message contact",
3138
+ switch="-msgcontact <str>",
3139
+ example=[
3140
+ "cli: -msgcontact 'wile.e.coyote@acme.com'",
3141
+ "api: chip.set('option', 'scheduler', 'msgcontact', 'wiley@acme.com')"],
3142
+ schelp="""
3143
+ List of email addresses to message on a 'msgevent'. Support for
3144
+ email messages relies on job scheduler daemon support.
3145
+ For more information, see the job scheduler documentation. """)
3146
+
3147
+ scparam(cfg, ['option', 'scheduler', 'maxnodes'],
3148
+ sctype='int',
3149
+ shorthelp="Option: Maximum concurrent nodes",
3150
+ switch="-maxnodes <int>",
3151
+ example=["cli: -maxnodes 4",
3152
+ "api: chip.set('option', 'scheduler', 'maxnodes', 4)"],
3153
+ schelp="""
3154
+ Maximum number of concurrent nodes to run in a job. If not set this will default
3155
+ to the number of cpu cores available.""")
3156
+
3157
+ return cfg
3158
+
3159
+
3160
+ ############################################
3161
+ # Package information
3162
+ ############################################
3163
+ def schema_package(cfg):
3164
+
3165
+ userid = 'default'
3166
+
3167
+ scparam(cfg, ['package', 'version'],
3168
+ sctype='str',
3169
+ scope='global',
3170
+ shorthelp="Package: version",
3171
+ switch="-package_version <str>",
3172
+ example=[
3173
+ "cli: -package_version 1.0",
3174
+ "api: chip.set('package', 'version', '1.0')"],
3175
+ schelp="""Package version. Can be a branch, tag, commit hash,
3176
+ or a semver compatible version.""")
3177
+
3178
+ scparam(cfg, ['package', 'description'],
3179
+ sctype='str',
3180
+ scope='global',
3181
+ shorthelp="Package: description",
3182
+ switch="-package_description <str>",
3183
+ example=[
3184
+ "cli: -package_description 'Yet another cpu'",
3185
+ "api: chip.set('package', 'description', 'Yet another cpu')"],
3186
+ schelp="""Package short one line description for package
3187
+ managers and summary reports.""")
3188
+
3189
+ scparam(cfg, ['package', 'keyword'],
3190
+ sctype='str',
3191
+ scope='global',
3192
+ shorthelp="Package: keyword",
3193
+ switch="-package_keyword <str>",
3194
+ example=[
3195
+ "cli: -package_keyword cpu",
3196
+ "api: chip.set('package', 'keyword', 'cpu')"],
3197
+ schelp="""Package keyword(s) used to characterize package.""")
3198
+ scparam(cfg, ['package', 'doc', 'homepage'],
3199
+ sctype='str',
3200
+ scope='global',
3201
+ shorthelp="Package: documentation homepage",
3202
+ switch="-package_doc_homepage <str>",
3203
+ example=[
3204
+ "cli: -package_doc_homepage index.html",
3205
+ "api: chip.set('package', 'doc', 'homepage', 'index.html')"],
3206
+ schelp="""
3207
+ Package documentation homepage. Filepath to design docs homepage.
3208
+ Complex designs can can include a long non standard list of
3209
+ documents dependent. A single html entry point can be used to
3210
+ present an organized documentation dashboard to the designer.""")
3211
+
3212
+ doctypes = ['datasheet',
3213
+ 'reference',
3214
+ 'userguide',
3215
+ 'quickstart',
3216
+ 'releasenotes',
3217
+ 'testplan',
3218
+ 'signoff',
3219
+ 'tutorial']
3220
+
3221
+ for item in doctypes:
3222
+ scparam(cfg, ['package', 'doc', item],
3223
+ sctype='[file]',
3224
+ scope='global',
3225
+ shorthelp=f"Package: {item} document",
3226
+ switch=f"-package_doc_{item} <file>",
3227
+ example=[
3228
+ f"cli: -package_doc_{item} {item}.pdf",
3229
+ f"api: chip.set('package', 'doc', '{item}', '{item}.pdf')"],
3230
+ schelp=f""" Package list of {item} documents.""")
3231
+
3232
+ scparam(cfg, ['package', 'license'],
3233
+ sctype='[str]',
3234
+ scope='global',
3235
+ shorthelp="Package: license identifiers",
3236
+ switch="-package_license <str>",
3237
+ example=[
3238
+ "cli: -package_license 'Apache-2.0'",
3239
+ "api: chip.set('package', 'license', 'Apache-2.0')"],
3240
+ schelp="""Package list of SPDX license identifiers.""")
3241
+
3242
+ scparam(cfg, ['package', 'licensefile'],
3243
+ sctype='[file]',
3244
+ scope='global',
3245
+ shorthelp="Package: license files",
3246
+ switch="-package_licensefile <file>",
3247
+ example=[
3248
+ "cli: -package_licensefile './LICENSE'",
3249
+ "api: chip.set('package', 'licensefile', './LICENSE')"],
3250
+ schelp="""Package list of license files for to be
3251
+ applied in cases when a SPDX identifier is not available.
3252
+ (eg. proprietary licenses).list of SPDX license identifiers.""")
3253
+
3254
+ scparam(cfg, ['package', 'organization'],
3255
+ sctype='[str]',
3256
+ scope='global',
3257
+ shorthelp="Package: sponsoring organization",
3258
+ switch="-package_organization <str>",
3259
+ example=[
3260
+ "cli: -package_organization 'humanity'",
3261
+ "api: chip.set('package', 'organization', 'humanity')"],
3262
+ schelp="""Package sponsoring organization. The field can be left
3263
+ blank if not applicable.""")
3264
+
3265
+ record = ['name',
3266
+ 'email',
3267
+ 'username',
3268
+ 'location',
3269
+ 'organization',
3270
+ 'publickey']
3271
+
3272
+ for item in record:
3273
+ scparam(cfg, ['package', 'author', userid, item],
3274
+ sctype='str',
3275
+ scope='global',
3276
+ shorthelp=f"Package: author {item}",
3277
+ switch=f"-package_author_{item} 'userid <str>'",
3278
+ example=[
3279
+ f"cli: -package_author_{item} 'wiley wiley@acme.com'",
3280
+ f"api: chip.set('package', 'author', 'wiley', '{item}', 'wiley@acme.com')"],
3281
+ schelp=f"""Package author {item} provided with full name as key and
3282
+ {item} as value.""")
3283
+
3284
+ source = 'default'
3285
+
3286
+ scparam(cfg, ['package', 'source', source, 'path'],
3287
+ sctype='str',
3288
+ scope='global',
3289
+ shorthelp="Package data source path",
3290
+ switch="-package_source_path 'source <str>'",
3291
+ example=[
3292
+ "cli: -package_source_path "
3293
+ "'freepdk45_data ssh://git@github.com/siliconcompiler/freepdk45/'",
3294
+ "api: chip.set('package', 'source', "
3295
+ "'freepdk45_data', 'path', 'ssh://git@github.com/siliconcompiler/freepdk45/')"],
3296
+ schelp="""
3297
+ Package data source path, allowed paths:
3298
+
3299
+ * /path/on/network/drive
3300
+ * file:///path/on/network/drive
3301
+ * git+https://github.com/xyz/xyz
3302
+ * git://github.com/xyz/xyz
3303
+ * git+ssh://github.com/xyz/xyz
3304
+ * ssh://github.com/xyz/xyz
3305
+ * https://github.com/xyz/xyz/archive
3306
+ * https://zeroasic.com/xyz.tar.gz
3307
+ * python://siliconcompiler
3308
+ """)
3309
+
3310
+ scparam(cfg, ['package', 'source', source, 'ref'],
3311
+ sctype='str',
3312
+ scope='global',
3313
+ shorthelp="Package data source reference",
3314
+ switch="-package_source_ref 'source <str>'",
3315
+ example=[
3316
+ "cli: -package_source_ref 'freepdk45_data 07ec4aa'",
3317
+ "api: chip.set('package', 'source', 'freepdk45_data', 'ref', '07ec4aa')"],
3318
+ schelp="""
3319
+ Package data source reference
3320
+ """)
3321
+
3322
+ return cfg
3323
+
3324
+
3325
+ ############################################
3326
+ # Design Checklist
3327
+ ############################################
3328
+ def schema_checklist(cfg):
3329
+
3330
+ item = 'default'
3331
+ standard = 'default'
3332
+ metric = 'default'
3333
+
3334
+ scparam(cfg, ['checklist', standard, item, 'description'],
3335
+ sctype='str',
3336
+ scope='global',
3337
+ shorthelp="Checklist: item description",
3338
+ switch="-checklist_description 'standard item <str>'",
3339
+ example=[
3340
+ "cli: -checklist_description 'ISO D000 A-DESCRIPTION'",
3341
+ "api: chip.set('checklist', 'ISO', 'D000', 'description', 'A-DESCRIPTION')"],
3342
+ schelp="""
3343
+ A short one line description of the checklist item.""")
3344
+
3345
+ scparam(cfg, ['checklist', standard, item, 'requirement'],
3346
+ sctype='str',
3347
+ scope='global',
3348
+ shorthelp="Checklist: item requirement",
3349
+ switch="-checklist_requirement 'standard item <str>'",
3350
+ example=[
3351
+ "cli: -checklist_requirement 'ISO D000 DOCSTRING'",
3352
+ "api: chip.set('checklist', 'ISO', 'D000', 'requirement', 'DOCSTRING')"],
3353
+ schelp="""
3354
+ A complete requirement description of the checklist item
3355
+ entered as a multi-line string.""")
3356
+
3357
+ scparam(cfg, ['checklist', standard, item, 'dataformat'],
3358
+ sctype='str',
3359
+ scope='global',
3360
+ shorthelp="Checklist: item data format",
3361
+ switch="-checklist_dataformat 'standard item <str>'",
3362
+ example=[
3363
+ "cli: -checklist_dataformat 'ISO D000 dataformat README'",
3364
+ "api: chip.set('checklist', 'ISO', 'D000', 'dataformat', 'README')"],
3365
+ schelp="""
3366
+ Free text description of the type of data files acceptable as
3367
+ checklist signoff validation.""")
3368
+
3369
+ scparam(cfg, ['checklist', standard, item, 'rationale'],
3370
+ sctype='[str]',
3371
+ scope='global',
3372
+ shorthelp="Checklist: item rational",
3373
+ switch="-checklist_rationale 'standard item <str>'",
3374
+ example=[
3375
+ "cli: -checklist_rationale 'ISO D000 reliability'",
3376
+ "api: chip.set('checklist', 'ISO', 'D000', 'rationale', 'reliability')"],
3377
+ schelp="""
3378
+ Rationale for the the checklist item. Rationale should be a
3379
+ unique alphanumeric code used by the standard or a short one line
3380
+ or single word description.""")
3381
+
3382
+ scparam(cfg, ['checklist', standard, item, 'criteria'],
3383
+ sctype='[str]',
3384
+ scope='global',
3385
+ shorthelp="Checklist: item criteria",
3386
+ switch="-checklist_criteria 'standard item <str>'",
3387
+ example=[
3388
+ "cli: -checklist_criteria 'ISO D000 errors==0'",
3389
+ "api: chip.set('checklist', 'ISO', 'D000', 'criteria', 'errors==0')"],
3390
+ schelp="""
3391
+ Simple list of signoff criteria for checklist item which
3392
+ must all be met for signoff. Each signoff criteria consists of
3393
+ a metric, a relational operator, and a value in the form.
3394
+ 'metric op value'.""")
3395
+
3396
+ scparam(cfg, ['checklist', standard, item, 'task'],
3397
+ sctype='[(str,str,str)]',
3398
+ scope='global',
3399
+ shorthelp="Checklist: item task",
3400
+ switch="-checklist_task 'standard item <(str,str,str)>'",
3401
+ example=[
3402
+ "cli: -checklist_task 'ISO D000 (job0,place,0)'",
3403
+ "api: chip.set('checklist', 'ISO', 'D000', 'task', ('job0', 'place', '0'))"],
3404
+ schelp="""
3405
+ Flowgraph job and task used to verify the checklist item.
3406
+ The parameter should be left empty for manual and for tool
3407
+ flows that bypass the SC infrastructure.""")
3408
+
3409
+ scparam(cfg, ['checklist', standard, item, 'report'],
3410
+ sctype='[file]',
3411
+ scope='global',
3412
+ shorthelp="Checklist: item report",
3413
+ switch="-checklist_report 'standard item <file>'",
3414
+ example=[
3415
+ "cli: -checklist_report 'ISO D000 my.rpt'",
3416
+ "api: chip.set('checklist', 'ISO', 'D000', 'report', 'my.rpt')"],
3417
+ schelp="""
3418
+ Filepath to report(s) of specified type documenting the successful
3419
+ validation of the checklist item.""")
3420
+
3421
+ scparam(cfg, ['checklist', standard, item, 'waiver', metric],
3422
+ sctype='[file]',
3423
+ scope='global',
3424
+ shorthelp="Checklist: item metric waivers",
3425
+ switch="-checklist_waiver 'standard item metric <file>'",
3426
+ example=[
3427
+ "cli: -checklist_waiver 'ISO D000 bold my.txt'",
3428
+ "api: chip.set('checklist', 'ISO', 'D000', 'waiver', 'hold', 'my.txt')"],
3429
+ schelp="""
3430
+ Filepath to report(s) documenting waivers for the checklist
3431
+ item specified on a per metric basis.""")
3432
+
3433
+ scparam(cfg, ['checklist', standard, item, 'ok'],
3434
+ sctype='bool',
3435
+ scope='global',
3436
+ shorthelp="Checklist: item ok",
3437
+ switch="-checklist_ok 'standard item <bool>'",
3438
+ example=[
3439
+ "cli: -checklist_ok 'ISO D000 true'",
3440
+ "api: chip.set('checklist', 'ISO', 'D000', 'ok', True)"],
3441
+ schelp="""
3442
+ Boolean check mark for the checklist item. A value of
3443
+ True indicates a human has inspected the all item dictionary
3444
+ parameters check out.""")
3445
+
3446
+ return cfg
3447
+
3448
+
3449
+ ###########################
3450
+ # ASIC Setup
3451
+ ###########################
3452
+ def schema_asic(cfg):
3453
+ '''ASIC Automated Place and Route Parameters'''
3454
+
3455
+ scparam(cfg, ['asic', 'logiclib'],
3456
+ sctype='[str]',
3457
+ scope='job',
3458
+ pernode='optional',
3459
+ shorthelp="ASIC: logic libraries",
3460
+ switch="-asic_logiclib <str>",
3461
+ example=["cli: -asic_logiclib nangate45",
3462
+ "api: chip.set('asic', 'logiclib', 'nangate45')"],
3463
+ schelp="""List of all selected logic libraries libraries
3464
+ to use for optimization for a given library architecture
3465
+ (9T, 11T, etc).""")
3466
+
3467
+ scparam(cfg, ['asic', 'macrolib'],
3468
+ sctype='[str]',
3469
+ scope='job',
3470
+ pernode='optional',
3471
+ shorthelp="ASIC: macro libraries",
3472
+ switch="-asic_macrolib <str>",
3473
+ example=["cli: -asic_macrolib sram64x1024",
3474
+ "api: chip.set('asic', 'macrolib', 'sram64x1024')"],
3475
+ schelp="""
3476
+ List of macro libraries to be linked in during synthesis and place
3477
+ and route. Macro libraries are used for resolving instances but are
3478
+ not used as targets for logic synthesis.""")
3479
+
3480
+ scparam(cfg, ['asic', 'delaymodel'],
3481
+ sctype='str',
3482
+ scope='job',
3483
+ pernode='optional',
3484
+ shorthelp="ASIC: delay model",
3485
+ switch="-asic_delaymodel <str>",
3486
+ example=["cli: -asic_delaymodel ccs",
3487
+ "api: chip.set('asic', 'delaymodel', 'ccs')"],
3488
+ schelp="""
3489
+ Delay model to use for the target libs. Supported values
3490
+ are nldm and ccs.""")
3491
+
3492
+ # TODO: Expand on the exact definitions of these types of cells.
3493
+ # minimize typing
3494
+ names = ['decap',
3495
+ 'tie',
3496
+ 'hold',
3497
+ 'clkbuf',
3498
+ 'clkgate',
3499
+ 'clklogic',
3500
+ 'dontuse',
3501
+ 'filler',
3502
+ 'tap',
3503
+ 'endcap',
3504
+ 'antenna']
3505
+
3506
+ for item in names:
3507
+ scparam(cfg, ['asic', 'cells', item],
3508
+ sctype='[str]',
3509
+ pernode='optional',
3510
+ shorthelp=f"ASIC: {item} cell list",
3511
+ switch=f"-asic_cells_{item} '<str>'",
3512
+ example=[
3513
+ f"cli: -asic_cells_{item} '*eco*'",
3514
+ f"api: chip.set('asic', 'cells', '{item}', '*eco*')"],
3515
+ schelp="""
3516
+ List of cells grouped by a property that can be accessed
3517
+ directly by the designer and tools. The example below shows how
3518
+ all cells containing the string 'eco' could be marked as dont use
3519
+ for the tool.""")
3520
+
3521
+ scparam(cfg, ['asic', 'libarch'],
3522
+ sctype='str',
3523
+ pernode='optional',
3524
+ shorthelp="ASIC: library architecture",
3525
+ switch="-asic_libarch '<str>'",
3526
+ example=[
3527
+ "cli: -asic_libarch '12track'",
3528
+ "api: chip.set('asic', 'libarch', '12track')"],
3529
+ schelp="""
3530
+ The library architecture (e.g. library height) used to build the
3531
+ design. For example a PDK with support for 9 and 12 track libraries
3532
+ might have 'libarchs' called 9t and 12t.""")
3533
+
3534
+ libarch = 'default'
3535
+ scparam(cfg, ['asic', 'site', libarch],
3536
+ sctype='[str]',
3537
+ pernode='optional',
3538
+ shorthelp="ASIC: Library sites",
3539
+ switch="-asic_site 'libarch <str>'",
3540
+ example=[
3541
+ "cli: -asic_site '12track Site_12T'",
3542
+ "api: chip.set('asic', 'site', '12track', 'Site_12T')"],
3543
+ schelp="""
3544
+ Site names for a given library architecture.""")
3545
+
3546
+ return cfg
3547
+
3548
+
3549
+ ############################################
3550
+ # Constraints
3551
+ ############################################
3552
+ def schema_constraint(cfg):
3553
+
3554
+ # TIMING
3555
+
3556
+ scenario = 'default'
3557
+
3558
+ pin = 'default'
3559
+ scparam(cfg, ['constraint', 'timing', scenario, 'voltage', pin],
3560
+ sctype='float',
3561
+ pernode='optional',
3562
+ unit='V',
3563
+ scope='job',
3564
+ shorthelp="Constraint: pin voltage level",
3565
+ switch="-constraint_timing_voltage 'scenario pin <float>'",
3566
+ example=["cli: -constraint_timing_voltage 'worst VDD 0.9'",
3567
+ "api: chip.set('constraint', 'timing', 'worst', 'voltage', 'VDD', '0.9')"],
3568
+ schelp="""Operating voltage applied to a specific pin in the scenario.""")
3569
+
3570
+ scparam(cfg, ['constraint', 'timing', scenario, 'temperature'],
3571
+ sctype='float',
3572
+ pernode='optional',
3573
+ unit='C',
3574
+ scope='job',
3575
+ shorthelp="Constraint: temperature",
3576
+ switch="-constraint_timing_temperature 'scenario <float>'",
3577
+ example=["cli: -constraint_timing_temperature 'worst 125'",
3578
+ "api: chip.set('constraint', 'timing', 'worst', 'temperature', '125')"],
3579
+ schelp="""Chip temperature applied to the scenario specified in degrees C.""")
3580
+
3581
+ scparam(cfg, ['constraint', 'timing', scenario, 'libcorner'],
3582
+ sctype='[str]',
3583
+ pernode='optional',
3584
+ scope='job',
3585
+ shorthelp="Constraint: library corner",
3586
+ switch="-constraint_timing_libcorner 'scenario <str>'",
3587
+ example=["cli: -constraint_timing_libcorner 'worst ttt'",
3588
+ "api: chip.set('constraint', 'timing', 'worst', 'libcorner', 'ttt')"],
3589
+ schelp="""List of characterization corners used to select
3590
+ timing files for all logiclibs and macrolibs.""")
3591
+
3592
+ scparam(cfg, ['constraint', 'timing', scenario, 'pexcorner'],
3593
+ sctype='str',
3594
+ pernode='optional',
3595
+ scope='job',
3596
+ shorthelp="Constraint: pex corner",
3597
+ switch="-constraint_timing_pexcorner 'scenario <str>'",
3598
+ example=["cli: -constraint_timing_pexcorner 'worst max'",
3599
+ "api: chip.set('constraint', 'timing', 'worst', 'pexcorner', 'max')"],
3600
+ schelp="""Parasitic corner applied to the scenario. The
3601
+ 'pexcorner' string must match a corner found in the pdk
3602
+ pexmodel setup.""")
3603
+
3604
+ scparam(cfg, ['constraint', 'timing', scenario, 'opcond'],
3605
+ sctype='str',
3606
+ pernode='optional',
3607
+ scope='job',
3608
+ shorthelp="Constraint: operating condition",
3609
+ switch="-constraint_timing_opcond 'scenario <str>'",
3610
+ example=["cli: -constraint_timing_opcond 'worst typical_1.0'",
3611
+ "api: chip.set('constraint', 'timing', 'worst', 'opcond', 'typical_1.0')"],
3612
+ schelp="""Operating condition applied to the scenario. The value
3613
+ can be used to access specific conditions within the library
3614
+ timing models from the 'logiclib' timing models.""")
3615
+
3616
+ scparam(cfg, ['constraint', 'timing', scenario, 'mode'],
3617
+ sctype='str',
3618
+ pernode='optional',
3619
+ scope='job',
3620
+ shorthelp="Constraint: operating mode",
3621
+ switch="-constraint_timing_mode 'scenario <str>'",
3622
+ example=["cli: -constraint_timing_mode 'worst test'",
3623
+ "api: chip.set('constraint', 'timing', 'worst', 'mode', 'test')"],
3624
+ schelp="""Operating mode for the scenario. Operating mode strings
3625
+ can be values such as test, functional, standby.""")
3626
+
3627
+ scparam(cfg, ['constraint', 'timing', scenario, 'file'],
3628
+ sctype='[file]',
3629
+ pernode='optional',
3630
+ scope='job',
3631
+ copy=True,
3632
+ shorthelp="Constraint: SDC files",
3633
+ switch="-constraint_timing_file 'scenario <file>'",
3634
+ example=[
3635
+ "cli: -constraint_timing_file 'worst hello.sdc'",
3636
+ "api: chip.set('constraint', 'timing', 'worst', 'file', 'hello.sdc')"],
3637
+ schelp="""List of timing constraint files to use for the scenario. The
3638
+ values are combined with any constraints specified by the design
3639
+ 'constraint' parameter. If no constraints are found, a default
3640
+ constraint file is used based on the clock definitions.""")
3641
+
3642
+ scparam(cfg, ['constraint', 'timing', scenario, 'check'],
3643
+ sctype='[str]',
3644
+ pernode='optional',
3645
+ scope='job',
3646
+ shorthelp="Constraint: timing checks",
3647
+ switch="-constraint_timing_check 'scenario <str>'",
3648
+ example=[
3649
+ "cli: -constraint_timing_check 'worst setup'",
3650
+ "api: chip.add('constraint', 'timing', 'worst', 'check', 'setup')"],
3651
+ schelp="""
3652
+ List of checks for to perform for the scenario. The checks must
3653
+ align with the capabilities of the EDA tools and flow being used.
3654
+ Checks generally include objectives like meeting setup and hold goals
3655
+ and minimize power. Standard check names include setup, hold, power,
3656
+ noise, reliability.""")
3657
+
3658
+ # COMPONENTS
3659
+
3660
+ inst = 'default'
3661
+
3662
+ scparam(cfg, ['constraint', 'component', inst, 'placement'],
3663
+ sctype='(float,float,float)',
3664
+ pernode='optional',
3665
+ unit='um',
3666
+ shorthelp="Constraint: Component placement",
3667
+ switch="-constraint_component_placement 'inst <(float,float,float)>'",
3668
+ example=[
3669
+ "cli: -constraint_component_placement 'i0 (2.0,3.0,0.0)'",
3670
+ "api: chip.set('constraint', 'component', 'i0', 'placement', (2.0, 3.0, 0.0))"],
3671
+ schelp="""
3672
+ Placement location of a named instance, specified as a (x, y, z) tuple of
3673
+ floats. The location refers to the placement of the center/centroid of the
3674
+ component. The 'placement' parameter is a goal/intent, not an exact specification.
3675
+ The compiler and layout system may adjust coordinates to meet competing
3676
+ goals such as manufacturing design rules and grid placement
3677
+ guidelines. The 'z' coordinate shall be set to 0 for planar systems
3678
+ with only (x, y) coordinates. Discretized systems like PCB stacks,
3679
+ package stacks, and breadboards only allow a reduced
3680
+ set of floating point values (0, 1, 2, 3). The user specifying the
3681
+ placement will need to have some understanding of the type of
3682
+ layout system the component is being placed in (ASIC, SIP, PCB) but
3683
+ should not need to know exact manufacturing specifications.""")
3684
+
3685
+ scparam(cfg, ['constraint', 'component', inst, 'partname'],
3686
+ sctype='str',
3687
+ pernode='optional',
3688
+ shorthelp="Constraint: Component part name",
3689
+ switch="-constraint_component_partname 'inst <str>'",
3690
+ example=[
3691
+ "cli: -constraint_component_partname 'i0 filler_x1'",
3692
+ "api: chip.set('constraint', 'component', 'i0', 'partname', 'filler_x1')"],
3693
+ schelp="""
3694
+ Part name of a named instance. The parameter is required for instances
3695
+ that are not contained within the design netlist (ie. physical only cells).
3696
+ """)
3697
+
3698
+ scparam(cfg, ['constraint', 'component', inst, 'halo'],
3699
+ sctype='(float,float)',
3700
+ pernode='optional',
3701
+ unit='um',
3702
+ shorthelp="Constraint: Component halo",
3703
+ switch="-constraint_component_halo 'inst <(float,float)>'",
3704
+ example=[
3705
+ "cli: -constraint_component_halo 'i0 (1,1)'",
3706
+ "api: chip.set('constraint', 'component', 'i0', 'halo', (1, 1))"],
3707
+ schelp="""
3708
+ Placement keepout halo around the named component, specified as a
3709
+ (horizontal, vertical) tuple represented in microns.
3710
+ """)
3711
+
3712
+ scparam(cfg, ['constraint', 'component', inst, 'rotation'],
3713
+ sctype='float',
3714
+ pernode='optional',
3715
+ shorthelp="Constraint: Component rotation",
3716
+ switch="-constraint_component_rotation 'inst <float>'",
3717
+ example=[
3718
+ "cli: -constraint_component_rotation 'i0 90'",
3719
+ "api: chip.set('constraint', 'component', 'i0', 'rotation', '90')"],
3720
+ schelp="""
3721
+ Placement rotation of the component specified in degrees. Rotation
3722
+ goes counter-clockwise for all parts on top and clock-wise for parts
3723
+ on the bottom. In both cases, this is from the perspective of looking
3724
+ at the top of the board. Rotation is specified in degrees. Most gridded
3725
+ layout systems (like ASICs) only allow a finite number of rotation
3726
+ values (0, 90, 180, 270).""")
3727
+
3728
+ scparam(cfg, ['constraint', 'component', inst, 'flip'],
3729
+ sctype='bool',
3730
+ pernode='optional',
3731
+ shorthelp="Constraint: Component flip option",
3732
+ switch="-constraint_component_flip 'inst <bool>'",
3733
+ example=[
3734
+ "cli: -constraint_component_flip 'i0 true'",
3735
+ "api: chip.set('constraint', 'component', 'i0', 'flip', True)"],
3736
+ schelp="""
3737
+ Boolean parameter specifying that the instanced library component should be flipped
3738
+ around the vertical axis before being placed on the substrate. The need to
3739
+ flip a component depends on the component footprint. Most dies have pads
3740
+ facing up and so must be flipped when assembled face down (eg. flip-chip,
3741
+ WCSP).""")
3742
+
3743
+ # PINS
3744
+ name = 'default'
3745
+
3746
+ scparam(cfg, ['constraint', 'pin', name, 'placement'],
3747
+ sctype='(float,float,float)',
3748
+ pernode='optional',
3749
+ unit='um',
3750
+ shorthelp="Constraint: Pin placement",
3751
+ switch="-constraint_pin_placement 'name <(float,float,float)>'",
3752
+ example=[
3753
+ "cli: -constraint_pin_placement 'nreset (2.0,3.0,0.0)'",
3754
+ "api: chip.set('constraint', 'pin', 'nreset', 'placement', (2.0, 3.0, 0.0))"],
3755
+ schelp="""
3756
+ Placement location of a named pin, specified as a (x, y, z) tuple of
3757
+ floats. The location refers to the placement of the center of the
3758
+ pin. The 'placement' parameter is a goal/intent, not an exact specification.
3759
+ The compiler and layout system may adjust sizes to meet competing
3760
+ goals such as manufacturing design rules and grid placement
3761
+ guidelines. The 'z' coordinate shall be set to 0 for planar components
3762
+ with only (x, y) coordinates. Discretized systems like 3D chips with
3763
+ pins on top and bottom may choose to discretize the top and bottom
3764
+ layer as 0, 1 or use absolute coordinates. Values are specified
3765
+ in microns.""")
3766
+
3767
+ scparam(cfg, ['constraint', 'pin', name, 'layer'],
3768
+ sctype='str',
3769
+ pernode='optional',
3770
+ shorthelp="Constraint: Pin layer",
3771
+ switch="-constraint_pin_layer 'name <str>'",
3772
+ example=[
3773
+ "cli: -constraint_pin_layer 'nreset m4'",
3774
+ "api: chip.set('constraint', 'pin', 'nreset', 'layer', 'm4')"],
3775
+ schelp="""
3776
+ Pin metal layer specified based on the SC standard layer stack
3777
+ starting with m1 as the lowest routing layer and ending
3778
+ with m<n> as the highest routing layer.""")
3779
+
3780
+ scparam(cfg, ['constraint', 'pin', name, 'side'],
3781
+ sctype='int',
3782
+ pernode='optional',
3783
+ shorthelp="Constraint: Pin side",
3784
+ switch="-constraint_pin_side 'name <int>'",
3785
+ example=[
3786
+ "cli: -constraint_pin_side 'nreset 1'",
3787
+ "api: chip.set('constraint', 'pin', 'nreset', 'side', 1)"],
3788
+ schelp="""
3789
+ Side of block where the named pin should be placed. Sides are
3790
+ enumerated as integers with '1' being the lower left side,
3791
+ with the side index incremented on right turn in a clock wise
3792
+ fashion. In case of conflict between 'lower' and 'left',
3793
+ 'left' has precedence. The side option and order option are
3794
+ orthogonal to the placement option.""")
3795
+
3796
+ scparam(cfg, ['constraint', 'pin', name, 'order'],
3797
+ sctype='int',
3798
+ pernode='optional',
3799
+ shorthelp="Constraint: Pin order",
3800
+ switch="-constraint_pin_order 'name <int>'",
3801
+ example=[
3802
+ "cli: -constraint_pin_order 'nreset 1'",
3803
+ "api: chip.set('constraint', 'pin', 'nreset', 'order', 1)"],
3804
+ schelp="""
3805
+ The relative position of the named pin in a vector of pins
3806
+ on the side specified by the 'side' option. Pin order counting
3807
+ is done clockwise. If multiple pins on the same side have the
3808
+ same order number, the actual order is at the discretion of the
3809
+ tool.""")
3810
+
3811
+ # NETS
3812
+ scparam(cfg, ['constraint', 'net', name, 'maxlength'],
3813
+ sctype='float',
3814
+ pernode='optional',
3815
+ unit='um',
3816
+ shorthelp="Constraint: Net max length",
3817
+ switch="-constraint_net_maxlength 'name <float>'",
3818
+ example=[
3819
+ "cli: -constraint_net_maxlength 'nreset 1000'",
3820
+ "api: chip.set('constraint', 'net', 'nreset', 'maxlength', '1000')"],
3821
+ schelp="""
3822
+ Maximum total length of a net, specified in microns.
3823
+ Wildcards ('*') can be used for net names.""")
3824
+
3825
+ scparam(cfg, ['constraint', 'net', name, 'maxresistance'],
3826
+ sctype='float',
3827
+ pernode='optional',
3828
+ unit='ohm',
3829
+ shorthelp="Constraint: Net max resistance",
3830
+ switch="-constraint_net_maxresistance 'name <float>'",
3831
+ example=[
3832
+ "cli: -constraint_net_maxresistance 'nreset 1'",
3833
+ "api: chip.set('constraint', 'net', 'nreset', 'maxresistance', '1')"],
3834
+ schelp="""
3835
+ Maximum resistance of named net between driver and receiver
3836
+ specified in ohms. Wildcards ('*') can be used for net names.""")
3837
+
3838
+ scparam(cfg, ['constraint', 'net', name, 'ndr'],
3839
+ sctype='(float,float)',
3840
+ pernode='optional',
3841
+ unit='um',
3842
+ shorthelp="Constraint: Net routing rule",
3843
+ switch="-constraint_net_ndr 'name <(float,float)>'",
3844
+ example=[
3845
+ "cli: -constraint_net_ndr 'nreset (0.4,0.4)'",
3846
+ "api: chip.set('constraint', 'net', 'nreset', 'ndr', (0.4, 0.4))"],
3847
+ schelp="""
3848
+ Definitions of non-default routing rule specified on a per
3849
+ net basis. Constraints are entered as a (width, space) tuples
3850
+ specified in microns. Wildcards ('*') can be used
3851
+ for net names.""")
3852
+
3853
+ scparam(cfg, ['constraint', 'net', name, 'minlayer'],
3854
+ sctype='str',
3855
+ pernode='optional',
3856
+ shorthelp="Constraint: Net minimum routing layer",
3857
+ switch="-constraint_net_minlayer 'name <str>'",
3858
+ example=[
3859
+ "cli: -constraint_net_minlayer 'nreset m1'",
3860
+ "api: chip.set('constraint', 'net', 'nreset', 'minlayer', 'm1')"],
3861
+ schelp="""
3862
+ Minimum metal layer to be used for automated place and route
3863
+ specified on a per net basis. Metal names should either be the PDK
3864
+ specific metal stack name or an integer with '1' being the lowest
3865
+ routing layer. Wildcards ('*') can be used for net names.""")
3866
+
3867
+ scparam(cfg, ['constraint', 'net', name, 'maxlayer'],
3868
+ sctype='str',
3869
+ pernode='optional',
3870
+ shorthelp="Constraint: Net maximum routing layer",
3871
+ switch="-constraint_net_maxlayer 'name <str>'",
3872
+ example=[
3873
+ "cli: -constraint_net_maxlayer 'nreset m1'",
3874
+ "api: chip.set('constraint', 'net', 'nreset', 'maxlayer', 'm1')"],
3875
+ schelp="""
3876
+ Maximum metal layer to be used for automated place and route
3877
+ specified on a per net basis. Metal names should either be the PDK
3878
+ specific metal stack name or an integer with '1' being the lowest
3879
+ routing layer. Wildcards ('*') can be used for net names.""")
3880
+
3881
+ scparam(cfg, ['constraint', 'net', name, 'shield'],
3882
+ sctype='str',
3883
+ pernode='optional',
3884
+ shorthelp="Constraint: Net shielding",
3885
+ switch="-constraint_net_shield 'name <str>'",
3886
+ example=[
3887
+ "cli: -constraint_net_shield 'clk vss'",
3888
+ "api: chip.set('constraint', 'net', 'clk', 'shield', 'vss')"],
3889
+ schelp="""
3890
+ Specifies that the named net should be shielded by the given
3891
+ signal on both sides of the net.""")
3892
+
3893
+ scparam(cfg, ['constraint', 'net', name, 'match'],
3894
+ sctype='[str]',
3895
+ pernode='optional',
3896
+ shorthelp="Constraint: Net matched routing",
3897
+ switch="-constraint_net_match 'name <str>'",
3898
+ example=[
3899
+ "cli: -constraint_net_match 'clk1 clk2'",
3900
+ "api: chip.set('constraint', 'net', 'clk1', 'match', 'clk2')"],
3901
+ schelp="""
3902
+ List of nets whose routing should closely matched the named
3903
+ net in terms of length, layer, width, etc. Wildcards ('*') can
3904
+ be used for net names.""")
3905
+
3906
+ scparam(cfg, ['constraint', 'net', name, 'diffpair'],
3907
+ sctype='str',
3908
+ pernode='optional',
3909
+ shorthelp="Constraint: Net diffpair",
3910
+ switch="-constraint_net_diffpair 'name <str>'",
3911
+ example=[
3912
+ "cli: -constraint_net_diffpair 'clkn clkp'",
3913
+ "api: chip.set('constraint', 'net', 'clkn', 'diffpair', 'clkp')"],
3914
+ schelp="""
3915
+ Differential pair signal of the named net (only used for actual
3916
+ differential pairs).""")
3917
+
3918
+ scparam(cfg, ['constraint', 'net', name, 'sympair'],
3919
+ sctype='str',
3920
+ pernode='optional',
3921
+ shorthelp="Constraint: Net sympair",
3922
+ switch="-constraint_net_sympair 'name <str>'",
3923
+ example=[
3924
+ "cli: -constraint_net_sympair 'netA netB'",
3925
+ "api: chip.set('constraint', 'net', 'netA', 'sympair', 'netB')"],
3926
+ schelp="""
3927
+ Symmetrical pair signal to the named net. The two nets should be routed
3928
+ as reflections around the vertical or horizontal axis to minimize on-chip
3929
+ variability.""")
3930
+
3931
+ # AREA
3932
+ scparam(cfg, ['constraint', 'outline'],
3933
+ sctype='[(float,float)]',
3934
+ pernode='optional',
3935
+ unit='um',
3936
+ scope='job',
3937
+ shorthelp="Constraint: Layout outline",
3938
+ switch="-constraint_outline <(float,float)>",
3939
+ example=["cli: -constraint_outline '(0,0)'",
3940
+ "api: chip.set('constraint', 'outline', (0, 0))"],
3941
+ schelp="""
3942
+ List of (x, y) points that define the outline physical layout
3943
+ physical design. Simple rectangle areas can be defined with two points,
3944
+ one for the lower left corner and one for the upper right corner. All
3945
+ values are specified in microns.""")
3946
+
3947
+ scparam(cfg, ['constraint', 'corearea'],
3948
+ sctype='[(float,float)]',
3949
+ pernode='optional',
3950
+ unit='um',
3951
+ scope='job',
3952
+ shorthelp="Constraint: Layout core area",
3953
+ switch="-constraint_corearea <(float,float)>",
3954
+ example=["cli: -constraint_corearea '(0,0)'",
3955
+ "api: chip.set('constraint', 'corearea', (0, 0))"],
3956
+ schelp="""
3957
+ List of (x, y) points that define the outline of the core area for the
3958
+ physical design. Simple rectangle areas can be defined with two points,
3959
+ one for the lower left corner and one for the upper right corner. All
3960
+ values are specified in microns.""")
3961
+
3962
+ scparam(cfg, ['constraint', 'coremargin'],
3963
+ sctype='float',
3964
+ pernode='optional',
3965
+ unit='um',
3966
+ scope='job',
3967
+ shorthelp="Constraint: Layout core margin",
3968
+ switch="-constraint_coremargin <float>",
3969
+ example=["cli: -constraint_coremargin 1",
3970
+ "api: chip.set('constraint', 'coremargin', '1')"],
3971
+ schelp="""
3972
+ Halo/margin between the outline and core area for fully
3973
+ automated layout sizing and floorplanning, specified in
3974
+ microns.""")
3975
+
3976
+ scparam(cfg, ['constraint', 'density'],
3977
+ sctype='float',
3978
+ pernode='optional',
3979
+ scope='job',
3980
+ shorthelp="Constraint: Layout density",
3981
+ switch="-constraint_density <float>",
3982
+ example=["cli: -constraint_density 30",
3983
+ "api: chip.set('constraint', 'density', '30')"],
3984
+ schelp="""
3985
+ Target density based on the total design cells area reported
3986
+ after synthesis/elaboration. This number is used when no outline
3987
+ or floorplan is supplied. Any number between 1 and 100 is legal,
3988
+ but values above 50 may fail due to area/congestion issues during
3989
+ automated place and route.""")
3990
+
3991
+ scparam(cfg, ['constraint', 'aspectratio'],
3992
+ sctype='float',
3993
+ pernode='optional',
3994
+ defvalue='1.0',
3995
+ scope='job',
3996
+ shorthelp="Constraint: Layout aspect ratio",
3997
+ switch="-constraint_aspectratio <float>",
3998
+ example=["cli: -constraint_aspectratio 2.0",
3999
+ "api: chip.set('constraint', 'aspectratio', '2.0')"],
4000
+ schelp="""
4001
+ Height to width ratio of the block for automated floorplanning.
4002
+ Values below 0.1 and above 10 should be avoided as they will likely fail
4003
+ to converge during placement and routing. The ideal aspect ratio for
4004
+ most designs is 1. This value is only used when no diearea or floorplan
4005
+ is supplied.""")
4006
+
4007
+ return cfg
4008
+
4009
+
4010
+ ##############################################################################
4011
+ # Main routine
4012
+ if __name__ == "__main__":
4013
+ cfg = schema_cfg()
4014
+ print(json.dumps(cfg, indent=4, sort_keys=True))