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,46 @@
|
|
|
1
|
+
from siliconcompiler.tools.builtin import _common
|
|
2
|
+
from siliconcompiler.tools.builtin import minimum
|
|
3
|
+
from siliconcompiler.tools.builtin.builtin import set_io_files
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def setup(chip):
|
|
7
|
+
'''
|
|
8
|
+
Selects the task with the maximum metric score from a list of inputs.
|
|
9
|
+
|
|
10
|
+
Sequence of operation:
|
|
11
|
+
|
|
12
|
+
1. Check list of input tasks to see if all metrics meets goals
|
|
13
|
+
2. Check list of input tasks to find global min/max for each metric
|
|
14
|
+
3. Select MAX value if all metrics are met.
|
|
15
|
+
4. Normalize the min value as sel = (val - MIN) / (MAX - MIN)
|
|
16
|
+
5. Return normalized value and task name
|
|
17
|
+
|
|
18
|
+
Meeting metric goals takes precedence over compute metric scores.
|
|
19
|
+
Only goals with values set and metrics with weights set are considered
|
|
20
|
+
in the calculation.
|
|
21
|
+
'''
|
|
22
|
+
|
|
23
|
+
set_io_files(chip)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _select_inputs(chip, step, index):
|
|
27
|
+
inputs = _common._select_inputs(chip, step, index)
|
|
28
|
+
|
|
29
|
+
score, sel_inputs = _common._minmax(chip, *inputs, op='maximum')
|
|
30
|
+
|
|
31
|
+
if sel_inputs:
|
|
32
|
+
chip.logger.info(f"Selected '{sel_inputs[0]}{sel_inputs[1]}' with score {score:.3f}")
|
|
33
|
+
|
|
34
|
+
return sel_inputs
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _gather_outputs(chip, step, index):
|
|
38
|
+
return minimum._gather_outputs(chip, step, index)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def run(chip):
|
|
42
|
+
return _common.run(chip)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def post_process(chip):
|
|
46
|
+
_common.post_process(chip)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
from siliconcompiler.tools.builtin import _common
|
|
2
|
+
from siliconcompiler import flowgraph
|
|
3
|
+
from siliconcompiler.tools.builtin.builtin import set_io_files
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def setup(chip):
|
|
7
|
+
'''
|
|
8
|
+
Selects the task with the minimum metric score from a list of inputs.
|
|
9
|
+
|
|
10
|
+
Sequence of operation:
|
|
11
|
+
|
|
12
|
+
1. Check list of input tasks to see if all metrics meets goals
|
|
13
|
+
2. Check list of input tasks to find global min/max for each metric
|
|
14
|
+
3. Select MIN value if all metrics are met.
|
|
15
|
+
4. Normalize the min value as sel = (val - MIN) / (MAX - MIN)
|
|
16
|
+
5. Return normalized value and task name
|
|
17
|
+
|
|
18
|
+
Meeting metric goals takes precedence over compute metric scores.
|
|
19
|
+
Only goals with values set and metrics with weights set are considered
|
|
20
|
+
in the calculation.
|
|
21
|
+
'''
|
|
22
|
+
|
|
23
|
+
set_io_files(chip)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _select_inputs(chip, step, index):
|
|
27
|
+
inputs = _common._select_inputs(chip, step, index)
|
|
28
|
+
|
|
29
|
+
score, sel_inputs = _common._minmax(chip, *inputs, op='minimum')
|
|
30
|
+
|
|
31
|
+
if sel_inputs:
|
|
32
|
+
chip.logger.info(f"Selected '{sel_inputs[0]}{sel_inputs[1]}' with score {score:.3f}")
|
|
33
|
+
|
|
34
|
+
return sel_inputs
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _gather_outputs(chip, step, index):
|
|
38
|
+
'''Return set of filenames that are guaranteed to be in outputs
|
|
39
|
+
directory after a successful run of step/index.'''
|
|
40
|
+
|
|
41
|
+
flow = chip.get('option', 'flow')
|
|
42
|
+
|
|
43
|
+
in_nodes = chip.get('flowgraph', flow, step, index, 'input')
|
|
44
|
+
in_task_outputs = [flowgraph._gather_outputs(chip, *node) for node in in_nodes]
|
|
45
|
+
|
|
46
|
+
if len(in_task_outputs) > 0:
|
|
47
|
+
return in_task_outputs[0].intersection(*in_task_outputs[1:])
|
|
48
|
+
|
|
49
|
+
return []
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def run(chip):
|
|
53
|
+
return _common.run(chip)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def post_process(chip):
|
|
57
|
+
_common.post_process(chip)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
from siliconcompiler.tools.builtin import _common
|
|
2
|
+
import re
|
|
3
|
+
from siliconcompiler.tools.builtin.builtin import set_io_files
|
|
4
|
+
from siliconcompiler import flowgraph, SiliconCompilerError
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def setup(chip):
|
|
8
|
+
'''
|
|
9
|
+
Selects a task from a list of inputs.
|
|
10
|
+
|
|
11
|
+
The selector criteria provided is used to create a custom function
|
|
12
|
+
for selecting the best step/index pair from the inputs. Metrics and
|
|
13
|
+
weights are passed in and used to select the step/index based on
|
|
14
|
+
the minimum or maximum score depending on the 'op' argument from
|
|
15
|
+
['flowgraph', flow, step, index, 'args'] in the form 'minimum(metric)' or
|
|
16
|
+
'maximum(metric)'.
|
|
17
|
+
|
|
18
|
+
The function can be used to bypass the flows weight functions for
|
|
19
|
+
the purpose of conditional flow execution and verification.
|
|
20
|
+
'''
|
|
21
|
+
|
|
22
|
+
set_io_files(chip)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _select_inputs(chip, step, index):
|
|
26
|
+
chip.logger.info("Running builtin task 'mux'")
|
|
27
|
+
|
|
28
|
+
flow = chip.get('option', 'flow')
|
|
29
|
+
inputs = chip.get('flowgraph', flow, step, index, 'input')
|
|
30
|
+
arguments = chip.get('flowgraph', flow, step, index, 'args')
|
|
31
|
+
|
|
32
|
+
operations = []
|
|
33
|
+
for criteria in arguments:
|
|
34
|
+
m = re.match(r'(minimum|maximum)\((\w+)\)', criteria)
|
|
35
|
+
if not m:
|
|
36
|
+
raise SiliconCompilerError(f"Illegal mux criteria: {criteria}", chip=chip)
|
|
37
|
+
|
|
38
|
+
op = m.group(1)
|
|
39
|
+
metric = m.group(2)
|
|
40
|
+
if metric not in chip.getkeys('metric'):
|
|
41
|
+
raise SiliconCompilerError(
|
|
42
|
+
f"Criteria must use legal metrics only: {criteria}", chip=chip)
|
|
43
|
+
|
|
44
|
+
operations.append((metric, op))
|
|
45
|
+
score, sel_inputs = _common._mux(chip, *inputs, operations=operations)
|
|
46
|
+
|
|
47
|
+
if sel_inputs:
|
|
48
|
+
chip.logger.info(f"Selected '{sel_inputs[0]}{sel_inputs[1]}' with score {score:.3f}")
|
|
49
|
+
|
|
50
|
+
return sel_inputs
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _gather_outputs(chip, step, index):
|
|
54
|
+
flow = chip.get('option', 'flow')
|
|
55
|
+
|
|
56
|
+
in_nodes = chip.get('flowgraph', flow, step, index, 'input')
|
|
57
|
+
in_task_outputs = [flowgraph._gather_outputs(chip, *node) for node in in_nodes]
|
|
58
|
+
|
|
59
|
+
if len(in_task_outputs) > 0:
|
|
60
|
+
return in_task_outputs[0].intersection(*in_task_outputs[1:])
|
|
61
|
+
|
|
62
|
+
return []
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def run(chip):
|
|
66
|
+
return _common.run(chip)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def post_process(chip):
|
|
70
|
+
_common.post_process(chip)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from siliconcompiler.tools.builtin import _common
|
|
2
|
+
from siliconcompiler.tools.builtin.builtin import set_io_files
|
|
3
|
+
from siliconcompiler import flowgraph
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def setup(chip):
|
|
7
|
+
'''
|
|
8
|
+
A no-operation that passes inputs to outputs.
|
|
9
|
+
'''
|
|
10
|
+
|
|
11
|
+
set_io_files(chip)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _select_inputs(chip, step, index):
|
|
15
|
+
return _common._select_inputs(chip, step, index)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _gather_outputs(chip, step, index):
|
|
19
|
+
'''Return set of filenames that are guaranteed to be in outputs
|
|
20
|
+
directory after a successful run of step/index.'''
|
|
21
|
+
|
|
22
|
+
flow = chip.get('option', 'flow')
|
|
23
|
+
|
|
24
|
+
in_nodes = chip.get('flowgraph', flow, step, index, 'input')
|
|
25
|
+
in_task_outputs = [flowgraph._gather_outputs(chip, *node) for node in in_nodes]
|
|
26
|
+
|
|
27
|
+
if len(in_task_outputs) > 0:
|
|
28
|
+
return in_task_outputs[0].union(*in_task_outputs[1:])
|
|
29
|
+
|
|
30
|
+
return []
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def run(chip):
|
|
34
|
+
return _common.run(chip)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def post_process(chip):
|
|
38
|
+
_common.post_process(chip)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from siliconcompiler.tools.builtin import _common
|
|
2
|
+
from siliconcompiler.schema import Schema
|
|
3
|
+
from siliconcompiler.scheduler import _haltstep
|
|
4
|
+
from siliconcompiler.tools.builtin.builtin import set_io_files
|
|
5
|
+
from siliconcompiler import utils, flowgraph, SiliconCompilerError
|
|
6
|
+
|
|
7
|
+
import re
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def setup(chip):
|
|
11
|
+
'''
|
|
12
|
+
Tests an assertion on an input task.
|
|
13
|
+
|
|
14
|
+
The input to this task is verified to ensure that all assertions
|
|
15
|
+
are True. If any of the assertions fail, False is returned.
|
|
16
|
+
Assertions are passed in using ['flowgraph', flow, step, index, 'args'] in the form
|
|
17
|
+
'metric==0.0'.
|
|
18
|
+
The allowed conditional operators are: >, <, >=, <=, ==
|
|
19
|
+
'''
|
|
20
|
+
|
|
21
|
+
set_io_files(chip, outputs=False)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _select_inputs(chip, step, index):
|
|
25
|
+
inputs = _common._select_inputs(chip, step, index)
|
|
26
|
+
if len(inputs) != 1:
|
|
27
|
+
raise SiliconCompilerError(
|
|
28
|
+
f'{step}{index} receives {len(inputs)} inputs, but only supports one', chip=chip)
|
|
29
|
+
inputs = inputs[0]
|
|
30
|
+
flow = chip.get('option', 'flow')
|
|
31
|
+
arguments = chip.get('flowgraph', flow, step, index, 'args')
|
|
32
|
+
|
|
33
|
+
if len(arguments) == 0:
|
|
34
|
+
raise SiliconCompilerError(f'{step}{index} requires arguments for verify', chip=chip)
|
|
35
|
+
|
|
36
|
+
passes = True
|
|
37
|
+
for criteria in arguments:
|
|
38
|
+
m = re.match(r'(\w+)([\>\=\<]+)(\w+)', criteria)
|
|
39
|
+
if not m:
|
|
40
|
+
raise SiliconCompilerError(f"Illegal verify criteria: {criteria}", chip=chip)
|
|
41
|
+
|
|
42
|
+
metric = m.group(1)
|
|
43
|
+
op = m.group(2)
|
|
44
|
+
goal = m.group(3)
|
|
45
|
+
if metric not in chip.getkeys('metric'):
|
|
46
|
+
raise SiliconCompilerError(
|
|
47
|
+
f"Criteria must use legal metrics only: {criteria}", chip=chip)
|
|
48
|
+
|
|
49
|
+
value = chip.get('metric', metric, step=inputs[0], index=inputs[1])
|
|
50
|
+
|
|
51
|
+
if value is None:
|
|
52
|
+
raise SiliconCompilerError(
|
|
53
|
+
f"Missing metric for {metric} in {inputs[0]}{inputs[1]}", chip=chip)
|
|
54
|
+
|
|
55
|
+
metric_type = chip.get('metric', metric, field='type')
|
|
56
|
+
goal = Schema._normalize_value(goal, metric_type, "", None)
|
|
57
|
+
if not utils.safecompare(chip, value, op, goal):
|
|
58
|
+
chip.error(f"{step}{index} fails '{metric}' metric: {value}{op}{goal}")
|
|
59
|
+
|
|
60
|
+
if not passes:
|
|
61
|
+
_haltstep(chip, flow, step, index)
|
|
62
|
+
|
|
63
|
+
return inputs
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _gather_outputs(chip, step, index):
|
|
67
|
+
flow = chip.get('option', 'flow')
|
|
68
|
+
|
|
69
|
+
in_nodes = chip.get('flowgraph', flow, step, index, 'input')
|
|
70
|
+
in_task_outputs = [flowgraph._gather_outputs(chip, *node) for node in in_nodes]
|
|
71
|
+
|
|
72
|
+
if len(in_task_outputs) > 0:
|
|
73
|
+
return in_task_outputs[0].intersection(*in_task_outputs[1:])
|
|
74
|
+
|
|
75
|
+
return []
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def run(chip):
|
|
79
|
+
return _common.run(chip)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def post_process(chip):
|
|
83
|
+
_common.post_process(chip)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Based on https://github.com/freechipsproject/chisel-template/blob/main/build.sbt
|
|
2
|
+
|
|
3
|
+
ThisBuild / scalaVersion := "2.12.13"
|
|
4
|
+
|
|
5
|
+
Compile / scalaSource := baseDirectory.value / "inputs"
|
|
6
|
+
|
|
7
|
+
lazy val root = (project in file("."))
|
|
8
|
+
.settings(
|
|
9
|
+
libraryDependencies ++= Seq(
|
|
10
|
+
"edu.berkeley.cs" %% "chisel3" % "3.4.3",
|
|
11
|
+
"edu.berkeley.cs" %% "chiseltest" % "0.3.3" % "test"
|
|
12
|
+
),
|
|
13
|
+
scalacOptions ++= Seq(
|
|
14
|
+
"-Xsource:2.11",
|
|
15
|
+
"-language:reflectiveCalls",
|
|
16
|
+
"-deprecation",
|
|
17
|
+
"-feature",
|
|
18
|
+
"-Xcheckinit",
|
|
19
|
+
// Enables autoclonetype2 in 3.4.x (on by default in 3.5)
|
|
20
|
+
"-P:chiselplugin:useBundlePlugin"
|
|
21
|
+
),
|
|
22
|
+
addCompilerPlugin("edu.berkeley.cs" % "chisel3-plugin" % "3.4.3" cross CrossVersion.full),
|
|
23
|
+
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full)
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
// Prevents exception on exit
|
|
27
|
+
trapExit := false
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'''
|
|
2
|
+
Chisel is a hardware design language that facilitates advanced circuit
|
|
3
|
+
generation and design reuse for both ASIC and FPGA digital logic designs.
|
|
4
|
+
Chisel adds hardware construction primitives to the Scala programming
|
|
5
|
+
language, providing designers with the power of a modern programming
|
|
6
|
+
language to write complex, parameterizable circuit generators that produce
|
|
7
|
+
synthesizable Verilog.
|
|
8
|
+
|
|
9
|
+
Documentation: https://www.chisel-lang.org/docs
|
|
10
|
+
|
|
11
|
+
Sources: https://github.com/chipsalliance/chisel
|
|
12
|
+
|
|
13
|
+
Installation: The Chisel plugin relies on having the Scala Build Tool (sbt)
|
|
14
|
+
installed. Instructions: https://www.scala-sbt.org/download.html.
|
|
15
|
+
'''
|
|
16
|
+
|
|
17
|
+
from siliconcompiler.tools.chisel import convert
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
####################################################################
|
|
21
|
+
# Make Docs
|
|
22
|
+
####################################################################
|
|
23
|
+
def make_docs(chip):
|
|
24
|
+
convert.setup(chip)
|
|
25
|
+
return chip
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def parse_version(stdout):
|
|
29
|
+
# sbt version in this project: 1.5.5
|
|
30
|
+
# sbt script version: 1.5.5
|
|
31
|
+
|
|
32
|
+
for line in stdout.splitlines():
|
|
33
|
+
line = line.strip()
|
|
34
|
+
if 'sbt script version:' in line:
|
|
35
|
+
return line.split()[-1]
|
|
36
|
+
|
|
37
|
+
return None
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import shutil
|
|
3
|
+
import glob
|
|
4
|
+
from siliconcompiler.tools._common import add_frontend_requires, get_tool_task, has_input_files
|
|
5
|
+
from siliconcompiler import sc_open, SiliconCompilerError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def setup(chip):
|
|
9
|
+
'''
|
|
10
|
+
Performs high level synthesis to generate a verilog output
|
|
11
|
+
'''
|
|
12
|
+
|
|
13
|
+
if not has_input_files(chip, 'input', 'config', 'chisel') and \
|
|
14
|
+
not has_input_files(chip, 'input', 'hll', 'scala'):
|
|
15
|
+
return "no files in [input,hll,scala] or [input,config,chisel]"
|
|
16
|
+
|
|
17
|
+
tool = 'chisel'
|
|
18
|
+
step = chip.get('arg', 'step')
|
|
19
|
+
index = chip.get('arg', 'index')
|
|
20
|
+
_, task = get_tool_task(chip, step, index)
|
|
21
|
+
|
|
22
|
+
# Standard Setup
|
|
23
|
+
refdir = 'tools/' + tool
|
|
24
|
+
chip.set('tool', tool, 'exe', 'sbt')
|
|
25
|
+
chip.set('tool', tool, 'vswitch', '--version')
|
|
26
|
+
chip.set('tool', tool, 'version', '>=1.5.5', clobber=False)
|
|
27
|
+
|
|
28
|
+
chip.set('tool', tool, 'task', task, 'refdir', refdir,
|
|
29
|
+
step=step, index=index,
|
|
30
|
+
package='siliconcompiler', clobber=False)
|
|
31
|
+
chip.set('tool', tool, 'task', task, 'threads', os.cpu_count(),
|
|
32
|
+
step=step, index=index, clobber=False)
|
|
33
|
+
|
|
34
|
+
chip.set('tool', tool, 'task', task, 'option', ['-batch',
|
|
35
|
+
'--no-share',
|
|
36
|
+
'--no-global'],
|
|
37
|
+
step=step, index=index)
|
|
38
|
+
|
|
39
|
+
chip.set('tool', tool, 'task', task, 'var', 'application',
|
|
40
|
+
'Application name of the chisel program',
|
|
41
|
+
field='help')
|
|
42
|
+
chip.set('tool', tool, 'task', task, 'var', 'argument',
|
|
43
|
+
'Arguments for the chisel build',
|
|
44
|
+
field='help')
|
|
45
|
+
|
|
46
|
+
# Input/Output requirements
|
|
47
|
+
if chip.valid('input', 'config', 'chisel') and \
|
|
48
|
+
chip.get('input', 'config', 'chisel', step=step, index=index):
|
|
49
|
+
chip.add('tool', tool, 'task', task, 'require', 'input,config,chisel',
|
|
50
|
+
step=step, index=index)
|
|
51
|
+
if len(chip.get('input', 'config', 'chisel', step=step, index=index)) != 1:
|
|
52
|
+
raise SiliconCompilerError('Only one build.sbt is supported.', chip=chip)
|
|
53
|
+
|
|
54
|
+
if chip.valid('input', 'hll', 'scala') and \
|
|
55
|
+
chip.get('input', 'hll', 'scala', step=step, index=index):
|
|
56
|
+
chip.add('tool', tool, 'task', task, 'require', 'input,hll,scala',
|
|
57
|
+
step=step, index=index)
|
|
58
|
+
|
|
59
|
+
chip.add('tool', tool, 'task', task, 'output', chip.top() + '.v', step=step, index=index)
|
|
60
|
+
|
|
61
|
+
add_frontend_requires(chip, [])
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def pre_process(chip):
|
|
65
|
+
tool = 'chisel'
|
|
66
|
+
step = chip.get('arg', 'step')
|
|
67
|
+
index = chip.get('arg', 'index')
|
|
68
|
+
_, task = get_tool_task(chip, step, index)
|
|
69
|
+
|
|
70
|
+
refdir = chip.find_files('tool', tool, 'task', task, 'refdir', step=step, index=index)[0]
|
|
71
|
+
|
|
72
|
+
if chip.valid('input', 'config', 'chisel') and \
|
|
73
|
+
chip.get('input', 'config', 'chisel', step=step, index=index):
|
|
74
|
+
build_file = chip.find_files('input', 'config', 'chisel', step=step, index=index)[0]
|
|
75
|
+
work_dir = chip.getworkdir(step=step, index=index)
|
|
76
|
+
build_dir = os.path.dirname(build_file)
|
|
77
|
+
# Expect file tree from: https://www.scala-sbt.org/1.x/docs/Directories.html
|
|
78
|
+
# copy build.sbt
|
|
79
|
+
# copy src/
|
|
80
|
+
shutil.copyfile(build_file, os.path.join(work_dir, 'build.sbt'))
|
|
81
|
+
shutil.copytree(os.path.join(build_dir, 'src'),
|
|
82
|
+
os.path.join(work_dir, 'src'))
|
|
83
|
+
if os.path.exists(os.path.join(build_dir, 'project')):
|
|
84
|
+
shutil.copytree(os.path.join(build_dir, 'project'),
|
|
85
|
+
os.path.join(work_dir, 'project'))
|
|
86
|
+
return
|
|
87
|
+
|
|
88
|
+
for filename in ('build.sbt', 'SCDriver.scala'):
|
|
89
|
+
src = os.path.join(refdir, filename)
|
|
90
|
+
dst = filename
|
|
91
|
+
shutil.copyfile(src, dst)
|
|
92
|
+
|
|
93
|
+
# Chisel driver relies on Scala files being collected into '$CWD/inputs'
|
|
94
|
+
chip.set('input', 'hll', 'scala', True, field='copy')
|
|
95
|
+
chip.collect(directory=os.path.join(chip.getworkdir(step=step, index=index), 'inputs'))
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def runtime_options(chip):
|
|
99
|
+
step = chip.get('arg', 'step')
|
|
100
|
+
index = chip.get('arg', 'index')
|
|
101
|
+
tool, task = get_tool_task(chip, step, index)
|
|
102
|
+
|
|
103
|
+
design = chip.top()
|
|
104
|
+
|
|
105
|
+
runMain = ["runMain"]
|
|
106
|
+
if chip.valid('input', 'config', 'chisel') and \
|
|
107
|
+
chip.get('input', 'config', 'chisel', step=step, index=index):
|
|
108
|
+
app = design
|
|
109
|
+
if chip.valid('tool', tool, 'task', task, 'var', 'application') and \
|
|
110
|
+
chip.get('tool', tool, 'task', task, 'var', 'application', step=step, index=index):
|
|
111
|
+
app = chip.get('tool', tool, 'task', task, 'var', 'application',
|
|
112
|
+
step=step, index=index)[0]
|
|
113
|
+
|
|
114
|
+
runMain.append(f"{app}")
|
|
115
|
+
|
|
116
|
+
if chip.valid('tool', tool, 'task', task, 'var', 'argument') and \
|
|
117
|
+
chip.get('tool', tool, 'task', task, 'var', 'argument', step=step, index=index):
|
|
118
|
+
runMain.extend(chip.get('tool', tool, 'task', task, 'var', 'argument',
|
|
119
|
+
step=step, index=index))
|
|
120
|
+
runMain.append("--")
|
|
121
|
+
|
|
122
|
+
runMain.append("--target-dir chisel-output")
|
|
123
|
+
else:
|
|
124
|
+
# Use built in driver
|
|
125
|
+
runMain.append("SCDriver")
|
|
126
|
+
runMain.append(f"--module {chip.top(step=step, index=index)}")
|
|
127
|
+
|
|
128
|
+
runMain.append(f"--output-file ../outputs/{design}.v")
|
|
129
|
+
|
|
130
|
+
return [f'"{" ".join(runMain)}"']
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def post_process(chip):
|
|
134
|
+
chisel_path = 'chisel-output'
|
|
135
|
+
if os.path.exists(chisel_path):
|
|
136
|
+
design = chip.top()
|
|
137
|
+
with open(f'outputs/{design}.v', 'w') as out:
|
|
138
|
+
for f in glob.glob(os.path.join(chisel_path, '*.v')):
|
|
139
|
+
with sc_open(f) as i_file:
|
|
140
|
+
out.writelines(i_file.readlines())
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import glob
|
|
2
|
+
import os
|
|
3
|
+
import stat
|
|
4
|
+
from siliconcompiler.tools.execute.execute import setup as tool_setup
|
|
5
|
+
from siliconcompiler.tools._common import input_provides, get_tool_task
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def setup(chip):
|
|
9
|
+
'''
|
|
10
|
+
Execute the output of the previous step directly.
|
|
11
|
+
This only works if the task receives a single file.
|
|
12
|
+
'''
|
|
13
|
+
tool_setup(chip)
|
|
14
|
+
|
|
15
|
+
step = chip.get('arg', 'step')
|
|
16
|
+
index = chip.get('arg', 'index')
|
|
17
|
+
tool, task = get_tool_task(chip, step, index)
|
|
18
|
+
|
|
19
|
+
chip.set('tool', tool, 'task', task, 'input',
|
|
20
|
+
list(input_provides(chip, step, index).keys()),
|
|
21
|
+
step=step, index=index)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def pre_process(chip):
|
|
25
|
+
step = chip.get('arg', 'step')
|
|
26
|
+
index = chip.get('arg', 'index')
|
|
27
|
+
tool, _ = get_tool_task(chip, step, index)
|
|
28
|
+
|
|
29
|
+
exec = None
|
|
30
|
+
for fin in glob.glob('inputs/*'):
|
|
31
|
+
if fin.endswith('.pkg.json'):
|
|
32
|
+
continue
|
|
33
|
+
exec = os.path.abspath(fin)
|
|
34
|
+
break
|
|
35
|
+
|
|
36
|
+
if not exec:
|
|
37
|
+
chip.error(f'{step}{index} did not receive an executable file')
|
|
38
|
+
|
|
39
|
+
chip.set('tool', tool, 'exe', exec)
|
|
40
|
+
|
|
41
|
+
os.chmod(exec, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'''
|
|
2
|
+
This tool is used to execute the output of a previous step.
|
|
3
|
+
For example, if the flow contains a compile step which generates the
|
|
4
|
+
next executable needed in the flow.
|
|
5
|
+
'''
|
|
6
|
+
|
|
7
|
+
from siliconcompiler.tools._common import get_tool_task
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def setup(chip):
|
|
11
|
+
step = chip.get('arg', 'step')
|
|
12
|
+
index = chip.get('arg', 'index')
|
|
13
|
+
|
|
14
|
+
tool, task = get_tool_task(chip, step, index)
|
|
15
|
+
|
|
16
|
+
chip.set('tool', tool, 'exe', ":exe:", clobber=False)
|
|
17
|
+
chip.set('tool', tool, 'task', task, 'option', [], step=step, index=index, clobber=False)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import shutil
|
|
3
|
+
from siliconcompiler.tools.genfasm import genfasm
|
|
4
|
+
from siliconcompiler.tools.vpr import vpr
|
|
5
|
+
from siliconcompiler.tools._common import get_tool_task
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def setup(chip):
|
|
9
|
+
'''
|
|
10
|
+
Generates a bitstream
|
|
11
|
+
'''
|
|
12
|
+
genfasm.setup(chip)
|
|
13
|
+
|
|
14
|
+
step = chip.get('arg', 'step')
|
|
15
|
+
index = chip.get('arg', 'index')
|
|
16
|
+
tool, task = get_tool_task(chip, step, index)
|
|
17
|
+
|
|
18
|
+
chip.set('tool', tool, 'task', task, 'threads', os.cpu_count(),
|
|
19
|
+
step=step, index=index, clobber=False)
|
|
20
|
+
|
|
21
|
+
chip.set('tool', tool, 'task', task, 'regex', 'warnings', "^Warning",
|
|
22
|
+
step=step, index=index, clobber=False)
|
|
23
|
+
chip.set('tool', tool, 'task', task, 'regex', 'errors', "^Error",
|
|
24
|
+
step=step, index=index, clobber=False)
|
|
25
|
+
|
|
26
|
+
design = chip.top()
|
|
27
|
+
|
|
28
|
+
chip.set('tool', tool, 'task', task, 'input', design + '.route', step=step, index=index)
|
|
29
|
+
chip.add('tool', tool, 'task', task, 'input', design + '.blif', step=step, index=index)
|
|
30
|
+
chip.add('tool', tool, 'task', task, 'input', design + '.net', step=step, index=index)
|
|
31
|
+
chip.add('tool', tool, 'task', task, 'input', design + '.place', step=step, index=index)
|
|
32
|
+
|
|
33
|
+
chip.add('tool', tool, 'task', task, 'output', design + '.fasm', step=step, index=index)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def runtime_options(chip):
|
|
37
|
+
options = vpr.runtime_options(chip)
|
|
38
|
+
|
|
39
|
+
design = chip.top()
|
|
40
|
+
|
|
41
|
+
blif = f"inputs/{design}.blif"
|
|
42
|
+
options.append(blif)
|
|
43
|
+
|
|
44
|
+
options.append(f'--net_file inputs/{design}.net')
|
|
45
|
+
options.append(f'--place_file inputs/{design}.place')
|
|
46
|
+
options.append(f'--route_file inputs/{design}.route')
|
|
47
|
+
|
|
48
|
+
return options
|
|
49
|
+
|
|
50
|
+
################################
|
|
51
|
+
# Post_process (post executable)
|
|
52
|
+
################################
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def post_process(chip):
|
|
56
|
+
''' Tool specific function to run after step execution
|
|
57
|
+
'''
|
|
58
|
+
vpr.vpr_post_process(chip)
|
|
59
|
+
|
|
60
|
+
design = chip.top()
|
|
61
|
+
shutil.move(f'{design}.fasm', 'outputs')
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from siliconcompiler.tools.vpr.vpr import parse_version as vpr_parse_version
|
|
2
|
+
from siliconcompiler.tools.vpr.vpr import normalize_version as vpr_normalize_version
|
|
3
|
+
|
|
4
|
+
'''
|
|
5
|
+
Generate a `FSAM <https://github.com/chipsalliance/fasm>`_ file from the output of
|
|
6
|
+
`VPR <https://github.com/verilog-to-routing/vtr-verilog-to-routing>`_
|
|
7
|
+
|
|
8
|
+
Documentation: https://docs.verilogtorouting.org/en/latest/utils/fasm/
|
|
9
|
+
|
|
10
|
+
Sources: https://github.com/verilog-to-routing/vtr-verilog-to-routing/tree/master/utils/fasm
|
|
11
|
+
'''
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
######################################################################
|
|
15
|
+
# Make Docs
|
|
16
|
+
######################################################################
|
|
17
|
+
def make_docs(chip):
|
|
18
|
+
from siliconcompiler.tools.genfasm.bitstream import setup
|
|
19
|
+
setup(chip)
|
|
20
|
+
return chip
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def setup(chip):
|
|
24
|
+
chip.set('tool', 'genfasm', 'exe', 'genfasm', clobber=False)
|
|
25
|
+
chip.set('tool', 'genfasm', 'vswitch', '--version')
|
|
26
|
+
chip.set('tool', 'genfasm', 'version', '>=8.1.0', clobber=False)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def parse_version(chip):
|
|
30
|
+
return vpr_parse_version(chip)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def normalize_version(chip):
|
|
34
|
+
return vpr_normalize_version(chip)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
##################################################
|
|
38
|
+
if __name__ == "__main__":
|
|
39
|
+
chip = make_docs()
|
|
40
|
+
chip.write_manifest("genfasm.json")
|