siliconcompiler 0.34.2__py3-none-any.whl → 0.34.3__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 +12 -5
- siliconcompiler/__main__.py +1 -7
- siliconcompiler/_metadata.py +1 -1
- siliconcompiler/apps/_common.py +104 -23
- siliconcompiler/apps/sc.py +4 -8
- siliconcompiler/apps/sc_dashboard.py +6 -4
- siliconcompiler/apps/sc_install.py +10 -6
- siliconcompiler/apps/sc_issue.py +7 -5
- siliconcompiler/apps/sc_remote.py +1 -1
- siliconcompiler/apps/sc_server.py +9 -14
- siliconcompiler/apps/sc_show.py +6 -5
- siliconcompiler/apps/smake.py +130 -94
- siliconcompiler/apps/utils/replay.py +4 -7
- siliconcompiler/apps/utils/summarize.py +3 -5
- siliconcompiler/asic.py +420 -0
- siliconcompiler/checklist.py +25 -2
- siliconcompiler/cmdlineschema.py +534 -0
- siliconcompiler/constraints/asic_component.py +2 -2
- siliconcompiler/constraints/asic_pins.py +2 -2
- siliconcompiler/constraints/asic_timing.py +3 -3
- siliconcompiler/core.py +7 -32
- siliconcompiler/data/templates/tcl/manifest.tcl.j2 +8 -0
- siliconcompiler/dependencyschema.py +89 -31
- siliconcompiler/design.py +176 -207
- siliconcompiler/filesetschema.py +250 -0
- siliconcompiler/flowgraph.py +274 -95
- siliconcompiler/fpga.py +124 -1
- siliconcompiler/library.py +218 -20
- siliconcompiler/metric.py +233 -20
- siliconcompiler/package/__init__.py +271 -50
- siliconcompiler/package/git.py +92 -16
- siliconcompiler/package/github.py +108 -12
- siliconcompiler/package/https.py +79 -16
- siliconcompiler/packageschema.py +88 -7
- siliconcompiler/pathschema.py +31 -2
- siliconcompiler/pdk.py +566 -1
- siliconcompiler/project.py +1095 -94
- siliconcompiler/record.py +38 -1
- siliconcompiler/remote/__init__.py +5 -2
- siliconcompiler/remote/client.py +11 -6
- siliconcompiler/remote/schema.py +5 -23
- siliconcompiler/remote/server.py +41 -54
- siliconcompiler/report/__init__.py +3 -3
- siliconcompiler/report/dashboard/__init__.py +48 -14
- siliconcompiler/report/dashboard/cli/__init__.py +99 -21
- siliconcompiler/report/dashboard/cli/board.py +364 -179
- siliconcompiler/report/dashboard/web/__init__.py +90 -12
- siliconcompiler/report/dashboard/web/components/__init__.py +219 -240
- siliconcompiler/report/dashboard/web/components/flowgraph.py +49 -26
- siliconcompiler/report/dashboard/web/components/graph.py +139 -100
- siliconcompiler/report/dashboard/web/layouts/__init__.py +29 -1
- siliconcompiler/report/dashboard/web/layouts/_common.py +38 -2
- siliconcompiler/report/dashboard/web/layouts/vertical_flowgraph.py +39 -26
- siliconcompiler/report/dashboard/web/layouts/vertical_flowgraph_node_tab.py +50 -50
- siliconcompiler/report/dashboard/web/layouts/vertical_flowgraph_sac_tabs.py +49 -46
- siliconcompiler/report/dashboard/web/state.py +141 -14
- siliconcompiler/report/dashboard/web/utils/__init__.py +79 -16
- siliconcompiler/report/dashboard/web/utils/file_utils.py +74 -11
- siliconcompiler/report/dashboard/web/viewer.py +25 -1
- siliconcompiler/report/report.py +5 -2
- siliconcompiler/report/summary_image.py +29 -11
- siliconcompiler/scheduler/__init__.py +9 -1
- siliconcompiler/scheduler/docker.py +79 -1
- siliconcompiler/scheduler/run_node.py +35 -19
- siliconcompiler/scheduler/scheduler.py +208 -24
- siliconcompiler/scheduler/schedulernode.py +372 -46
- siliconcompiler/scheduler/send_messages.py +77 -29
- siliconcompiler/scheduler/slurm.py +76 -12
- siliconcompiler/scheduler/taskscheduler.py +140 -20
- siliconcompiler/schema/__init__.py +0 -2
- siliconcompiler/schema/baseschema.py +194 -38
- siliconcompiler/schema/journal.py +7 -4
- siliconcompiler/schema/namedschema.py +16 -10
- siliconcompiler/schema/parameter.py +55 -9
- siliconcompiler/schema/parametervalue.py +60 -0
- siliconcompiler/schema/safeschema.py +25 -2
- siliconcompiler/schema/schema_cfg.py +5 -5
- siliconcompiler/schema/utils.py +2 -2
- siliconcompiler/schema_obj.py +20 -3
- siliconcompiler/tool.py +979 -302
- siliconcompiler/tools/bambu/__init__.py +41 -0
- siliconcompiler/tools/builtin/concatenate.py +2 -2
- siliconcompiler/tools/builtin/minimum.py +2 -1
- siliconcompiler/tools/builtin/mux.py +2 -1
- siliconcompiler/tools/builtin/nop.py +2 -1
- siliconcompiler/tools/builtin/verify.py +2 -1
- siliconcompiler/tools/klayout/__init__.py +95 -0
- siliconcompiler/tools/openroad/__init__.py +289 -0
- siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +3 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_detailed_route.tcl +7 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_global_route.tcl +8 -4
- siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +9 -5
- siliconcompiler/tools/openroad/scripts/common/write_images.tcl +5 -1
- siliconcompiler/tools/slang/__init__.py +1 -1
- siliconcompiler/tools/slang/elaborate.py +2 -1
- siliconcompiler/tools/vivado/scripts/sc_run.tcl +1 -1
- siliconcompiler/tools/vivado/scripts/sc_syn_fpga.tcl +8 -1
- siliconcompiler/tools/vivado/syn_fpga.py +6 -0
- siliconcompiler/tools/vivado/vivado.py +35 -2
- siliconcompiler/tools/vpr/__init__.py +150 -0
- siliconcompiler/tools/yosys/__init__.py +369 -1
- siliconcompiler/tools/yosys/scripts/procs.tcl +0 -1
- siliconcompiler/toolscripts/_tools.json +5 -10
- siliconcompiler/utils/__init__.py +66 -0
- siliconcompiler/utils/flowgraph.py +2 -2
- siliconcompiler/utils/issue.py +2 -1
- siliconcompiler/utils/logging.py +14 -0
- siliconcompiler/utils/multiprocessing.py +256 -0
- siliconcompiler/utils/showtools.py +10 -0
- {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/METADATA +5 -5
- {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/RECORD +115 -118
- {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/entry_points.txt +3 -0
- siliconcompiler/schema/cmdlineschema.py +0 -250
- siliconcompiler/toolscripts/rhel8/install-slang.sh +0 -40
- siliconcompiler/toolscripts/rhel9/install-slang.sh +0 -40
- siliconcompiler/toolscripts/ubuntu20/install-slang.sh +0 -47
- siliconcompiler/toolscripts/ubuntu22/install-slang.sh +0 -37
- siliconcompiler/toolscripts/ubuntu24/install-slang.sh +0 -37
- {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/WHEEL +0 -0
- {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/licenses/LICENSE +0 -0
- {siliconcompiler-0.34.2.dist-info → siliconcompiler-0.34.3.dist-info}/top_level.txt +0 -0
|
@@ -19,6 +19,12 @@ def setup(chip):
|
|
|
19
19
|
chip.add('tool', tool, 'task', task, 'output', f'{design}.vg',
|
|
20
20
|
step=step, index=index)
|
|
21
21
|
|
|
22
|
+
chip.set('tool', tool, 'task', task, 'var', 'synth_directive', 'Default',
|
|
23
|
+
step=step, index=index, clobber=False)
|
|
24
|
+
|
|
25
|
+
chip.set('tool', tool, 'task', task, 'var', 'synth_mode', 'none',
|
|
26
|
+
step=step, index=index, clobber=False)
|
|
27
|
+
|
|
22
28
|
|
|
23
29
|
def post_process(chip):
|
|
24
30
|
vivado.post_process(chip)
|
|
@@ -11,6 +11,7 @@ import re
|
|
|
11
11
|
from siliconcompiler import utils
|
|
12
12
|
from siliconcompiler import sc_open
|
|
13
13
|
from siliconcompiler.tools._common import record_metric
|
|
14
|
+
from siliconcompiler.tools._common import get_tool_task
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
def make_docs(chip):
|
|
@@ -57,6 +58,9 @@ def setup_task(chip, task):
|
|
|
57
58
|
chip.set('tool', tool, 'task', task, 'regex', 'warnings', r'^(CRITICAL )?WARNING:',
|
|
58
59
|
step=step, index=index, clobber=False)
|
|
59
60
|
|
|
61
|
+
chip.set('tool', tool, 'task', task, 'var', 'metric_luts', 'true',
|
|
62
|
+
step=step, index=index, clobber=False)
|
|
63
|
+
|
|
60
64
|
|
|
61
65
|
def parse_version(stdout):
|
|
62
66
|
# Vivado v2021.2 (64-bit)
|
|
@@ -121,9 +125,22 @@ def _parse_utilization(chip, step, index):
|
|
|
121
125
|
if not os.path.isfile('reports/total_utilization.rpt'):
|
|
122
126
|
return
|
|
123
127
|
|
|
128
|
+
step = chip.get('arg', 'step')
|
|
129
|
+
index = chip.get('arg', 'index')
|
|
130
|
+
tool, task = get_tool_task(chip, step, index)
|
|
131
|
+
|
|
124
132
|
with sc_open('reports/total_utilization.rpt') as f:
|
|
125
133
|
regexes = {
|
|
126
134
|
'luts': (re.compile(r'(?:CLB|Slice) LUTs\*?\s+\|\s+(\d+)'), int),
|
|
135
|
+
'lut6': (re.compile(r'LUT6\*?\s+\|\s+(\d+)'), int),
|
|
136
|
+
'lut5': (re.compile(r'LUT5\*?\s+\|\s+(\d+)'), int),
|
|
137
|
+
'lut4': (re.compile(r'LUT4\*?\s+\|\s+(\d+)'), int),
|
|
138
|
+
'lut3': (re.compile(r'LUT3\*?\s+\|\s+(\d+)'), int),
|
|
139
|
+
'lut2': (re.compile(r'LUT2\*?\s+\|\s+(\d+)'), int),
|
|
140
|
+
'lut1': (re.compile(r'LUT1\*?\s+\|\s+(\d+)'), int),
|
|
141
|
+
'f7mux': (re.compile(r'MUXF7\*?\s+\|\s+(\d+)'), int),
|
|
142
|
+
'f8mux': (re.compile(r'MUXF8\*?\s+\|\s+(\d+)'), int),
|
|
143
|
+
'dsps': (re.compile(r'DSPs\*?\s+\|\s+(\d+)'), int),
|
|
127
144
|
'regs': (re.compile(r'(?:CLB|Slice) Registers\s+\|\s+(\d+)'), int),
|
|
128
145
|
'bram': (re.compile(r'Block RAM Tile\s+\|\s+(\d+(.\d+)?)'), float),
|
|
129
146
|
# TODO: should URAM be float?
|
|
@@ -140,8 +157,20 @@ def _parse_utilization(chip, step, index):
|
|
|
140
157
|
vals[metric] = datatype(match.group(1))
|
|
141
158
|
continue
|
|
142
159
|
|
|
143
|
-
|
|
144
|
-
|
|
160
|
+
lut_cnt = 0
|
|
161
|
+
if chip.get('tool', tool, 'task', task, 'var', 'metric_luts', step=step, index=index)[0] \
|
|
162
|
+
== 'true':
|
|
163
|
+
lut_cnt = vals.get('luts', 0)
|
|
164
|
+
else:
|
|
165
|
+
lut_cnt = sum([cnt for name, cnt in vals.items() if name.startswith('lut')])
|
|
166
|
+
lut_cnt -= vals.get('luts', 0) # avoid double counting
|
|
167
|
+
if "f7mux" in vals:
|
|
168
|
+
lut_cnt += vals["f7mux"]
|
|
169
|
+
if "f8mux" in vals:
|
|
170
|
+
lut_cnt -= vals["f8mux"]
|
|
171
|
+
|
|
172
|
+
if lut_cnt != 0:
|
|
173
|
+
record_metric(chip, step, index, 'luts', lut_cnt,
|
|
145
174
|
'reports/total_utilization.rpt')
|
|
146
175
|
if 'regs' in vals:
|
|
147
176
|
record_metric(chip, step, index, 'registers', vals['regs'],
|
|
@@ -156,6 +185,10 @@ def _parse_utilization(chip, step, index):
|
|
|
156
185
|
record_metric(chip, step, index, 'brams', total_bram,
|
|
157
186
|
'reports/total_utilization.rpt')
|
|
158
187
|
|
|
188
|
+
if 'dsps' in vals:
|
|
189
|
+
record_metric(chip, step, index, 'dsps', vals['dsps'],
|
|
190
|
+
'reports/total_utilization.rpt')
|
|
191
|
+
|
|
159
192
|
|
|
160
193
|
def post_process(chip):
|
|
161
194
|
step = chip.get('arg', 'step')
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
from typing import List, Union
|
|
2
|
+
|
|
3
|
+
from siliconcompiler import FPGASchema
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class VPRFPGA(FPGASchema):
|
|
7
|
+
"""
|
|
8
|
+
Schema for defining library parameters specifically for the
|
|
9
|
+
VPR (Verilog Place and Route) tool.
|
|
10
|
+
|
|
11
|
+
This class extends the base FPGASchema to manage various settings
|
|
12
|
+
related to VPR, such as device information, channel width, resource types,
|
|
13
|
+
and input file paths for the architecture and routing graph.
|
|
14
|
+
"""
|
|
15
|
+
def __init__(self):
|
|
16
|
+
super().__init__()
|
|
17
|
+
|
|
18
|
+
self.define_tool_parameter("vpr", "devicecode", "str",
|
|
19
|
+
"The name or code for the target FPGA device.")
|
|
20
|
+
self.define_tool_parameter("vpr", "channelwidth", "int",
|
|
21
|
+
"The channel width to be used during routing.")
|
|
22
|
+
|
|
23
|
+
self.define_tool_parameter("vpr", "registers", "{str}",
|
|
24
|
+
"A set of supported register types.")
|
|
25
|
+
self.define_tool_parameter("vpr", "brams", "{str}",
|
|
26
|
+
"A set of supported block RAM types.")
|
|
27
|
+
self.define_tool_parameter("vpr", "dsps", "{str}",
|
|
28
|
+
"A set of supported DSP types.")
|
|
29
|
+
|
|
30
|
+
self.define_tool_parameter("vpr", "archfile", "file",
|
|
31
|
+
"The path to the VPR architecture description file.")
|
|
32
|
+
self.define_tool_parameter("vpr", "graphfile", "file",
|
|
33
|
+
"The path to the VPR routing graph file.")
|
|
34
|
+
self.define_tool_parameter("vpr", "constraintsmap", "file",
|
|
35
|
+
"The path to the VPR constraints map file.")
|
|
36
|
+
|
|
37
|
+
self.define_tool_parameter("vpr", "clock_model", "<ideal,route,dedicated_network>",
|
|
38
|
+
"The clock modeling strategy to be used.")
|
|
39
|
+
|
|
40
|
+
def set_vpr_devicecode(self, name: str):
|
|
41
|
+
"""
|
|
42
|
+
Sets the device code for VPR.
|
|
43
|
+
|
|
44
|
+
Args:
|
|
45
|
+
name (str): The name or code of the device.
|
|
46
|
+
"""
|
|
47
|
+
return self.set("tool", "vpr", "devicecode", name)
|
|
48
|
+
|
|
49
|
+
def set_vpr_channelwidth(self, width: int):
|
|
50
|
+
"""
|
|
51
|
+
Sets the channel width for VPR routing.
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
width (int): The channel width value.
|
|
55
|
+
"""
|
|
56
|
+
return self.set("tool", "vpr", "channelwidth", width)
|
|
57
|
+
|
|
58
|
+
def add_vpr_registertype(self, name: Union[str, List[str]] = None, clobber: bool = False):
|
|
59
|
+
"""
|
|
60
|
+
Adds one or more register types to the list of supported registers.
|
|
61
|
+
|
|
62
|
+
Args:
|
|
63
|
+
name (Union[str, List[str]], optional): The register type or a list of types.
|
|
64
|
+
Defaults to None.
|
|
65
|
+
clobber (bool, optional): If True, overwrites the existing list.
|
|
66
|
+
If False, adds to the list. Defaults to False.
|
|
67
|
+
"""
|
|
68
|
+
if clobber:
|
|
69
|
+
return self.set("tool", "vpr", "registers", name)
|
|
70
|
+
else:
|
|
71
|
+
return self.add("tool", "vpr", "registers", name)
|
|
72
|
+
|
|
73
|
+
def add_vpr_bramtype(self, name: Union[str, List[str]] = None, clobber: bool = False):
|
|
74
|
+
"""
|
|
75
|
+
Adds one or more block RAM types to the list of supported BRAMs.
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
name (Union[str, List[str]], optional): The BRAM type or a list of types.
|
|
79
|
+
Defaults to None.
|
|
80
|
+
clobber (bool, optional): If True, overwrites the existing list.
|
|
81
|
+
If False, adds to the list. Defaults to False.
|
|
82
|
+
"""
|
|
83
|
+
if clobber:
|
|
84
|
+
return self.set("tool", "vpr", "brams", name)
|
|
85
|
+
else:
|
|
86
|
+
return self.add("tool", "vpr", "brams", name)
|
|
87
|
+
|
|
88
|
+
def add_vpr_dsptype(self, name: Union[str, List[str]] = None, clobber: bool = False):
|
|
89
|
+
"""
|
|
90
|
+
Adds one or more DSP types to the list of supported DSPs.
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
name (Union[str, List[str]], optional): The DSP type or a list of types.
|
|
94
|
+
Defaults to None.
|
|
95
|
+
clobber (bool, optional): If True, overwrites the existing list.
|
|
96
|
+
If False, adds to the list. Defaults to False.
|
|
97
|
+
"""
|
|
98
|
+
if clobber:
|
|
99
|
+
return self.set("tool", "vpr", "dsps", name)
|
|
100
|
+
else:
|
|
101
|
+
return self.add("tool", "vpr", "dsps", name)
|
|
102
|
+
|
|
103
|
+
def set_vpr_archfile(self, file: str, dataroot: str = None):
|
|
104
|
+
"""
|
|
105
|
+
Sets the path to the VPR architecture file.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
file (str): The path to the architecture file.
|
|
109
|
+
dataroot (str, optional): The data root directory. Defaults to the active package.
|
|
110
|
+
"""
|
|
111
|
+
if not dataroot:
|
|
112
|
+
dataroot = self._get_active("package")
|
|
113
|
+
with self.active_dataroot(dataroot):
|
|
114
|
+
return self.set("tool", "vpr", "archfile", file)
|
|
115
|
+
|
|
116
|
+
def set_vpr_graphfile(self, file: str, dataroot: str = None):
|
|
117
|
+
"""
|
|
118
|
+
Sets the path to the VPR routing graph file.
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
file (str): The path to the routing graph file.
|
|
122
|
+
dataroot (str, optional): The data root directory. Defaults to the active package.
|
|
123
|
+
"""
|
|
124
|
+
if not dataroot:
|
|
125
|
+
dataroot = self._get_active("package")
|
|
126
|
+
with self.active_dataroot(dataroot):
|
|
127
|
+
return self.set("tool", "vpr", "graphfile", file)
|
|
128
|
+
|
|
129
|
+
def set_vpr_constraintsmap(self, file: str, dataroot: str = None):
|
|
130
|
+
"""
|
|
131
|
+
Sets the path to the VPR constraints map file.
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
file (str): The path to the constraints map file.
|
|
135
|
+
dataroot (str, optional): The data root directory. Defaults to the active package.
|
|
136
|
+
"""
|
|
137
|
+
if not dataroot:
|
|
138
|
+
dataroot = self._get_active("package")
|
|
139
|
+
with self.active_dataroot(dataroot):
|
|
140
|
+
return self.set("tool", "vpr", "constraintsmap", file)
|
|
141
|
+
|
|
142
|
+
def set_vpr_clockmodel(self, model: str):
|
|
143
|
+
"""
|
|
144
|
+
Sets the clock modeling strategy.
|
|
145
|
+
|
|
146
|
+
Args:
|
|
147
|
+
model (str): The name of the clock model to use
|
|
148
|
+
(e.g., 'ideal', 'route', or 'dedicated_network').
|
|
149
|
+
"""
|
|
150
|
+
return self.set("tool", "vpr", "clock_model", model)
|
|
@@ -12,12 +12,380 @@ Sources: https://github.com/YosysHQ/yosys
|
|
|
12
12
|
|
|
13
13
|
Installation: https://github.com/YosysHQ/yosys
|
|
14
14
|
'''
|
|
15
|
+
import json
|
|
15
16
|
import os
|
|
16
17
|
import re
|
|
17
|
-
|
|
18
|
+
|
|
19
|
+
from typing import List, Union
|
|
20
|
+
|
|
18
21
|
from siliconcompiler import sc_open
|
|
19
22
|
from siliconcompiler.tools._common import get_tool_task, record_metric
|
|
20
23
|
|
|
24
|
+
from siliconcompiler import StdCellLibrarySchema
|
|
25
|
+
from siliconcompiler import FPGASchema
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class YosysStdCellLibrary(StdCellLibrarySchema):
|
|
29
|
+
"""
|
|
30
|
+
Schema for a standard cell library specifically for the Yosys tool.
|
|
31
|
+
|
|
32
|
+
This class extends the base StdCellLibrarySchema to define and manage
|
|
33
|
+
a variety of tool-specific parameters required by Yosys for synthesis
|
|
34
|
+
and technology mapping.
|
|
35
|
+
"""
|
|
36
|
+
def __init__(self):
|
|
37
|
+
super().__init__()
|
|
38
|
+
|
|
39
|
+
self.define_tool_parameter("yosys", "abc_clock_multiplier", "float",
|
|
40
|
+
"Scalar factor to convert timing from library units to ns "
|
|
41
|
+
"for ABC.")
|
|
42
|
+
self.define_tool_parameter("yosys", "abc_constraint_load", "float",
|
|
43
|
+
"The load constraint for the ABC tool", unit="fF")
|
|
44
|
+
|
|
45
|
+
self.define_tool_parameter("yosys", "driver_cell", "str",
|
|
46
|
+
"The name of the driver cell to be used.")
|
|
47
|
+
self.define_tool_parameter("yosys", "buffer_cell", "(str,str,str)",
|
|
48
|
+
"A tuple specifying the buffer cell name, its input port, and "
|
|
49
|
+
"its output port.")
|
|
50
|
+
self.define_tool_parameter("yosys", "tiehigh_cell", "(str,str)",
|
|
51
|
+
"A tuple specifying the tie-high cell name and its output port.")
|
|
52
|
+
self.define_tool_parameter("yosys", "tielow_cell", "(str,str)",
|
|
53
|
+
"A tuple specifying the tie-low cell name and its output port.")
|
|
54
|
+
|
|
55
|
+
self.define_tool_parameter("yosys", "techmap", "[file]",
|
|
56
|
+
"A list of technology map files to be used by Yosys.")
|
|
57
|
+
self.define_tool_parameter("yosys", "tristatebuffermap",
|
|
58
|
+
"file", "The file to be used for tristate buffer mapping.")
|
|
59
|
+
self.define_tool_parameter("yosys", "addermap", "file",
|
|
60
|
+
"The file to be used for adder mapping.")
|
|
61
|
+
|
|
62
|
+
self.define_tool_parameter("yosys", "synthesis_fileset", "[str]",
|
|
63
|
+
"name of the filesets to use for yosys synthesis")
|
|
64
|
+
self.define_tool_parameter("yosys", "blackbox_fileset", "[str]",
|
|
65
|
+
"A list of fileset names that contain blackbox definitions.")
|
|
66
|
+
|
|
67
|
+
def set_yosys_driver_cell(self, cell: str):
|
|
68
|
+
"""
|
|
69
|
+
Sets the driver cell for Yosys synthesis.
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
cell (str): The name of the driver cell.
|
|
73
|
+
"""
|
|
74
|
+
self.set("tool", "yosys", "driver_cell", cell)
|
|
75
|
+
|
|
76
|
+
def set_yosys_buffer_cell(self, cell: str, input_port: str, output_port: str):
|
|
77
|
+
"""
|
|
78
|
+
Sets the buffer cell and its corresponding input and output ports.
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
cell (str): The name of the buffer cell.
|
|
82
|
+
input_port (str): The name of the input port.
|
|
83
|
+
output_port (str): The name of the output port.
|
|
84
|
+
"""
|
|
85
|
+
self.set("tool", "yosys", "buffer_cell", (cell, input_port, output_port))
|
|
86
|
+
|
|
87
|
+
def set_yosys_tiehigh_cell(self, cell: str, output_port: str):
|
|
88
|
+
"""
|
|
89
|
+
Sets the tie-high cell and its output port.
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
cell (str): The name of the tie-high cell.
|
|
93
|
+
output_port (str): The name of the output port.
|
|
94
|
+
"""
|
|
95
|
+
self.set("tool", "yosys", "tiehigh_cell", (cell, output_port))
|
|
96
|
+
|
|
97
|
+
def set_yosys_tielow_cell(self, cell: str, output_port: str):
|
|
98
|
+
"""
|
|
99
|
+
Sets the tie-low cell and its output port.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
cell (str): The name of the tie-low cell.
|
|
103
|
+
output_port (str): The name of the output port.
|
|
104
|
+
"""
|
|
105
|
+
self.set("tool", "yosys", "tielow_cell", (cell, output_port))
|
|
106
|
+
|
|
107
|
+
def set_yosys_abc(self, clock_multiplier: float, load: float):
|
|
108
|
+
"""
|
|
109
|
+
Sets the clock multiplier and load constraints for the Yosys ABC tool.
|
|
110
|
+
|
|
111
|
+
Args:
|
|
112
|
+
clock_multiplier (float): The scalar clock multiplier.
|
|
113
|
+
load (float): The constraint load in fF.
|
|
114
|
+
"""
|
|
115
|
+
self.set("tool", "yosys", "abc_clock_multiplier", clock_multiplier)
|
|
116
|
+
self.set("tool", "yosys", "abc_constraint_load", load)
|
|
117
|
+
|
|
118
|
+
def set_yosys_tristatebuffer_map(self, map: str, dataroot: str = None):
|
|
119
|
+
"""
|
|
120
|
+
Sets the file path for the tristate buffer mapping.
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
map (str): The file path for the mapping.
|
|
124
|
+
dataroot (str, optional): The data root directory. Defaults to the active package.
|
|
125
|
+
"""
|
|
126
|
+
if not dataroot:
|
|
127
|
+
dataroot = self._get_active("package")
|
|
128
|
+
with self.active_dataroot(dataroot):
|
|
129
|
+
self.set("tool", "yosys", "tristatebuffermap", map)
|
|
130
|
+
|
|
131
|
+
def set_yosys_adder_map(self, map: str, dataroot: str = None):
|
|
132
|
+
"""
|
|
133
|
+
Sets the file path for the adder mapping.
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
map (str): The file path for the mapping.
|
|
137
|
+
dataroot (str, optional): The data root directory. Defaults to the active package.
|
|
138
|
+
"""
|
|
139
|
+
if not dataroot:
|
|
140
|
+
dataroot = self._get_active("package")
|
|
141
|
+
with self.active_dataroot(dataroot):
|
|
142
|
+
self.set("tool", "yosys", "addermap", map)
|
|
143
|
+
|
|
144
|
+
def add_yosys_tech_map(self,
|
|
145
|
+
map: Union[str, List[str]],
|
|
146
|
+
dataroot: str = None,
|
|
147
|
+
clobber: bool = False):
|
|
148
|
+
"""
|
|
149
|
+
Adds a technology map file to the list of maps.
|
|
150
|
+
|
|
151
|
+
Args:
|
|
152
|
+
map (Union[str, List[str]]): The file path or a list of file paths for the technology
|
|
153
|
+
map.
|
|
154
|
+
dataroot (str, optional): The data root directory. Defaults to the active package.
|
|
155
|
+
clobber (bool, optional): If True, replaces the current value. Defaults to False.
|
|
156
|
+
"""
|
|
157
|
+
if not dataroot:
|
|
158
|
+
dataroot = self._get_active("package")
|
|
159
|
+
with self.active_dataroot(dataroot):
|
|
160
|
+
if clobber:
|
|
161
|
+
self.set("tool", "yosys", "techmap", map)
|
|
162
|
+
else:
|
|
163
|
+
self.add("tool", "yosys", "techmap", map)
|
|
164
|
+
|
|
165
|
+
def add_yosys_synthesis_fileset(self, fileset: Union[str, List[str]], clobber: bool = False):
|
|
166
|
+
"""
|
|
167
|
+
Adds a fileset name to the list of synthesis filesets.
|
|
168
|
+
|
|
169
|
+
Args:
|
|
170
|
+
fileset (Union[str, List[str]]): The name of the fileset or a list of fileset names.
|
|
171
|
+
clobber (bool, optional): If True, replaces the current value. Defaults to False.
|
|
172
|
+
"""
|
|
173
|
+
if clobber:
|
|
174
|
+
self.set("tool", "yosys", "synthesis_fileset", fileset)
|
|
175
|
+
else:
|
|
176
|
+
self.add("tool", "yosys", "synthesis_fileset", fileset)
|
|
177
|
+
|
|
178
|
+
def add_yosys_blackbox_fileset(self, fileset: Union[str, List[str]], clobber: bool = False):
|
|
179
|
+
"""
|
|
180
|
+
Adds a fileset name to the list of blackbox filesets.
|
|
181
|
+
|
|
182
|
+
Args:
|
|
183
|
+
fileset (Union[str, List[str]]): The name of the fileset or a list of fileset names.
|
|
184
|
+
clobber (bool, optional): If True, replaces the current value. Defaults to False.
|
|
185
|
+
"""
|
|
186
|
+
if clobber:
|
|
187
|
+
self.set("tool", "yosys", "blackbox_fileset", fileset)
|
|
188
|
+
else:
|
|
189
|
+
self.add("tool", "yosys", "blackbox_fileset", fileset)
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
class YosysFPGA(FPGASchema):
|
|
193
|
+
"""
|
|
194
|
+
Schema for defining FPGA-specific parameters for the Yosys tool.
|
|
195
|
+
|
|
196
|
+
This class extends the base FPGASchema to manage various configurations
|
|
197
|
+
and technology-specific files required for synthesizing designs onto
|
|
198
|
+
an FPGA using Yosys, including macro libraries, technology maps, and
|
|
199
|
+
feature sets.
|
|
200
|
+
"""
|
|
201
|
+
def __init__(self):
|
|
202
|
+
super().__init__()
|
|
203
|
+
|
|
204
|
+
self.define_tool_parameter("yosys", "fpga_config", "file",
|
|
205
|
+
"The main configuration file for the target FPGA.")
|
|
206
|
+
self.define_tool_parameter("yosys", "macrolib", "[file]",
|
|
207
|
+
"A list of macro library files to be used.")
|
|
208
|
+
self.define_tool_parameter("yosys", "extractlib", "[file]",
|
|
209
|
+
"A list of files used to extract a macro library.")
|
|
210
|
+
self.define_tool_parameter("yosys", "dsp_techmap", "file",
|
|
211
|
+
"The technology map file for DSP blocks.")
|
|
212
|
+
self.define_tool_parameter("yosys", "dsp_options", "{str}",
|
|
213
|
+
"A list of synthesis options for DSP blocks.")
|
|
214
|
+
self.define_tool_parameter("yosys", "memory_libmap", "file",
|
|
215
|
+
"The library map file for memory elements.")
|
|
216
|
+
self.define_tool_parameter("yosys", "memory_techmap", "file",
|
|
217
|
+
"The technology map file for memory elements.")
|
|
218
|
+
self.define_tool_parameter("yosys", "flop_techmap", "file",
|
|
219
|
+
"The technology map file for flip-flop elements.")
|
|
220
|
+
self.define_tool_parameter("yosys", "feature_set",
|
|
221
|
+
"{<mem_init,enable,async_reset,async_set>}",
|
|
222
|
+
"The set of supported features for the FPGA.")
|
|
223
|
+
|
|
224
|
+
self.define_tool_parameter("yosys", "registers", "{str}",
|
|
225
|
+
"A list of supported register types.")
|
|
226
|
+
self.define_tool_parameter("yosys", "brams", "{str}",
|
|
227
|
+
"A list of supported block RAM types.")
|
|
228
|
+
self.define_tool_parameter("yosys", "dsps", "{str}",
|
|
229
|
+
"A list of supported DSP types.")
|
|
230
|
+
|
|
231
|
+
def set_yosys_config(self, file: str, dataroot: str = None):
|
|
232
|
+
"""
|
|
233
|
+
Sets the main FPGA configuration file.
|
|
234
|
+
|
|
235
|
+
Args:
|
|
236
|
+
file (str): The path to the configuration file.
|
|
237
|
+
dataroot (str, optional): The data root directory. Defaults to the active package.
|
|
238
|
+
"""
|
|
239
|
+
if not dataroot:
|
|
240
|
+
dataroot = self._get_active("package")
|
|
241
|
+
with self.active_dataroot(dataroot):
|
|
242
|
+
return self.set("tool", "yosys", "fpga_config", file)
|
|
243
|
+
|
|
244
|
+
def add_yosys_macrolib(self, file: Union[str, List[str]], dataroot: str = None,
|
|
245
|
+
clobber: bool = False):
|
|
246
|
+
"""
|
|
247
|
+
Adds a macro library file.
|
|
248
|
+
|
|
249
|
+
Args:
|
|
250
|
+
file (Union[str, List[str]]): The path to the macro library file or a list of paths.
|
|
251
|
+
dataroot (str, optional): The data root directory. Defaults to the active package.
|
|
252
|
+
clobber (bool, optional): If True, overwrites the existing list with the new file(s).
|
|
253
|
+
If False, appends the file(s) to the list. Defaults to False.
|
|
254
|
+
"""
|
|
255
|
+
if not dataroot:
|
|
256
|
+
dataroot = self._get_active("package")
|
|
257
|
+
with self.active_dataroot(dataroot):
|
|
258
|
+
if clobber:
|
|
259
|
+
return self.set("tool", "yosys", "macrolib", file)
|
|
260
|
+
else:
|
|
261
|
+
return self.add("tool", "yosys", "macrolib", file)
|
|
262
|
+
|
|
263
|
+
def add_yosys_extractlib(self, file: Union[str, List[str]], dataroot: str = None,
|
|
264
|
+
clobber: bool = False):
|
|
265
|
+
"""
|
|
266
|
+
Adds a file used to extract a macro library.
|
|
267
|
+
|
|
268
|
+
Args:
|
|
269
|
+
file (Union[str, List[str]]): The path to the extraction file or a list of paths.
|
|
270
|
+
dataroot (str, optional): The data root directory. Defaults to the active package.
|
|
271
|
+
clobber (bool, optional): If True, overwrites the existing list with the new file(s).
|
|
272
|
+
If False, appends the file(s) to the list. Defaults to False.
|
|
273
|
+
"""
|
|
274
|
+
if not dataroot:
|
|
275
|
+
dataroot = self._get_active("package")
|
|
276
|
+
with self.active_dataroot(dataroot):
|
|
277
|
+
if clobber:
|
|
278
|
+
return self.set("tool", "yosys", "extractlib", file)
|
|
279
|
+
else:
|
|
280
|
+
return self.add("tool", "yosys", "extractlib", file)
|
|
281
|
+
|
|
282
|
+
def set_yosys_dsptechmap(self, file: str, options: List[str] = None, dataroot: str = None):
|
|
283
|
+
"""
|
|
284
|
+
Sets the technology map file and optional synthesis options for DSP blocks.
|
|
285
|
+
|
|
286
|
+
Args:
|
|
287
|
+
file (str): The path to the DSP technology map file.
|
|
288
|
+
options (List[str], optional): A list of synthesis options for DSP blocks.
|
|
289
|
+
Defaults to None.
|
|
290
|
+
dataroot (str, optional): The data root directory. Defaults to the active package.
|
|
291
|
+
"""
|
|
292
|
+
if not dataroot:
|
|
293
|
+
dataroot = self._get_active("package")
|
|
294
|
+
with self.active_dataroot(dataroot):
|
|
295
|
+
self.set("tool", "yosys", "dsp_techmap", file)
|
|
296
|
+
if options:
|
|
297
|
+
self.set("tool", "yosys", "dsp_options", options)
|
|
298
|
+
|
|
299
|
+
def set_yosys_memorymap(self, libmap: str = None, techmap: str = None, dataroot: str = None):
|
|
300
|
+
"""
|
|
301
|
+
Sets the library and technology map files for memory elements.
|
|
302
|
+
|
|
303
|
+
Args:
|
|
304
|
+
libmap (str, optional): The path to the memory library map file. Defaults to None.
|
|
305
|
+
techmap (str, optional): The path to the memory technology map file. Defaults to None.
|
|
306
|
+
dataroot (str, optional): The data root directory. Defaults to the active package.
|
|
307
|
+
"""
|
|
308
|
+
if not dataroot:
|
|
309
|
+
dataroot = self._get_active("package")
|
|
310
|
+
with self.active_dataroot(dataroot):
|
|
311
|
+
if libmap:
|
|
312
|
+
self.set("tool", "yosys", "memory_libmap", libmap)
|
|
313
|
+
if techmap:
|
|
314
|
+
self.set("tool", "yosys", "memory_techmap", techmap)
|
|
315
|
+
|
|
316
|
+
def set_yosys_flipfloptechmap(self, file: str = None, dataroot: str = None):
|
|
317
|
+
"""
|
|
318
|
+
Sets the technology map file for flip-flops.
|
|
319
|
+
|
|
320
|
+
Args:
|
|
321
|
+
file (str, optional): The path to the flip-flop technology map file. Defaults to None.
|
|
322
|
+
dataroot (str, optional): The data root directory. Defaults to the active package.
|
|
323
|
+
"""
|
|
324
|
+
if not dataroot:
|
|
325
|
+
dataroot = self._get_active("package")
|
|
326
|
+
with self.active_dataroot(dataroot):
|
|
327
|
+
return self.set("tool", "yosys", "flop_techmap", file)
|
|
328
|
+
|
|
329
|
+
def add_yosys_featureset(self, feature: Union[str, List[str]] = None, clobber: bool = False):
|
|
330
|
+
"""
|
|
331
|
+
Adds a feature to the feature set.
|
|
332
|
+
|
|
333
|
+
Args:
|
|
334
|
+
feature (Union[str, List[str]], optional): The name of the feature or a list of feature
|
|
335
|
+
names to add. Defaults to None.
|
|
336
|
+
clobber (bool, optional): If True, overwrites the existing set with the new feature(s).
|
|
337
|
+
If False, adds the feature(s) to the set. Defaults to False.
|
|
338
|
+
"""
|
|
339
|
+
if clobber:
|
|
340
|
+
return self.set("tool", "yosys", "feature_set", feature)
|
|
341
|
+
else:
|
|
342
|
+
return self.add("tool", "yosys", "feature_set", feature)
|
|
343
|
+
|
|
344
|
+
def add_yosys_registertype(self, name: Union[str, List[str]] = None, clobber: bool = False):
|
|
345
|
+
"""
|
|
346
|
+
Adds a register type to the list of supported registers.
|
|
347
|
+
|
|
348
|
+
Args:
|
|
349
|
+
name (Union[str, List[str]], optional): The name of the register type or a list
|
|
350
|
+
of types. Defaults to None.
|
|
351
|
+
clobber (bool, optional): If True, overwrites the existing list with the new type(s).
|
|
352
|
+
If False, adds the type(s) to the list. Defaults to False.
|
|
353
|
+
"""
|
|
354
|
+
if clobber:
|
|
355
|
+
return self.set("tool", "yosys", "registers", name)
|
|
356
|
+
else:
|
|
357
|
+
return self.add("tool", "yosys", "registers", name)
|
|
358
|
+
|
|
359
|
+
def add_yosys_bramtype(self, name: Union[str, List[str]] = None, clobber: bool = False):
|
|
360
|
+
"""
|
|
361
|
+
Adds a block RAM type to the list of supported BRAMs.
|
|
362
|
+
|
|
363
|
+
Args:
|
|
364
|
+
name (Union[str, List[str]], optional): The name of the BRAM type or a list of types.
|
|
365
|
+
Defaults to None.
|
|
366
|
+
clobber (bool, optional): If True, overwrites the existing list with the new type(s).
|
|
367
|
+
If False, adds the type(s) to the list. Defaults to False.
|
|
368
|
+
"""
|
|
369
|
+
if clobber:
|
|
370
|
+
return self.set("tool", "yosys", "brams", name)
|
|
371
|
+
else:
|
|
372
|
+
return self.add("tool", "yosys", "brams", name)
|
|
373
|
+
|
|
374
|
+
def add_yosys_dsptype(self, name: Union[str, List[str]] = None, clobber: bool = False):
|
|
375
|
+
"""
|
|
376
|
+
Adds a DSP type to the list of supported DSPs.
|
|
377
|
+
|
|
378
|
+
Args:
|
|
379
|
+
name (Union[str, List[str]], optional): The name of the DSP type or a list of types.
|
|
380
|
+
Defaults to None.
|
|
381
|
+
clobber (bool, optional): If True, overwrites the existing list with the new type(s).
|
|
382
|
+
If False, adds the type(s) to the list. Defaults to False.
|
|
383
|
+
"""
|
|
384
|
+
if clobber:
|
|
385
|
+
return self.set("tool", "yosys", "dsps", name)
|
|
386
|
+
else:
|
|
387
|
+
return self.add("tool", "yosys", "dsps", name)
|
|
388
|
+
|
|
21
389
|
|
|
22
390
|
######################################################################
|
|
23
391
|
# Make Docs
|
|
@@ -123,7 +123,6 @@ proc sc_fpga_legalize_flops { feature_set } {
|
|
|
123
123
|
# won't tech map. Goal is to get the user to fix
|
|
124
124
|
# their code and put in synchronous resets
|
|
125
125
|
lappend legalize_flop_types \$_DFF_P_
|
|
126
|
-
lappend legalize_flop_types \$_DFF_P??_
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
set legalize_list []
|