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.
- siliconcompiler/__init__.py +24 -0
- siliconcompiler/__main__.py +12 -0
- siliconcompiler/_common.py +49 -0
- siliconcompiler/_metadata.py +36 -0
- siliconcompiler/apps/__init__.py +0 -0
- siliconcompiler/apps/_common.py +76 -0
- siliconcompiler/apps/sc.py +92 -0
- siliconcompiler/apps/sc_dashboard.py +94 -0
- siliconcompiler/apps/sc_issue.py +178 -0
- siliconcompiler/apps/sc_remote.py +199 -0
- siliconcompiler/apps/sc_server.py +39 -0
- siliconcompiler/apps/sc_show.py +142 -0
- siliconcompiler/apps/smake.py +232 -0
- siliconcompiler/checklists/__init__.py +0 -0
- siliconcompiler/checklists/oh_tapeout.py +41 -0
- siliconcompiler/core.py +3221 -0
- siliconcompiler/data/RobotoMono/LICENSE.txt +202 -0
- siliconcompiler/data/RobotoMono/RobotoMono-Regular.ttf +0 -0
- siliconcompiler/data/heartbeat.v +18 -0
- siliconcompiler/data/logo.png +0 -0
- siliconcompiler/flowgraph.py +570 -0
- siliconcompiler/flows/__init__.py +0 -0
- siliconcompiler/flows/_common.py +67 -0
- siliconcompiler/flows/asicflow.py +180 -0
- siliconcompiler/flows/asictopflow.py +38 -0
- siliconcompiler/flows/dvflow.py +86 -0
- siliconcompiler/flows/fpgaflow.py +202 -0
- siliconcompiler/flows/generate_openroad_rcx.py +66 -0
- siliconcompiler/flows/lintflow.py +35 -0
- siliconcompiler/flows/screenshotflow.py +51 -0
- siliconcompiler/flows/showflow.py +59 -0
- siliconcompiler/flows/signoffflow.py +53 -0
- siliconcompiler/flows/synflow.py +128 -0
- siliconcompiler/fpgas/__init__.py +0 -0
- siliconcompiler/fpgas/lattice_ice40.py +42 -0
- siliconcompiler/fpgas/vpr_example.py +109 -0
- siliconcompiler/issue.py +300 -0
- siliconcompiler/libs/__init__.py +0 -0
- siliconcompiler/libs/asap7sc7p5t.py +8 -0
- siliconcompiler/libs/gf180mcu.py +8 -0
- siliconcompiler/libs/nangate45.py +8 -0
- siliconcompiler/libs/sky130hd.py +8 -0
- siliconcompiler/libs/sky130io.py +8 -0
- siliconcompiler/package.py +412 -0
- siliconcompiler/pdks/__init__.py +0 -0
- siliconcompiler/pdks/asap7.py +8 -0
- siliconcompiler/pdks/freepdk45.py +8 -0
- siliconcompiler/pdks/gf180.py +8 -0
- siliconcompiler/pdks/skywater130.py +8 -0
- siliconcompiler/remote/__init__.py +36 -0
- siliconcompiler/remote/client.py +891 -0
- siliconcompiler/remote/schema.py +106 -0
- siliconcompiler/remote/server.py +507 -0
- siliconcompiler/remote/server_schema/requests/cancel_job.json +51 -0
- siliconcompiler/remote/server_schema/requests/check_progress.json +61 -0
- siliconcompiler/remote/server_schema/requests/check_server.json +38 -0
- siliconcompiler/remote/server_schema/requests/delete_job.json +51 -0
- siliconcompiler/remote/server_schema/requests/get_results.json +48 -0
- siliconcompiler/remote/server_schema/requests/remote_run.json +40 -0
- siliconcompiler/remote/server_schema/responses/cancel_job.json +18 -0
- siliconcompiler/remote/server_schema/responses/check_progress.json +30 -0
- siliconcompiler/remote/server_schema/responses/check_server.json +32 -0
- siliconcompiler/remote/server_schema/responses/delete_job.json +18 -0
- siliconcompiler/remote/server_schema/responses/get_results.json +21 -0
- siliconcompiler/remote/server_schema/responses/remote_run.json +25 -0
- siliconcompiler/report/__init__.py +13 -0
- siliconcompiler/report/html_report.py +74 -0
- siliconcompiler/report/report.py +355 -0
- siliconcompiler/report/streamlit_report.py +137 -0
- siliconcompiler/report/streamlit_viewer.py +944 -0
- siliconcompiler/report/summary_image.py +117 -0
- siliconcompiler/report/summary_table.py +105 -0
- siliconcompiler/report/utils.py +163 -0
- siliconcompiler/scheduler/__init__.py +2092 -0
- siliconcompiler/scheduler/docker_runner.py +253 -0
- siliconcompiler/scheduler/run_node.py +138 -0
- siliconcompiler/scheduler/send_messages.py +178 -0
- siliconcompiler/scheduler/slurm.py +208 -0
- siliconcompiler/scheduler/validation/email_credentials.json +54 -0
- siliconcompiler/schema/__init__.py +7 -0
- siliconcompiler/schema/schema_cfg.py +4014 -0
- siliconcompiler/schema/schema_obj.py +1841 -0
- siliconcompiler/schema/utils.py +93 -0
- siliconcompiler/sphinx_ext/__init__.py +0 -0
- siliconcompiler/sphinx_ext/dynamicgen.py +1006 -0
- siliconcompiler/sphinx_ext/schemagen.py +221 -0
- siliconcompiler/sphinx_ext/utils.py +166 -0
- siliconcompiler/targets/__init__.py +0 -0
- siliconcompiler/targets/asap7_demo.py +68 -0
- siliconcompiler/targets/asic_demo.py +38 -0
- siliconcompiler/targets/fpgaflow_demo.py +47 -0
- siliconcompiler/targets/freepdk45_demo.py +59 -0
- siliconcompiler/targets/gf180_demo.py +77 -0
- siliconcompiler/targets/skywater130_demo.py +70 -0
- siliconcompiler/templates/email/general.j2 +66 -0
- siliconcompiler/templates/email/summary.j2 +43 -0
- siliconcompiler/templates/issue/README.txt +26 -0
- siliconcompiler/templates/issue/run.sh +6 -0
- siliconcompiler/templates/report/bootstrap.min.css +7 -0
- siliconcompiler/templates/report/bootstrap.min.js +7 -0
- siliconcompiler/templates/report/bootstrap_LICENSE.md +24 -0
- siliconcompiler/templates/report/sc_report.j2 +427 -0
- siliconcompiler/templates/slurm/run.sh +9 -0
- siliconcompiler/templates/tcl/manifest.tcl.j2 +137 -0
- siliconcompiler/tools/__init__.py +0 -0
- siliconcompiler/tools/_common/__init__.py +432 -0
- siliconcompiler/tools/_common/asic.py +115 -0
- siliconcompiler/tools/_common/sdc/sc_constraints.sdc +76 -0
- siliconcompiler/tools/_common/tcl/sc_pin_constraints.tcl +63 -0
- siliconcompiler/tools/bambu/bambu.py +32 -0
- siliconcompiler/tools/bambu/convert.py +77 -0
- siliconcompiler/tools/bluespec/bluespec.py +40 -0
- siliconcompiler/tools/bluespec/convert.py +103 -0
- siliconcompiler/tools/builtin/_common.py +155 -0
- siliconcompiler/tools/builtin/builtin.py +26 -0
- siliconcompiler/tools/builtin/concatenate.py +85 -0
- siliconcompiler/tools/builtin/join.py +27 -0
- siliconcompiler/tools/builtin/maximum.py +46 -0
- siliconcompiler/tools/builtin/minimum.py +57 -0
- siliconcompiler/tools/builtin/mux.py +70 -0
- siliconcompiler/tools/builtin/nop.py +38 -0
- siliconcompiler/tools/builtin/verify.py +83 -0
- siliconcompiler/tools/chisel/SCDriver.scala +10 -0
- siliconcompiler/tools/chisel/build.sbt +27 -0
- siliconcompiler/tools/chisel/chisel.py +37 -0
- siliconcompiler/tools/chisel/convert.py +140 -0
- siliconcompiler/tools/execute/exec_input.py +41 -0
- siliconcompiler/tools/execute/execute.py +17 -0
- siliconcompiler/tools/genfasm/bitstream.py +61 -0
- siliconcompiler/tools/genfasm/genfasm.py +40 -0
- siliconcompiler/tools/ghdl/convert.py +87 -0
- siliconcompiler/tools/ghdl/ghdl.py +41 -0
- siliconcompiler/tools/icarus/compile.py +87 -0
- siliconcompiler/tools/icarus/icarus.py +36 -0
- siliconcompiler/tools/icepack/bitstream.py +20 -0
- siliconcompiler/tools/icepack/icepack.py +43 -0
- siliconcompiler/tools/klayout/export.py +117 -0
- siliconcompiler/tools/klayout/klayout.py +119 -0
- siliconcompiler/tools/klayout/klayout_export.py +205 -0
- siliconcompiler/tools/klayout/klayout_operations.py +363 -0
- siliconcompiler/tools/klayout/klayout_show.py +242 -0
- siliconcompiler/tools/klayout/klayout_utils.py +176 -0
- siliconcompiler/tools/klayout/operations.py +194 -0
- siliconcompiler/tools/klayout/screenshot.py +98 -0
- siliconcompiler/tools/klayout/show.py +101 -0
- siliconcompiler/tools/magic/drc.py +49 -0
- siliconcompiler/tools/magic/extspice.py +19 -0
- siliconcompiler/tools/magic/magic.py +85 -0
- siliconcompiler/tools/magic/sc_drc.tcl +96 -0
- siliconcompiler/tools/magic/sc_extspice.tcl +54 -0
- siliconcompiler/tools/magic/sc_magic.tcl +47 -0
- siliconcompiler/tools/montage/montage.py +30 -0
- siliconcompiler/tools/montage/tile.py +66 -0
- siliconcompiler/tools/netgen/count_lvs.py +132 -0
- siliconcompiler/tools/netgen/lvs.py +90 -0
- siliconcompiler/tools/netgen/netgen.py +36 -0
- siliconcompiler/tools/netgen/sc_lvs.tcl +46 -0
- siliconcompiler/tools/nextpnr/apr.py +24 -0
- siliconcompiler/tools/nextpnr/nextpnr.py +59 -0
- siliconcompiler/tools/openfpgaloader/openfpgaloader.py +39 -0
- siliconcompiler/tools/openroad/__init__.py +0 -0
- siliconcompiler/tools/openroad/cts.py +45 -0
- siliconcompiler/tools/openroad/dfm.py +66 -0
- siliconcompiler/tools/openroad/export.py +131 -0
- siliconcompiler/tools/openroad/floorplan.py +70 -0
- siliconcompiler/tools/openroad/openroad.py +977 -0
- siliconcompiler/tools/openroad/physyn.py +27 -0
- siliconcompiler/tools/openroad/place.py +41 -0
- siliconcompiler/tools/openroad/rcx_bench.py +95 -0
- siliconcompiler/tools/openroad/rcx_extract.py +34 -0
- siliconcompiler/tools/openroad/route.py +45 -0
- siliconcompiler/tools/openroad/screenshot.py +60 -0
- siliconcompiler/tools/openroad/scripts/sc_apr.tcl +499 -0
- siliconcompiler/tools/openroad/scripts/sc_cts.tcl +64 -0
- siliconcompiler/tools/openroad/scripts/sc_dfm.tcl +20 -0
- siliconcompiler/tools/openroad/scripts/sc_export.tcl +98 -0
- siliconcompiler/tools/openroad/scripts/sc_floorplan.tcl +413 -0
- siliconcompiler/tools/openroad/scripts/sc_metrics.tcl +158 -0
- siliconcompiler/tools/openroad/scripts/sc_physyn.tcl +7 -0
- siliconcompiler/tools/openroad/scripts/sc_place.tcl +84 -0
- siliconcompiler/tools/openroad/scripts/sc_procs.tcl +423 -0
- siliconcompiler/tools/openroad/scripts/sc_rcx.tcl +63 -0
- siliconcompiler/tools/openroad/scripts/sc_rcx_bench.tcl +20 -0
- siliconcompiler/tools/openroad/scripts/sc_rcx_extract.tcl +12 -0
- siliconcompiler/tools/openroad/scripts/sc_route.tcl +133 -0
- siliconcompiler/tools/openroad/scripts/sc_screenshot.tcl +21 -0
- siliconcompiler/tools/openroad/scripts/sc_write.tcl +5 -0
- siliconcompiler/tools/openroad/scripts/sc_write_images.tcl +361 -0
- siliconcompiler/tools/openroad/show.py +94 -0
- siliconcompiler/tools/openroad/templates/pex.tcl +8 -0
- siliconcompiler/tools/opensta/__init__.py +101 -0
- siliconcompiler/tools/opensta/report_libraries.py +28 -0
- siliconcompiler/tools/opensta/scripts/sc_procs.tcl +47 -0
- siliconcompiler/tools/opensta/scripts/sc_report_libraries.tcl +74 -0
- siliconcompiler/tools/opensta/scripts/sc_timing.tcl +268 -0
- siliconcompiler/tools/opensta/timing.py +214 -0
- siliconcompiler/tools/slang/__init__.py +49 -0
- siliconcompiler/tools/slang/lint.py +101 -0
- siliconcompiler/tools/surelog/__init__.py +123 -0
- siliconcompiler/tools/surelog/parse.py +183 -0
- siliconcompiler/tools/surelog/templates/output.v +7 -0
- siliconcompiler/tools/sv2v/convert.py +46 -0
- siliconcompiler/tools/sv2v/sv2v.py +37 -0
- siliconcompiler/tools/template/template.py +125 -0
- siliconcompiler/tools/verilator/compile.py +139 -0
- siliconcompiler/tools/verilator/lint.py +19 -0
- siliconcompiler/tools/verilator/parse.py +27 -0
- siliconcompiler/tools/verilator/verilator.py +172 -0
- siliconcompiler/tools/vivado/__init__.py +7 -0
- siliconcompiler/tools/vivado/bitstream.py +21 -0
- siliconcompiler/tools/vivado/place.py +21 -0
- siliconcompiler/tools/vivado/route.py +21 -0
- siliconcompiler/tools/vivado/scripts/sc_bitstream.tcl +6 -0
- siliconcompiler/tools/vivado/scripts/sc_place.tcl +2 -0
- siliconcompiler/tools/vivado/scripts/sc_route.tcl +4 -0
- siliconcompiler/tools/vivado/scripts/sc_run.tcl +45 -0
- siliconcompiler/tools/vivado/scripts/sc_syn_fpga.tcl +25 -0
- siliconcompiler/tools/vivado/syn_fpga.py +20 -0
- siliconcompiler/tools/vivado/vivado.py +147 -0
- siliconcompiler/tools/vpr/_json_constraint.py +63 -0
- siliconcompiler/tools/vpr/_xml_constraint.py +109 -0
- siliconcompiler/tools/vpr/place.py +137 -0
- siliconcompiler/tools/vpr/route.py +124 -0
- siliconcompiler/tools/vpr/screenshot.py +54 -0
- siliconcompiler/tools/vpr/show.py +88 -0
- siliconcompiler/tools/vpr/vpr.py +357 -0
- siliconcompiler/tools/xyce/xyce.py +36 -0
- siliconcompiler/tools/yosys/lec.py +56 -0
- siliconcompiler/tools/yosys/prepareLib.py +59 -0
- siliconcompiler/tools/yosys/sc_lec.tcl +84 -0
- siliconcompiler/tools/yosys/sc_syn.tcl +79 -0
- siliconcompiler/tools/yosys/syn_asic.py +565 -0
- siliconcompiler/tools/yosys/syn_asic.tcl +377 -0
- siliconcompiler/tools/yosys/syn_asic_fpga_shared.tcl +31 -0
- siliconcompiler/tools/yosys/syn_fpga.py +146 -0
- siliconcompiler/tools/yosys/syn_fpga.tcl +233 -0
- siliconcompiler/tools/yosys/syn_strategies.tcl +81 -0
- siliconcompiler/tools/yosys/techmaps/lcu_kogge_stone.v +39 -0
- siliconcompiler/tools/yosys/templates/abc.const +2 -0
- siliconcompiler/tools/yosys/yosys.py +147 -0
- siliconcompiler/units.py +259 -0
- siliconcompiler/use.py +177 -0
- siliconcompiler/utils/__init__.py +423 -0
- siliconcompiler/utils/asic.py +158 -0
- siliconcompiler/utils/showtools.py +25 -0
- siliconcompiler-0.26.5.dist-info/LICENSE +190 -0
- siliconcompiler-0.26.5.dist-info/METADATA +195 -0
- siliconcompiler-0.26.5.dist-info/RECORD +251 -0
- siliconcompiler-0.26.5.dist-info/WHEEL +5 -0
- siliconcompiler-0.26.5.dist-info/entry_points.txt +12 -0
- siliconcompiler-0.26.5.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
from siliconcompiler.tools.klayout import klayout
|
|
2
|
+
from siliconcompiler.tools.klayout.klayout import setup as setup_tool
|
|
3
|
+
from siliconcompiler.tools.klayout.show import general_gui_setup
|
|
4
|
+
from siliconcompiler.tools.klayout.show import pre_process as show_pre_process
|
|
5
|
+
from siliconcompiler.tools._common import get_tool_task
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def make_docs(chip):
|
|
9
|
+
klayout.make_docs(chip)
|
|
10
|
+
chip.set('tool', 'klayout', 'task', 'screenshot', 'var', 'show_filepath', '<path>')
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def setup(chip):
|
|
14
|
+
'''
|
|
15
|
+
Generate a PNG file from a layout file
|
|
16
|
+
'''
|
|
17
|
+
|
|
18
|
+
# Generic tool setup.
|
|
19
|
+
setup_tool(chip)
|
|
20
|
+
|
|
21
|
+
tool = 'klayout'
|
|
22
|
+
step = chip.get('arg', 'step')
|
|
23
|
+
index = chip.get('arg', 'index')
|
|
24
|
+
_, task = get_tool_task(chip, step, index)
|
|
25
|
+
clobber = False
|
|
26
|
+
|
|
27
|
+
setup_gui_screenshot(chip)
|
|
28
|
+
|
|
29
|
+
option = ['-nc', '-z', '-rm']
|
|
30
|
+
chip.set('tool', tool, 'task', task, 'option', option, step=step, index=index, clobber=clobber)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def pre_process(chip):
|
|
34
|
+
show_pre_process(chip)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def setup_gui_screenshot(chip, require_input=True):
|
|
38
|
+
step = chip.get('arg', 'step')
|
|
39
|
+
index = chip.get('arg', 'index')
|
|
40
|
+
tool, task = get_tool_task(chip, step, index)
|
|
41
|
+
design = chip.top()
|
|
42
|
+
|
|
43
|
+
general_gui_setup(chip, task, True, require_input=require_input)
|
|
44
|
+
|
|
45
|
+
chip.set('tool', tool, 'task', task, 'var', 'show_horizontal_resolution', '4096',
|
|
46
|
+
step=step, index=index, clobber=False)
|
|
47
|
+
chip.set('tool', tool, 'task', task, 'var', 'show_vertical_resolution', '4096',
|
|
48
|
+
step=step, index=index, clobber=False)
|
|
49
|
+
|
|
50
|
+
chip.set('tool', tool, 'task', task, 'var', 'xbins', '1',
|
|
51
|
+
step=step, index=index, clobber=False)
|
|
52
|
+
chip.set('tool', tool, 'task', task, 'var', 'ybins', '1',
|
|
53
|
+
step=step, index=index, clobber=False)
|
|
54
|
+
chip.set('tool', tool, 'task', task, 'var', 'margin', '10',
|
|
55
|
+
step=step, index=index, clobber=False)
|
|
56
|
+
|
|
57
|
+
chip.set('tool', tool, 'task', task, 'var', 'linewidth', '0',
|
|
58
|
+
step=step, index=index, clobber=False)
|
|
59
|
+
chip.set('tool', tool, 'task', task, 'var', 'oversampling', '2',
|
|
60
|
+
step=step, index=index, clobber=False)
|
|
61
|
+
|
|
62
|
+
# Help
|
|
63
|
+
chip.set('tool', tool, 'task', task, 'var', 'show_horizontal_resolution',
|
|
64
|
+
'Horizontal resolution in pixels',
|
|
65
|
+
field='help')
|
|
66
|
+
chip.set('tool', tool, 'task', task, 'var', 'show_vertical_resolution',
|
|
67
|
+
'Vertical resolution in pixels',
|
|
68
|
+
field='help')
|
|
69
|
+
|
|
70
|
+
chip.set('tool', tool, 'task', task, 'var', 'xbins',
|
|
71
|
+
'If greater than 1, splits the image into multiple segments along x-axis',
|
|
72
|
+
field='help')
|
|
73
|
+
chip.set('tool', tool, 'task', task, 'var', 'ybins',
|
|
74
|
+
'If greater than 1, splits the image into multiple segments along y-axis',
|
|
75
|
+
field='help')
|
|
76
|
+
chip.set('tool', tool, 'task', task, 'var', 'margin',
|
|
77
|
+
'Margin around design in microns',
|
|
78
|
+
field='help')
|
|
79
|
+
chip.set('tool', tool, 'task', task, 'var', 'linewidth',
|
|
80
|
+
'Width of lines in detailed screenshots',
|
|
81
|
+
field='help')
|
|
82
|
+
chip.set('tool', tool, 'task', task, 'var', 'oversampling',
|
|
83
|
+
'Image oversampling used in detailed screenshots',
|
|
84
|
+
field='help')
|
|
85
|
+
|
|
86
|
+
xbins = int(chip.get('tool', tool, 'task', task, 'var', 'xbins',
|
|
87
|
+
step=step, index=index)[0])
|
|
88
|
+
ybins = int(chip.get('tool', tool, 'task', task, 'var', 'ybins',
|
|
89
|
+
step=step, index=index)[0])
|
|
90
|
+
|
|
91
|
+
if xbins == 1 and ybins == 1:
|
|
92
|
+
chip.add('tool', tool, 'task', task, 'output', design + '.png',
|
|
93
|
+
step=step, index=index)
|
|
94
|
+
else:
|
|
95
|
+
for x in range(xbins):
|
|
96
|
+
for y in range(ybins):
|
|
97
|
+
chip.add('tool', tool, 'task', task, 'output', f'{design}_X{x}_Y{y}.png',
|
|
98
|
+
step=step, index=index)
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import shutil
|
|
3
|
+
|
|
4
|
+
from siliconcompiler.tools.klayout import klayout
|
|
5
|
+
from siliconcompiler.tools.klayout.klayout import setup as setup_tool
|
|
6
|
+
from siliconcompiler.tools._common import find_incoming_ext, get_tool_task
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def make_docs(chip):
|
|
10
|
+
klayout.make_docs(chip)
|
|
11
|
+
chip.set('tool', 'klayout', 'task', 'show', 'var', 'show_filepath', '<path>')
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def general_gui_setup(chip, task, exit, require_input=True):
|
|
15
|
+
# Generic tool setup.
|
|
16
|
+
setup_tool(chip)
|
|
17
|
+
|
|
18
|
+
tool = 'klayout'
|
|
19
|
+
step = chip.get('arg', 'step')
|
|
20
|
+
index = chip.get('arg', 'index')
|
|
21
|
+
clobber = False
|
|
22
|
+
|
|
23
|
+
script = 'klayout_show.py'
|
|
24
|
+
chip.set('tool', tool, 'task', task, 'script', script, step=step, index=index, clobber=clobber)
|
|
25
|
+
|
|
26
|
+
pdk = chip.get('option', 'pdk')
|
|
27
|
+
stackup = chip.get('option', 'stackup')
|
|
28
|
+
if chip.valid('pdk', pdk, 'var', 'klayout', 'hide_layers', stackup):
|
|
29
|
+
layers_to_hide = chip.get('pdk', pdk, 'var', 'klayout', 'hide_layers', stackup)
|
|
30
|
+
chip.add('tool', tool, 'task', task, 'var', 'hide_layers', layers_to_hide,
|
|
31
|
+
step=step, index=index)
|
|
32
|
+
|
|
33
|
+
if chip.valid('tool', tool, 'task', task, 'var', 'show_filepath') and \
|
|
34
|
+
chip.get('tool', tool, 'task', task, 'var', 'show_filepath', step=step, index=index):
|
|
35
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
36
|
+
",".join(['tool', tool, 'task', task, 'var', 'show_filepath']),
|
|
37
|
+
step=step, index=index)
|
|
38
|
+
elif require_input:
|
|
39
|
+
incoming_ext = find_incoming_ext(chip, ('gds', 'oas', 'def'), 'def')
|
|
40
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
41
|
+
",".join(['tool', tool, 'task', task, 'var', 'show_filetype']),
|
|
42
|
+
step=step, index=index)
|
|
43
|
+
chip.set('tool', tool, 'task', task, 'var', 'show_filetype', incoming_ext,
|
|
44
|
+
step=step, index=index)
|
|
45
|
+
chip.add('tool', tool, 'task', task, 'input', f'{chip.top()}.{incoming_ext}',
|
|
46
|
+
step=step, index=index)
|
|
47
|
+
|
|
48
|
+
chip.set('tool', tool, 'task', task, 'var', 'show_exit', "true" if exit else "false",
|
|
49
|
+
step=step, index=index, clobber=False)
|
|
50
|
+
|
|
51
|
+
# Help
|
|
52
|
+
chip.set('tool', tool, 'task', task, 'var', 'hide_layers',
|
|
53
|
+
'List of layers to hide',
|
|
54
|
+
field='help')
|
|
55
|
+
chip.set('tool', tool, 'task', task, 'var', 'show_filepath',
|
|
56
|
+
'File to open',
|
|
57
|
+
field='help')
|
|
58
|
+
chip.set('tool', tool, 'task', task, 'var', 'show_filetype',
|
|
59
|
+
'File type to look for in the inputs',
|
|
60
|
+
field='help')
|
|
61
|
+
chip.set('tool', tool, 'task', task, 'var', 'show_exit',
|
|
62
|
+
'true/false: true will cause kLayout to exit when complete',
|
|
63
|
+
field='help')
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def setup(chip):
|
|
67
|
+
'''
|
|
68
|
+
Show a layout in kLayout
|
|
69
|
+
'''
|
|
70
|
+
|
|
71
|
+
# Generic tool setup.
|
|
72
|
+
setup_tool(chip)
|
|
73
|
+
|
|
74
|
+
step = chip.get('arg', 'step')
|
|
75
|
+
index = chip.get('arg', 'index')
|
|
76
|
+
_, task = get_tool_task(chip, step, index)
|
|
77
|
+
|
|
78
|
+
general_gui_setup(chip, task, False)
|
|
79
|
+
|
|
80
|
+
tool = 'klayout'
|
|
81
|
+
clobber = False
|
|
82
|
+
|
|
83
|
+
option = ['-nc', '-rm']
|
|
84
|
+
chip.set('tool', tool, 'task', task, 'option', option, step=step, index=index, clobber=clobber)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def pre_process(chip):
|
|
88
|
+
step = chip.get('arg', 'step')
|
|
89
|
+
index = chip.get('arg', 'index')
|
|
90
|
+
tool, task = get_tool_task(chip, step, index)
|
|
91
|
+
|
|
92
|
+
if chip.valid('tool', tool, 'task', task, 'var', 'show_filepath') and \
|
|
93
|
+
chip.get('tool', tool, 'task', task, 'var', 'show_filepath', step=step, index=index):
|
|
94
|
+
show_file = chip.get('tool', tool, 'task', task, 'var', 'show_filepath',
|
|
95
|
+
step=step, index=index)[0]
|
|
96
|
+
|
|
97
|
+
rel_path = os.path.dirname(show_file)
|
|
98
|
+
for ext in ('lyt', 'lyp'):
|
|
99
|
+
ext_file = os.path.join(rel_path, f'{chip.top()}.{ext}')
|
|
100
|
+
if ext_file and os.path.exists(ext_file):
|
|
101
|
+
shutil.copy2(ext_file, f"inputs/{chip.top()}.{ext}")
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
from siliconcompiler.tools.magic.magic import setup as setup_tool
|
|
4
|
+
from siliconcompiler import sc_open
|
|
5
|
+
from siliconcompiler.tools._common import get_tool_task, record_metric
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def setup(chip):
|
|
9
|
+
'''
|
|
10
|
+
Perform DRC checks
|
|
11
|
+
'''
|
|
12
|
+
|
|
13
|
+
# Generic tool setup
|
|
14
|
+
setup_tool(chip)
|
|
15
|
+
|
|
16
|
+
step = chip.get('arg', 'step')
|
|
17
|
+
index = chip.get('arg', 'index')
|
|
18
|
+
tool, task = get_tool_task(chip, step, index)
|
|
19
|
+
|
|
20
|
+
design = chip.top()
|
|
21
|
+
|
|
22
|
+
chip.set('tool', tool, 'task', task, 'output', f'{design}.drc.mag', step=step, index=index)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
################################
|
|
26
|
+
# Post_process (post executable)
|
|
27
|
+
################################
|
|
28
|
+
def post_process(chip):
|
|
29
|
+
''' Tool specific function to run after step execution
|
|
30
|
+
|
|
31
|
+
Reads error count from output and fills in appropriate entry in metrics
|
|
32
|
+
'''
|
|
33
|
+
|
|
34
|
+
step = chip.get('arg', 'step')
|
|
35
|
+
index = chip.get('arg', 'index')
|
|
36
|
+
design = chip.top()
|
|
37
|
+
|
|
38
|
+
report_path = f'reports/{design}.drc'
|
|
39
|
+
drcs = 0
|
|
40
|
+
with sc_open(report_path) as f:
|
|
41
|
+
for line in f:
|
|
42
|
+
errors = re.search(r'^\[INFO\]: COUNT: (\d+)', line)
|
|
43
|
+
|
|
44
|
+
if errors:
|
|
45
|
+
drcs = errors.group(1)
|
|
46
|
+
record_metric(chip, step, index, 'drcs', drcs, report_path)
|
|
47
|
+
|
|
48
|
+
# TODO: return error code
|
|
49
|
+
return 0
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from siliconcompiler.tools.magic.magic import setup as setup_tool
|
|
2
|
+
from siliconcompiler.tools._common import get_tool_task
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def setup(chip):
|
|
6
|
+
'''
|
|
7
|
+
Extract spice netlists from a GDS file for simulation use
|
|
8
|
+
'''
|
|
9
|
+
|
|
10
|
+
# Generic tool setup
|
|
11
|
+
setup_tool(chip)
|
|
12
|
+
|
|
13
|
+
tool = 'magic'
|
|
14
|
+
step = chip.get('arg', 'step')
|
|
15
|
+
index = chip.get('arg', 'index')
|
|
16
|
+
_, task = get_tool_task(chip, step, index)
|
|
17
|
+
design = chip.top()
|
|
18
|
+
|
|
19
|
+
chip.add('tool', tool, 'task', task, 'output', f'{design}.spice', step=step, index=index)
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'''
|
|
2
|
+
Magic is a chip layout viewer, editor, and circuit verifier with
|
|
3
|
+
built in DRC and LVS engines.
|
|
4
|
+
|
|
5
|
+
Documentation: http://opencircuitdesign.com/magic/userguide.html
|
|
6
|
+
|
|
7
|
+
Installation: https://github.com/RTimothyEdwards/magic
|
|
8
|
+
|
|
9
|
+
Sources: https://github.com/RTimothyEdwards/magic
|
|
10
|
+
'''
|
|
11
|
+
|
|
12
|
+
import os
|
|
13
|
+
from siliconcompiler.tools._common import input_provides, get_tool_task
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
####################################################################
|
|
17
|
+
# Make Docs
|
|
18
|
+
####################################################################
|
|
19
|
+
def make_docs(chip):
|
|
20
|
+
chip.load_target("freepdk45_demo")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
################################
|
|
24
|
+
# Setup Tool (pre executable)
|
|
25
|
+
################################
|
|
26
|
+
def setup(chip):
|
|
27
|
+
''' Setup function for 'magic' tool
|
|
28
|
+
'''
|
|
29
|
+
|
|
30
|
+
tool = 'magic'
|
|
31
|
+
refdir = 'tools/' + tool
|
|
32
|
+
step = chip.get('arg', 'step')
|
|
33
|
+
index = chip.get('arg', 'index')
|
|
34
|
+
_, task = get_tool_task(chip, step, index)
|
|
35
|
+
|
|
36
|
+
# magic used for drc and lvs
|
|
37
|
+
# if step not in ('drc', 'extspice'):
|
|
38
|
+
# raise ValueError(f"Magic tool doesn't support step {step}.")
|
|
39
|
+
script = 'sc_magic.tcl'
|
|
40
|
+
|
|
41
|
+
chip.set('tool', tool, 'exe', tool)
|
|
42
|
+
chip.set('tool', tool, 'vswitch', '--version')
|
|
43
|
+
chip.set('tool', tool, 'version', '>=8.3.196', clobber=False)
|
|
44
|
+
chip.set('tool', tool, 'format', 'tcl')
|
|
45
|
+
|
|
46
|
+
chip.set('tool', tool, 'task', task, 'threads', os.cpu_count(),
|
|
47
|
+
step=step, index=index, clobber=False)
|
|
48
|
+
chip.set('tool', tool, 'task', task, 'refdir', refdir,
|
|
49
|
+
step=step, index=index,
|
|
50
|
+
package='siliconcompiler', clobber=False)
|
|
51
|
+
chip.set('tool', tool, 'task', task, 'script', script,
|
|
52
|
+
step=step, index=index, clobber=False)
|
|
53
|
+
|
|
54
|
+
# set options
|
|
55
|
+
options = []
|
|
56
|
+
options.append('-noc')
|
|
57
|
+
options.append('-dnull')
|
|
58
|
+
chip.set('tool', tool, 'task', task, 'option', options, step=step, index=index, clobber=False)
|
|
59
|
+
|
|
60
|
+
design = chip.top()
|
|
61
|
+
if f'{design}.gds' in input_provides(chip, step, index):
|
|
62
|
+
chip.add('tool', tool, 'task', task, 'input', f'{design}.gds', step=step, index=index)
|
|
63
|
+
else:
|
|
64
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
65
|
+
','.join(['input', 'layout', 'gds']),
|
|
66
|
+
step=step, index=index)
|
|
67
|
+
|
|
68
|
+
chip.set('tool', tool, 'task', task, 'regex', 'errors', r'^Error',
|
|
69
|
+
step=step, index=index, clobber=False)
|
|
70
|
+
chip.set('tool', tool, 'task', task, 'regex', 'warnings', r'warning',
|
|
71
|
+
step=step, index=index, clobber=False)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
################################
|
|
75
|
+
# Version Check
|
|
76
|
+
################################
|
|
77
|
+
def parse_version(stdout):
|
|
78
|
+
return stdout.strip('\n')
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
##################################################
|
|
82
|
+
if __name__ == "__main__":
|
|
83
|
+
|
|
84
|
+
chip = make_docs()
|
|
85
|
+
chip.write_manifest("magic.json")
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2020 Efabless Corporation
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
15
|
+
|
|
16
|
+
source ./sc_manifest.tcl
|
|
17
|
+
|
|
18
|
+
set sc_step [sc_cfg_get arg step]
|
|
19
|
+
set sc_index [sc_cfg_get arg index]
|
|
20
|
+
set sc_task $sc_step
|
|
21
|
+
|
|
22
|
+
set sc_design [sc_top]
|
|
23
|
+
set sc_macrolibs [sc_get_asic_libraries macro]
|
|
24
|
+
set sc_stackup [sc_cfg_get option stackup]
|
|
25
|
+
|
|
26
|
+
if { [sc_cfg_tool_task_exists var exclude] } {
|
|
27
|
+
set sc_exclude [sc_cfg_tool_task_get var exclude]
|
|
28
|
+
} else {
|
|
29
|
+
set sc_exclude [list]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
# Ignore specific libraries by reading their LEFs (causes magic to abstract them)
|
|
33
|
+
foreach lib $sc_macrolibs {
|
|
34
|
+
puts $lib
|
|
35
|
+
if { [lsearch -exact $sc_exclude $lib] >= 0 } {
|
|
36
|
+
lef read [sc_cfg_get library $lib output $sc_stackup lef]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
gds noduplicates true
|
|
41
|
+
|
|
42
|
+
if { [file exists "inputs/$sc_design.gds"] } {
|
|
43
|
+
set gds_path "inputs/$sc_design.gds"
|
|
44
|
+
} else {
|
|
45
|
+
set gds_path [sc_cfg_get input layout gds]
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
gds read $gds_path
|
|
49
|
+
puts $sc_design.gds
|
|
50
|
+
set fout [open reports/$sc_design.drc w]
|
|
51
|
+
set oscale [cif scale out]
|
|
52
|
+
set cell_name $sc_design
|
|
53
|
+
magic::suspendall
|
|
54
|
+
puts stdout "\[INFO\]: Loading ${sc_design}\n"
|
|
55
|
+
flush stdout
|
|
56
|
+
load $sc_design
|
|
57
|
+
select top cell
|
|
58
|
+
drc euclidean on
|
|
59
|
+
drc style drc(full)
|
|
60
|
+
drc check
|
|
61
|
+
set drcresult [drc listall why]
|
|
62
|
+
set count 0
|
|
63
|
+
puts $fout "$sc_design"
|
|
64
|
+
puts $fout "----------------------------------------"
|
|
65
|
+
foreach {errtype coordlist} $drcresult {
|
|
66
|
+
puts $fout $errtype
|
|
67
|
+
puts $fout "----------------------------------------"
|
|
68
|
+
foreach coord $coordlist {
|
|
69
|
+
set bllx [expr { $oscale * [lindex $coord 0] }]
|
|
70
|
+
set blly [expr { $oscale * [lindex $coord 1] }]
|
|
71
|
+
set burx [expr { $oscale * [lindex $coord 2] }]
|
|
72
|
+
set bury [expr { $oscale * [lindex $coord 3] }]
|
|
73
|
+
set coords [format " %.3f %.3f %.3f %.3f" $bllx $blly $burx $bury]
|
|
74
|
+
puts $fout "$coords"
|
|
75
|
+
incr count
|
|
76
|
+
}
|
|
77
|
+
puts $fout "----------------------------------------"
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
puts $fout "\[INFO\]: COUNT: $count"
|
|
81
|
+
puts $fout "\[INFO\]: Should be divided by 3 or 4"
|
|
82
|
+
|
|
83
|
+
puts $fout ""
|
|
84
|
+
close $fout
|
|
85
|
+
|
|
86
|
+
puts stdout "\[INFO\]: COUNT: $count"
|
|
87
|
+
puts stdout "\[INFO\]: Should be divided by 3 or 4"
|
|
88
|
+
puts stdout "\[INFO\]: DRC Checking DONE (outputs/${sc_design}.drc)"
|
|
89
|
+
flush stdout
|
|
90
|
+
|
|
91
|
+
puts stdout "\[INFO\]: Saving mag view with DRC errors(outputs/${sc_design}.drc.mag)"
|
|
92
|
+
# WARNING: changes the name of the cell; keep as last step
|
|
93
|
+
save outputs/${sc_design}.drc.mag
|
|
94
|
+
puts stdout "\[INFO\]: Saved"
|
|
95
|
+
|
|
96
|
+
exit 0
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
source ./sc_manifest.tcl
|
|
2
|
+
|
|
3
|
+
set sc_step [sc_cfg_get arg step]
|
|
4
|
+
set sc_index [sc_cfg_get arg index]
|
|
5
|
+
set sc_task $sc_step
|
|
6
|
+
|
|
7
|
+
set sc_design [sc_top]
|
|
8
|
+
set sc_logiclibs [sc_get_asic_libraries logic]
|
|
9
|
+
set sc_mainlib [lindex $sc_logiclibs 0]
|
|
10
|
+
set sc_stackup [sc_cfg_get option stackup]
|
|
11
|
+
set sc_pdk [sc_cfg_get option pdk]
|
|
12
|
+
set sc_libtype [sc_cfg_get library $sc_mainlib asic libarch]
|
|
13
|
+
set sc_techlef [sc_cfg_get pdk $sc_pdk aprtech magic $sc_stackup $sc_libtype lef]
|
|
14
|
+
set sc_liblef [sc_cfg_get library $sc_mainlib output $sc_stackup lef]
|
|
15
|
+
set sc_macrolibs [sc_get_asic_libraries macro]
|
|
16
|
+
|
|
17
|
+
if { [sc_cfg_tool_task_exists var exclude] } {
|
|
18
|
+
set sc_exclude [sc_cfg_tool_task_get var exclude]
|
|
19
|
+
} else {
|
|
20
|
+
set sc_exclude [list]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
lef read $sc_techlef
|
|
24
|
+
lef read $sc_liblef
|
|
25
|
+
|
|
26
|
+
# Ignore specific libraries by reading their LEFs (causes magic to abstract them)
|
|
27
|
+
foreach lib $sc_macrolibs {
|
|
28
|
+
puts $lib
|
|
29
|
+
if { [lsearch -exact $sc_exclude $lib] >= 0 } {
|
|
30
|
+
lef read [sc_cfg_get library $lib output $sc_stackup lef]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if { [file exists "inputs/$sc_design.gds"] } {
|
|
35
|
+
set gds_path "inputs/$sc_design.gds"
|
|
36
|
+
} else {
|
|
37
|
+
set gds_path [sc_cfg_get input layout gds]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
gds noduplicates true
|
|
41
|
+
gds read $gds_path
|
|
42
|
+
|
|
43
|
+
# Extract layout to Spice netlist
|
|
44
|
+
load $sc_design -dereference
|
|
45
|
+
select top cell
|
|
46
|
+
extract no all
|
|
47
|
+
extract do local
|
|
48
|
+
extract unique
|
|
49
|
+
extract
|
|
50
|
+
ext2spice lvs
|
|
51
|
+
ext2spice ${sc_design}.ext -o outputs/$sc_design.spice
|
|
52
|
+
feedback save extract_${sc_design}.log
|
|
53
|
+
|
|
54
|
+
exit
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
source ./sc_manifest.tcl
|
|
2
|
+
|
|
3
|
+
set sc_stackup [sc_cfg_get option stackup]
|
|
4
|
+
set sc_pdk [sc_cfg_get option pdk]
|
|
5
|
+
set sc_runset [sc_cfg_get pdk $sc_pdk drc runset magic $sc_stackup basic]
|
|
6
|
+
|
|
7
|
+
# Put grid on 0.005 pitch. This is important, as some commands don't
|
|
8
|
+
# rescale the grid automatically (such as lef read?).
|
|
9
|
+
|
|
10
|
+
set scalefac [tech lambda]
|
|
11
|
+
if { [lindex $scalefac 1] < 2 } {
|
|
12
|
+
scalegrid 1 2
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
drc euclidean on
|
|
16
|
+
# Change this to a fixed number for repeatable behavior with GDS writes
|
|
17
|
+
# e.g., "random seed 12345"
|
|
18
|
+
catch { random seed }
|
|
19
|
+
|
|
20
|
+
# loading technology
|
|
21
|
+
tech load $sc_runset
|
|
22
|
+
|
|
23
|
+
# set units to lambda grid
|
|
24
|
+
snap lambda
|
|
25
|
+
|
|
26
|
+
if { $sc_pdk == "skywater130" } {
|
|
27
|
+
# TODO: should not have process specific stuff here!
|
|
28
|
+
|
|
29
|
+
# set sky130 standard power, ground, and substrate names
|
|
30
|
+
set VDD VPWR
|
|
31
|
+
set GND VGND
|
|
32
|
+
set SUB VSUBS
|
|
33
|
+
|
|
34
|
+
# switch GDS input style to vendor variant, which ensures pins will be read
|
|
35
|
+
# correctly
|
|
36
|
+
cif istyle sky130(vendor)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
set mydir [file dirname [file normalize [info script]]]
|
|
40
|
+
set sc_step [sc_cfg_get arg step]
|
|
41
|
+
|
|
42
|
+
if { [catch { source "$mydir/sc_${sc_step}.tcl" } err] } {
|
|
43
|
+
puts $err
|
|
44
|
+
exit 1
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
exit 0
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
'''
|
|
3
|
+
ImageMagick® is a free and open-source software suite for displaying, converting, and editing raster
|
|
4
|
+
image and vector image files.
|
|
5
|
+
It can read and write over 200 image file formats, and can support a wide range of image
|
|
6
|
+
manipulation operations, such as resizing, cropping, and color correction.
|
|
7
|
+
Use the montage program to create a composite image by combining several separate images.
|
|
8
|
+
The images are tiled on the composite image optionally adorned with a border, frame, image name,
|
|
9
|
+
and more
|
|
10
|
+
|
|
11
|
+
Documentation: https://imagemagick.org/
|
|
12
|
+
|
|
13
|
+
Sources: https://github.com/ImageMagick/ImageMagick
|
|
14
|
+
|
|
15
|
+
Installation: https://github.com/ImageMagick/ImageMagick
|
|
16
|
+
'''
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def setup(chip):
|
|
20
|
+
exe = 'montage'
|
|
21
|
+
|
|
22
|
+
chip.set('tool', 'montage', 'exe', exe)
|
|
23
|
+
chip.set('tool', 'montage', 'vswitch', '-version')
|
|
24
|
+
chip.set('tool', 'montage', 'version', '>=6.9.0')
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def parse_version(stdout):
|
|
28
|
+
first_line = stdout.splitlines()[0]
|
|
29
|
+
|
|
30
|
+
return first_line.split(' ')[2]
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
from siliconcompiler.tools.montage import montage
|
|
2
|
+
from siliconcompiler.tools._common import get_tool_task
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def setup(chip):
|
|
6
|
+
'''
|
|
7
|
+
Tiles input images into a single output image.
|
|
8
|
+
|
|
9
|
+
Notes:
|
|
10
|
+
Need to make ensure that /etc/ImageMagick-6/policy.xml
|
|
11
|
+
<policy domain="resource" name="memory" value="8GiB"/>
|
|
12
|
+
<policy domain="resource" name="map" value="8GiB"/>
|
|
13
|
+
<policy domain="resource" name="width" value="32KP"/>
|
|
14
|
+
<policy domain="resource" name="height" value="32KP"/>
|
|
15
|
+
<policy domain="resource" name="area" value="1GP"/>
|
|
16
|
+
<policy domain="resource" name="disk" value="8GiB"/>
|
|
17
|
+
This ensures there are enough resources available to generate
|
|
18
|
+
the final image.
|
|
19
|
+
'''
|
|
20
|
+
|
|
21
|
+
step = chip.get('arg', 'step')
|
|
22
|
+
index = chip.get('arg', 'index')
|
|
23
|
+
tool, task = get_tool_task(chip, step, index)
|
|
24
|
+
design = chip.top()
|
|
25
|
+
|
|
26
|
+
montage.setup(chip)
|
|
27
|
+
|
|
28
|
+
chip.set('tool', tool, 'task', task, 'var', 'xbins', '2',
|
|
29
|
+
step=step, index=index, clobber=False)
|
|
30
|
+
chip.set('tool', tool, 'task', task, 'var', 'ybins', '2',
|
|
31
|
+
step=step, index=index, clobber=False)
|
|
32
|
+
|
|
33
|
+
chip.set('tool', tool, 'task', task, 'var', 'xbins',
|
|
34
|
+
'Number of bins along the x-axis',
|
|
35
|
+
field='help')
|
|
36
|
+
chip.set('tool', tool, 'task', task, 'var', 'ybins',
|
|
37
|
+
'Number of bins along the y-axis',
|
|
38
|
+
field='help')
|
|
39
|
+
|
|
40
|
+
xbins = int(chip.get('tool', tool, 'task', task, 'var', 'xbins',
|
|
41
|
+
step=step, index=index)[0])
|
|
42
|
+
ybins = int(chip.get('tool', tool, 'task', task, 'var', 'ybins',
|
|
43
|
+
step=step, index=index)[0])
|
|
44
|
+
|
|
45
|
+
for x in range(xbins):
|
|
46
|
+
for y in range(ybins):
|
|
47
|
+
chip.add('tool', tool, 'task', task, 'input', f'{design}_X{x}_Y{y}.png',
|
|
48
|
+
step=step, index=index)
|
|
49
|
+
|
|
50
|
+
chip.set('tool', tool, 'task', task, 'output', f'{design}.png',
|
|
51
|
+
step=step, index=index)
|
|
52
|
+
|
|
53
|
+
options = []
|
|
54
|
+
|
|
55
|
+
for y in range(ybins):
|
|
56
|
+
for x in range(xbins):
|
|
57
|
+
options.append(f'inputs/{design}_X{x}_Y{y}.png')
|
|
58
|
+
|
|
59
|
+
options.append('-tile')
|
|
60
|
+
options.append(f'{xbins}x{ybins}')
|
|
61
|
+
options.append('-geometry')
|
|
62
|
+
options.append('+0+0')
|
|
63
|
+
options.append(f'outputs/{design}.png')
|
|
64
|
+
|
|
65
|
+
chip.set('tool', tool, 'task', task, 'option', options,
|
|
66
|
+
step=step, index=index)
|