siliconcompiler 0.35.3__py3-none-any.whl → 0.36.0__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/apps/sc_issue.py +18 -2
- siliconcompiler/checklist.py +2 -1
- siliconcompiler/constraints/__init__.py +4 -1
- siliconcompiler/constraints/asic_component.py +49 -11
- siliconcompiler/constraints/asic_floorplan.py +23 -21
- siliconcompiler/constraints/asic_pins.py +55 -17
- siliconcompiler/constraints/asic_timing.py +280 -57
- siliconcompiler/constraints/fpga_timing.py +212 -18
- siliconcompiler/constraints/timing_mode.py +82 -0
- siliconcompiler/data/templates/replay/replay.sh.j2 +27 -14
- siliconcompiler/data/templates/tcl/manifest.tcl.j2 +0 -6
- siliconcompiler/flowgraph.py +95 -42
- siliconcompiler/flows/generate_openroad_rcx.py +2 -2
- siliconcompiler/flows/highresscreenshotflow.py +37 -0
- siliconcompiler/library.py +2 -1
- siliconcompiler/package/__init__.py +56 -51
- siliconcompiler/project.py +13 -2
- siliconcompiler/scheduler/docker.py +24 -25
- siliconcompiler/scheduler/scheduler.py +143 -100
- siliconcompiler/scheduler/schedulernode.py +138 -22
- siliconcompiler/scheduler/slurm.py +120 -35
- siliconcompiler/scheduler/taskscheduler.py +19 -23
- siliconcompiler/schema/_metadata.py +1 -1
- siliconcompiler/schema/editableschema.py +29 -0
- siliconcompiler/schema/namedschema.py +2 -4
- siliconcompiler/schema/parametervalue.py +14 -2
- siliconcompiler/schema_support/cmdlineschema.py +0 -3
- siliconcompiler/schema_support/dependencyschema.py +0 -6
- siliconcompiler/schema_support/option.py +82 -1
- siliconcompiler/schema_support/pathschema.py +7 -13
- siliconcompiler/schema_support/record.py +4 -3
- siliconcompiler/tool.py +105 -52
- siliconcompiler/tools/_common/tcl/sc_schema_access.tcl +0 -6
- siliconcompiler/tools/keplerformal/__init__.py +7 -0
- siliconcompiler/tools/keplerformal/lec.py +112 -0
- siliconcompiler/tools/klayout/__init__.py +3 -0
- siliconcompiler/tools/klayout/screenshot.py +66 -1
- siliconcompiler/tools/klayout/scripts/klayout_convert_drc_db.py +1 -0
- siliconcompiler/tools/klayout/scripts/klayout_export.py +11 -40
- siliconcompiler/tools/klayout/scripts/klayout_operations.py +1 -0
- siliconcompiler/tools/klayout/scripts/klayout_show.py +5 -4
- siliconcompiler/tools/klayout/scripts/klayout_utils.py +16 -5
- siliconcompiler/tools/montage/tile.py +26 -12
- siliconcompiler/tools/openroad/__init__.py +27 -1
- siliconcompiler/tools/openroad/_apr.py +107 -14
- siliconcompiler/tools/openroad/clock_tree_synthesis.py +1 -0
- siliconcompiler/tools/openroad/global_placement.py +1 -0
- siliconcompiler/tools/openroad/init_floorplan.py +119 -7
- siliconcompiler/tools/openroad/power_grid_analysis.py +174 -0
- siliconcompiler/tools/openroad/repair_design.py +1 -0
- siliconcompiler/tools/openroad/repair_timing.py +1 -0
- siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +1 -1
- siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +91 -18
- siliconcompiler/tools/openroad/scripts/apr/sc_irdrop.tcl +148 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_repair_design.tcl +1 -1
- siliconcompiler/tools/openroad/scripts/apr/sc_write_data.tcl +8 -10
- siliconcompiler/tools/openroad/scripts/common/procs.tcl +15 -6
- siliconcompiler/tools/openroad/scripts/common/read_liberty.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/common/reports.tcl +7 -4
- siliconcompiler/tools/openroad/scripts/common/screenshot.tcl +1 -1
- siliconcompiler/tools/openroad/scripts/common/write_data_physical.tcl +8 -0
- siliconcompiler/tools/openroad/scripts/common/write_images.tcl +16 -12
- siliconcompiler/tools/openroad/scripts/rcx/sc_rcx_bench.tcl +2 -4
- siliconcompiler/tools/openroad/scripts/sc_rdlroute.tcl +3 -1
- siliconcompiler/tools/openroad/write_data.py +2 -2
- siliconcompiler/tools/opensta/__init__.py +1 -1
- siliconcompiler/tools/opensta/scripts/sc_check_library.tcl +2 -2
- siliconcompiler/tools/opensta/scripts/sc_report_libraries.tcl +2 -2
- siliconcompiler/tools/opensta/scripts/sc_timing.tcl +13 -10
- siliconcompiler/tools/opensta/timing.py +6 -2
- siliconcompiler/tools/vivado/scripts/sc_bitstream.tcl +11 -0
- siliconcompiler/tools/vivado/scripts/sc_place.tcl +11 -0
- siliconcompiler/tools/vivado/scripts/sc_route.tcl +11 -0
- siliconcompiler/tools/vivado/scripts/sc_syn_fpga.tcl +10 -0
- siliconcompiler/tools/vpr/__init__.py +28 -0
- siliconcompiler/tools/yosys/scripts/sc_screenshot.tcl +1 -1
- siliconcompiler/tools/yosys/scripts/sc_synth_asic.tcl +40 -4
- siliconcompiler/tools/yosys/scripts/sc_synth_fpga.tcl +15 -5
- siliconcompiler/tools/yosys/syn_asic.py +42 -0
- siliconcompiler/tools/yosys/syn_fpga.py +8 -0
- siliconcompiler/toolscripts/_tools.json +12 -7
- siliconcompiler/toolscripts/ubuntu22/install-keplerformal.sh +72 -0
- siliconcompiler/toolscripts/ubuntu24/install-keplerformal.sh +72 -0
- siliconcompiler/utils/__init__.py +243 -51
- siliconcompiler/utils/curation.py +89 -56
- siliconcompiler/utils/issue.py +6 -1
- siliconcompiler/utils/multiprocessing.py +46 -2
- siliconcompiler/utils/paths.py +21 -0
- siliconcompiler/utils/settings.py +162 -0
- {siliconcompiler-0.35.3.dist-info → siliconcompiler-0.36.0.dist-info}/METADATA +5 -4
- {siliconcompiler-0.35.3.dist-info → siliconcompiler-0.36.0.dist-info}/RECORD +96 -87
- {siliconcompiler-0.35.3.dist-info → siliconcompiler-0.36.0.dist-info}/WHEEL +0 -0
- {siliconcompiler-0.35.3.dist-info → siliconcompiler-0.36.0.dist-info}/entry_points.txt +0 -0
- {siliconcompiler-0.35.3.dist-info → siliconcompiler-0.36.0.dist-info}/licenses/LICENSE +0 -0
- {siliconcompiler-0.35.3.dist-info → siliconcompiler-0.36.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Adopted from https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/3f9740e6b3643835e918d78ae1d377d65af0f0fb/flow/scripts/save_images.tcl
|
|
2
2
|
|
|
3
|
-
proc sc_image_heatmap { name ident image_name title { gif
|
|
3
|
+
proc sc_image_heatmap { name ident image_name title { gif -1 } { allow_bin_adjust 1 } } {
|
|
4
4
|
lassign [sc_cfg_tool_task_get var ord_heatmap_bins] ord_heatmap_bins_x ord_heatmap_bins_y
|
|
5
5
|
|
|
6
6
|
file mkdir reports/images/heatmap
|
|
@@ -124,12 +124,12 @@ proc sc_image_irdrop { net corner } {
|
|
|
124
124
|
return
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
set gif
|
|
127
|
+
set gif -1
|
|
128
128
|
if { [sc_check_version 21574] } {
|
|
129
|
-
set gif
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
set gif [save_animated_gif -start "reports/images/heatmap/irdrop/${net}.${corner}.gif"]
|
|
130
|
+
if { $gif == "" } {
|
|
131
|
+
set gif 0
|
|
132
|
+
}
|
|
133
133
|
}
|
|
134
134
|
foreach layer [[ord::get_db_tech] getLayers] {
|
|
135
135
|
if { [$layer getRoutingLevel] == 0 } {
|
|
@@ -160,8 +160,12 @@ proc sc_image_irdrop { net corner } {
|
|
|
160
160
|
gui::delete_label $label
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
if { $gif } {
|
|
164
|
-
|
|
163
|
+
if { $gif >= 0 } {
|
|
164
|
+
if { [sc_check_version 26866] } {
|
|
165
|
+
save_animated_gif -end -key $gif
|
|
166
|
+
} else {
|
|
167
|
+
save_animated_gif -end
|
|
168
|
+
}
|
|
165
169
|
}
|
|
166
170
|
}
|
|
167
171
|
|
|
@@ -176,7 +180,7 @@ proc sc_image_routing_congestion { } {
|
|
|
176
180
|
"Routing" \
|
|
177
181
|
"routing_congestion.png" \
|
|
178
182
|
"routing congestion" \
|
|
179
|
-
|
|
183
|
+
-1 \
|
|
180
184
|
0
|
|
181
185
|
}
|
|
182
186
|
|
|
@@ -194,7 +198,7 @@ proc sc_image_estimated_routing_congestion { } {
|
|
|
194
198
|
"RUDY" \
|
|
195
199
|
"estimated_routing_congestion.png" \
|
|
196
200
|
"estimated routing congestion" \
|
|
197
|
-
|
|
201
|
+
-1 \
|
|
198
202
|
0
|
|
199
203
|
} err
|
|
200
204
|
unsuppress_message GRT 10
|
|
@@ -342,7 +346,7 @@ proc sc_image_timing_histograms { } {
|
|
|
342
346
|
|
|
343
347
|
if { [sc_cfg_tool_task_check_in_list setup var reports] } {
|
|
344
348
|
set path reports/images/timing/setup.histogram.png
|
|
345
|
-
utl::info FLW 1 "Saving setup timing histogram to $path"
|
|
349
|
+
utl::info FLW 1 "Saving \"setup timing histogram\" to $path"
|
|
346
350
|
save_histogram_image $path \
|
|
347
351
|
-mode setup \
|
|
348
352
|
-width 500 \
|
|
@@ -350,7 +354,7 @@ proc sc_image_timing_histograms { } {
|
|
|
350
354
|
}
|
|
351
355
|
if { [sc_cfg_tool_task_check_in_list hold var reports] } {
|
|
352
356
|
set path reports/images/timing/hold.histogram.png
|
|
353
|
-
utl::info FLW 1 "Saving hold timing histogram to $path"
|
|
357
|
+
utl::info FLW 1 "Saving \"hold timing histogram\" to $path"
|
|
354
358
|
save_histogram_image $path \
|
|
355
359
|
-mode hold \
|
|
356
360
|
-width 500 \
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
#https://github.com/The-OpenROAD-Project/OpenROAD/blob/9b52b1d9cfb532f9872739ffe482afb5ac9def92/src/rcx/calibration/script/generate_rules.tcl
|
|
2
2
|
|
|
3
|
-
set openroad_bench_length
|
|
4
|
-
[lindex [sc_cfg_tool_task_get {var} bench_length] 0]
|
|
3
|
+
set openroad_bench_length [sc_cfg_tool_task_get {var} bench_length]
|
|
5
4
|
|
|
6
|
-
set sc_maxmetal
|
|
7
|
-
[sc_get_layer_name [lindex [sc_cfg_tool_task_get {var} max_layer] 0]]
|
|
5
|
+
set sc_maxmetal [sc_get_layer_name [sc_cfg_tool_task_get {var} max_layer]]
|
|
8
6
|
set openroad_top_metal_number [[[ord::get_db_tech] findLayer $sc_maxmetal] getRoutingLevel]
|
|
9
7
|
|
|
10
8
|
# Creates the patterns and
|
|
@@ -149,5 +149,7 @@ utl::pop_metrics_stage
|
|
|
149
149
|
###############################
|
|
150
150
|
|
|
151
151
|
utl::push_metrics_stage "sc__write__{}"
|
|
152
|
-
|
|
152
|
+
write_db "outputs/${sc_topmodule}.odb"
|
|
153
|
+
write_def "outputs/${sc_topmodule}.def"
|
|
154
|
+
write_verilog -include_pwr_gnd "outputs/${sc_topmodule}.vg"
|
|
153
155
|
utl::pop_metrics_stage
|
|
@@ -74,10 +74,10 @@ class WriteViewsTask(APRTask, OpenROADSTAParameter, OpenROADPSMParameter):
|
|
|
74
74
|
for corner in self.get("var", "pex_corners"):
|
|
75
75
|
self.add_output_file(ext=f"{corner}.spef")
|
|
76
76
|
if self.get("var", "write_liberty"):
|
|
77
|
-
for corner in self.project.getkeys("constraint", "timing"):
|
|
77
|
+
for corner in self.project.getkeys("constraint", "timing", "scenario"):
|
|
78
78
|
self.add_output_file(ext=f"{corner}.lib")
|
|
79
79
|
if self.get("var", "write_sdf"):
|
|
80
|
-
for corner in self.project.getkeys("constraint", "timing"):
|
|
80
|
+
for corner in self.project.getkeys("constraint", "timing", "scenario"):
|
|
81
81
|
self.add_output_file(ext=f"{corner}.sdf")
|
|
82
82
|
|
|
83
83
|
self.add_required_key("var", "ord_abstract_lef_bloat_layers")
|
|
@@ -37,7 +37,7 @@ class OpenSTATask(Task):
|
|
|
37
37
|
self.set_threads()
|
|
38
38
|
|
|
39
39
|
self.add_regex("warnings", r'^\[WARNING|^Warning')
|
|
40
|
-
self.add_regex("errors", r'^\[ERROR')
|
|
40
|
+
self.add_regex("errors", r'^\[ERROR|^Error')
|
|
41
41
|
|
|
42
42
|
def runtime_options(self):
|
|
43
43
|
options = super().runtime_options()
|
|
@@ -22,7 +22,7 @@ set sc_design [sc_top]
|
|
|
22
22
|
# APR Parameters
|
|
23
23
|
set sc_targetlibs [sc_get_asic_libraries logic]
|
|
24
24
|
set sc_delaymodel [sc_cfg_get asic delaymodel]
|
|
25
|
-
set sc_scenarios [dict keys [sc_cfg_get constraint timing]]
|
|
25
|
+
set sc_scenarios [dict keys [sc_cfg_get constraint timing scenario]]
|
|
26
26
|
|
|
27
27
|
###############################
|
|
28
28
|
# Optional
|
|
@@ -41,7 +41,7 @@ define_corners {*}$sc_scenarios
|
|
|
41
41
|
foreach lib "$sc_targetlibs $sc_macrolibs" {
|
|
42
42
|
#Liberty
|
|
43
43
|
foreach corner $sc_scenarios {
|
|
44
|
-
foreach libcorner [sc_cfg_get constraint timing $corner libcorner] {
|
|
44
|
+
foreach libcorner [sc_cfg_get constraint timing scenario $corner libcorner] {
|
|
45
45
|
if { [sc_cfg_exists library $lib output $libcorner $sc_delaymodel] } {
|
|
46
46
|
foreach lib_file [sc_cfg_get library $lib output $libcorner $sc_delaymodel] {
|
|
47
47
|
puts "Reading liberty file for ${corner} ($libcorner): ${lib_file}"
|
|
@@ -22,7 +22,7 @@ set sc_design [sc_top]
|
|
|
22
22
|
# APR Parameters
|
|
23
23
|
set sc_targetlibs [sc_get_asic_libraries logic]
|
|
24
24
|
set sc_delaymodel [sc_cfg_get asic delaymodel]
|
|
25
|
-
set sc_scenarios [dict keys [sc_cfg_get constraint timing]]
|
|
25
|
+
set sc_scenarios [dict keys [sc_cfg_get constraint timing scenario]]
|
|
26
26
|
|
|
27
27
|
###############################
|
|
28
28
|
# Optional
|
|
@@ -41,7 +41,7 @@ define_corners {*}$sc_scenarios
|
|
|
41
41
|
foreach lib "$sc_targetlibs $sc_macrolibs" {
|
|
42
42
|
#Liberty
|
|
43
43
|
foreach corner $sc_scenarios {
|
|
44
|
-
foreach libcorner [sc_cfg_get constraint timing $corner libcorner] {
|
|
44
|
+
foreach libcorner [sc_cfg_get constraint timing scenario $corner libcorner] {
|
|
45
45
|
if { [sc_cfg_exists library $lib output $libcorner $sc_delaymodel] } {
|
|
46
46
|
foreach lib_file [sc_cfg_get library $lib output $libcorner $sc_delaymodel] {
|
|
47
47
|
puts "Reading liberty file for ${corner} ($libcorner): ${lib_file}"
|
|
@@ -12,7 +12,7 @@ set sc_topmodulelib [sc_cfg_get option design]
|
|
|
12
12
|
set sc_filesets [sc_cfg_get option fileset]
|
|
13
13
|
|
|
14
14
|
# APR Parameters
|
|
15
|
-
set sc_timing_mode [
|
|
15
|
+
set sc_timing_mode [sc_cfg_tool_task_get var timing_mode]
|
|
16
16
|
|
|
17
17
|
set sc_mainlib []
|
|
18
18
|
set sc_logiclibs []
|
|
@@ -23,8 +23,11 @@ if { $opensta_timing_mode == "asic" } {
|
|
|
23
23
|
set sc_logiclibs [sc_cfg_get asic asiclib]
|
|
24
24
|
set sc_delaymodel [sc_cfg_get asic delaymodel]
|
|
25
25
|
|
|
26
|
-
foreach corner [dict keys [sc_cfg_get constraint timing]] {
|
|
27
|
-
if {
|
|
26
|
+
foreach corner [dict keys [sc_cfg_get constraint timing scenario]] {
|
|
27
|
+
if {
|
|
28
|
+
$sc_timing_mode == {} ||
|
|
29
|
+
[sc_cfg_get constraint timing scenario $corner mode] == $sc_timing_mode
|
|
30
|
+
} {
|
|
28
31
|
lappend sc_scenarios $corner
|
|
29
32
|
}
|
|
30
33
|
}
|
|
@@ -53,7 +56,7 @@ if { $opensta_timing_mode == "asic" } {
|
|
|
53
56
|
foreach corner $sc_scenarios {
|
|
54
57
|
foreach lib $sc_logiclibs {
|
|
55
58
|
set lib_filesets []
|
|
56
|
-
foreach libcorner [sc_cfg_get constraint timing $corner libcorner] {
|
|
59
|
+
foreach libcorner [sc_cfg_get constraint timing scenario $corner libcorner] {
|
|
57
60
|
if {
|
|
58
61
|
[sc_cfg_exists library $lib asic \
|
|
59
62
|
libcornerfileset $libcorner $sc_delaymodel]
|
|
@@ -111,8 +114,8 @@ if { [file exists "inputs/${sc_topmodule}.sdc"] } {
|
|
|
111
114
|
lappend sdc_files $sdc
|
|
112
115
|
}
|
|
113
116
|
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
if { $sc_timing_mode != {} } {
|
|
118
|
+
set sdcfileset [sc_cfg_get constraint timing mode $sc_timing_mode sdcfileset]
|
|
116
119
|
foreach sdc [sc_cfg_get_fileset $sc_topmodulelib $sdcfileset sdc] {
|
|
117
120
|
if { [lsearch -exact $sdc_files $sdc] == -1 } {
|
|
118
121
|
# read step constraint if exists
|
|
@@ -137,7 +140,7 @@ if { [llength [sta::path_group_names]] == 0 } {
|
|
|
137
140
|
|
|
138
141
|
if {
|
|
139
142
|
[llength [all_clocks]] == 1 ||
|
|
140
|
-
[
|
|
143
|
+
![sc_cfg_tool_task_get var unique_path_groups_per_clock]
|
|
141
144
|
} {
|
|
142
145
|
sc_path_group -name in2reg -from [all_inputs -no_clocks] -to [all_registers]
|
|
143
146
|
sc_path_group -name reg2reg -from [all_registers] -to [all_registers]
|
|
@@ -163,7 +166,7 @@ puts "Timing path groups: [sta::path_group_names]"
|
|
|
163
166
|
|
|
164
167
|
if { $opensta_timing_mode == "asic" } {
|
|
165
168
|
foreach corner $sc_scenarios {
|
|
166
|
-
set pex_corner [sc_cfg_get constraint timing $corner pexcorner]
|
|
169
|
+
set pex_corner [sc_cfg_get constraint timing scenario $corner pexcorner]
|
|
167
170
|
|
|
168
171
|
set spef_file "inputs/${sc_topmodule}.${pex_corner}.spef"
|
|
169
172
|
if { [file exists $spef_file] } {
|
|
@@ -173,7 +176,7 @@ if { $opensta_timing_mode == "asic" } {
|
|
|
173
176
|
}
|
|
174
177
|
|
|
175
178
|
foreach corner $sc_scenarios {
|
|
176
|
-
set pex_corner [sc_cfg_get constraint timing $corner pexcorner]
|
|
179
|
+
set pex_corner [sc_cfg_get constraint timing scenario $corner pexcorner]
|
|
177
180
|
|
|
178
181
|
set input_sdf_file "inputs/${sc_topmodule}.${pex_corner}.sdf"
|
|
179
182
|
if { [file exists $input_sdf_file] } {
|
|
@@ -195,7 +198,7 @@ if { $opensta_timing_mode == "asic" } {
|
|
|
195
198
|
# Report Metrics
|
|
196
199
|
###############################
|
|
197
200
|
|
|
198
|
-
set opensta_top_n_paths [
|
|
201
|
+
set opensta_top_n_paths [sc_cfg_tool_task_get var top_n_paths]
|
|
199
202
|
|
|
200
203
|
set fields "{capacitance slew input_pins hierarcial_pins net fanout}"
|
|
201
204
|
set PREFIX "SC_METRIC:"
|
|
@@ -2,6 +2,8 @@ import re
|
|
|
2
2
|
|
|
3
3
|
import os.path
|
|
4
4
|
|
|
5
|
+
from typing import Optional
|
|
6
|
+
|
|
5
7
|
from siliconcompiler import sc_open
|
|
6
8
|
|
|
7
9
|
from siliconcompiler.tools.opensta import OpenSTATask
|
|
@@ -27,7 +29,7 @@ class TimingTaskBase(OpenSTATask):
|
|
|
27
29
|
defvalue="tools/_common/sdc/sc_constraints.sdc",
|
|
28
30
|
dataroot="siliconcompiler")
|
|
29
31
|
|
|
30
|
-
def set_timing_mode(self, mode: str, step: str = None, index: str = None):
|
|
32
|
+
def set_timing_mode(self, mode: str, step: Optional[str] = None, index: Optional[str] = None):
|
|
31
33
|
return self.set("var", "timing_mode", mode, step=step, index=index)
|
|
32
34
|
|
|
33
35
|
def setup(self):
|
|
@@ -40,6 +42,8 @@ class TimingTaskBase(OpenSTATask):
|
|
|
40
42
|
|
|
41
43
|
if self.get("var", "timing_mode"):
|
|
42
44
|
self.add_required_key("var", "timing_mode")
|
|
45
|
+
if self.get("var", "timing_mode") not in self.project.constraint.timing.get_modes():
|
|
46
|
+
raise LookupError(f'{self.get("var", "timing_mode")} is not a defined mode')
|
|
43
47
|
self.add_required_key("var", "top_n_paths")
|
|
44
48
|
self.add_required_key("var", "unique_path_groups_per_clock")
|
|
45
49
|
self.add_required_key("var", "opensta_generic_sdc")
|
|
@@ -149,7 +153,7 @@ class TimingTaskBase(OpenSTATask):
|
|
|
149
153
|
self.record_metric("drvs", drv_count, source_file=[drv_report])
|
|
150
154
|
|
|
151
155
|
def __report_map(self, metric):
|
|
152
|
-
corners = self.project.getkeys('constraint', 'timing')
|
|
156
|
+
corners = self.project.getkeys('constraint', 'timing', 'scenario')
|
|
153
157
|
mapping = {
|
|
154
158
|
"power": [f"reports/power.{corner}.rpt" for corner in corners],
|
|
155
159
|
"unconstrained": ["reports/unconstrained.rpt", "reports/unconstrained.topN.rpt"],
|
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
open_checkpoint "inputs/${sc_topmodule}.dcp"
|
|
2
|
+
|
|
3
|
+
foreach sc_pre_script [sc_cfg_tool_task_get prescript] {
|
|
4
|
+
puts "Sourcing pre script: ${sc_pre_script}"
|
|
5
|
+
source $sc_pre_script
|
|
6
|
+
}
|
|
7
|
+
|
|
2
8
|
write_bitstream -force -file "outputs/${sc_topmodule}.bit"
|
|
9
|
+
|
|
10
|
+
foreach sc_post_script [sc_cfg_tool_task_get postscript] {
|
|
11
|
+
puts "Sourcing post script: ${sc_post_script}"
|
|
12
|
+
source $sc_post_script
|
|
13
|
+
}
|
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
open_checkpoint "inputs/${sc_topmodule}.dcp"
|
|
2
|
+
|
|
3
|
+
foreach sc_pre_script [sc_cfg_tool_task_get prescript] {
|
|
4
|
+
puts "Sourcing pre script: ${sc_pre_script}"
|
|
5
|
+
source $sc_pre_script
|
|
6
|
+
}
|
|
7
|
+
|
|
2
8
|
place_design
|
|
9
|
+
|
|
10
|
+
foreach sc_post_script [sc_cfg_tool_task_get postscript] {
|
|
11
|
+
puts "Sourcing post script: ${sc_post_script}"
|
|
12
|
+
source $sc_post_script
|
|
13
|
+
}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
open_checkpoint "inputs/${sc_topmodule}.dcp"
|
|
2
|
+
|
|
3
|
+
foreach sc_pre_script [sc_cfg_tool_task_get prescript] {
|
|
4
|
+
puts "Sourcing pre script: ${sc_pre_script}"
|
|
5
|
+
source $sc_pre_script
|
|
6
|
+
}
|
|
7
|
+
|
|
2
8
|
phys_opt_design
|
|
3
9
|
power_opt_design
|
|
4
10
|
route_design
|
|
11
|
+
|
|
12
|
+
foreach sc_post_script [sc_cfg_tool_task_get postscript] {
|
|
13
|
+
puts "Sourcing post script: ${sc_post_script}"
|
|
14
|
+
source $sc_post_script
|
|
15
|
+
}
|
|
@@ -3,6 +3,11 @@ create_project $sc_topmodule -force
|
|
|
3
3
|
set_property part $sc_partname [current_project]
|
|
4
4
|
set_property target_language Verilog [current_project]
|
|
5
5
|
|
|
6
|
+
foreach sc_pre_script [sc_cfg_tool_task_get prescript] {
|
|
7
|
+
puts "Sourcing pre script: ${sc_pre_script}"
|
|
8
|
+
source $sc_pre_script
|
|
9
|
+
}
|
|
10
|
+
|
|
6
11
|
# add imported files
|
|
7
12
|
if { [string equal [get_filesets -quiet sources_1] ""] } {
|
|
8
13
|
create_fileset -srcset sources_1
|
|
@@ -28,3 +33,8 @@ if { $synth_mode != "none" } {
|
|
|
28
33
|
synth_design -top $sc_topmodule {*}$synth_args
|
|
29
34
|
|
|
30
35
|
opt_design
|
|
36
|
+
|
|
37
|
+
foreach sc_post_script [sc_cfg_tool_task_get postscript] {
|
|
38
|
+
puts "Sourcing post script: ${sc_post_script}"
|
|
39
|
+
source $sc_post_script
|
|
40
|
+
}
|
|
@@ -272,8 +272,17 @@ class VPRTask(Task):
|
|
|
272
272
|
if lib.has_file(fileset=fileset, filetype="sdc"):
|
|
273
273
|
self.add_required_key(lib, "fileset", fileset, "file", "sdc")
|
|
274
274
|
self.set("var", "enable_timing_analysis", True)
|
|
275
|
+
|
|
276
|
+
fpga = self.project.get("library", self.project.get("fpga", "device"), field="schema")
|
|
277
|
+
self.add_required_key(fpga, "tool", "vpr", "devicecode")
|
|
278
|
+
self.add_required_key(fpga, "tool", "vpr", "clock_model")
|
|
279
|
+
self.add_required_key(fpga, "tool", "vpr", "archfile")
|
|
280
|
+
self.add_required_key(fpga, "tool", "vpr", "graphfile")
|
|
281
|
+
self.add_required_key(fpga, "tool", "vpr", "channelwidth")
|
|
275
282
|
if self.get("var", "router_lookahead"):
|
|
276
283
|
self.add_required_key("var", "router_lookahead")
|
|
284
|
+
else:
|
|
285
|
+
self.add_required_key(fpga, "tool", "vpr", "router_lookahead")
|
|
277
286
|
|
|
278
287
|
def runtime_options(self):
|
|
279
288
|
options = super().runtime_options()
|
|
@@ -520,3 +529,22 @@ class VPRTask(Task):
|
|
|
520
529
|
if path.match(line):
|
|
521
530
|
count += 1
|
|
522
531
|
return count
|
|
532
|
+
|
|
533
|
+
@classmethod
|
|
534
|
+
def make_docs(cls):
|
|
535
|
+
from siliconcompiler import Flowgraph, Design, FPGA
|
|
536
|
+
from siliconcompiler.scheduler import SchedulerNode
|
|
537
|
+
from siliconcompiler.demos.fpga_demo import Z1000
|
|
538
|
+
design = Design("<design>")
|
|
539
|
+
with design.active_fileset("docs"):
|
|
540
|
+
design.set_topmodule("top")
|
|
541
|
+
proj = FPGA(design)
|
|
542
|
+
proj.add_fileset("docs")
|
|
543
|
+
proj.set_fpga(Z1000())
|
|
544
|
+
flow = Flowgraph("docsflow")
|
|
545
|
+
flow.node("<step>", cls(), index="<index>")
|
|
546
|
+
proj.set_flow(flow)
|
|
547
|
+
|
|
548
|
+
node = SchedulerNode(proj, "<step>", "<index>")
|
|
549
|
+
node.setup()
|
|
550
|
+
return node.task
|
|
@@ -43,7 +43,7 @@ if { [file exists "inputs/$sc_design.v"] } {
|
|
|
43
43
|
set file_type "vg"
|
|
44
44
|
} elseif { [sc_cfg_tool_task_exists var show_filepath] } {
|
|
45
45
|
yosys read_verilog -noblackbox -sv [sc_cfg_tool_task_get var show_filepath]
|
|
46
|
-
set file_type [
|
|
46
|
+
set file_type [sc_cfg_tool_task_get var show_filetype]
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
########################################################
|
|
@@ -80,7 +80,16 @@ if { ![file exists $input_verilog] } {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
set use_slang false
|
|
84
|
+
if { [sc_cfg_tool_task_get var use_slang] } {
|
|
85
|
+
if { ![sc_load_plugin slang] } {
|
|
86
|
+
puts "WARNING: Unable to load slang plugin reverting back to yosys read_verilog"
|
|
87
|
+
} else {
|
|
88
|
+
set use_slang true
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if { $use_slang } {
|
|
84
93
|
# This needs some reordering of loaded to ensure blackboxes are handled
|
|
85
94
|
# before this
|
|
86
95
|
set slang_params []
|
|
@@ -90,6 +99,7 @@ if { [sc_cfg_tool_task_get var use_slang] && [sc_load_plugin slang] } {
|
|
|
90
99
|
lappend slang_params -G "${key}=${value}"
|
|
91
100
|
}
|
|
92
101
|
}
|
|
102
|
+
yosys slang_version
|
|
93
103
|
yosys read_slang \
|
|
94
104
|
-D SYNTHESIS \
|
|
95
105
|
--keep-hierarchy \
|
|
@@ -272,7 +282,29 @@ if { !$flatten_design && [sc_cfg_tool_task_get var auto_flatten] } {
|
|
|
272
282
|
}
|
|
273
283
|
|
|
274
284
|
# Finish synthesis
|
|
275
|
-
|
|
285
|
+
# Unroll of synth -run fine:check
|
|
286
|
+
set opt_args []
|
|
287
|
+
if { [sc_cfg_tool_task_get var opt_undriven] } {
|
|
288
|
+
lappend opt_args -undriven
|
|
289
|
+
}
|
|
290
|
+
yosys opt -fast -mux_undef -mux_bool -fine {*}$opt_args
|
|
291
|
+
yosys memory_map
|
|
292
|
+
yosys opt -mux_undef -mux_bool -fine {*}$opt_args
|
|
293
|
+
|
|
294
|
+
set tech_map_args []
|
|
295
|
+
lappend tech_map_args "-map" "+/techmap.v"
|
|
296
|
+
foreach extra_map [sc_cfg_tool_task_get var synth_extra_map] {
|
|
297
|
+
lappend tech_map_args "-map" $extra_map
|
|
298
|
+
}
|
|
299
|
+
yosys techmap {*}$tech_map_args
|
|
300
|
+
|
|
301
|
+
yosys opt -fast
|
|
302
|
+
yosys abc -fast
|
|
303
|
+
yosys opt -fast
|
|
304
|
+
|
|
305
|
+
yosys hierarchy -check
|
|
306
|
+
yosys stat
|
|
307
|
+
yosys check
|
|
276
308
|
|
|
277
309
|
# Logic locking
|
|
278
310
|
if { [sc_cfg_tool_task_get var lock_design] } {
|
|
@@ -440,7 +472,11 @@ yosys clean -purge
|
|
|
440
472
|
# Recheck hierarchy to remove all unused modules
|
|
441
473
|
yosys hierarchy -top $sc_topmodule
|
|
442
474
|
|
|
443
|
-
|
|
475
|
+
if { [sc_cfg_tool_task_get var tie_undef] == "high" } {
|
|
476
|
+
yosys setundef -one
|
|
477
|
+
} elseif { [sc_cfg_tool_task_get var tie_undef] == "low" } {
|
|
478
|
+
yosys setundef -zero
|
|
479
|
+
}
|
|
444
480
|
|
|
445
481
|
yosys splitnets
|
|
446
482
|
|
|
@@ -453,7 +489,7 @@ if { [sc_has_tie_cell low] } {
|
|
|
453
489
|
if { [sc_has_tie_cell high] } {
|
|
454
490
|
lappend yosys_hilomap_args -hicell {*}[sc_get_tie_cell high]
|
|
455
491
|
}
|
|
456
|
-
if { [llength $yosys_hilomap_args] != 0 } {
|
|
492
|
+
if { [sc_cfg_tool_task_get var add_tieoffs] && [llength $yosys_hilomap_args] != 0 } {
|
|
457
493
|
yosys hilomap -singleton {*}$yosys_hilomap_args
|
|
458
494
|
}
|
|
459
495
|
|
|
@@ -30,7 +30,16 @@ if { ![file exists $input_verilog] } {
|
|
|
30
30
|
set input_verilog "inputs/$sc_topmodule.sv"
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
set use_slang false
|
|
34
|
+
if { [sc_cfg_tool_task_get var use_slang] } {
|
|
35
|
+
if { ![sc_load_plugin slang] } {
|
|
36
|
+
puts "WARNING: Unable to load slang plugin reverting back to yosys read_verilog"
|
|
37
|
+
} else {
|
|
38
|
+
set use_slang true
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if { $use_slang } {
|
|
34
43
|
# This needs some reordering of loaded to ensure blackboxes are handled
|
|
35
44
|
# before this
|
|
36
45
|
set slang_params []
|
|
@@ -40,6 +49,7 @@ if { [sc_cfg_tool_task_get var use_slang] && [sc_load_plugin slang] } {
|
|
|
40
49
|
lappend slang_params -G "${key}=${value}"
|
|
41
50
|
}
|
|
42
51
|
}
|
|
52
|
+
yosys slang_version
|
|
43
53
|
yosys read_slang \
|
|
44
54
|
-D SYNTHESIS \
|
|
45
55
|
--keep-hierarchy \
|
|
@@ -73,9 +83,7 @@ set sc_syn_lut_size [sc_cfg_get library $sc_designlib fpga lutsize]
|
|
|
73
83
|
# comment in syn_asic.tcl for longer explanation.
|
|
74
84
|
yosys hierarchy -top $sc_topmodule
|
|
75
85
|
|
|
76
|
-
if {
|
|
77
|
-
yosys synth_ice40 -top $sc_topmodule
|
|
78
|
-
} elseif {
|
|
86
|
+
if {
|
|
79
87
|
[sc_cfg_exists library $sc_designlib tool yosys fpga_config] &&
|
|
80
88
|
[sc_cfg_get library $sc_designlib tool yosys fpga_config] != {} &&
|
|
81
89
|
[sc_load_plugin wildebeest]
|
|
@@ -83,7 +91,7 @@ if { [string match {ice*} $sc_partname] } {
|
|
|
83
91
|
set synth_fpga_args []
|
|
84
92
|
if { [sc_cfg_tool_task_get var synth_opt_mode] != "none" } {
|
|
85
93
|
lappend synth_fpga_args \
|
|
86
|
-
-opt [
|
|
94
|
+
-opt [sc_cfg_tool_task_get var synth_opt_mode]
|
|
87
95
|
}
|
|
88
96
|
if { [sc_cfg_tool_task_get var synth_insert_buffers] } {
|
|
89
97
|
lappend synth_fpga_args -insbuf
|
|
@@ -94,6 +102,8 @@ if { [string match {ice*} $sc_partname] } {
|
|
|
94
102
|
-show_config \
|
|
95
103
|
-top $sc_topmodule \
|
|
96
104
|
{*}$synth_fpga_args
|
|
105
|
+
} elseif { [string match {ice*} $sc_partname] } {
|
|
106
|
+
yosys synth_ice40 -top $sc_topmodule
|
|
97
107
|
} else {
|
|
98
108
|
set sc_syn_feature_set [sc_cfg_get library $sc_designlib tool yosys feature_set]
|
|
99
109
|
|
|
@@ -2,6 +2,8 @@ import json
|
|
|
2
2
|
|
|
3
3
|
import os.path
|
|
4
4
|
|
|
5
|
+
from typing import Optional
|
|
6
|
+
|
|
5
7
|
from siliconcompiler.tools.yosys.prepareLib import process_liberty_file
|
|
6
8
|
from siliconcompiler import sc_open
|
|
7
9
|
from siliconcompiler import utils
|
|
@@ -177,6 +179,21 @@ class ASICSynthesis(_ASICTask, YosysTask):
|
|
|
177
179
|
"bool",
|
|
178
180
|
"true/false, flag to indicate whether to add buffers or not.",
|
|
179
181
|
True)
|
|
182
|
+
self.add_parameter(
|
|
183
|
+
"tie_undef",
|
|
184
|
+
"<high,low,none>",
|
|
185
|
+
"Flag to indicate how to handle undefined signals in netlist",
|
|
186
|
+
"low")
|
|
187
|
+
self.add_parameter(
|
|
188
|
+
"add_tieoffs",
|
|
189
|
+
"bool",
|
|
190
|
+
"true/false, flag to indicate add tie high and tie low cells.",
|
|
191
|
+
True)
|
|
192
|
+
self.add_parameter(
|
|
193
|
+
"opt_undriven",
|
|
194
|
+
"bool",
|
|
195
|
+
"true/false, flag to indicate if optimizations should mark undriven nets",
|
|
196
|
+
True)
|
|
180
197
|
|
|
181
198
|
self.__init_techmapping_parameter()
|
|
182
199
|
self.__init_hierarchy_parameter()
|
|
@@ -297,6 +314,26 @@ class ASICSynthesis(_ASICTask, YosysTask):
|
|
|
297
314
|
"str",
|
|
298
315
|
"lock locking port name")
|
|
299
316
|
|
|
317
|
+
def set_yosys_useslang(self, enable: bool,
|
|
318
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
319
|
+
self.set("var", "use_slang", enable, step=step, index=index)
|
|
320
|
+
|
|
321
|
+
def set_yosys_tieundefined(self, tie: str,
|
|
322
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
323
|
+
self.set("var", "tie_undef", tie, step=step, index=index)
|
|
324
|
+
|
|
325
|
+
def set_yosys_addtiecells(self, enable: bool,
|
|
326
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
327
|
+
self.set("var", "add_tieoffs", enable, step=step, index=index)
|
|
328
|
+
|
|
329
|
+
def set_yosys_addbuffers(self, enable: bool,
|
|
330
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
331
|
+
self.set("var", "add_buffers", enable, step=step, index=index)
|
|
332
|
+
|
|
333
|
+
def set_yosys_optundriven(self, enable: bool,
|
|
334
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
335
|
+
self.set("var", "opt_undriven", enable, step=step, index=index)
|
|
336
|
+
|
|
300
337
|
def task(self):
|
|
301
338
|
return "syn_asic"
|
|
302
339
|
|
|
@@ -374,6 +411,11 @@ class ASICSynthesis(_ASICTask, YosysTask):
|
|
|
374
411
|
if self.get("var", "blackbox_modules"):
|
|
375
412
|
self.add_required_key("var", "blackbox_modules")
|
|
376
413
|
|
|
414
|
+
self.add_required_key("var", "use_slang")
|
|
415
|
+
self.add_required_key("var", "add_buffers")
|
|
416
|
+
self.add_required_key("var", "tie_undef")
|
|
417
|
+
self.add_required_key("var", "add_tieoffs")
|
|
418
|
+
self.add_required_key("var", "opt_undriven")
|
|
377
419
|
self.add_required_key("var", "flatten")
|
|
378
420
|
self.add_required_key("var", "auto_flatten")
|
|
379
421
|
self.add_required_key("var", "hier_threshold")
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
3
5
|
from siliconcompiler import sc_open
|
|
4
6
|
|
|
5
7
|
from siliconcompiler.tools.yosys import YosysTask
|
|
@@ -26,6 +28,10 @@ class FPGASynthesis(YosysTask):
|
|
|
26
28
|
"perform buffer insertion",
|
|
27
29
|
True)
|
|
28
30
|
|
|
31
|
+
def set_yosys_useslang(self, enable: bool,
|
|
32
|
+
step: Optional[str] = None, index: Optional[str] = None):
|
|
33
|
+
self.set("var", "use_slang", enable, step=step, index=index)
|
|
34
|
+
|
|
29
35
|
def task(self):
|
|
30
36
|
return "syn_fpga"
|
|
31
37
|
|
|
@@ -53,6 +59,8 @@ class FPGASynthesis(YosysTask):
|
|
|
53
59
|
self.add_output_file(ext="netlist.json")
|
|
54
60
|
self.add_output_file(ext="blif")
|
|
55
61
|
|
|
62
|
+
self.add_required_key("var", "use_slang")
|
|
63
|
+
|
|
56
64
|
def post_process(self):
|
|
57
65
|
super().post_process()
|
|
58
66
|
|