siliconcompiler 0.35.3__py3-none-any.whl → 0.35.4__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/asic_component.py +49 -11
- siliconcompiler/constraints/asic_floorplan.py +23 -21
- siliconcompiler/constraints/asic_pins.py +55 -17
- siliconcompiler/constraints/asic_timing.py +53 -22
- siliconcompiler/constraints/fpga_timing.py +5 -6
- siliconcompiler/data/templates/replay/replay.sh.j2 +27 -14
- siliconcompiler/package/__init__.py +17 -6
- siliconcompiler/project.py +9 -1
- siliconcompiler/scheduler/docker.py +24 -25
- siliconcompiler/scheduler/scheduler.py +82 -68
- siliconcompiler/scheduler/schedulernode.py +133 -20
- siliconcompiler/scheduler/slurm.py +113 -29
- siliconcompiler/scheduler/taskscheduler.py +0 -7
- siliconcompiler/schema/editableschema.py +29 -0
- siliconcompiler/schema/parametervalue.py +14 -2
- siliconcompiler/schema_support/option.py +82 -1
- siliconcompiler/schema_support/pathschema.py +7 -13
- siliconcompiler/tool.py +47 -25
- siliconcompiler/tools/klayout/__init__.py +3 -0
- siliconcompiler/tools/klayout/scripts/klayout_convert_drc_db.py +1 -0
- siliconcompiler/tools/klayout/scripts/klayout_export.py +1 -0
- siliconcompiler/tools/klayout/scripts/klayout_operations.py +1 -0
- siliconcompiler/tools/klayout/scripts/klayout_show.py +1 -0
- siliconcompiler/tools/klayout/scripts/klayout_utils.py +3 -4
- siliconcompiler/tools/openroad/__init__.py +27 -1
- siliconcompiler/tools/openroad/_apr.py +81 -4
- siliconcompiler/tools/openroad/clock_tree_synthesis.py +1 -0
- siliconcompiler/tools/openroad/global_placement.py +1 -0
- siliconcompiler/tools/openroad/init_floorplan.py +116 -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 +42 -4
- siliconcompiler/tools/openroad/scripts/apr/sc_irdrop.tcl +146 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_repair_design.tcl +1 -1
- siliconcompiler/tools/openroad/scripts/apr/sc_write_data.tcl +4 -6
- siliconcompiler/tools/openroad/scripts/common/procs.tcl +1 -1
- siliconcompiler/tools/openroad/scripts/common/reports.tcl +1 -1
- siliconcompiler/tools/openroad/scripts/rcx/sc_rcx_bench.tcl +2 -4
- siliconcompiler/tools/opensta/__init__.py +1 -1
- siliconcompiler/tools/opensta/scripts/sc_timing.tcl +17 -12
- 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 +6 -6
- siliconcompiler/utils/__init__.py +243 -51
- siliconcompiler/utils/curation.py +89 -56
- siliconcompiler/utils/issue.py +6 -1
- siliconcompiler/utils/multiprocessing.py +35 -2
- siliconcompiler/utils/paths.py +21 -0
- siliconcompiler/utils/settings.py +141 -0
- {siliconcompiler-0.35.3.dist-info → siliconcompiler-0.35.4.dist-info}/METADATA +4 -3
- {siliconcompiler-0.35.3.dist-info → siliconcompiler-0.35.4.dist-info}/RECORD +68 -65
- {siliconcompiler-0.35.3.dist-info → siliconcompiler-0.35.4.dist-info}/WHEEL +0 -0
- {siliconcompiler-0.35.3.dist-info → siliconcompiler-0.35.4.dist-info}/entry_points.txt +0 -0
- {siliconcompiler-0.35.3.dist-info → siliconcompiler-0.35.4.dist-info}/licenses/LICENSE +0 -0
- {siliconcompiler-0.35.3.dist-info → siliconcompiler-0.35.4.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
###############################
|
|
2
|
+
# Reading SC Schema
|
|
3
|
+
###############################
|
|
4
|
+
|
|
5
|
+
source ./sc_manifest.tcl
|
|
6
|
+
|
|
7
|
+
###############################
|
|
8
|
+
# Task Preamble
|
|
9
|
+
###############################
|
|
10
|
+
|
|
11
|
+
set sc_refdir [sc_cfg_tool_task_get refdir]
|
|
12
|
+
source "$sc_refdir/apr/preamble.tcl"
|
|
13
|
+
|
|
14
|
+
set nets []
|
|
15
|
+
if { [llength [sc_cfg_tool_task_get var net]] > 0 } {
|
|
16
|
+
set nets [sc_cfg_tool_task_get var net]
|
|
17
|
+
} else {
|
|
18
|
+
set nets [sc_psm_check_nets]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
###############################
|
|
22
|
+
# Assign power
|
|
23
|
+
###############################
|
|
24
|
+
|
|
25
|
+
foreach inst_setting [sc_cfg_tool_task_get var instance_power] {
|
|
26
|
+
lassign $inst_setting inst power
|
|
27
|
+
set pwr_mw [expr { $power * 1000 }]
|
|
28
|
+
puts "Setting power for $inst to: [format "%.3f" $pwr_mw]mW"
|
|
29
|
+
|
|
30
|
+
set_pdnsim_inst_power \
|
|
31
|
+
-inst $inst \
|
|
32
|
+
-power $power
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
###############################
|
|
36
|
+
# Depopulate Terminals
|
|
37
|
+
###############################
|
|
38
|
+
|
|
39
|
+
if { [sc_cfg_tool_task_get var source_disconnection_rate] > 0 } {
|
|
40
|
+
expr { srand([sc_cfg_tool_task_get var source_disconnection_seed]) }
|
|
41
|
+
|
|
42
|
+
set depop_target [expr { [sc_cfg_tool_task_get var source_disconnection_rate] / 100.0 }]
|
|
43
|
+
|
|
44
|
+
foreach net $nets {
|
|
45
|
+
set count 0
|
|
46
|
+
set disabled 0
|
|
47
|
+
foreach bpin [[[ord::get_db_block] findBTerm $net] getBPins] {
|
|
48
|
+
foreach box [$bpin getBoxes] {
|
|
49
|
+
incr count
|
|
50
|
+
if { rand() < $depop_target } {
|
|
51
|
+
incr disabled
|
|
52
|
+
odb::dbBoolProperty_create $box PSM_DISCONNECT 1
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
set term_proc [expr { 100 * (double($disabled) / $count) }]
|
|
57
|
+
utl::info FLW 1 "$net terminals disabled $disabled / $count ([format "%.1f" $term_proc]%)"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
###############################
|
|
62
|
+
# Setup power grid analysis
|
|
63
|
+
###############################
|
|
64
|
+
|
|
65
|
+
set source_args []
|
|
66
|
+
|
|
67
|
+
set res [sc_cfg_tool_task_get var external_resistance]
|
|
68
|
+
if { $res > 0 } {
|
|
69
|
+
puts "Setting external resistance to $res ohms"
|
|
70
|
+
lappend source_args -external_resistance $res
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if { [llength $source_args] != 0 } {
|
|
74
|
+
set_pdnsim_source_settings {*}$source_args
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
###############################
|
|
78
|
+
# Analyze nets
|
|
79
|
+
###############################
|
|
80
|
+
|
|
81
|
+
lassign [sc_cfg_tool_task_get var heatmap_grid] heatmap_x heatmap_y
|
|
82
|
+
gui::save_display_controls
|
|
83
|
+
|
|
84
|
+
sc_image_setup_default
|
|
85
|
+
gui::set_display_controls "Shape Types/Pin*" visible false
|
|
86
|
+
|
|
87
|
+
foreach net $nets {
|
|
88
|
+
file mkdir reports/${net}
|
|
89
|
+
foreach corner $sc_scenarios {
|
|
90
|
+
analyze_power_grid -net $net -corner $corner -allow_reuse
|
|
91
|
+
|
|
92
|
+
save_animated_gif -start "reports/${net}/${corner}.gif"
|
|
93
|
+
|
|
94
|
+
foreach layer [[ord::get_db_tech] getLayers] {
|
|
95
|
+
if { [$layer getRoutingLevel] == 0 } {
|
|
96
|
+
continue
|
|
97
|
+
}
|
|
98
|
+
set layer_name [$layer getName]
|
|
99
|
+
|
|
100
|
+
gui::set_heatmap IRDrop Net $net
|
|
101
|
+
gui::set_heatmap IRDrop Corner $corner
|
|
102
|
+
gui::set_heatmap IRDrop Layer $layer_name
|
|
103
|
+
gui::set_heatmap IRDrop LogScale 0
|
|
104
|
+
gui::set_heatmap IRDrop ShowLegend 1
|
|
105
|
+
gui::set_heatmap IRDrop GridX $heatmap_x
|
|
106
|
+
gui::set_heatmap IRDrop GridY $heatmap_y
|
|
107
|
+
gui::set_display_controls "Heat Maps/IR Drop" visible true
|
|
108
|
+
|
|
109
|
+
gui::set_heatmap IRDrop rebuild
|
|
110
|
+
|
|
111
|
+
if { ![gui::get_heatmap_bool IRDrop has_data] } {
|
|
112
|
+
continue
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
# Save CSV
|
|
116
|
+
gui::dump_heatmap IRDrop reports/${net}/${corner}.${layer_name}.csv
|
|
117
|
+
|
|
118
|
+
set box [[ord::get_db_block] getDieArea]
|
|
119
|
+
set x [ord::dbu_to_microns [$box xMax]]
|
|
120
|
+
set y [ord::dbu_to_microns [$box yMin]]
|
|
121
|
+
set label [add_label -position "$x $y" -anchor "bottom right" -color white $layer_name]
|
|
122
|
+
|
|
123
|
+
sc_save_image \
|
|
124
|
+
"IR drop for $net on $layer_name for $corner heatmap" \
|
|
125
|
+
reports/${net}/${corner}.${layer_name}.png \
|
|
126
|
+
true
|
|
127
|
+
|
|
128
|
+
gui::set_heatmap IRDrop LogScale 1
|
|
129
|
+
gui::set_heatmap IRDrop rebuild
|
|
130
|
+
|
|
131
|
+
sc_save_image \
|
|
132
|
+
"IR drop for $net on $layer_name for $corner heatmap" \
|
|
133
|
+
reports/${net}/${corner}.${layer_name}_log.png \
|
|
134
|
+
false
|
|
135
|
+
|
|
136
|
+
gui::set_display_controls "Heat Maps/IR Drop" visible false
|
|
137
|
+
|
|
138
|
+
if { $label != "" } {
|
|
139
|
+
gui::delete_label $label
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
save_animated_gif -end
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
gui::restore_display_controls
|
|
@@ -52,7 +52,7 @@ sc_set_dont_use
|
|
|
52
52
|
# Tie-off cell insertion
|
|
53
53
|
###############################
|
|
54
54
|
|
|
55
|
-
set tie_separation [
|
|
55
|
+
set tie_separation [sc_cfg_tool_task_get {var} ifp_tie_separation]
|
|
56
56
|
foreach tie_type "high low" {
|
|
57
57
|
if { [sc_has_tie_cell $tie_type] } {
|
|
58
58
|
repair_tie_fanout \
|
|
@@ -33,12 +33,10 @@ write_abstract_lef {*}$lef_args "outputs/${sc_topmodule}.lef"
|
|
|
33
33
|
if { [sc_cfg_tool_task_get var write_cdl] } {
|
|
34
34
|
# Write CDL
|
|
35
35
|
set sc_cdl_masters []
|
|
36
|
-
foreach lib
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
lappend sc_cdl_masters $cdl_file
|
|
41
|
-
}
|
|
36
|
+
foreach lib $sc_logiclibs {
|
|
37
|
+
set filesets [sc_cfg_get library $lib asic aprfileset]
|
|
38
|
+
foreach cdl_file [sc_cfg_get_fileset $lib $filesets cdl] {
|
|
39
|
+
lappend sc_cdl_masters $cdl_file
|
|
42
40
|
}
|
|
43
41
|
}
|
|
44
42
|
write_cdl -masters $sc_cdl_masters "outputs/${sc_topmodule}.cdl"
|
|
@@ -14,7 +14,7 @@ proc sc_global_placement_density { args } {
|
|
|
14
14
|
|
|
15
15
|
set density_args []
|
|
16
16
|
if { ![info exists flags(-exclude_padding)] } {
|
|
17
|
-
set gpl_padding [
|
|
17
|
+
set gpl_padding [sc_cfg_tool_task_get var pad_global_place]
|
|
18
18
|
|
|
19
19
|
lappend density_args -pad_left $gpl_padding
|
|
20
20
|
lappend density_args -pad_right $gpl_padding
|
|
@@ -8,7 +8,7 @@ file mkdir reports/power
|
|
|
8
8
|
file mkdir reports/markers
|
|
9
9
|
|
|
10
10
|
set fields "{capacitance slew input_pins hierarcial_pins net fanout}"
|
|
11
|
-
set sta_top_n_paths [
|
|
11
|
+
set sta_top_n_paths [sc_cfg_tool_task_get var sta_top_n_paths]
|
|
12
12
|
set PREFIX "SC_METRIC:"
|
|
13
13
|
|
|
14
14
|
if { [sc_cfg_tool_task_check_in_list setup var reports] } {
|
|
@@ -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
|
|
@@ -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()
|
|
@@ -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 []
|
|
@@ -24,7 +24,10 @@ if { $opensta_timing_mode == "asic" } {
|
|
|
24
24
|
set sc_delaymodel [sc_cfg_get asic delaymodel]
|
|
25
25
|
|
|
26
26
|
foreach corner [dict keys [sc_cfg_get constraint timing]] {
|
|
27
|
-
if {
|
|
27
|
+
if {
|
|
28
|
+
$sc_timing_mode == {} ||
|
|
29
|
+
[sc_cfg_get constraint timing $corner mode] == $sc_timing_mode
|
|
30
|
+
} {
|
|
28
31
|
lappend sc_scenarios $corner
|
|
29
32
|
}
|
|
30
33
|
}
|
|
@@ -111,14 +114,16 @@ if { [file exists "inputs/${sc_topmodule}.sdc"] } {
|
|
|
111
114
|
lappend sdc_files $sdc
|
|
112
115
|
}
|
|
113
116
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
if { $sc_timing_mode != {} } {
|
|
118
|
+
foreach corner $sc_scenarios {
|
|
119
|
+
set sdcfileset [sc_cfg_get constraint timing $corner sdcfileset]
|
|
120
|
+
foreach sdc [sc_cfg_get_fileset $sc_topmodulelib $sdcfileset sdc] {
|
|
121
|
+
if { [lsearch -exact $sdc_files $sdc] == -1 } {
|
|
122
|
+
# read step constraint if exists
|
|
123
|
+
puts "Reading mode (${sc_timing_mode}) SDC: ${sdc}"
|
|
124
|
+
lappend sdc_files $sdc
|
|
125
|
+
read_sdc $sdc
|
|
126
|
+
}
|
|
122
127
|
}
|
|
123
128
|
}
|
|
124
129
|
}
|
|
@@ -137,7 +142,7 @@ if { [llength [sta::path_group_names]] == 0 } {
|
|
|
137
142
|
|
|
138
143
|
if {
|
|
139
144
|
[llength [all_clocks]] == 1 ||
|
|
140
|
-
[
|
|
145
|
+
![sc_cfg_tool_task_get var unique_path_groups_per_clock]
|
|
141
146
|
} {
|
|
142
147
|
sc_path_group -name in2reg -from [all_inputs -no_clocks] -to [all_registers]
|
|
143
148
|
sc_path_group -name reg2reg -from [all_registers] -to [all_registers]
|
|
@@ -195,7 +200,7 @@ if { $opensta_timing_mode == "asic" } {
|
|
|
195
200
|
# Report Metrics
|
|
196
201
|
###############################
|
|
197
202
|
|
|
198
|
-
set opensta_top_n_paths [
|
|
203
|
+
set opensta_top_n_paths [sc_cfg_tool_task_get var top_n_paths]
|
|
199
204
|
|
|
200
205
|
set fields "{capacitance slew input_pins hierarcial_pins net fanout}"
|
|
201
206
|
set PREFIX "SC_METRIC:"
|
|
@@ -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
|
|