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.
Files changed (56) hide show
  1. siliconcompiler/_metadata.py +1 -1
  2. siliconcompiler/asic.py +4 -4
  3. siliconcompiler/design.py +6 -1
  4. siliconcompiler/package/__init__.py +3 -2
  5. siliconcompiler/project.py +30 -14
  6. siliconcompiler/schema_support/filesetschema.py +9 -1
  7. siliconcompiler/schema_support/pathschema.py +16 -10
  8. siliconcompiler/tool.py +3 -1
  9. siliconcompiler/tools/chisel/convert.py +44 -0
  10. siliconcompiler/tools/ghdl/convert.py +37 -2
  11. siliconcompiler/tools/icarus/compile.py +14 -0
  12. siliconcompiler/tools/keplerformal/lec.py +2 -2
  13. siliconcompiler/tools/klayout/drc.py +14 -0
  14. siliconcompiler/tools/klayout/export.py +41 -1
  15. siliconcompiler/tools/klayout/operations.py +40 -0
  16. siliconcompiler/tools/openroad/__init__.py +11 -0
  17. siliconcompiler/tools/openroad/_apr.py +823 -12
  18. siliconcompiler/tools/openroad/antenna_repair.py +26 -0
  19. siliconcompiler/tools/openroad/fillmetal_insertion.py +14 -0
  20. siliconcompiler/tools/openroad/global_placement.py +67 -0
  21. siliconcompiler/tools/openroad/global_route.py +15 -0
  22. siliconcompiler/tools/openroad/init_floorplan.py +14 -0
  23. siliconcompiler/tools/openroad/macro_placement.py +252 -0
  24. siliconcompiler/tools/openroad/power_grid.py +44 -1
  25. siliconcompiler/tools/openroad/rcx_bench.py +28 -0
  26. siliconcompiler/tools/openroad/rcx_extract.py +14 -0
  27. siliconcompiler/tools/openroad/rdlroute.py +14 -0
  28. siliconcompiler/tools/openroad/repair_design.py +41 -0
  29. siliconcompiler/tools/openroad/repair_timing.py +54 -0
  30. siliconcompiler/tools/openroad/screenshot.py +31 -1
  31. siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +8 -0
  32. siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +5 -1
  33. siliconcompiler/tools/openroad/scripts/common/read_timing_constraints.tcl +17 -15
  34. siliconcompiler/tools/openroad/scripts/common/write_data_timing.tcl +3 -1
  35. siliconcompiler/tools/openroad/write_data.py +76 -0
  36. siliconcompiler/tools/opensta/timing.py +37 -2
  37. siliconcompiler/tools/slang/elaborate.py +16 -1
  38. siliconcompiler/tools/surelog/parse.py +54 -0
  39. siliconcompiler/tools/verilator/compile.py +120 -0
  40. siliconcompiler/tools/vivado/syn_fpga.py +27 -0
  41. siliconcompiler/tools/vpr/__init__.py +9 -9
  42. siliconcompiler/tools/vpr/place.py +1 -2
  43. siliconcompiler/tools/vpr/route.py +40 -0
  44. siliconcompiler/tools/xdm/convert.py +14 -0
  45. siliconcompiler/tools/xyce/simulate.py +26 -0
  46. siliconcompiler/tools/yosys/lec_asic.py +13 -0
  47. siliconcompiler/tools/yosys/syn_asic.py +336 -7
  48. siliconcompiler/tools/yosys/syn_fpga.py +39 -8
  49. siliconcompiler/toolscripts/_tools.json +5 -5
  50. siliconcompiler/utils/logging.py +6 -0
  51. {siliconcompiler-0.36.0.dist-info → siliconcompiler-0.36.2.dist-info}/METADATA +3 -3
  52. {siliconcompiler-0.36.0.dist-info → siliconcompiler-0.36.2.dist-info}/RECORD +56 -56
  53. {siliconcompiler-0.36.0.dist-info → siliconcompiler-0.36.2.dist-info}/WHEEL +0 -0
  54. {siliconcompiler-0.36.0.dist-info → siliconcompiler-0.36.2.dist-info}/entry_points.txt +0 -0
  55. {siliconcompiler-0.36.0.dist-info → siliconcompiler-0.36.2.dist-info}/licenses/LICENSE +0 -0
  56. {siliconcompiler-0.36.0.dist-info → siliconcompiler-0.36.2.dist-info}/top_level.txt +0 -0
@@ -1,3 +1,5 @@
1
+ from typing import Optional, Union
2
+
1
3
  from siliconcompiler.tools.openroad._apr import APRTask
2
4
  from siliconcompiler.tools.openroad._apr import OpenROADSTAParameter, OpenROADDPLParameter, \
3
5
  OpenROADRSZDRVParameter, OpenROADRSZTimingParameter, OpenROADFillCellsParameter
@@ -21,6 +23,58 @@ class RepairTimingTask(APRTask, OpenROADSTAParameter, OpenROADDPLParameter,
21
23
  self.add_parameter("rsz_skip_recover_power", "bool", "skip power recovery",
22
24
  defvalue=False)
23
25
 
26
+ def set_openroad_skipdrvrepair(self, skip: bool,
27
+ step: Optional[str] = None,
28
+ index: Optional[Union[int, str]] = None):
29
+ """
30
+ Enables or disables skipping design rule violation repair.
31
+
32
+ Args:
33
+ skip (bool): True to skip repair, False to perform it.
34
+ step (str, optional): The specific step to apply this configuration to.
35
+ index (str, optional): The specific index to apply this configuration to.
36
+ """
37
+ self.set("var", "rsz_skip_drv_repair", skip, step=step, index=index)
38
+
39
+ def set_openroad_skipsetuprepair(self, skip: bool,
40
+ step: Optional[str] = None,
41
+ index: Optional[Union[int, str]] = None):
42
+ """
43
+ Enables or disables skipping setup timing repair.
44
+
45
+ Args:
46
+ skip (bool): True to skip repair, False to perform it.
47
+ step (str, optional): The specific step to apply this configuration to.
48
+ index (str, optional): The specific index to apply this configuration to.
49
+ """
50
+ self.set("var", "rsz_skip_setup_repair", skip, step=step, index=index)
51
+
52
+ def set_openroad_skipholdrepair(self, skip: bool,
53
+ step: Optional[str] = None,
54
+ index: Optional[Union[int, str]] = None):
55
+ """
56
+ Enables or disables skipping hold timing repair.
57
+
58
+ Args:
59
+ skip (bool): True to skip repair, False to perform it.
60
+ step (str, optional): The specific step to apply this configuration to.
61
+ index (str, optional): The specific index to apply this configuration to.
62
+ """
63
+ self.set("var", "rsz_skip_hold_repair", skip, step=step, index=index)
64
+
65
+ def set_openroad_skiprecoverpower(self, skip: bool,
66
+ step: Optional[str] = None,
67
+ index: Optional[Union[int, str]] = None):
68
+ """
69
+ Enables or disables skipping power recovery.
70
+
71
+ Args:
72
+ skip (bool): True to skip recovery, False to perform it.
73
+ step (str, optional): The specific step to apply this configuration to.
74
+ index (str, optional): The specific index to apply this configuration to.
75
+ """
76
+ self.set("var", "rsz_skip_recover_power", skip, step=step, index=index)
77
+
24
78
  def task(self):
25
79
  return "repair_timing"
26
80
 
@@ -1,3 +1,5 @@
1
+ from typing import Optional, Union
2
+
1
3
  from siliconcompiler import ScreenshotTask
2
4
  from siliconcompiler.tools.openroad.show import ShowTask
3
5
 
@@ -9,10 +11,38 @@ class ScreenshotTask(ScreenshotTask, ShowTask):
9
11
  def __init__(self):
10
12
  super().__init__()
11
13
 
12
- self.add_parameter("show_vertical_resolution", "int", "blah", defvalue=1024)
14
+ self.add_parameter("show_vertical_resolution", "int",
15
+ "Vertical resolution of the screenshot image",
16
+ defvalue=1024)
13
17
  self.add_parameter("include_report_images", "bool",
14
18
  "true/false, include the images in reports/", defvalue=False)
15
19
 
20
+ def set_openroad_verticalresolution(self, value: int,
21
+ step: Optional[str] = None,
22
+ index: Optional[Union[int, str]] = None):
23
+ """
24
+ Set the vertical resolution for OpenROAD screenshots.
25
+
26
+ Args:
27
+ value (int): The vertical resolution in pixels.
28
+ step (Optional[str]): The step in the flow where this setting applies.
29
+ index (Optional[Union[int, str]]): The index for multiple runs or configurations.
30
+ """
31
+ self.set("var", "show_vertical_resolution", value, step=step, index=index)
32
+
33
+ def set_openroad_includereportimages(self, value: bool,
34
+ step: Optional[str] = None,
35
+ index: Optional[Union[int, str]] = None):
36
+ """
37
+ Set whether to include report images in the output.
38
+
39
+ Args:
40
+ value (bool): Whether to include report images.
41
+ step (Optional[str]): The step in the flow where this setting applies.
42
+ index (Optional[Union[int, str]]): The index for multiple runs or configurations.
43
+ """
44
+ self.set("var", "include_report_images", value, step=step, index=index)
45
+
16
46
  def setup(self):
17
47
  super().setup()
18
48
 
@@ -92,3 +92,11 @@ tee -file reports/global_connections.start.rpt {report_global_connect}
92
92
  if { [sc_cfg_tool_task_check_in_list report_buffers var reports] && [sc_check_version 23264] } {
93
93
  tee -quiet -file reports/report_buffers.rpt {report_buffers -filtered}
94
94
  }
95
+ tee -quiet -file reports/report_units.rpt {report_units}
96
+
97
+ tee -quiet -file reports/report_layer_rc.rpt {report_layer_rc}
98
+ foreach corner [sta::corners] {
99
+ set corner_name [$corner name]
100
+ tee -quiet -append -file reports/report_layer_rc.rpt "puts \"Corner: $corner_name\""
101
+ tee -quiet -append -file reports/report_layer_rc.rpt "report_layer_rc -corner $corner_name"
102
+ }
@@ -149,7 +149,7 @@ set sc_hpinmetal [sc_get_layer_name [sc_cfg_tool_task_get var pin_layer_horizont
149
149
  set sc_vpinmetal [sc_get_layer_name [sc_cfg_tool_task_get var pin_layer_vertical]]
150
150
 
151
151
  if { [sc_cfg_exists constraint pin] } {
152
- source "[sc_cfg_tool_task_get file sc_pin_constraint]"
152
+ source [sc_cfg_tool_task_get var sc_pin_constraints_tcl]
153
153
 
154
154
  proc sc_pin_print { arg } { utl::warn FLW 1 $arg }
155
155
  proc sc_pin_layer_select { pin } {
@@ -366,6 +366,10 @@ if { [sc_cfg_exists constraint component] } {
366
366
 
367
367
  if { $halo != {} } {
368
368
  set inst [[ord::get_db_block] findInst $name]
369
+ set halo_box [$inst getHalo]
370
+ if { $halo_box != "NULL" } {
371
+ odb::dbBox_destroy $halo_box
372
+ }
369
373
  odb::dbBox_create $inst \
370
374
  [ord::microns_to_dbu [lindex $halo 0]] \
371
375
  [ord::microns_to_dbu [lindex $halo 1]] \
@@ -2,22 +2,24 @@
2
2
  # Read timing constraints
3
3
  ###############################
4
4
 
5
- if { [file exists "inputs/${sc_topmodule}.sdc"] } {
6
- set sdc "inputs/${sc_topmodule}.sdc"
7
- puts "Reading SDC: ${sdc}"
8
- read_sdc $sdc
9
- } else {
10
- set sdcs [sc_cfg_get_fileset $sc_designlib [sc_cfg_get option fileset] sdc]
11
- if { [llength $sdcs] > 0 } {
12
- foreach sdc $sdcs {
5
+ if { [sc_cfg_tool_task_get var load_sdcs] } {
6
+ if { [file exists "inputs/${sc_topmodule}.sdc"] } {
7
+ set sdc "inputs/${sc_topmodule}.sdc"
8
+ puts "Reading SDC: ${sdc}"
9
+ read_sdc $sdc
10
+ } else {
11
+ set sdcs [sc_cfg_get_fileset $sc_designlib [sc_cfg_get option fileset] sdc]
12
+ if { [llength $sdcs] > 0 } {
13
+ foreach sdc $sdcs {
14
+ puts "Reading SDC: ${sdc}"
15
+ read_sdc $sdc
16
+ }
17
+ } else {
18
+ # fall back on default auto generated constraints file
19
+ set sdc [sc_cfg_tool_task_get var opensta_generic_sdc]
13
20
  puts "Reading SDC: ${sdc}"
14
- read_sdc $sdc
21
+ utl::warn FLW 1 "Defaulting back to default SDC"
22
+ read_sdc "${sdc}"
15
23
  }
16
- } else {
17
- # fall back on default auto generated constraints file
18
- set sdc [sc_cfg_tool_task_get var opensta_generic_sdc]
19
- puts "Reading SDC: ${sdc}"
20
- utl::warn FLW 1 "Defaulting back to default SDC"
21
- read_sdc "${sdc}"
22
24
  }
23
25
  }
@@ -1 +1,3 @@
1
- write_sdc "outputs/${sc_topmodule}.sdc"
1
+ if { [sc_cfg_tool_task_get var load_sdcs] } {
2
+ write_sdc "outputs/${sc_topmodule}.sdc"
3
+ }
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from siliconcompiler.tools.openroad._apr import APRTask
2
4
  from siliconcompiler.tools.openroad._apr import OpenROADSTAParameter, OpenROADPSMParameter
3
5
 
@@ -32,6 +34,80 @@ class WriteViewsTask(APRTask, OpenROADSTAParameter, OpenROADPSMParameter):
32
34
 
33
35
  self.add_parameter("pex_corners", "{str}", "set of pex corners to perform extraction on")
34
36
 
37
+ def set_openroad_abstractlefbloatlayers(self, enable: bool,
38
+ step: Optional[str] = None,
39
+ index: Optional[str] = None):
40
+ """
41
+ Enables or disables filling all layers when writing the abstract LEF.
42
+
43
+ Args:
44
+ enable (bool): True to enable, False to disable.
45
+ step (str, optional): The specific step to apply this configuration to.
46
+ index (str, optional): The specific index to apply this configuration to.
47
+ """
48
+ self.set("var", "ord_abstract_lef_bloat_layers", enable, step=step, index=index)
49
+
50
+ def set_openroad_abstractlefbloatfactor(self, factor: int,
51
+ step: Optional[str] = None,
52
+ index: Optional[str] = None):
53
+ """
54
+ Sets the bloat factor to apply when writing the abstract LEF.
55
+
56
+ Args:
57
+ factor (int): The bloat factor.
58
+ step (str, optional): The specific step to apply this configuration to.
59
+ index (str, optional): The specific index to apply this configuration to.
60
+ """
61
+ self.set("var", "ord_abstract_lef_bloat_factor", factor, step=step, index=index)
62
+
63
+ def set_openroad_writecdl(self, enable: bool,
64
+ step: Optional[str] = None, index: Optional[str] = None):
65
+ """
66
+ Enables or disables writing the CDL file.
67
+
68
+ Args:
69
+ enable (bool): True to enable, False to disable.
70
+ step (str, optional): The specific step to apply this configuration to.
71
+ index (str, optional): The specific index to apply this configuration to.
72
+ """
73
+ self.set("var", "write_cdl", enable, step=step, index=index)
74
+
75
+ def set_openroad_writespef(self, enable: bool,
76
+ step: Optional[str] = None, index: Optional[str] = None):
77
+ """
78
+ Enables or disables writing the SPEF file.
79
+
80
+ Args:
81
+ enable (bool): True to enable, False to disable.
82
+ step (str, optional): The specific step to apply this configuration to.
83
+ index (str, optional): The specific index to apply this configuration to.
84
+ """
85
+ self.set("var", "write_spef", enable, step=step, index=index)
86
+
87
+ def set_openroad_writeliberty(self, enable: bool,
88
+ step: Optional[str] = None, index: Optional[str] = None):
89
+ """
90
+ Enables or disables writing the Liberty timing model.
91
+
92
+ Args:
93
+ enable (bool): True to enable, False to disable.
94
+ step (str, optional): The specific step to apply this configuration to.
95
+ index (str, optional): The specific index to apply this configuration to.
96
+ """
97
+ self.set("var", "write_liberty", enable, step=step, index=index)
98
+
99
+ def set_openroad_writesdf(self, enable: bool,
100
+ step: Optional[str] = None, index: Optional[str] = None):
101
+ """
102
+ Enables or disables writing the SDF timing model.
103
+
104
+ Args:
105
+ enable (bool): True to enable, False to disable.
106
+ step (str, optional): The specific step to apply this configuration to.
107
+ index (str, optional): The specific index to apply this configuration to.
108
+ """
109
+ self.set("var", "write_sdf", enable, step=step, index=index)
110
+
35
111
  def task(self):
36
112
  return "write_data"
37
113
 
@@ -29,8 +29,43 @@ class TimingTaskBase(OpenSTATask):
29
29
  defvalue="tools/_common/sdc/sc_constraints.sdc",
30
30
  dataroot="siliconcompiler")
31
31
 
32
- def set_timing_mode(self, mode: str, step: Optional[str] = None, index: Optional[str] = None):
33
- return self.set("var", "timing_mode", mode, step=step, index=index)
32
+ def set_opensta_topnpaths(self, n: int,
33
+ step: Optional[str] = None,
34
+ index: Optional[str] = None):
35
+ """
36
+ Sets the number of paths to report timing for.
37
+
38
+ Args:
39
+ n (int): The number of paths.
40
+ step (str, optional): The specific step to apply this configuration to.
41
+ index (str, optional): The specific index to apply this configuration to.
42
+ """
43
+ self.set("var", "top_n_paths", n, step=step, index=index)
44
+
45
+ def set_opensta_uniquepathgroupsperclock(self, enable: bool,
46
+ step: Optional[str] = None,
47
+ index: Optional[str] = None):
48
+ """
49
+ Enables or disables generating separate path groups per clock.
50
+
51
+ Args:
52
+ enable (bool): Whether to enable unique path groups per clock.
53
+ step (str, optional): The specific step to apply this configuration to.
54
+ index (str, optional): The specific index to apply this configuration to.
55
+ """
56
+ self.set("var", "unique_path_groups_per_clock", enable, step=step, index=index)
57
+
58
+ def set_opensta_timingmode(self, mode: str,
59
+ step: Optional[str] = None, index: Optional[str] = None):
60
+ """
61
+ Sets the timing mode to use.
62
+
63
+ Args:
64
+ mode (str): The timing mode to use.
65
+ step (str, optional): The specific step to apply this configuration to.
66
+ index (str, optional): The specific index to apply this configuration to.
67
+ """
68
+ self.set("var", "timing_mode", mode, step=step, index=index)
34
69
 
35
70
  def setup(self):
36
71
  super().setup()
@@ -1,6 +1,8 @@
1
+ from typing import Optional, Union
2
+
1
3
  import os.path
2
- from siliconcompiler.tools.slang import pyslang
3
4
 
5
+ from siliconcompiler.tools.slang import pyslang
4
6
 
5
7
  from siliconcompiler.tools.slang import SlangTask
6
8
 
@@ -18,6 +20,19 @@ class Elaborate(SlangTask):
18
20
  "true/false, if true add the source file path information",
19
21
  True)
20
22
 
23
+ def set_slang_includesourcepaths(self, enable: bool,
24
+ step: Optional[str] = None,
25
+ index: Optional[Union[int, str]] = None):
26
+ """
27
+ Enables or disables adding source file path information to the output.
28
+
29
+ Args:
30
+ enable (bool): True to include source paths, False to exclude.
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", "include_source_paths", enable, step=step, index=index)
35
+
21
36
  def task(self):
22
37
  return "elaborate"
23
38
 
@@ -3,6 +3,8 @@ import sys
3
3
 
4
4
  import os.path
5
5
 
6
+ from typing import Optional
7
+
6
8
  from siliconcompiler import sc_open
7
9
  from siliconcompiler import utils
8
10
 
@@ -23,6 +25,58 @@ class ElaborateTask(Task):
23
25
  self.add_parameter("disable_note", "bool",
24
26
  "true/false, when true instructs Surelog to not log notes.")
25
27
 
28
+ def set_surelog_enablelowmem(self, enable: bool,
29
+ step: Optional[str] = None,
30
+ index: Optional[str] = None):
31
+ """
32
+ Enables or disables low memory mode.
33
+
34
+ Args:
35
+ enable (bool): Whether to enable low memory mode.
36
+ step (str, optional): The specific step to apply this configuration to.
37
+ index (str, optional): The specific index to apply this configuration to.
38
+ """
39
+ self.set("var", "enable_lowmem", enable, step=step, index=index)
40
+
41
+ def set_surelog_disablewritecache(self, disable: bool,
42
+ step: Optional[str] = None,
43
+ index: Optional[str] = None):
44
+ """
45
+ Disables or enables writing to the cache.
46
+
47
+ Args:
48
+ disable (bool): Whether to disable writing to the cache.
49
+ step (str, optional): The specific step to apply this configuration to.
50
+ index (str, optional): The specific index to apply this configuration to.
51
+ """
52
+ self.set("var", "disable_write_cache", disable, step=step, index=index)
53
+
54
+ def set_surelog_disableinfo(self, disable: bool,
55
+ step: Optional[str] = None,
56
+ index: Optional[str] = None):
57
+ """
58
+ Disables or enables logging info messages.
59
+
60
+ Args:
61
+ disable (bool): Whether to disable logging info messages.
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", "disable_info", disable, step=step, index=index)
66
+
67
+ def set_surelog_disablenote(self, disable: bool,
68
+ step: Optional[str] = None,
69
+ index: Optional[str] = None):
70
+ """
71
+ Disables or enables logging note messages.
72
+
73
+ Args:
74
+ disable (bool): Whether to disable logging note messages.
75
+ step (str, optional): The specific step to apply this configuration to.
76
+ index (str, optional): The specific index to apply this configuration to.
77
+ """
78
+ self.set("var", "disable_note", disable, step=step, index=index)
79
+
26
80
  def tool(self):
27
81
  return "surelog"
28
82
 
@@ -1,4 +1,5 @@
1
1
  import shlex
2
+ from typing import Optional, List, Union
2
3
 
3
4
  from siliconcompiler.tools.verilator import VerilatorTask
4
5
 
@@ -35,6 +36,125 @@ class CompileTask(VerilatorTask):
35
36
  self.add_parameter("initialize_random", "bool",
36
37
  "true/false, when true registers will reset with a random value")
37
38
 
39
+ def set_verilator_mode(self, mode: str,
40
+ step: Optional[str] = None,
41
+ index: Optional[str] = None):
42
+ """
43
+ Sets the compilation mode for Verilator.
44
+
45
+ Args:
46
+ mode (str): The compilation mode.
47
+ step (str, optional): The specific step to apply this configuration to.
48
+ index (str, optional): The specific index to apply this configuration to.
49
+ """
50
+ self.set("var", "mode", mode, step=step, index=index)
51
+
52
+ def set_verilator_trace(self, enable: bool,
53
+ step: Optional[str] = None,
54
+ index: Optional[str] = None):
55
+ """
56
+ Enables or disables trace generation.
57
+
58
+ Args:
59
+ enable (bool): Whether to enable trace generation.
60
+ step (str, optional): The specific step to apply this configuration to.
61
+ index (str, optional): The specific index to apply this configuration to.
62
+ """
63
+ self.set("var", "trace", enable, step=step, index=index)
64
+
65
+ def set_verilator_tracetype(self, trace_type: str,
66
+ step: Optional[str] = None,
67
+ index: Optional[str] = None):
68
+ """
69
+ Sets the type of wave file to create when trace is enabled.
70
+
71
+ Args:
72
+ trace_type (str): The trace type.
73
+ step (str, optional): The specific step to apply this configuration to.
74
+ index (str, optional): The specific index to apply this configuration to.
75
+ """
76
+ self.set("var", "trace_type", trace_type, step=step, index=index)
77
+
78
+ def add_verilator_cincludes(self, include: Union[str, List[str]],
79
+ step: Optional[str] = None,
80
+ index: Optional[str] = None,
81
+ clobber: bool = False):
82
+ """
83
+ Adds include directories for the C++ compiler.
84
+
85
+ Args:
86
+ include (Union[str, List[str]]): The include directory/directories to add.
87
+ step (str, optional): The specific step to apply this configuration to.
88
+ index (str, optional): The specific index to apply this configuration to.
89
+ clobber (bool, optional): If True, overwrites the existing list. Defaults to False.
90
+ """
91
+ if clobber:
92
+ self.set("var", "cincludes", include, step=step, index=index)
93
+ else:
94
+ self.add("var", "cincludes", include, step=step, index=index)
95
+
96
+ def add_verilator_cflags(self, flag: Union[str, List[str]],
97
+ step: Optional[str] = None,
98
+ index: Optional[str] = None,
99
+ clobber: bool = False):
100
+ """
101
+ Adds flags for the C++ compiler.
102
+
103
+ Args:
104
+ flag (Union[str, List[str]]): The flag(s) to add.
105
+ step (str, optional): The specific step to apply this configuration to.
106
+ index (str, optional): The specific index to apply this configuration to.
107
+ clobber (bool, optional): If True, overwrites the existing list. Defaults to False.
108
+ """
109
+ if clobber:
110
+ self.set("var", "cflags", flag, step=step, index=index)
111
+ else:
112
+ self.add("var", "cflags", flag, step=step, index=index)
113
+
114
+ def add_verilator_ldflags(self, flag: Union[str, List[str]],
115
+ step: Optional[str] = None,
116
+ index: Optional[str] = None,
117
+ clobber: bool = False):
118
+ """
119
+ Adds flags for the linker.
120
+
121
+ Args:
122
+ flag (Union[str, List[str]]): The flag(s) to add.
123
+ step (str, optional): The specific step to apply this configuration to.
124
+ index (str, optional): The specific index to apply this configuration to.
125
+ clobber (bool, optional): If True, overwrites the existing list. Defaults to False.
126
+ """
127
+ if clobber:
128
+ self.set("var", "ldflags", flag, step=step, index=index)
129
+ else:
130
+ self.add("var", "ldflags", flag, step=step, index=index)
131
+
132
+ def set_verilator_pinsbv(self, width: int,
133
+ step: Optional[str] = None,
134
+ index: Optional[str] = None):
135
+ """
136
+ Sets the datatype width for SystemC inputs/outputs.
137
+
138
+ Args:
139
+ width (int): The bit width.
140
+ step (str, optional): The specific step to apply this configuration to.
141
+ index (str, optional): The specific index to apply this configuration to.
142
+ """
143
+ self.set("var", "pins_bv", width, step=step, index=index)
144
+
145
+ def set_verilator_initializerandom(self, enable: bool,
146
+ step: Optional[str] = None,
147
+ index: Optional[str] = None):
148
+ """
149
+ Enables or disables random initialization of registers.
150
+
151
+ Args:
152
+ enable (bool): Whether to enable random initialization.
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
+ """
156
+ self.set("var", "initialize_random", enable, step=step, index=index)
157
+
38
158
  def task(self):
39
159
  return "compile"
40
160
 
@@ -1,3 +1,4 @@
1
+ from typing import Optional
1
2
  from siliconcompiler.tools.vivado import VivadoTask
2
3
 
3
4
 
@@ -9,6 +10,32 @@ class SynthesisTask(VivadoTask):
9
10
  self.add_parameter("synth_directive", "str", "synthesis directive", defvalue="Default")
10
11
  self.add_parameter("synth_mode", "str", "synthesis mode", defvalue="none")
11
12
 
13
+ def set_vivado_synthdirective(self, directive: str,
14
+ step: Optional[str] = None,
15
+ index: Optional[str] = None):
16
+ """
17
+ Sets the synthesis directive.
18
+
19
+ Args:
20
+ directive (str): The synthesis directive.
21
+ step (str, optional): The specific step to apply this configuration to.
22
+ index (str, optional): The specific index to apply this configuration to.
23
+ """
24
+ self.set("var", "synth_directive", directive, step=step, index=index)
25
+
26
+ def set_vivado_synthmode(self, mode: str,
27
+ step: Optional[str] = None,
28
+ index: Optional[str] = None):
29
+ """
30
+ Sets the synthesis mode.
31
+
32
+ Args:
33
+ mode (str): The synthesis mode.
34
+ step (str, optional): The specific step to apply this configuration to.
35
+ index (str, optional): The specific index to apply this configuration to.
36
+ """
37
+ self.set("var", "synth_mode", mode, step=step, index=index)
38
+
12
39
  def task(self):
13
40
  return "syn_fpga"
14
41
 
@@ -273,7 +273,7 @@ class VPRTask(Task):
273
273
  self.add_required_key(lib, "fileset", fileset, "file", "sdc")
274
274
  self.set("var", "enable_timing_analysis", True)
275
275
 
276
- fpga = self.project.get("library", self.project.get("fpga", "device"), field="schema")
276
+ fpga = self.project.get_library(self.project.get("fpga", "device"))
277
277
  self.add_required_key(fpga, "tool", "vpr", "devicecode")
278
278
  self.add_required_key(fpga, "tool", "vpr", "clock_model")
279
279
  self.add_required_key(fpga, "tool", "vpr", "archfile")
@@ -287,7 +287,7 @@ class VPRTask(Task):
287
287
  def runtime_options(self):
288
288
  options = super().runtime_options()
289
289
 
290
- fpga = self.project.get("library", self.project.get("fpga", "device"), field="schema")
290
+ fpga = self.project.get_library(self.project.get("fpga", "device"))
291
291
 
292
292
  options.extend(["--device", fpga.get("tool", "vpr", "devicecode")])
293
293
 
@@ -393,17 +393,17 @@ class VPRTask(Task):
393
393
  for report in glob.glob("*.rpt"):
394
394
  shutil.move(report, 'reports')
395
395
 
396
- fpga = self.project.get("fpga", "device")
396
+ fpga = self.project.get_library(self.project.get("fpga", "device"))
397
397
 
398
398
  dff_cells = []
399
- if self.project.valid("library", fpga, "tool", "yosys", "registers"):
400
- dff_cells = self.project.get("library", fpga, "tool", "yosys", "registers")
399
+ if fpga.valid("tool", "yosys", "registers"):
400
+ dff_cells = fpga.get("tool", "yosys", "registers")
401
401
  brams_cells = []
402
- if self.project.valid("library", fpga, "tool", "yosys", "brams"):
403
- brams_cells = self.project.get("library", fpga, "tool", "yosys", "brams")
402
+ if fpga.valid("tool", "yosys", "brams"):
403
+ brams_cells = fpga.get("tool", "yosys", "brams")
404
404
  dsps_cells = []
405
- if self.project.valid("library", fpga, "tool", "yosys", "dsps"):
406
- dsps_cells = self.project.get("library", fpga, "tool", "yosys", "dsps")
405
+ if fpga.valid("tool", "yosys", "dsps"):
406
+ dsps_cells = fpga.get("tool", "yosys", "dsps")
407
407
 
408
408
  stat_extract = re.compile(r' \s*(.*)\s*:\s*([0-9]+)')
409
409
  lut_match = re.compile(r'([0-9]+)-LUT')
@@ -48,8 +48,7 @@ class PlaceTask(VPRTask):
48
48
  if files:
49
49
  pcf_file = files[0]
50
50
 
51
- fpga = self.project.get("library", self.project.get("fpga", "device"),
52
- field="schema")
51
+ fpga = self.project.get_library(self.project.get("fpga", "device"))
53
52
  map_file = fpga.find_files("tool", "vpr", "constraintsmap")
54
53
 
55
54
  constraints_map = load_constraints_map(map_file)