siliconcompiler 0.36.0__py3-none-any.whl → 0.36.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- siliconcompiler/_metadata.py +1 -1
- siliconcompiler/asic.py +4 -4
- siliconcompiler/design.py +6 -1
- siliconcompiler/package/__init__.py +3 -2
- siliconcompiler/project.py +30 -14
- siliconcompiler/schema_support/filesetschema.py +9 -1
- siliconcompiler/schema_support/pathschema.py +16 -10
- siliconcompiler/tool.py +3 -1
- siliconcompiler/tools/chisel/convert.py +44 -0
- siliconcompiler/tools/ghdl/convert.py +37 -2
- siliconcompiler/tools/icarus/compile.py +14 -0
- siliconcompiler/tools/keplerformal/lec.py +2 -2
- siliconcompiler/tools/klayout/drc.py +14 -0
- siliconcompiler/tools/klayout/export.py +41 -1
- siliconcompiler/tools/klayout/operations.py +40 -0
- siliconcompiler/tools/openroad/__init__.py +11 -0
- siliconcompiler/tools/openroad/_apr.py +823 -12
- siliconcompiler/tools/openroad/antenna_repair.py +26 -0
- siliconcompiler/tools/openroad/fillmetal_insertion.py +14 -0
- siliconcompiler/tools/openroad/global_placement.py +67 -0
- siliconcompiler/tools/openroad/global_route.py +15 -0
- siliconcompiler/tools/openroad/init_floorplan.py +14 -0
- siliconcompiler/tools/openroad/macro_placement.py +252 -0
- siliconcompiler/tools/openroad/power_grid.py +44 -1
- siliconcompiler/tools/openroad/rcx_bench.py +28 -0
- siliconcompiler/tools/openroad/rcx_extract.py +14 -0
- siliconcompiler/tools/openroad/rdlroute.py +14 -0
- siliconcompiler/tools/openroad/repair_design.py +41 -0
- siliconcompiler/tools/openroad/repair_timing.py +54 -0
- siliconcompiler/tools/openroad/screenshot.py +31 -1
- siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +8 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +5 -1
- siliconcompiler/tools/openroad/scripts/common/read_timing_constraints.tcl +17 -15
- siliconcompiler/tools/openroad/scripts/common/write_data_timing.tcl +3 -1
- siliconcompiler/tools/openroad/write_data.py +76 -0
- siliconcompiler/tools/opensta/timing.py +37 -2
- siliconcompiler/tools/slang/elaborate.py +16 -1
- siliconcompiler/tools/surelog/parse.py +54 -0
- siliconcompiler/tools/verilator/compile.py +120 -0
- siliconcompiler/tools/vivado/syn_fpga.py +27 -0
- siliconcompiler/tools/vpr/__init__.py +9 -9
- siliconcompiler/tools/vpr/place.py +1 -2
- siliconcompiler/tools/vpr/route.py +40 -0
- siliconcompiler/tools/xdm/convert.py +14 -0
- siliconcompiler/tools/xyce/simulate.py +26 -0
- siliconcompiler/tools/yosys/lec_asic.py +13 -0
- siliconcompiler/tools/yosys/syn_asic.py +336 -7
- siliconcompiler/tools/yosys/syn_fpga.py +39 -8
- siliconcompiler/toolscripts/_tools.json +5 -5
- siliconcompiler/utils/logging.py +6 -0
- {siliconcompiler-0.36.0.dist-info → siliconcompiler-0.36.2.dist-info}/METADATA +3 -3
- {siliconcompiler-0.36.0.dist-info → siliconcompiler-0.36.2.dist-info}/RECORD +56 -56
- {siliconcompiler-0.36.0.dist-info → siliconcompiler-0.36.2.dist-info}/WHEEL +0 -0
- {siliconcompiler-0.36.0.dist-info → siliconcompiler-0.36.2.dist-info}/entry_points.txt +0 -0
- {siliconcompiler-0.36.0.dist-info → siliconcompiler-0.36.2.dist-info}/licenses/LICENSE +0 -0
- {siliconcompiler-0.36.0.dist-info → siliconcompiler-0.36.2.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import shutil
|
|
2
|
+
from typing import Optional
|
|
2
3
|
|
|
3
4
|
from siliconcompiler.tools.vpr import VPRTask
|
|
4
5
|
|
|
@@ -19,6 +20,45 @@ class RouteTask(VPRTask):
|
|
|
19
20
|
"set the timing corner for files generated by the post-implementation "
|
|
20
21
|
"netlist", defvalue="typical")
|
|
21
22
|
|
|
23
|
+
def set_vpr_maxrouteriterations(self, iterations: int,
|
|
24
|
+
step: Optional[str] = None,
|
|
25
|
+
index: Optional[str] = None):
|
|
26
|
+
"""
|
|
27
|
+
Sets the maximum number of routing iterations.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
iterations (int): The maximum number of iterations.
|
|
31
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
32
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
33
|
+
"""
|
|
34
|
+
self.set("var", "max_router_iterations", iterations, step=step, index=index)
|
|
35
|
+
|
|
36
|
+
def set_vpr_genpostimplementationnetlist(self, enable: bool,
|
|
37
|
+
step: Optional[str] = None,
|
|
38
|
+
index: Optional[str] = None):
|
|
39
|
+
"""
|
|
40
|
+
Enables or disables generating a post-implementation netlist.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
enable (bool): Whether to generate the netlist.
|
|
44
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
45
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
46
|
+
"""
|
|
47
|
+
self.set("var", "gen_post_implementation_netlist", enable, step=step, index=index)
|
|
48
|
+
|
|
49
|
+
def set_vpr_timingcorner(self, corner: str,
|
|
50
|
+
step: Optional[str] = None,
|
|
51
|
+
index: Optional[str] = None):
|
|
52
|
+
"""
|
|
53
|
+
Sets the timing corner for files generated by the post-implementation netlist.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
corner (str): The timing corner.
|
|
57
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
58
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
59
|
+
"""
|
|
60
|
+
self.set("var", "timing_corner", corner, step=step, index=index)
|
|
61
|
+
|
|
22
62
|
def task(self):
|
|
23
63
|
return "route"
|
|
24
64
|
|
|
@@ -2,6 +2,7 @@ import shutil
|
|
|
2
2
|
|
|
3
3
|
import os.path
|
|
4
4
|
|
|
5
|
+
from typing import Optional
|
|
5
6
|
from siliconcompiler import Task
|
|
6
7
|
|
|
7
8
|
|
|
@@ -14,6 +15,19 @@ class ConvertTask(Task):
|
|
|
14
15
|
"the naming scheme for siliconcompiler",
|
|
15
16
|
defvalue=True)
|
|
16
17
|
|
|
18
|
+
def set_xdm_rename(self, enable: bool,
|
|
19
|
+
step: Optional[str] = None,
|
|
20
|
+
index: Optional[str] = None):
|
|
21
|
+
"""
|
|
22
|
+
Enables or disables renaming the output file.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
enable (bool): Whether to rename the output file.
|
|
26
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
27
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
28
|
+
"""
|
|
29
|
+
self.set("var", "rename", enable, step=step, index=index)
|
|
30
|
+
|
|
17
31
|
def tool(self):
|
|
18
32
|
return "xdm"
|
|
19
33
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import os.path
|
|
2
2
|
|
|
3
|
+
from typing import Union, Optional
|
|
4
|
+
|
|
3
5
|
from siliconcompiler import Task
|
|
4
6
|
|
|
5
7
|
|
|
@@ -11,6 +13,30 @@ class SimulateTask(Task):
|
|
|
11
13
|
self.add_parameter("trace_format", "<ASCII,binary>", "Format to use for traces.",
|
|
12
14
|
defvalue="ASCII")
|
|
13
15
|
|
|
16
|
+
def set_xyce_trace(self, enable: bool,
|
|
17
|
+
step: Optional[str] = None, index: Optional[Union[int, str]] = None):
|
|
18
|
+
"""
|
|
19
|
+
Enables or disables dumping all signals.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
enable (bool): True to enable, False to disable.
|
|
23
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
24
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
25
|
+
"""
|
|
26
|
+
self.set('var', 'trace', enable, step=step, index=index)
|
|
27
|
+
|
|
28
|
+
def set_xyce_traceformat(self, trace_format: str,
|
|
29
|
+
step: Optional[str] = None, index: Optional[Union[int, str]] = None):
|
|
30
|
+
"""
|
|
31
|
+
Sets the format to use for traces.
|
|
32
|
+
|
|
33
|
+
Args:
|
|
34
|
+
trace_format (str): The format to use for traces.
|
|
35
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
36
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
37
|
+
"""
|
|
38
|
+
self.set('var', 'trace_format', trace_format, step=step, index=index)
|
|
39
|
+
|
|
14
40
|
def tool(self):
|
|
15
41
|
return "xyce"
|
|
16
42
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import re
|
|
2
|
+
from typing import Optional
|
|
2
3
|
|
|
3
4
|
from siliconcompiler import sc_open
|
|
4
5
|
|
|
@@ -15,6 +16,18 @@ class ASICLECTask(_ASICTask):
|
|
|
15
16
|
self.add_parameter("induction_steps", "int",
|
|
16
17
|
"Number of induction steps for yosys equivalence checking", defvalue=10)
|
|
17
18
|
|
|
19
|
+
def set_yosys_inductionsteps(self, steps: int,
|
|
20
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
21
|
+
"""
|
|
22
|
+
Sets the number of induction steps for yosys equivalence checking.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
steps (int): The number of steps.
|
|
26
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
27
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
28
|
+
"""
|
|
29
|
+
self.set("var", "induction_steps", steps, step=step, index=index)
|
|
30
|
+
|
|
18
31
|
def task(self):
|
|
19
32
|
return "lec_asic"
|
|
20
33
|
|
|
@@ -2,7 +2,7 @@ import json
|
|
|
2
2
|
|
|
3
3
|
import os.path
|
|
4
4
|
|
|
5
|
-
from typing import Optional
|
|
5
|
+
from typing import Optional, Union, List
|
|
6
6
|
|
|
7
7
|
from siliconcompiler.tools.yosys.prepareLib import process_liberty_file
|
|
8
8
|
from siliconcompiler import sc_open
|
|
@@ -39,7 +39,7 @@ class _ASICTask(ASICTask, YosysTask):
|
|
|
39
39
|
|
|
40
40
|
delaymodel = self.project.get("asic", "delaymodel")
|
|
41
41
|
for lib in self.project.get("asic", "asiclib"):
|
|
42
|
-
lib_obj = self.project.
|
|
42
|
+
lib_obj = self.project.get_library(lib)
|
|
43
43
|
for corner in self.get("var", "synthesis_corner"):
|
|
44
44
|
if lib_obj.get("asic", "libcornerfileset", corner, delaymodel):
|
|
45
45
|
self.add_required_key(lib_obj, "asic", "libcornerfileset", corner, delaymodel)
|
|
@@ -56,14 +56,14 @@ class _ASICTask(ASICTask, YosysTask):
|
|
|
56
56
|
if not scenario.get_libcorner():
|
|
57
57
|
continue
|
|
58
58
|
if "setup" in scenario.get_check():
|
|
59
|
-
self.
|
|
59
|
+
self.add_yosys_synthesiscorner(scenario.get_libcorner())
|
|
60
60
|
return
|
|
61
61
|
|
|
62
62
|
if scenarios:
|
|
63
63
|
# try getting it from first constraint with a valid libcorner
|
|
64
64
|
for scenario in scenarios.get_scenario().values():
|
|
65
65
|
if scenario.get_libcorner():
|
|
66
|
-
self.
|
|
66
|
+
self.add_yosys_synthesiscorner(scenario.get_libcorner())
|
|
67
67
|
return
|
|
68
68
|
|
|
69
69
|
def pre_process(self):
|
|
@@ -81,7 +81,7 @@ class _ASICTask(ASICTask, YosysTask):
|
|
|
81
81
|
# Generate synthesis_libraries for Yosys use
|
|
82
82
|
fileset_map = []
|
|
83
83
|
for lib in self.project.get("asic", "asiclib"):
|
|
84
|
-
lib_obj = self.project.
|
|
84
|
+
lib_obj = self.project.get_library(lib)
|
|
85
85
|
for corner in self.get("var", "synthesis_corner"):
|
|
86
86
|
for fileset in lib_obj.get("asic", "libcornerfileset", corner, delaymodel):
|
|
87
87
|
fileset_map.append((lib_obj, fileset))
|
|
@@ -132,6 +132,28 @@ class _ASICTask(ASICTask, YosysTask):
|
|
|
132
132
|
self.add("var", 'synthesis_libraries', output_file)
|
|
133
133
|
|
|
134
134
|
def add_synthesis_corner(self, corner, step=None, index=None, clobber=True):
|
|
135
|
+
"""Deprecated"""
|
|
136
|
+
import warnings
|
|
137
|
+
warnings.warn(
|
|
138
|
+
"add_synthesis_corner is deprecated. "
|
|
139
|
+
"Please use add_yosys_synthesiscorner instead.",
|
|
140
|
+
DeprecationWarning,
|
|
141
|
+
stacklevel=2
|
|
142
|
+
)
|
|
143
|
+
self.add_yosys_synthesiscorner(corner, step=step, index=index, clobber=clobber)
|
|
144
|
+
|
|
145
|
+
def add_yosys_synthesiscorner(self, corner: str,
|
|
146
|
+
step: Optional[str] = None, index: Optional[str] = None,
|
|
147
|
+
clobber: bool = False):
|
|
148
|
+
"""
|
|
149
|
+
Adds a timing corner to use for synthesis.
|
|
150
|
+
|
|
151
|
+
Args:
|
|
152
|
+
corner (str): The name of the corner.
|
|
153
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
154
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
155
|
+
clobber (bool, optional): If True, overwrites the existing list. Defaults to False.
|
|
156
|
+
"""
|
|
135
157
|
if clobber:
|
|
136
158
|
self.set("var", "synthesis_corner", corner, step=step, index=index)
|
|
137
159
|
else:
|
|
@@ -316,24 +338,331 @@ class ASICSynthesis(_ASICTask, YosysTask):
|
|
|
316
338
|
|
|
317
339
|
def set_yosys_useslang(self, enable: bool,
|
|
318
340
|
step: Optional[str] = None, index: Optional[str] = None):
|
|
341
|
+
"""
|
|
342
|
+
Enables or disables using the slang frontend.
|
|
343
|
+
|
|
344
|
+
Args:
|
|
345
|
+
enable (bool): True to enable, False to disable.
|
|
346
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
347
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
348
|
+
"""
|
|
319
349
|
self.set("var", "use_slang", enable, step=step, index=index)
|
|
320
350
|
|
|
351
|
+
def set_yosys_autoname(self, enable: bool,
|
|
352
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
353
|
+
"""
|
|
354
|
+
Enables or disables renaming wires based on registers.
|
|
355
|
+
|
|
356
|
+
Args:
|
|
357
|
+
enable (bool): True to enable, False to disable.
|
|
358
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
359
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
360
|
+
"""
|
|
361
|
+
self.set("var", "autoname", enable, step=step, index=index)
|
|
362
|
+
|
|
321
363
|
def set_yosys_tieundefined(self, tie: str,
|
|
322
364
|
step: Optional[str] = None, index: Optional[str] = None):
|
|
365
|
+
"""
|
|
366
|
+
Sets how to handle undefined signals in the netlist.
|
|
367
|
+
|
|
368
|
+
Args:
|
|
369
|
+
tie (str): The tie strategy ('high', 'low', 'none').
|
|
370
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
371
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
372
|
+
"""
|
|
323
373
|
self.set("var", "tie_undef", tie, step=step, index=index)
|
|
324
374
|
|
|
325
375
|
def set_yosys_addtiecells(self, enable: bool,
|
|
326
376
|
step: Optional[str] = None, index: Optional[str] = None):
|
|
377
|
+
"""
|
|
378
|
+
Enables or disables adding tie high and tie low cells.
|
|
379
|
+
|
|
380
|
+
Args:
|
|
381
|
+
enable (bool): True to enable, False to disable.
|
|
382
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
383
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
384
|
+
"""
|
|
327
385
|
self.set("var", "add_tieoffs", enable, step=step, index=index)
|
|
328
386
|
|
|
329
387
|
def set_yosys_addbuffers(self, enable: bool,
|
|
330
388
|
step: Optional[str] = None, index: Optional[str] = None):
|
|
389
|
+
"""
|
|
390
|
+
Enables or disables adding buffers.
|
|
391
|
+
|
|
392
|
+
Args:
|
|
393
|
+
enable (bool): True to enable, False to disable.
|
|
394
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
395
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
396
|
+
"""
|
|
331
397
|
self.set("var", "add_buffers", enable, step=step, index=index)
|
|
332
398
|
|
|
333
399
|
def set_yosys_optundriven(self, enable: bool,
|
|
334
400
|
step: Optional[str] = None, index: Optional[str] = None):
|
|
401
|
+
"""
|
|
402
|
+
Enables or disables marking undriven nets during optimization.
|
|
403
|
+
|
|
404
|
+
Args:
|
|
405
|
+
enable (bool): True to enable, False to disable.
|
|
406
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
407
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
408
|
+
"""
|
|
335
409
|
self.set("var", "opt_undriven", enable, step=step, index=index)
|
|
336
410
|
|
|
411
|
+
def set_yosys_mapadders(self, enable: bool,
|
|
412
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
413
|
+
"""
|
|
414
|
+
Enables or disables techmapping adders in Yosys.
|
|
415
|
+
|
|
416
|
+
Args:
|
|
417
|
+
enable (bool): True to enable, False to disable.
|
|
418
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
419
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
420
|
+
"""
|
|
421
|
+
self.set("var", "map_adders", enable, step=step, index=index)
|
|
422
|
+
|
|
423
|
+
def set_yosys_memorylibmap(self, file: str,
|
|
424
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
425
|
+
"""
|
|
426
|
+
Sets the file used to map memories with Yosys.
|
|
427
|
+
|
|
428
|
+
Args:
|
|
429
|
+
file (str): The path to the library map file.
|
|
430
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
431
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
432
|
+
"""
|
|
433
|
+
self.set("var", "memory_libmap", file, step=step, index=index)
|
|
434
|
+
|
|
435
|
+
def set_yosys_memorytechmap(self, file: str,
|
|
436
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
437
|
+
"""
|
|
438
|
+
Sets the file used to techmap memories with Yosys.
|
|
439
|
+
|
|
440
|
+
Args:
|
|
441
|
+
file (str): The path to the technology map file.
|
|
442
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
443
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
444
|
+
"""
|
|
445
|
+
self.set("var", "memory_techmap", file, step=step, index=index)
|
|
446
|
+
|
|
447
|
+
def add_yosys_synthextramap(self, map: Union[str, List[str]],
|
|
448
|
+
step: Optional[str] = None, index: Optional[str] = None,
|
|
449
|
+
clobber: bool = False):
|
|
450
|
+
"""
|
|
451
|
+
Adds files used in synthesis to perform additional techmapping.
|
|
452
|
+
|
|
453
|
+
Args:
|
|
454
|
+
map (Union[str, List[str]]): The map file(s) to add.
|
|
455
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
456
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
457
|
+
clobber (bool, optional): If True, overwrites the existing list. Defaults to False.
|
|
458
|
+
"""
|
|
459
|
+
if clobber:
|
|
460
|
+
self.set("var", "synth_extra_map", map, step=step, index=index)
|
|
461
|
+
else:
|
|
462
|
+
self.add("var", "synth_extra_map", map, step=step, index=index)
|
|
463
|
+
|
|
464
|
+
def add_yosys_preservemodules(self, modules: Union[str, List[str]],
|
|
465
|
+
step: Optional[str] = None, index: Optional[str] = None,
|
|
466
|
+
clobber: bool = False):
|
|
467
|
+
"""
|
|
468
|
+
Adds modules to prevent flattening.
|
|
469
|
+
|
|
470
|
+
Args:
|
|
471
|
+
modules (Union[str, List[str]]): The module name(s) to preserve.
|
|
472
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
473
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
474
|
+
clobber (bool, optional): If True, overwrites the existing list. Defaults to False.
|
|
475
|
+
"""
|
|
476
|
+
if clobber:
|
|
477
|
+
self.set("var", "preserve_modules", modules, step=step, index=index)
|
|
478
|
+
else:
|
|
479
|
+
self.add("var", "preserve_modules", modules, step=step, index=index)
|
|
480
|
+
|
|
481
|
+
def add_yosys_blackboxmodules(self, modules: Union[str, List[str]],
|
|
482
|
+
step: Optional[str] = None, index: Optional[str] = None,
|
|
483
|
+
clobber: bool = False):
|
|
484
|
+
"""
|
|
485
|
+
Adds modules to exclude from synthesis by replacing them with empty blackboxes.
|
|
486
|
+
|
|
487
|
+
Args:
|
|
488
|
+
modules (Union[str, List[str]]): The module name(s) to blackbox.
|
|
489
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
490
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
491
|
+
clobber (bool, optional): If True, overwrites the existing list. Defaults to False.
|
|
492
|
+
"""
|
|
493
|
+
if clobber:
|
|
494
|
+
self.set("var", "blackbox_modules", modules, step=step, index=index)
|
|
495
|
+
else:
|
|
496
|
+
self.add("var", "blackbox_modules", modules, step=step, index=index)
|
|
497
|
+
|
|
498
|
+
def set_yosys_flatten(self, enable: bool,
|
|
499
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
500
|
+
"""
|
|
501
|
+
Enables or disables invoking synth with the -flatten option.
|
|
502
|
+
|
|
503
|
+
Args:
|
|
504
|
+
enable (bool): True to enable, False to disable.
|
|
505
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
506
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
507
|
+
"""
|
|
508
|
+
self.set("var", "flatten", enable, step=step, index=index)
|
|
509
|
+
|
|
510
|
+
def set_yosys_autoflatten(self, enable: bool,
|
|
511
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
512
|
+
"""
|
|
513
|
+
Enables or disables attempting to determine how to flatten the design.
|
|
514
|
+
|
|
515
|
+
Args:
|
|
516
|
+
enable (bool): True to enable, False to disable.
|
|
517
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
518
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
519
|
+
"""
|
|
520
|
+
self.set("var", "auto_flatten", enable, step=step, index=index)
|
|
521
|
+
|
|
522
|
+
def set_yosys_hierthreshold(self, threshold: int,
|
|
523
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
524
|
+
"""
|
|
525
|
+
Sets the instance limit for the number of cells in a module to preserve.
|
|
526
|
+
|
|
527
|
+
Args:
|
|
528
|
+
threshold (int): The instance limit.
|
|
529
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
530
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
531
|
+
"""
|
|
532
|
+
self.set("var", "hier_threshold", threshold, step=step, index=index)
|
|
533
|
+
|
|
534
|
+
def set_yosys_hierarchyseparator(self, separator: str,
|
|
535
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
536
|
+
"""
|
|
537
|
+
Sets the hierarchy separator used during design flattening.
|
|
538
|
+
|
|
539
|
+
Args:
|
|
540
|
+
separator (str): The separator character.
|
|
541
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
542
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
543
|
+
"""
|
|
544
|
+
self.set("var", "hierarchy_separator", separator, step=step, index=index)
|
|
545
|
+
|
|
546
|
+
def set_yosys_strategy(self, strategy: str,
|
|
547
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
548
|
+
"""
|
|
549
|
+
Sets the ABC synthesis strategy.
|
|
550
|
+
|
|
551
|
+
Args:
|
|
552
|
+
strategy (str): The strategy name (e.g., 'DELAY1', 'AREA2').
|
|
553
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
554
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
555
|
+
"""
|
|
556
|
+
self.set("var", "strategy", strategy, step=step, index=index)
|
|
557
|
+
|
|
558
|
+
def set_yosys_abcconstraintdriver(self, driver: str,
|
|
559
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
560
|
+
"""
|
|
561
|
+
Sets the buffer that drives the ABC techmapping.
|
|
562
|
+
|
|
563
|
+
Args:
|
|
564
|
+
driver (str): The driver cell name.
|
|
565
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
566
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
567
|
+
"""
|
|
568
|
+
self.set("var", "abc_constraint_driver", driver, step=step, index=index)
|
|
569
|
+
|
|
570
|
+
def set_yosys_abcclockperiod(self, period: float,
|
|
571
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
572
|
+
"""
|
|
573
|
+
Sets the clock period to use for synthesis.
|
|
574
|
+
|
|
575
|
+
Args:
|
|
576
|
+
period (float): The clock period in ps.
|
|
577
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
578
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
579
|
+
"""
|
|
580
|
+
self.set("var", "abc_clock_period", period, step=step, index=index)
|
|
581
|
+
|
|
582
|
+
def set_yosys_abcconstraintload(self, load: float,
|
|
583
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
584
|
+
"""
|
|
585
|
+
Sets the capacitive load for the ABC techmapping.
|
|
586
|
+
|
|
587
|
+
Args:
|
|
588
|
+
load (float): The load in fF.
|
|
589
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
590
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
591
|
+
"""
|
|
592
|
+
self.set("var", "abc_constraint_load", load, step=step, index=index)
|
|
593
|
+
|
|
594
|
+
def set_yosys_abcclockderating(self, derating: float,
|
|
595
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
596
|
+
"""
|
|
597
|
+
Sets the derating to apply to the clock period for ABC synthesis.
|
|
598
|
+
|
|
599
|
+
Args:
|
|
600
|
+
derating (float): The derating factor.
|
|
601
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
602
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
603
|
+
"""
|
|
604
|
+
self.set("var", "abc_clock_derating", derating, step=step, index=index)
|
|
605
|
+
|
|
606
|
+
def set_yosys_mapclockgates(self, enable: bool,
|
|
607
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
608
|
+
"""
|
|
609
|
+
Enables or disables mapping clockgates during synthesis.
|
|
610
|
+
|
|
611
|
+
Args:
|
|
612
|
+
enable (bool): True to enable, False to disable.
|
|
613
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
614
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
615
|
+
"""
|
|
616
|
+
self.set("var", "map_clockgates", enable, step=step, index=index)
|
|
617
|
+
|
|
618
|
+
def set_yosys_minclockgatefanout(self, fanout: int,
|
|
619
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
620
|
+
"""
|
|
621
|
+
Sets the minimum clockgate fanout.
|
|
622
|
+
|
|
623
|
+
Args:
|
|
624
|
+
fanout (int): The minimum fanout.
|
|
625
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
626
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
627
|
+
"""
|
|
628
|
+
self.set("var", "min_clockgate_fanout", fanout, step=step, index=index)
|
|
629
|
+
|
|
630
|
+
def set_yosys_lockdesign(self, enable: bool,
|
|
631
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
632
|
+
"""
|
|
633
|
+
Enables or disables attempting to lock the design with moosic.
|
|
634
|
+
|
|
635
|
+
Args:
|
|
636
|
+
enable (bool): True to enable, False to disable.
|
|
637
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
638
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
639
|
+
"""
|
|
640
|
+
self.set("var", "lock_design", enable, step=step, index=index)
|
|
641
|
+
|
|
642
|
+
def set_yosys_lockdesignkey(self, key: str,
|
|
643
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
644
|
+
"""
|
|
645
|
+
Sets the lock locking key.
|
|
646
|
+
|
|
647
|
+
Args:
|
|
648
|
+
key (str): The key.
|
|
649
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
650
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
651
|
+
"""
|
|
652
|
+
self.set("var", "lock_design_key", key, step=step, index=index)
|
|
653
|
+
|
|
654
|
+
def set_yosys_lockdesignport(self, port: str,
|
|
655
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
656
|
+
"""
|
|
657
|
+
Sets the lock locking port name.
|
|
658
|
+
|
|
659
|
+
Args:
|
|
660
|
+
port (str): The port name.
|
|
661
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
662
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
663
|
+
"""
|
|
664
|
+
self.set("var", "lock_design_port", port, step=step, index=index)
|
|
665
|
+
|
|
337
666
|
def task(self):
|
|
338
667
|
return "syn_asic"
|
|
339
668
|
|
|
@@ -367,7 +696,7 @@ class ASICSynthesis(_ASICTask, YosysTask):
|
|
|
367
696
|
self.add_output_file(ext="vg", clobber=True)
|
|
368
697
|
self.add_output_file(ext="netlist.json")
|
|
369
698
|
|
|
370
|
-
mainlib = self.project.
|
|
699
|
+
mainlib = self.project.get_library(self.project.get("asic", "mainlib"))
|
|
371
700
|
|
|
372
701
|
if self.get('var', 'abc_constraint_driver') is not None:
|
|
373
702
|
self.add_required_key("var", "abc_constraint_driver")
|
|
@@ -470,7 +799,7 @@ class ASICSynthesis(_ASICTask, YosysTask):
|
|
|
470
799
|
|
|
471
800
|
def _get_clock_period(self):
|
|
472
801
|
mainlib = self.project.get("asic", "mainlib")
|
|
473
|
-
clock_units_multiplier = self.project.
|
|
802
|
+
clock_units_multiplier = self.project.get_library(mainlib).get(
|
|
474
803
|
"tool", "yosys", "abc_clock_multiplier") / 1000
|
|
475
804
|
|
|
476
805
|
_, period = self.get_clock()
|
|
@@ -30,8 +30,40 @@ class FPGASynthesis(YosysTask):
|
|
|
30
30
|
|
|
31
31
|
def set_yosys_useslang(self, enable: bool,
|
|
32
32
|
step: Optional[str] = None, index: Optional[str] = None):
|
|
33
|
+
"""
|
|
34
|
+
Enables or disables using the slang frontend.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
enable (bool): True to enable, False to disable.
|
|
38
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
39
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
40
|
+
"""
|
|
33
41
|
self.set("var", "use_slang", enable, step=step, index=index)
|
|
34
42
|
|
|
43
|
+
def set_yosys_synthoptmode(self, mode: str,
|
|
44
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
45
|
+
"""
|
|
46
|
+
Sets the optimization mode for synthesis.
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
mode (str): The optimization mode ('none', 'delay', 'area').
|
|
50
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
51
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
52
|
+
"""
|
|
53
|
+
self.set("var", "synth_opt_mode", mode, step=step, index=index)
|
|
54
|
+
|
|
55
|
+
def set_yosys_synthinsertbuffers(self, enable: bool,
|
|
56
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
57
|
+
"""
|
|
58
|
+
Enables or disables buffer insertion during synthesis.
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
enable (bool): True to enable, False to disable.
|
|
62
|
+
step (str, optional): The specific step to apply this configuration to.
|
|
63
|
+
index (str, optional): The specific index to apply this configuration to.
|
|
64
|
+
"""
|
|
65
|
+
self.set("var", "synth_insert_buffers", enable, step=step, index=index)
|
|
66
|
+
|
|
35
67
|
def task(self):
|
|
36
68
|
return "syn_fpga"
|
|
37
69
|
|
|
@@ -66,7 +98,7 @@ class FPGASynthesis(YosysTask):
|
|
|
66
98
|
|
|
67
99
|
self._synthesis_post_process()
|
|
68
100
|
|
|
69
|
-
fpga = self.project.get("fpga", "device")
|
|
101
|
+
fpga = self.project.get_library(self.project.get("fpga", "device"))
|
|
70
102
|
|
|
71
103
|
with sc_open("reports/stat.json") as f:
|
|
72
104
|
metrics = json.load(f)
|
|
@@ -81,15 +113,14 @@ class FPGASynthesis(YosysTask):
|
|
|
81
113
|
return
|
|
82
114
|
|
|
83
115
|
dff_cells = []
|
|
84
|
-
if
|
|
85
|
-
dff_cells =
|
|
116
|
+
if fpga.valid("tool", "yosys", "registers"):
|
|
117
|
+
dff_cells = fpga.get("tool", "yosys", "registers")
|
|
86
118
|
brams_cells = []
|
|
87
|
-
if
|
|
88
|
-
brams_cells =
|
|
119
|
+
if fpga.valid("tool", "yosys", "brams"):
|
|
120
|
+
brams_cells = fpga.get("tool", "yosys", "brams")
|
|
89
121
|
dsps_cells = []
|
|
90
|
-
if
|
|
91
|
-
dsps_cells =
|
|
92
|
-
|
|
122
|
+
if fpga.valid("tool", "yosys", "dsps"):
|
|
123
|
+
dsps_cells = fpga.get("tool", "yosys", "dsps")
|
|
93
124
|
data = {
|
|
94
125
|
"registers": 0,
|
|
95
126
|
"luts": 0,
|