siliconcompiler 0.28.9__py3-none-any.whl → 0.29.1__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.
- siliconcompiler/_metadata.py +1 -1
- siliconcompiler/apps/__init__.py +26 -0
- siliconcompiler/apps/sc_remote.py +15 -14
- siliconcompiler/apps/sc_show.py +5 -5
- siliconcompiler/apps/utils/replay.py +194 -0
- siliconcompiler/checklists/__init__.py +12 -0
- siliconcompiler/core.py +89 -22
- siliconcompiler/flows/__init__.py +34 -0
- siliconcompiler/flows/_common.py +11 -13
- siliconcompiler/flows/asicflow.py +83 -42
- siliconcompiler/flows/showflow.py +1 -1
- siliconcompiler/libs/__init__.py +5 -0
- siliconcompiler/optimizer/__init__.py +199 -0
- siliconcompiler/optimizer/vizier.py +259 -0
- siliconcompiler/pdks/__init__.py +5 -0
- siliconcompiler/remote/__init__.py +11 -0
- siliconcompiler/remote/client.py +753 -815
- siliconcompiler/report/report.py +2 -0
- siliconcompiler/report/summary_table.py +1 -1
- siliconcompiler/scheduler/__init__.py +118 -58
- siliconcompiler/scheduler/send_messages.py +1 -1
- siliconcompiler/schema/schema_cfg.py +16 -4
- siliconcompiler/schema/schema_obj.py +29 -10
- siliconcompiler/schema/utils.py +2 -0
- siliconcompiler/sphinx_ext/__init__.py +85 -0
- siliconcompiler/sphinx_ext/dynamicgen.py +19 -34
- siliconcompiler/sphinx_ext/schemagen.py +3 -2
- siliconcompiler/targets/__init__.py +26 -0
- siliconcompiler/targets/gf180_demo.py +3 -3
- siliconcompiler/templates/replay/replay.py.j2 +62 -0
- siliconcompiler/templates/replay/requirements.txt +7 -0
- siliconcompiler/templates/replay/setup.sh +130 -0
- siliconcompiler/tools/__init__.py +60 -0
- siliconcompiler/tools/_common/__init__.py +15 -1
- siliconcompiler/tools/_common/asic.py +17 -9
- siliconcompiler/tools/builtin/concatenate.py +1 -1
- siliconcompiler/tools/ghdl/ghdl.py +1 -2
- siliconcompiler/tools/klayout/convert_drc_db.py +1 -1
- siliconcompiler/tools/klayout/drc.py +1 -1
- siliconcompiler/tools/klayout/export.py +8 -1
- siliconcompiler/tools/klayout/klayout.py +2 -2
- siliconcompiler/tools/klayout/klayout_convert_drc_db.py +2 -2
- siliconcompiler/tools/klayout/klayout_export.py +7 -5
- siliconcompiler/tools/klayout/klayout_operations.py +4 -3
- siliconcompiler/tools/klayout/klayout_show.py +3 -2
- siliconcompiler/tools/klayout/klayout_utils.py +1 -1
- siliconcompiler/tools/klayout/operations.py +8 -0
- siliconcompiler/tools/klayout/screenshot.py +6 -1
- siliconcompiler/tools/klayout/show.py +8 -1
- siliconcompiler/tools/magic/magic.py +1 -1
- siliconcompiler/tools/openroad/__init__.py +103 -0
- siliconcompiler/tools/openroad/{openroad.py → _apr.py} +415 -423
- siliconcompiler/tools/openroad/antenna_repair.py +78 -0
- siliconcompiler/tools/openroad/clock_tree_synthesis.py +64 -0
- siliconcompiler/tools/openroad/detailed_placement.py +59 -0
- siliconcompiler/tools/openroad/detailed_route.py +62 -0
- siliconcompiler/tools/openroad/endcap_tapcell_insertion.py +52 -0
- siliconcompiler/tools/openroad/fillercell_insertion.py +58 -0
- siliconcompiler/tools/openroad/{dfm.py → fillmetal_insertion.py} +35 -19
- siliconcompiler/tools/openroad/global_placement.py +58 -0
- siliconcompiler/tools/openroad/global_route.py +63 -0
- siliconcompiler/tools/openroad/init_floorplan.py +103 -0
- siliconcompiler/tools/openroad/macro_placement.py +65 -0
- siliconcompiler/tools/openroad/metrics.py +23 -8
- siliconcompiler/tools/openroad/pin_placement.py +56 -0
- siliconcompiler/tools/openroad/power_grid.py +65 -0
- siliconcompiler/tools/openroad/rcx_bench.py +7 -4
- siliconcompiler/tools/openroad/rcx_extract.py +2 -1
- siliconcompiler/tools/openroad/rdlroute.py +4 -4
- siliconcompiler/tools/openroad/repair_design.py +59 -0
- siliconcompiler/tools/openroad/repair_timing.py +63 -0
- siliconcompiler/tools/openroad/screenshot.py +9 -20
- siliconcompiler/tools/openroad/scripts/apr/postamble.tcl +44 -0
- siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +95 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_antenna_repair.tcl +51 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_clock_tree_synthesis.tcl +66 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_detailed_placement.tcl +41 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_detailed_route.tcl +71 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_endcap_tapcell_insertion.tcl +55 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_fillercell_insertion.tcl +27 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_fillmetal_insertion.tcl +36 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_global_placement.tcl +26 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_global_route.tcl +61 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +333 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_macro_placement.tcl +123 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_metrics.tcl +22 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_pin_placement.tcl +41 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_power_grid.tcl +60 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_repair_design.tcl +68 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_repair_timing.tcl +83 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_write_data.tcl +125 -0
- siliconcompiler/tools/openroad/scripts/common/debugging.tcl +28 -0
- siliconcompiler/tools/openroad/scripts/common/procs.tcl +727 -0
- siliconcompiler/tools/openroad/scripts/common/read_input_files.tcl +59 -0
- siliconcompiler/tools/openroad/scripts/common/read_liberty.tcl +20 -0
- siliconcompiler/tools/openroad/scripts/common/read_timing_constraints.tcl +16 -0
- siliconcompiler/tools/openroad/scripts/common/reports.tcl +180 -0
- siliconcompiler/tools/openroad/scripts/common/screenshot.tcl +18 -0
- siliconcompiler/tools/openroad/scripts/common/write_images.tcl +395 -0
- siliconcompiler/tools/openroad/scripts/{sc_rcx_bench.tcl → rcx/sc_rcx_bench.tcl} +5 -5
- siliconcompiler/tools/openroad/scripts/{sc_rcx_extract.tcl → rcx/sc_rcx_extract.tcl} +0 -0
- siliconcompiler/tools/openroad/scripts/sc_rcx.tcl +5 -16
- siliconcompiler/tools/openroad/scripts/sc_rdlroute.tcl +51 -51
- siliconcompiler/tools/openroad/scripts/sc_show.tcl +110 -0
- siliconcompiler/tools/openroad/show.py +28 -23
- siliconcompiler/tools/openroad/{export.py → write_data.py} +31 -26
- siliconcompiler/tools/opensta/__init__.py +2 -2
- siliconcompiler/tools/opensta/check_library.py +27 -0
- siliconcompiler/tools/opensta/scripts/sc_check_library.tcl +255 -0
- siliconcompiler/tools/opensta/scripts/sc_timing.tcl +1 -1
- siliconcompiler/tools/sv2v/sv2v.py +1 -2
- siliconcompiler/tools/verilator/verilator.py +6 -7
- siliconcompiler/tools/vivado/vivado.py +1 -1
- siliconcompiler/tools/yosys/__init__.py +149 -0
- siliconcompiler/tools/yosys/lec.py +22 -9
- siliconcompiler/tools/yosys/sc_lec.tcl +94 -49
- siliconcompiler/tools/yosys/sc_syn.tcl +1 -0
- siliconcompiler/tools/yosys/screenshot.py +2 -2
- siliconcompiler/tools/yosys/syn_asic.py +105 -74
- siliconcompiler/tools/yosys/syn_asic.tcl +58 -12
- siliconcompiler/tools/yosys/syn_fpga.py +2 -3
- siliconcompiler/tools/yosys/syn_fpga.tcl +26 -19
- siliconcompiler/toolscripts/_tools.json +5 -5
- siliconcompiler/utils/__init__.py +7 -3
- {siliconcompiler-0.28.9.dist-info → siliconcompiler-0.29.1.dist-info}/METADATA +22 -17
- {siliconcompiler-0.28.9.dist-info → siliconcompiler-0.29.1.dist-info}/RECORD +131 -114
- {siliconcompiler-0.28.9.dist-info → siliconcompiler-0.29.1.dist-info}/WHEEL +1 -1
- {siliconcompiler-0.28.9.dist-info → siliconcompiler-0.29.1.dist-info}/entry_points.txt +13 -0
- siliconcompiler/libs/asap7sc7p5t.py +0 -8
- siliconcompiler/libs/gf180mcu.py +0 -8
- siliconcompiler/libs/interposer.py +0 -8
- siliconcompiler/libs/nangate45.py +0 -8
- siliconcompiler/libs/sg13g2_stdcell.py +0 -8
- siliconcompiler/libs/sky130hd.py +0 -8
- siliconcompiler/libs/sky130io.py +0 -8
- siliconcompiler/pdks/asap7.py +0 -8
- siliconcompiler/pdks/freepdk45.py +0 -8
- siliconcompiler/pdks/gf180.py +0 -8
- siliconcompiler/pdks/ihp130.py +0 -8
- siliconcompiler/pdks/interposer.py +0 -8
- siliconcompiler/pdks/skywater130.py +0 -8
- siliconcompiler/tools/openroad/cts.py +0 -45
- siliconcompiler/tools/openroad/floorplan.py +0 -75
- siliconcompiler/tools/openroad/physyn.py +0 -27
- siliconcompiler/tools/openroad/place.py +0 -41
- siliconcompiler/tools/openroad/route.py +0 -45
- siliconcompiler/tools/openroad/scripts/__init__.py +0 -0
- siliconcompiler/tools/openroad/scripts/sc_apr.tcl +0 -514
- siliconcompiler/tools/openroad/scripts/sc_cts.tcl +0 -68
- siliconcompiler/tools/openroad/scripts/sc_dfm.tcl +0 -22
- siliconcompiler/tools/openroad/scripts/sc_export.tcl +0 -100
- siliconcompiler/tools/openroad/scripts/sc_floorplan.tcl +0 -456
- siliconcompiler/tools/openroad/scripts/sc_metrics.tcl +0 -1
- siliconcompiler/tools/openroad/scripts/sc_physyn.tcl +0 -6
- siliconcompiler/tools/openroad/scripts/sc_place.tcl +0 -84
- siliconcompiler/tools/openroad/scripts/sc_procs.tcl +0 -494
- siliconcompiler/tools/openroad/scripts/sc_report.tcl +0 -189
- siliconcompiler/tools/openroad/scripts/sc_route.tcl +0 -143
- siliconcompiler/tools/openroad/scripts/sc_screenshot.tcl +0 -18
- siliconcompiler/tools/openroad/scripts/sc_write_images.tcl +0 -393
- siliconcompiler/tools/yosys/yosys.py +0 -148
- /siliconcompiler/tools/openroad/scripts/{sc_write.tcl → common/write_data.tcl} +0 -0
- {siliconcompiler-0.28.9.dist-info → siliconcompiler-0.29.1.dist-info}/LICENSE +0 -0
- {siliconcompiler-0.28.9.dist-info → siliconcompiler-0.29.1.dist-info}/top_level.txt +0 -0
|
@@ -9,6 +9,7 @@ from sphinx.util.docutils import SphinxDirective
|
|
|
9
9
|
from sphinx.domains.std import StandardDomain
|
|
10
10
|
from sphinx.addnodes import pending_xref
|
|
11
11
|
import docutils
|
|
12
|
+
from siliconcompiler.utils import get_plugins
|
|
12
13
|
|
|
13
14
|
import importlib
|
|
14
15
|
import pkgutil
|
|
@@ -16,6 +17,7 @@ import os
|
|
|
16
17
|
import subprocess
|
|
17
18
|
|
|
18
19
|
import siliconcompiler
|
|
20
|
+
from siliconcompiler.sphinx_ext import sc_root as SC_ROOT
|
|
19
21
|
from siliconcompiler.schema import Schema, utils
|
|
20
22
|
from siliconcompiler.sphinx_ext.utils import (
|
|
21
23
|
strong,
|
|
@@ -36,9 +38,6 @@ from siliconcompiler.sphinx_ext.utils import (
|
|
|
36
38
|
# Helpers
|
|
37
39
|
#############
|
|
38
40
|
|
|
39
|
-
# We need this in a few places, so just make it global
|
|
40
|
-
SC_ROOT = os.path.abspath(f'{__file__}/../../../')
|
|
41
|
-
|
|
42
41
|
|
|
43
42
|
def build_schema_value_table(cfg, refdoc, keypath_prefix=None, skip_zero_weight=False):
|
|
44
43
|
'''Helper function for displaying values set in schema as a docutils table.'''
|
|
@@ -193,6 +192,7 @@ class DynamicGen(SphinxDirective):
|
|
|
193
192
|
# Then use setup doc string
|
|
194
193
|
self.generate_documentation_from_object(setup, path, s)
|
|
195
194
|
|
|
195
|
+
chips = None
|
|
196
196
|
try:
|
|
197
197
|
chips = self.configure_chip_for_docs(module)
|
|
198
198
|
except Exception as e:
|
|
@@ -250,22 +250,14 @@ class DynamicGen(SphinxDirective):
|
|
|
250
250
|
|
|
251
251
|
This function explicitly searches builtins.
|
|
252
252
|
'''
|
|
253
|
-
builtins_dir = f'{SC_ROOT}/siliconcompiler/{self.PATH}'
|
|
254
|
-
if 'nobuiltins' not in self.options:
|
|
255
|
-
modules = self.get_modules_in_dir(builtins_dir)
|
|
256
|
-
else:
|
|
257
|
-
modules = []
|
|
258
253
|
|
|
259
|
-
|
|
260
|
-
for
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
if builtins_dir == scpath:
|
|
267
|
-
continue
|
|
268
|
-
modules.extend(self.get_modules_in_dir(scpath))
|
|
254
|
+
modules = []
|
|
255
|
+
for plugin in get_plugins("docs", name=self.PATH):
|
|
256
|
+
for mod in plugin():
|
|
257
|
+
if isinstance(mod, str):
|
|
258
|
+
modules.extend(self.get_modules_in_dir(mod))
|
|
259
|
+
else:
|
|
260
|
+
modules.append(mod)
|
|
269
261
|
|
|
270
262
|
return modules
|
|
271
263
|
|
|
@@ -320,15 +312,15 @@ class DynamicGen(SphinxDirective):
|
|
|
320
312
|
else:
|
|
321
313
|
return False
|
|
322
314
|
|
|
323
|
-
|
|
315
|
+
src_link = None
|
|
316
|
+
for docs_link in get_plugins("docs", name="linkcode"):
|
|
317
|
+
src_link = docs_link(file=path)
|
|
318
|
+
if src_link:
|
|
319
|
+
break
|
|
324
320
|
|
|
325
|
-
if
|
|
326
|
-
relpath = path[len(SC_ROOT) + 1:]
|
|
327
|
-
gh_root = 'https://github.com/siliconcompiler/siliconcompiler/blob/main'
|
|
328
|
-
gh_link = f'{gh_root}/{relpath}'
|
|
329
|
-
filename = os.path.basename(relpath)
|
|
321
|
+
if src_link:
|
|
330
322
|
p = para('Setup file: ')
|
|
331
|
-
p += link(
|
|
323
|
+
p += link(src_link, text=os.path.basename(path))
|
|
332
324
|
s += p
|
|
333
325
|
|
|
334
326
|
return True
|
|
@@ -477,7 +469,6 @@ class DynamicGen(SphinxDirective):
|
|
|
477
469
|
class FlowGen(DynamicGen):
|
|
478
470
|
PATH = 'flows'
|
|
479
471
|
REF_PREFIX = 'flows'
|
|
480
|
-
SEARCH_ENV = "SC_DOCS_FLOWS"
|
|
481
472
|
|
|
482
473
|
def extra_content(self, chip, modname):
|
|
483
474
|
flow_path = os.path.join(self.env.app.outdir, f'_images/gen/{modname}.svg')
|
|
@@ -524,7 +515,6 @@ class FlowGen(DynamicGen):
|
|
|
524
515
|
class PDKGen(DynamicGen):
|
|
525
516
|
PATH = 'pdks'
|
|
526
517
|
REF_PREFIX = 'pdks'
|
|
527
|
-
SEARCH_ENV = "SC_DOCS_PDKS"
|
|
528
518
|
|
|
529
519
|
def display_config(self, chip, modname):
|
|
530
520
|
'''Display parameters under `pdk`, `asic`, and `library` in nested form.'''
|
|
@@ -549,7 +539,6 @@ class PDKGen(DynamicGen):
|
|
|
549
539
|
class LibGen(DynamicGen):
|
|
550
540
|
PATH = 'libs'
|
|
551
541
|
REF_PREFIX = 'libs'
|
|
552
|
-
SEARCH_ENV = "SC_DOCS_LIBS"
|
|
553
542
|
|
|
554
543
|
def extra_content(self, chip, modname):
|
|
555
544
|
# assume same pdk for all libraries configured by this module
|
|
@@ -592,7 +581,6 @@ class LibGen(DynamicGen):
|
|
|
592
581
|
class ToolGen(DynamicGen):
|
|
593
582
|
PATH = 'tools'
|
|
594
583
|
REF_PREFIX = 'tools'
|
|
595
|
-
SEARCH_ENV = "SC_DOCS_TOOLS"
|
|
596
584
|
|
|
597
585
|
def make_chip(self):
|
|
598
586
|
chip = super().make_chip()
|
|
@@ -753,8 +741,8 @@ class ToolGen(DynamicGen):
|
|
|
753
741
|
path = os.path.abspath(path)
|
|
754
742
|
module_dir = os.path.dirname(path)
|
|
755
743
|
for taskfile in os.listdir(module_dir):
|
|
756
|
-
if taskfile
|
|
757
|
-
# skip
|
|
744
|
+
if taskfile.startswith("_"):
|
|
745
|
+
# skip private file
|
|
758
746
|
continue
|
|
759
747
|
|
|
760
748
|
task_path = os.path.join(module_dir, taskfile)
|
|
@@ -809,7 +797,6 @@ class ToolGen(DynamicGen):
|
|
|
809
797
|
class TargetGen(DynamicGen):
|
|
810
798
|
PATH = 'targets'
|
|
811
799
|
REF_PREFIX = 'targets'
|
|
812
|
-
SEARCH_ENV = "SC_DOCS_TARGETS"
|
|
813
800
|
|
|
814
801
|
def build_module_list(self, chip, header, modtype, targetname, *refprefix):
|
|
815
802
|
modules = chip._loaded_modules[modtype]
|
|
@@ -877,7 +864,6 @@ class TargetGen(DynamicGen):
|
|
|
877
864
|
class AppGen(DynamicGen):
|
|
878
865
|
PATH = 'apps'
|
|
879
866
|
REF_PREFIX = 'apps'
|
|
880
|
-
SEARCH_ENV = "SC_DOCS_APPS"
|
|
881
867
|
|
|
882
868
|
def document_module(self, module, modname, path):
|
|
883
869
|
if modname[0] == "_":
|
|
@@ -897,7 +883,6 @@ class AppGen(DynamicGen):
|
|
|
897
883
|
class ChecklistGen(DynamicGen):
|
|
898
884
|
PATH = 'checklists'
|
|
899
885
|
REF_PREFIX = 'checklists'
|
|
900
|
-
SEARCH_ENV = "SC_DOCS_CHECKLISTS"
|
|
901
886
|
|
|
902
887
|
def display_config(self, chip, modname):
|
|
903
888
|
'''Display parameters under in nested form.'''
|
|
@@ -16,14 +16,15 @@ from siliconcompiler.sphinx_ext.utils import (
|
|
|
16
16
|
build_list
|
|
17
17
|
)
|
|
18
18
|
from siliconcompiler.schema import utils
|
|
19
|
+
from siliconcompiler.sphinx_ext import sc_root as SC_ROOT
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
# Main Sphinx plugin
|
|
22
23
|
class SchemaGen(SphinxDirective):
|
|
23
24
|
|
|
24
25
|
def run(self):
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
self.env.note_dependency(
|
|
27
|
+
os.path.join(SC_ROOT, 'siliconcompiler', 'schema', 'schema_cfg.py'))
|
|
27
28
|
self.env.note_dependency(__file__)
|
|
28
29
|
self.env.note_dependency(utils.__file__)
|
|
29
30
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from siliconcompiler.targets import asap7_demo
|
|
2
|
+
from siliconcompiler.targets import asic_demo
|
|
3
|
+
from siliconcompiler.targets import fpgaflow_demo
|
|
4
|
+
from siliconcompiler.targets import freepdk45_demo
|
|
5
|
+
from siliconcompiler.targets import gf180_demo
|
|
6
|
+
from siliconcompiler.targets import ihp130_demo
|
|
7
|
+
from siliconcompiler.targets import interposer_demo
|
|
8
|
+
from siliconcompiler.targets import skywater130_demo
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def get_targets():
|
|
12
|
+
'''
|
|
13
|
+
Returns a dict of builtin targets
|
|
14
|
+
'''
|
|
15
|
+
return {
|
|
16
|
+
module.__name__.split(".")[-1]: module for module in (
|
|
17
|
+
asap7_demo,
|
|
18
|
+
asic_demo,
|
|
19
|
+
fpgaflow_demo,
|
|
20
|
+
freepdk45_demo,
|
|
21
|
+
gf180_demo,
|
|
22
|
+
ihp130_demo,
|
|
23
|
+
interposer_demo,
|
|
24
|
+
skywater130_demo
|
|
25
|
+
)
|
|
26
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import siliconcompiler
|
|
2
2
|
from siliconcompiler.flows import asicflow, asictopflow, signoffflow, synflow
|
|
3
3
|
from siliconcompiler.checklists import oh_tapeout
|
|
4
|
-
from siliconcompiler.tools
|
|
4
|
+
from siliconcompiler.tools import openroad
|
|
5
5
|
from siliconcompiler.tools._common import get_tool_tasks
|
|
6
6
|
|
|
7
7
|
from lambdapdk import gf180
|
|
@@ -66,8 +66,8 @@ def setup(chip, syn_np=1, floorplan_np=1, physyn_np=1, place_np=1, cts_np=1, rou
|
|
|
66
66
|
|
|
67
67
|
# PSM gets stuck in a loop, must be disabled for now on gf180
|
|
68
68
|
for task in get_tool_tasks(chip, openroad):
|
|
69
|
-
chip.set('tool', 'openroad', 'task', task, 'var', 'psm_enable',
|
|
70
|
-
chip.set('tool', 'openroad', 'task', 'route', 'var', 'ant_check',
|
|
69
|
+
chip.set('tool', 'openroad', 'task', task, 'var', 'psm_enable', False)
|
|
70
|
+
chip.set('tool', 'openroad', 'task', 'route', 'var', 'ant_check', False)
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
#########################
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# SiliconCompiler Replay
|
|
3
|
+
# Design: {{ design }}
|
|
4
|
+
# Jobname: {{ jobname }}
|
|
5
|
+
# Date: {{ date }}
|
|
6
|
+
|
|
7
|
+
import base64
|
|
8
|
+
import os.path
|
|
9
|
+
import tarfile
|
|
10
|
+
import sys
|
|
11
|
+
|
|
12
|
+
from io import BytesIO
|
|
13
|
+
|
|
14
|
+
from siliconcompiler import Chip
|
|
15
|
+
|
|
16
|
+
# Input files as a tarball encoded as base64
|
|
17
|
+
INPUT_FILES = \{% for line in src_file %}
|
|
18
|
+
"{{ line }}"{% if not loop.last %} \{% endif %}{% endfor %}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
if __name__ == "__main__":
|
|
22
|
+
chip = Chip("{{ design }}")
|
|
23
|
+
chip.read_manifest(os.path.join(os.path.dirname(__file__), "sc_manifest.json"))
|
|
24
|
+
|
|
25
|
+
args = chip.create_cmdline(
|
|
26
|
+
progname="{{ design }}",
|
|
27
|
+
description="Replay script for {{ design }} / {{ jobname }}",
|
|
28
|
+
switchlist=[
|
|
29
|
+
"-builddir",
|
|
30
|
+
"-cachedir",
|
|
31
|
+
"-jobname",
|
|
32
|
+
"-to",
|
|
33
|
+
"-from",
|
|
34
|
+
"-novercheck",
|
|
35
|
+
"-continue"
|
|
36
|
+
],
|
|
37
|
+
additional_args={
|
|
38
|
+
"-check_files": {
|
|
39
|
+
"action": "store_true",
|
|
40
|
+
"help": "Do not run, just check files"
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
# Extract input files
|
|
45
|
+
with BytesIO(base64.b64decode(INPUT_FILES.encode())) as fd:
|
|
46
|
+
with tarfile.open(fileobj=fd, mode='r:gz') as tar:
|
|
47
|
+
tar.extractall(path=chip._getcollectdir())
|
|
48
|
+
|
|
49
|
+
# Set tool versions{% for node, tool, version in tool_versions %}
|
|
50
|
+
chip.set("tool", "{{ tool }}", "version", "=={{ version }}", step="{{ node[0] }}", index="{{ node[1] }}"){% endfor %}
|
|
51
|
+
|
|
52
|
+
if args["check_files"]:
|
|
53
|
+
if chip.check_filepaths():
|
|
54
|
+
sys.exit(0)
|
|
55
|
+
else:
|
|
56
|
+
sys.exit(1)
|
|
57
|
+
|
|
58
|
+
# Run
|
|
59
|
+
chip.run()
|
|
60
|
+
|
|
61
|
+
# Report summary
|
|
62
|
+
chip.summary()
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# SiliconCompiler Replay Setup
|
|
3
|
+
# Design: {{ design }}
|
|
4
|
+
# Jobname: {{ jobname }}
|
|
5
|
+
# Date: {{ date }}
|
|
6
|
+
|
|
7
|
+
if ! [ "${BASH_SOURCE[0]}" -ef "$0" ];
|
|
8
|
+
then
|
|
9
|
+
echo "${BASH_SOURCE[0]} must be executed"
|
|
10
|
+
return 1
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
_help() {
|
|
14
|
+
cat <<EOF
|
|
15
|
+
{{ description }}
|
|
16
|
+
Usage: $0 -dir=DIR
|
|
17
|
+
# Directory to use for extraction, defaults to "./replay"
|
|
18
|
+
$0 -venv=DIR
|
|
19
|
+
# Name of virtual environment, defaults to "venv"
|
|
20
|
+
$0 -print_tools
|
|
21
|
+
# Print tool version and exit
|
|
22
|
+
$0 -extract_only
|
|
23
|
+
# Only extract the files
|
|
24
|
+
$0 -setup_only
|
|
25
|
+
# Only setup the runtime environment
|
|
26
|
+
$0 -assert_python
|
|
27
|
+
# Require python versions match
|
|
28
|
+
$0 -help
|
|
29
|
+
# Print this help information
|
|
30
|
+
EOF
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_print_tools() {
|
|
34
|
+
cat <<EOF{% for line in tools %}
|
|
35
|
+
{{ line }}{% endfor %}
|
|
36
|
+
EOF
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
path=$(realpath replay)
|
|
40
|
+
venv="venv"
|
|
41
|
+
extract_only="no"
|
|
42
|
+
setup_only="no"
|
|
43
|
+
assert_python="no"
|
|
44
|
+
|
|
45
|
+
while [ "$#" -gt 0 ]; do
|
|
46
|
+
case "${1}" in
|
|
47
|
+
-h|-help)
|
|
48
|
+
_help
|
|
49
|
+
exit 0
|
|
50
|
+
;;
|
|
51
|
+
-extract_only)
|
|
52
|
+
extract_only="yes"
|
|
53
|
+
;;
|
|
54
|
+
-setup_only)
|
|
55
|
+
setup_only="yes"
|
|
56
|
+
;;
|
|
57
|
+
-assert_python)
|
|
58
|
+
assert_python="yes"
|
|
59
|
+
;;
|
|
60
|
+
-print_tools)
|
|
61
|
+
_print_tools
|
|
62
|
+
exit 0
|
|
63
|
+
;;
|
|
64
|
+
-dir=*)
|
|
65
|
+
path=$(realpath ${1#-dir=})
|
|
66
|
+
;;
|
|
67
|
+
-venv=*)
|
|
68
|
+
venv=${1#-venv=}
|
|
69
|
+
;;
|
|
70
|
+
*)
|
|
71
|
+
echo "Unknown option: ${1}" >&2
|
|
72
|
+
_help
|
|
73
|
+
exit 1
|
|
74
|
+
;;
|
|
75
|
+
esac
|
|
76
|
+
shift 1
|
|
77
|
+
done
|
|
78
|
+
|
|
79
|
+
# Create output path
|
|
80
|
+
mkdir -p "$path"
|
|
81
|
+
|
|
82
|
+
# Change to output path directory
|
|
83
|
+
cd "$path"
|
|
84
|
+
|
|
85
|
+
# Add gitignore
|
|
86
|
+
echo "*" > .gitignore
|
|
87
|
+
|
|
88
|
+
# Extract files
|
|
89
|
+
read -r -d '' SCRIPT << PythonScript{% for line in script %}
|
|
90
|
+
{{ line }}{% endfor %}
|
|
91
|
+
PythonScript
|
|
92
|
+
|
|
93
|
+
echo "$SCRIPT" | base64 --decode | gunzip > replay.py
|
|
94
|
+
chmod +x replay.py
|
|
95
|
+
|
|
96
|
+
read -r -d '' MANIFEST << Manifest{% for line in manifest %}
|
|
97
|
+
{{ line }}{% endfor %}
|
|
98
|
+
Manifest
|
|
99
|
+
|
|
100
|
+
echo "$MANIFEST" | base64 --decode | gunzip > sc_manifest.json
|
|
101
|
+
|
|
102
|
+
cat > requirements.txt << PythonRequirements{% for line in requirements %}
|
|
103
|
+
{{ line }}{% endfor %}
|
|
104
|
+
PythonRequirements
|
|
105
|
+
|
|
106
|
+
if [ "$extract_only" == "yes" ]; then
|
|
107
|
+
exit 0
|
|
108
|
+
fi
|
|
109
|
+
|
|
110
|
+
if [ "$(python3 -V)" != "Python {{ pythonversion }}" ]; then
|
|
111
|
+
echo "Python version mismatch: $(python3 -V) != {{ pythonversion }}"
|
|
112
|
+
|
|
113
|
+
if [ "$assert_python" == "yes" ]; then
|
|
114
|
+
exit 1
|
|
115
|
+
fi
|
|
116
|
+
fi
|
|
117
|
+
|
|
118
|
+
python3 -m venv $venv --clear
|
|
119
|
+
|
|
120
|
+
. $venv/bin/activate
|
|
121
|
+
pip3 install -r requirements.txt
|
|
122
|
+
|
|
123
|
+
echo "To enable run environment: . $path/$venv/bin/activate"
|
|
124
|
+
echo "To replay: $path/replay.py"
|
|
125
|
+
|
|
126
|
+
if [ "$setup_only" == "yes" ]; then
|
|
127
|
+
exit 0
|
|
128
|
+
fi
|
|
129
|
+
|
|
130
|
+
./replay.py
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
from siliconcompiler.tools.bambu import bambu
|
|
2
|
+
from siliconcompiler.tools.bluespec import bluespec
|
|
3
|
+
from siliconcompiler.tools.builtin import builtin
|
|
4
|
+
from siliconcompiler.tools.chisel import chisel
|
|
5
|
+
from siliconcompiler.tools.execute import execute
|
|
6
|
+
from siliconcompiler.tools.genfasm import genfasm
|
|
7
|
+
from siliconcompiler.tools.ghdl import ghdl
|
|
8
|
+
from siliconcompiler.tools.icarus import icarus
|
|
9
|
+
from siliconcompiler.tools.icepack import icepack
|
|
10
|
+
from siliconcompiler.tools.klayout import klayout
|
|
11
|
+
from siliconcompiler.tools.magic import magic
|
|
12
|
+
from siliconcompiler.tools.montage import montage
|
|
13
|
+
from siliconcompiler.tools.netgen import netgen
|
|
14
|
+
from siliconcompiler.tools.nextpnr import nextpnr
|
|
15
|
+
from siliconcompiler.tools import openroad
|
|
16
|
+
from siliconcompiler.tools import opensta
|
|
17
|
+
from siliconcompiler.tools import slang
|
|
18
|
+
from siliconcompiler.tools import surelog
|
|
19
|
+
from siliconcompiler.tools.sv2v import sv2v
|
|
20
|
+
from siliconcompiler.tools.verilator import verilator
|
|
21
|
+
from siliconcompiler.tools.vivado import vivado
|
|
22
|
+
from siliconcompiler.tools.vpr import vpr
|
|
23
|
+
from siliconcompiler.tools import xdm
|
|
24
|
+
from siliconcompiler.tools import xyce
|
|
25
|
+
from siliconcompiler.tools import yosys
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def get_tools():
|
|
29
|
+
'''
|
|
30
|
+
Returns a dict of builtin tools
|
|
31
|
+
'''
|
|
32
|
+
return {
|
|
33
|
+
module.__name__.split(".")[-1]: module for module in (
|
|
34
|
+
bambu,
|
|
35
|
+
bluespec,
|
|
36
|
+
builtin,
|
|
37
|
+
chisel,
|
|
38
|
+
execute,
|
|
39
|
+
genfasm,
|
|
40
|
+
ghdl,
|
|
41
|
+
icarus,
|
|
42
|
+
icepack,
|
|
43
|
+
klayout,
|
|
44
|
+
magic,
|
|
45
|
+
montage,
|
|
46
|
+
netgen,
|
|
47
|
+
nextpnr,
|
|
48
|
+
openroad,
|
|
49
|
+
opensta,
|
|
50
|
+
slang,
|
|
51
|
+
surelog,
|
|
52
|
+
sv2v,
|
|
53
|
+
verilator,
|
|
54
|
+
vivado,
|
|
55
|
+
vpr,
|
|
56
|
+
xdm,
|
|
57
|
+
xyce,
|
|
58
|
+
yosys
|
|
59
|
+
)
|
|
60
|
+
}
|
|
@@ -411,11 +411,16 @@ def get_tool_task(chip, step, index, flow=None):
|
|
|
411
411
|
|
|
412
412
|
def get_tool_tasks(chip, tool):
|
|
413
413
|
tool_dir = os.path.dirname(tool.__file__)
|
|
414
|
-
tool_base_module = tool.__name__.split('.')[0:-1]
|
|
415
414
|
tool_name = tool.__name__.split('.')[-1]
|
|
415
|
+
tool_base_module = tool.__name__.split('.')
|
|
416
|
+
if not tool.__file__.endswith('__init__.py'):
|
|
417
|
+
tool_base_module = tool_base_module[0:-1]
|
|
416
418
|
|
|
417
419
|
task_candidates = []
|
|
418
420
|
for task_mod in pkgutil.iter_modules([tool_dir]):
|
|
421
|
+
if task_mod.name.startswith('_'):
|
|
422
|
+
continue
|
|
423
|
+
|
|
419
424
|
if task_mod.name == tool_name:
|
|
420
425
|
continue
|
|
421
426
|
task_candidates.append(task_mod.name)
|
|
@@ -468,3 +473,12 @@ def record_metric(chip, step, index, metric, value, source, source_unit=None):
|
|
|
468
473
|
tool, task = get_tool_task(chip, step, index, flow=flow)
|
|
469
474
|
|
|
470
475
|
chip.add('tool', tool, 'task', task, 'report', metric, source, step=step, index=index)
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
def has_pre_post_script(chip):
|
|
479
|
+
step = chip.get('arg', 'step')
|
|
480
|
+
index = chip.get('arg', 'index')
|
|
481
|
+
tool, task = get_tool_task(chip, step, index)
|
|
482
|
+
|
|
483
|
+
return chip.get('tool', tool, 'task', task, 'prescript', step=step, index=index) or \
|
|
484
|
+
chip.get('tool', tool, 'task', task, 'postscript', step=step, index=index)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
from
|
|
1
|
+
from . import get_libraries as common_get_libraries
|
|
2
|
+
from . import get_tool_task, pick_key
|
|
2
3
|
import json
|
|
3
4
|
|
|
4
5
|
|
|
@@ -19,7 +20,7 @@ def get_libraries(chip, type):
|
|
|
19
20
|
continue
|
|
20
21
|
libs.append(lib)
|
|
21
22
|
|
|
22
|
-
for lib in
|
|
23
|
+
for lib in common_get_libraries(chip, include_asic=False):
|
|
23
24
|
if not chip.valid('library', lib, 'asic', f'{type}lib'):
|
|
24
25
|
continue
|
|
25
26
|
for sublib in chip.get('library', lib, 'asic', f'{type}lib', step=step, index=index):
|
|
@@ -55,7 +56,7 @@ def set_tool_task_var(chip,
|
|
|
55
56
|
'''
|
|
56
57
|
step = chip.get('arg', 'step')
|
|
57
58
|
index = chip.get('arg', 'index')
|
|
58
|
-
tool, task =
|
|
59
|
+
tool, task = get_tool_task(chip, step, index)
|
|
59
60
|
pdkname = chip.get('option', 'pdk')
|
|
60
61
|
stackup = chip.get('option', 'stackup')
|
|
61
62
|
|
|
@@ -102,11 +103,18 @@ def set_tool_task_var(chip,
|
|
|
102
103
|
','.join(check_keys[-1]),
|
|
103
104
|
step=step, index=index)
|
|
104
105
|
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
def check_value(val):
|
|
107
|
+
if isinstance(val, (list, tuple)):
|
|
108
|
+
return len(val) > 0
|
|
109
|
+
return val is not None
|
|
110
|
+
|
|
111
|
+
require_key, value = pick_key(chip, reversed(check_keys), step=step, index=index)
|
|
112
|
+
if not check_value(value):
|
|
107
113
|
value = default_value
|
|
108
114
|
|
|
109
|
-
|
|
115
|
+
has_value = check_value(value)
|
|
116
|
+
|
|
117
|
+
if has_value:
|
|
110
118
|
chip.set('tool', tool, 'task', task, 'var', param_key, value,
|
|
111
119
|
step=step, index=index, clobber=False)
|
|
112
120
|
|
|
@@ -115,7 +123,7 @@ def set_tool_task_var(chip,
|
|
|
115
123
|
','.join(require_key),
|
|
116
124
|
step=step, index=index)
|
|
117
125
|
|
|
118
|
-
if
|
|
126
|
+
if has_value or 'key' in require:
|
|
119
127
|
chip.add('tool', tool, 'task', task, 'require',
|
|
120
128
|
','.join(['tool', tool, 'task', task, 'var', param_key]),
|
|
121
129
|
step=step, index=index)
|
|
@@ -138,7 +146,7 @@ def get_tool_task_var(chip,
|
|
|
138
146
|
'''
|
|
139
147
|
step = chip.get('arg', 'step')
|
|
140
148
|
index = chip.get('arg', 'index')
|
|
141
|
-
tool, _ =
|
|
149
|
+
tool, _ = get_tool_task(chip, step, index)
|
|
142
150
|
pdkname = chip.get('option', 'pdk')
|
|
143
151
|
stackup = chip.get('option', 'stackup')
|
|
144
152
|
|
|
@@ -167,7 +175,7 @@ def get_tool_task_var(chip,
|
|
|
167
175
|
option_key = f'{tool}_{param_key}'
|
|
168
176
|
check_keys.append(['option', 'var', option_key])
|
|
169
177
|
|
|
170
|
-
_, value =
|
|
178
|
+
_, value = pick_key(chip, reversed(check_keys), step=step, index=index)
|
|
171
179
|
|
|
172
180
|
return value
|
|
173
181
|
|
|
@@ -15,7 +15,7 @@ def make_docs(chip):
|
|
|
15
15
|
for step, index in flowgraph._get_flowgraph_entry_nodes(chip, 'asicflow'):
|
|
16
16
|
scheduler._setup_node(chip, step, index)
|
|
17
17
|
|
|
18
|
-
chip.set('arg', 'step', 'combine')
|
|
18
|
+
chip.set('arg', 'step', 'import.combine')
|
|
19
19
|
chip.set('arg', 'index', '0')
|
|
20
20
|
setup(chip)
|
|
21
21
|
|
|
@@ -12,13 +12,12 @@ Sources: https://github.com/ghdl/ghdl
|
|
|
12
12
|
Installation: https://github.com/ghdl/ghdl
|
|
13
13
|
'''
|
|
14
14
|
|
|
15
|
-
from siliconcompiler.tools.ghdl import convert
|
|
16
|
-
|
|
17
15
|
|
|
18
16
|
#####################################################################
|
|
19
17
|
# Make Docs
|
|
20
18
|
#####################################################################
|
|
21
19
|
def make_docs(chip):
|
|
20
|
+
from siliconcompiler.tools.ghdl import convert
|
|
22
21
|
convert.setup(chip)
|
|
23
22
|
return chip
|
|
24
23
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from siliconcompiler.tools._common import input_provides, input_file_node_name, get_tool_task
|
|
2
2
|
|
|
3
|
-
from siliconcompiler.tools.klayout import klayout
|
|
4
3
|
from siliconcompiler.tools.klayout.klayout import setup as setup_tool
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
def make_docs(chip):
|
|
7
|
+
from siliconcompiler.tools.klayout import klayout
|
|
8
8
|
klayout.make_docs(chip)
|
|
9
9
|
|
|
10
10
|
|
|
@@ -5,12 +5,12 @@ from siliconcompiler.tools._common import input_provides, has_input_files, \
|
|
|
5
5
|
get_input_files, get_tool_task, record_metric
|
|
6
6
|
from siliconcompiler.tools._common.asic import set_tool_task_var, get_tool_task_var
|
|
7
7
|
|
|
8
|
-
from siliconcompiler.tools.klayout import klayout
|
|
9
8
|
from siliconcompiler.tools.klayout.klayout import setup as setup_tool
|
|
10
9
|
import xml.etree.ElementTree as ET
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
def make_docs(chip):
|
|
13
|
+
from siliconcompiler.tools.klayout import klayout
|
|
14
14
|
klayout.make_docs(chip)
|
|
15
15
|
chip.set('tool', 'klayout', 'task', 'drc', 'var', 'drc_name', '<drc_name>',
|
|
16
16
|
step='<step>', index='<index>')
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import os
|
|
2
2
|
from siliconcompiler.tools.klayout.klayout import setup as setup_tool
|
|
3
|
+
from siliconcompiler.tools.klayout.klayout import runtime_options as runtime_options_tool
|
|
3
4
|
from siliconcompiler.tools.klayout.screenshot import setup_gui_screenshot
|
|
4
5
|
from siliconcompiler.tools._common import input_provides, get_tool_task
|
|
5
6
|
from siliconcompiler.tools._common.asic import get_libraries
|
|
@@ -120,3 +121,9 @@ def setup(chip):
|
|
|
120
121
|
if chip.get('tool', tool, 'task', task, 'var', 'screenshot',
|
|
121
122
|
step=step, index=index) == ['true']:
|
|
122
123
|
setup_gui_screenshot(chip, require_input=False)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def runtime_options(chip):
|
|
127
|
+
return runtime_options_tool(chip) + [
|
|
128
|
+
'-rd', f'SC_TOOLS_ROOT={os.path.dirname(os.path.dirname(__file__))}'
|
|
129
|
+
]
|
|
@@ -15,13 +15,13 @@ from pathlib import Path
|
|
|
15
15
|
import platform
|
|
16
16
|
import shutil
|
|
17
17
|
from siliconcompiler.tools._common import get_tool_task
|
|
18
|
-
from siliconcompiler.targets import freepdk45_demo
|
|
19
18
|
|
|
20
19
|
|
|
21
20
|
####################################################################
|
|
22
21
|
# Make Docs
|
|
23
22
|
####################################################################
|
|
24
23
|
def make_docs(chip):
|
|
24
|
+
from siliconcompiler.targets import freepdk45_demo
|
|
25
25
|
chip.use(freepdk45_demo)
|
|
26
26
|
|
|
27
27
|
|
|
@@ -102,7 +102,7 @@ def runtime_options(chip):
|
|
|
102
102
|
# that has no 3rd-party dependencies.
|
|
103
103
|
# This must be done at runtime to work in a remote context.
|
|
104
104
|
|
|
105
|
-
return ['-rd', f'
|
|
105
|
+
return ['-rd', f'SC_KLAYOUT_ROOT={os.path.dirname(__file__)}']
|
|
106
106
|
|
|
107
107
|
|
|
108
108
|
################################
|