siliconcompiler 0.29.3__py3-none-any.whl → 0.30.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.py +1 -1
- siliconcompiler/apps/sc_install.py +46 -3
- siliconcompiler/core.py +15 -4
- siliconcompiler/remote/client.py +3 -0
- siliconcompiler/scheduler/__init__.py +9 -3
- siliconcompiler/schema/schema_cfg.py +149 -92
- siliconcompiler/tools/__init__.py +4 -2
- siliconcompiler/tools/_common/asic.py +3 -0
- siliconcompiler/tools/_common/asic_clock.py +101 -0
- siliconcompiler/tools/bambu/__init__.py +32 -0
- siliconcompiler/tools/bambu/convert.py +93 -12
- siliconcompiler/tools/bluespec/__init__.py +35 -0
- siliconcompiler/tools/bluespec/convert.py +44 -5
- siliconcompiler/tools/graphviz/__init__.py +12 -0
- siliconcompiler/tools/graphviz/screenshot.py +48 -0
- siliconcompiler/tools/graphviz/show.py +20 -0
- siliconcompiler/tools/openroad/_apr.py +17 -0
- siliconcompiler/tools/openroad/fillmetal_insertion.py +0 -1
- siliconcompiler/tools/openroad/init_floorplan.py +7 -1
- siliconcompiler/tools/openroad/macro_placement.py +10 -2
- siliconcompiler/tools/openroad/pin_placement.py +0 -1
- siliconcompiler/tools/openroad/power_grid.py +6 -0
- siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +3 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_clock_tree_synthesis.tcl +2 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_detailed_route.tcl +2 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_global_route.tcl +15 -5
- siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +1 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_macro_placement.tcl +9 -1
- siliconcompiler/tools/openroad/scripts/apr/sc_power_grid.tcl +54 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_repair_timing.tcl +24 -0
- siliconcompiler/tools/openroad/scripts/common/procs.tcl +28 -6
- siliconcompiler/tools/openroad/scripts/common/read_input_files.tcl +1 -0
- siliconcompiler/tools/openroad/scripts/common/reports.tcl +10 -16
- siliconcompiler/tools/slang/__init__.py +1 -0
- siliconcompiler/tools/verilator/verilator.py +1 -0
- siliconcompiler/tools/yosys/__init__.py +26 -23
- siliconcompiler/tools/yosys/procs.tcl +17 -0
- siliconcompiler/tools/yosys/syn_asic.py +12 -65
- siliconcompiler/tools/yosys/syn_asic.tcl +6 -51
- siliconcompiler/toolscripts/_tools.json +5 -5
- siliconcompiler/toolscripts/rhel8/install-yosys.sh +1 -1
- siliconcompiler/toolscripts/rhel9/install-openroad.sh +34 -0
- siliconcompiler/toolscripts/rhel9/install-yosys.sh +1 -1
- siliconcompiler/toolscripts/ubuntu20/install-openroad.sh +1 -1
- siliconcompiler/toolscripts/ubuntu20/install-yosys.sh +1 -1
- siliconcompiler/toolscripts/ubuntu22/install-openroad.sh +1 -1
- siliconcompiler/toolscripts/ubuntu22/install-yosys.sh +1 -1
- siliconcompiler/toolscripts/ubuntu24/install-openroad.sh +1 -1
- siliconcompiler/toolscripts/ubuntu24/install-yosys.sh +1 -1
- siliconcompiler/utils/__init__.py +13 -0
- siliconcompiler/utils/showtools.py +7 -0
- {siliconcompiler-0.29.3.dist-info → siliconcompiler-0.30.0.dist-info}/METADATA +9 -9
- {siliconcompiler-0.29.3.dist-info → siliconcompiler-0.30.0.dist-info}/RECORD +58 -55
- siliconcompiler/tools/bambu/bambu.py +0 -32
- siliconcompiler/tools/bluespec/bluespec.py +0 -40
- {siliconcompiler-0.29.3.dist-info → siliconcompiler-0.30.0.dist-info}/LICENSE +0 -0
- {siliconcompiler-0.29.3.dist-info → siliconcompiler-0.30.0.dist-info}/WHEEL +0 -0
- {siliconcompiler-0.29.3.dist-info → siliconcompiler-0.30.0.dist-info}/entry_points.txt +0 -0
- {siliconcompiler-0.29.3.dist-info → siliconcompiler-0.30.0.dist-info}/top_level.txt +0 -0
|
@@ -16,6 +16,8 @@ source -echo "$sc_refdir/apr/preamble.tcl"
|
|
|
16
16
|
###############################
|
|
17
17
|
|
|
18
18
|
if { [lindex [sc_cfg_tool_task_get {var} grt_use_pin_access] 0] == "true" } {
|
|
19
|
+
sc_setup_detailed_route
|
|
20
|
+
|
|
19
21
|
set sc_minmetal [sc_cfg_get pdk $sc_pdk minlayer $sc_stackup]
|
|
20
22
|
set sc_minmetal [sc_get_layer_name $sc_minmetal]
|
|
21
23
|
set sc_maxmetal [sc_cfg_get pdk $sc_pdk maxlayer $sc_stackup]
|
|
@@ -45,11 +47,19 @@ if { [lindex [sc_cfg_tool_task_get {var} grt_allow_overflow] 0] == "true" } {
|
|
|
45
47
|
lappend sc_grt_arguments "-allow_overflow"
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
if {
|
|
51
|
+
[catch {
|
|
52
|
+
global_route -guide_file "reports/route.guide" \
|
|
53
|
+
-congestion_iterations [lindex [sc_cfg_tool_task_get {var} grt_overflow_iter] 0] \
|
|
54
|
+
-congestion_report_file "reports/${sc_design}_congestion.rpt" \
|
|
55
|
+
-verbose \
|
|
56
|
+
{*}$sc_grt_arguments
|
|
57
|
+
}]
|
|
58
|
+
} {
|
|
59
|
+
write_db "reports/${sc_design}.globalroute-error.odb"
|
|
60
|
+
utl::error FLW 1 \
|
|
61
|
+
"Global routing failed, saving database to reports/${sc_design}.globalroute-error.odb"
|
|
62
|
+
}
|
|
53
63
|
|
|
54
64
|
# estimate for metrics
|
|
55
65
|
estimate_parasitics -global_routing
|
|
@@ -11,6 +11,14 @@ source ./sc_manifest.tcl > /dev/null
|
|
|
11
11
|
set sc_refdir [sc_cfg_tool_task_get refdir]
|
|
12
12
|
source -echo "$sc_refdir/apr/preamble.tcl"
|
|
13
13
|
|
|
14
|
+
###############################
|
|
15
|
+
# Macro placement constraints
|
|
16
|
+
###############################
|
|
17
|
+
foreach script [sc_cfg_tool_task_get file rtlmp_constraints] {
|
|
18
|
+
puts "Sourcing macro placement constraints: $script"
|
|
19
|
+
source -echo $script
|
|
20
|
+
}
|
|
21
|
+
|
|
14
22
|
# Need to check if we have any macros before performing macro placement,
|
|
15
23
|
# since we get an error otherwise.
|
|
16
24
|
if { [sc_design_has_unplaced_macros] } {
|
|
@@ -94,7 +102,7 @@ if { [sc_design_has_unplaced_macros] } {
|
|
|
94
102
|
-report_directory reports/rtlmp \
|
|
95
103
|
-halo_width $halo_x \
|
|
96
104
|
-halo_height $halo_y \
|
|
97
|
-
-target_util [sc_global_placement_density] \
|
|
105
|
+
-target_util [sc_global_placement_density -exclude_padding] \
|
|
98
106
|
{*}$rtlmp_args
|
|
99
107
|
}
|
|
100
108
|
|
|
@@ -19,6 +19,48 @@ if { [sc_design_has_unplaced_macros] } {
|
|
|
19
19
|
utl::error FLW 1 "Design contains unplaced macros."
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
###############################
|
|
23
|
+
# Add blockages
|
|
24
|
+
###############################
|
|
25
|
+
|
|
26
|
+
set pdn_blockages []
|
|
27
|
+
set pdn_pin_keepout [lindex [sc_cfg_tool_task_get var fixed_pin_keepout] 0]
|
|
28
|
+
if { $pdn_pin_keepout > 0 } {
|
|
29
|
+
foreach bterm [[ord::get_db_block] getBTerms] {
|
|
30
|
+
foreach bpin [$bterm getBPins] {
|
|
31
|
+
if {
|
|
32
|
+
[$bpin getPlacementStatus] != "FIRM" &&
|
|
33
|
+
[$bpin getPlacementStatus] != "LOCKED"
|
|
34
|
+
} {
|
|
35
|
+
continue
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
foreach box [$bpin getBoxes] {
|
|
39
|
+
set layer [$box getTechLayer]
|
|
40
|
+
if { $layer == "NULL" } {
|
|
41
|
+
continue
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
set tech_pitch [expr { [$layer getPitch] * $pdn_pin_keepout }]
|
|
45
|
+
|
|
46
|
+
set xmin [expr { [$box xMin] - $tech_pitch }]
|
|
47
|
+
set xmax [expr { [$box xMax] + $tech_pitch }]
|
|
48
|
+
set ymin [expr { [$box yMin] - $tech_pitch }]
|
|
49
|
+
set ymax [expr { [$box yMax] + $tech_pitch }]
|
|
50
|
+
|
|
51
|
+
set blockage [odb::dbObstruction_create \
|
|
52
|
+
[ord::get_db_block] \
|
|
53
|
+
$layer \
|
|
54
|
+
$xmin $ymin \
|
|
55
|
+
$xmax $ymax]
|
|
56
|
+
lappend pdn_blockages $blockage
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
utl::info FLW 1 "Added [llength $pdn_blockages] obstructions to pins"
|
|
62
|
+
}
|
|
63
|
+
|
|
22
64
|
###############################
|
|
23
65
|
# Power Network
|
|
24
66
|
###############################
|
|
@@ -33,6 +75,7 @@ foreach pdnconfig [sc_cfg_tool_task_get {file} pdn_config] {
|
|
|
33
75
|
|
|
34
76
|
lappend pdn_files $pdnconfig
|
|
35
77
|
}
|
|
78
|
+
tee -quiet -file reports/power_grid_configuration.rpt {pdngen -report_only}
|
|
36
79
|
pdngen -failed_via_report "reports/${sc_design}_pdngen_failed_vias.rpt"
|
|
37
80
|
|
|
38
81
|
###############################
|
|
@@ -63,6 +106,17 @@ foreach net [sc_psm_check_nets] {
|
|
|
63
106
|
{*}$check_args
|
|
64
107
|
}
|
|
65
108
|
|
|
109
|
+
###############################
|
|
110
|
+
# Remove blockages
|
|
111
|
+
###############################
|
|
112
|
+
|
|
113
|
+
if { [llength $pdn_blockages] > 0 } {
|
|
114
|
+
foreach obstruction $pdn_blockages {
|
|
115
|
+
odb::dbObstruction_destroy $obstruction
|
|
116
|
+
}
|
|
117
|
+
utl::info FLW 1 "Deleted [llength $pdn_blockages] obstructions"
|
|
118
|
+
}
|
|
119
|
+
|
|
66
120
|
###############################
|
|
67
121
|
# Task Postamble
|
|
68
122
|
###############################
|
|
@@ -20,6 +20,7 @@ set rsz_hold_slack_margin [lindex [sc_cfg_tool_task_get {var} rsz_hold_slack_mar
|
|
|
20
20
|
set rsz_slew_margin [lindex [sc_cfg_tool_task_get {var} rsz_slew_margin] 0]
|
|
21
21
|
set rsz_cap_margin [lindex [sc_cfg_tool_task_get {var} rsz_cap_margin] 0]
|
|
22
22
|
set rsz_repair_tns [lindex [sc_cfg_tool_task_get {var} rsz_repair_tns] 0]
|
|
23
|
+
set rsz_recover_power [lindex [sc_cfg_tool_task_get {var} rsz_recover_power] 0]
|
|
23
24
|
|
|
24
25
|
set repair_timing_args []
|
|
25
26
|
if { [lindex [sc_cfg_tool_task_get {var} rsz_skip_pin_swap] 0] == "true" } {
|
|
@@ -77,6 +78,29 @@ if { [lindex [sc_cfg_tool_task_get var rsz_skip_hold_repair] 0] != "true" } {
|
|
|
77
78
|
sc_set_dont_use
|
|
78
79
|
}
|
|
79
80
|
|
|
81
|
+
if { [lindex [sc_cfg_tool_task_get var rsz_skip_recover_power] 0] != "true" } {
|
|
82
|
+
###############################
|
|
83
|
+
# Recover power
|
|
84
|
+
###############################
|
|
85
|
+
|
|
86
|
+
estimate_parasitics -placement
|
|
87
|
+
|
|
88
|
+
# Enable cells
|
|
89
|
+
sc_set_dont_use -hold -scanchain -multibit -report dont_use.repair_timing.power
|
|
90
|
+
|
|
91
|
+
repair_timing \
|
|
92
|
+
-recover_power $rsz_recover_power \
|
|
93
|
+
-verbose \
|
|
94
|
+
-setup_margin $rsz_setup_slack_margin \
|
|
95
|
+
-hold_margin $rsz_hold_slack_margin \
|
|
96
|
+
{*}$repair_timing_args
|
|
97
|
+
|
|
98
|
+
sc_detailed_placement
|
|
99
|
+
|
|
100
|
+
# Restore dont use
|
|
101
|
+
sc_set_dont_use
|
|
102
|
+
}
|
|
103
|
+
|
|
80
104
|
global_connect
|
|
81
105
|
|
|
82
106
|
# estimate for metrics
|
|
@@ -2,15 +2,24 @@
|
|
|
2
2
|
# Global Placement
|
|
3
3
|
#######################
|
|
4
4
|
|
|
5
|
-
proc sc_global_placement_density { } {
|
|
6
|
-
|
|
5
|
+
proc sc_global_placement_density { args } {
|
|
6
|
+
sta::parse_key_args "sc_global_placement_density" args \
|
|
7
|
+
keys {} \
|
|
8
|
+
flags {-exclude_padding}
|
|
9
|
+
sta::check_argc_eq0 "sc_global_placement_density" $args
|
|
10
|
+
|
|
7
11
|
set gpl_place_density [lindex [sc_cfg_tool_task_get var place_density] 0]
|
|
8
12
|
set gpl_uniform_placement_adjustment \
|
|
9
13
|
[lindex [sc_cfg_tool_task_get var gpl_uniform_placement_adjustment] 0]
|
|
10
14
|
|
|
11
|
-
set
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
set density_args []
|
|
16
|
+
if { ![info exists flags(-exclude_padding)] } {
|
|
17
|
+
set gpl_padding [lindex [sc_cfg_tool_task_get var pad_global_place] 0]
|
|
18
|
+
|
|
19
|
+
lappend density_args -pad_left $gpl_padding
|
|
20
|
+
lappend density_args -pad_right $gpl_padding
|
|
21
|
+
}
|
|
22
|
+
set or_uniform_density [gpl::get_global_placement_uniform_density {*}$density_args]
|
|
14
23
|
|
|
15
24
|
# Small adder to ensure requested density is slightly over the uniform density
|
|
16
25
|
set or_adjust_density_adder 0.001
|
|
@@ -758,6 +767,19 @@ proc sc_set_dont_use { args } {
|
|
|
758
767
|
}
|
|
759
768
|
|
|
760
769
|
if { [info exists keys(-report)] } {
|
|
761
|
-
|
|
770
|
+
puts "Dont use report: reports/$keys(-report).rpt"
|
|
771
|
+
tee -quiet -file reports/$keys(-report).rpt {report_dont_use}
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
proc sc_setup_detailed_route { } {
|
|
776
|
+
foreach via [sc_cfg_tool_task_get var detailed_route_default_via] {
|
|
777
|
+
utl::info FLW 1 "Marking $via a default routing via"
|
|
778
|
+
detailed_route_set_default_via $via
|
|
779
|
+
}
|
|
780
|
+
foreach layer [sc_cfg_tool_task_get var detailed_route_unidirectional_layer] {
|
|
781
|
+
set layer [sc_get_layer_name $layer]
|
|
782
|
+
utl::info FLW 1 "Marking $layer as a unidirectional routing layer"
|
|
783
|
+
detailed_route_set_unidirectional_layer $layer
|
|
762
784
|
}
|
|
763
785
|
}
|
|
@@ -70,10 +70,17 @@ if { [sc_cfg_tool_task_check_in_list drv_violations var reports] } {
|
|
|
70
70
|
tee -file reports/timing/drv_violators.rpt \
|
|
71
71
|
"report_check_types -max_slew -max_capacitance -max_fanout -violators"
|
|
72
72
|
report_erc_metrics
|
|
73
|
+
}
|
|
73
74
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
puts "$PREFIX floating nets"
|
|
76
|
+
tee -file reports/floating_nets.rpt \
|
|
77
|
+
"report_floating_nets -verbose"
|
|
78
|
+
if { [sc_check_version 19048] } {
|
|
79
|
+
puts "$PREFIX overdriven nets"
|
|
80
|
+
tee -file reports/overdriven_nets.rpt \
|
|
81
|
+
"report_overdriven_nets -verbose"
|
|
82
|
+
tee -file reports/overdriven_nets_with_parallel.rpt \
|
|
83
|
+
"report_overdriven_nets -include_parallel_driven -verbose"
|
|
77
84
|
}
|
|
78
85
|
|
|
79
86
|
utl::metric_int "timing__clocks" [llength [all_clocks]]
|
|
@@ -168,17 +175,4 @@ foreach markerdb [[ord::get_db_block] getMarkerCategories] {
|
|
|
168
175
|
|
|
169
176
|
utl::push_metrics_stage "sc__cellarea__{}"
|
|
170
177
|
tee -file reports/cell_usage.rpt {report_cell_usage -verbose}
|
|
171
|
-
|
|
172
|
-
foreach modinst [[ord::get_db_block] getModInsts] {
|
|
173
|
-
tee -quiet -append -file reports/cell_usage.rpt { puts "" }
|
|
174
|
-
tee -quiet -append -file reports/cell_usage.rpt {
|
|
175
|
-
puts "########################################################"
|
|
176
|
-
}
|
|
177
|
-
tee -quiet -append -file reports/cell_usage.rpt { puts "" }
|
|
178
|
-
|
|
179
|
-
utl::metric "design__instance__name__in_module:[[$modinst getMaster] getName]" \
|
|
180
|
-
[$modinst getHierarchicalName]
|
|
181
|
-
tee -quiet -append -file reports/cell_usage.rpt \
|
|
182
|
-
"report_cell_usage -verbose [$modinst getHierarchicalName]"
|
|
183
|
-
}
|
|
184
178
|
utl::pop_metrics_stage
|
|
@@ -120,6 +120,7 @@ def common_runtime_options(chip):
|
|
|
120
120
|
###############################
|
|
121
121
|
# Set up user-provided parameters to ensure we elaborate the correct modules
|
|
122
122
|
for param, value in opts['param']:
|
|
123
|
+
value = value.replace('"', '\\"')
|
|
123
124
|
options.append(f'-G {param}={value}')
|
|
124
125
|
|
|
125
126
|
return options
|
|
@@ -12,7 +12,7 @@ Sources: https://github.com/YosysHQ/yosys
|
|
|
12
12
|
|
|
13
13
|
Installation: https://github.com/YosysHQ/yosys
|
|
14
14
|
'''
|
|
15
|
-
|
|
15
|
+
import os
|
|
16
16
|
import re
|
|
17
17
|
import json
|
|
18
18
|
from siliconcompiler import sc_open
|
|
@@ -107,28 +107,31 @@ def syn_post_process(chip):
|
|
|
107
107
|
step = chip.get('arg', 'step')
|
|
108
108
|
index = chip.get('arg', 'index')
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
110
|
+
if os.path.exists("reports/stat.json"):
|
|
111
|
+
with sc_open("reports/stat.json") as f:
|
|
112
|
+
metrics = json.load(f)
|
|
113
|
+
if "design" in metrics:
|
|
114
|
+
metrics = metrics["design"]
|
|
115
|
+
|
|
116
|
+
if "area" in metrics:
|
|
117
|
+
record_metric(chip, step, index, 'cellarea',
|
|
118
|
+
float(metrics["area"]),
|
|
119
|
+
"reports/stat.json",
|
|
120
|
+
source_unit='um^2')
|
|
121
|
+
if "num_cells" in metrics:
|
|
122
|
+
record_metric(chip, step, index, 'cells',
|
|
123
|
+
metrics["num_cells"],
|
|
124
|
+
"reports/stat.json")
|
|
125
|
+
if "num_wire_bits" in metrics:
|
|
126
|
+
record_metric(chip, step, index, 'nets',
|
|
127
|
+
metrics["num_wire_bits"],
|
|
128
|
+
"reports/stat.json")
|
|
129
|
+
if "num_port_bits" in metrics:
|
|
130
|
+
record_metric(chip, step, index, 'pins',
|
|
131
|
+
metrics["num_port_bits"],
|
|
132
|
+
"reports/stat.json")
|
|
133
|
+
else:
|
|
134
|
+
chip.logger.warning("Yosys cell statistics are missing")
|
|
132
135
|
|
|
133
136
|
registers = None
|
|
134
137
|
with sc_open(f"{step}.log") as f:
|
|
@@ -52,3 +52,20 @@ proc sc_apply_params { } {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
|
|
56
|
+
proc sc_get_scratchpad { name } {
|
|
57
|
+
yosys echo off
|
|
58
|
+
set value [yosys tee -q -s result.string scratchpad -get $name]
|
|
59
|
+
yosys echo on
|
|
60
|
+
|
|
61
|
+
return $value
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
proc sc_load_plugin { name } {
|
|
65
|
+
catch { yosys tee -q -s sc.load.test plugin -i $name }
|
|
66
|
+
set load_test [sc_get_scratchpad sc.load.test]
|
|
67
|
+
if { [string first "ERROR" $load_test] == -1 } {
|
|
68
|
+
return 1
|
|
69
|
+
}
|
|
70
|
+
return 0
|
|
71
|
+
}
|
|
@@ -8,6 +8,7 @@ from siliconcompiler import sc_open
|
|
|
8
8
|
from siliconcompiler import utils
|
|
9
9
|
from siliconcompiler.tools._common.asic import set_tool_task_var, get_libraries, get_mainlib, \
|
|
10
10
|
CellArea
|
|
11
|
+
from siliconcompiler.tools._common.asic_clock import get_clock_period
|
|
11
12
|
from siliconcompiler.tools._common import get_tool_task
|
|
12
13
|
|
|
13
14
|
|
|
@@ -75,12 +76,11 @@ def setup_asic(chip):
|
|
|
75
76
|
# set default control knobs
|
|
76
77
|
mainlib = get_mainlib(chip)
|
|
77
78
|
for option, value in [
|
|
78
|
-
('flatten',
|
|
79
|
-
('auto_flatten',
|
|
80
|
-
('
|
|
81
|
-
('
|
|
82
|
-
('
|
|
83
|
-
('add_buffers', "true")]:
|
|
79
|
+
('flatten', True),
|
|
80
|
+
('auto_flatten', True),
|
|
81
|
+
('hier_threshold', 1000),
|
|
82
|
+
('autoname', True),
|
|
83
|
+
('add_buffers', True)]:
|
|
84
84
|
chip.set('tool', tool, 'task', task, 'var', option, value,
|
|
85
85
|
step=step, index=index, clobber=False)
|
|
86
86
|
chip.add('tool', tool, 'task', task, 'require',
|
|
@@ -387,11 +387,9 @@ def _get_synthesis_library_key(chip, lib, corners):
|
|
|
387
387
|
|
|
388
388
|
|
|
389
389
|
def get_abc_period(chip):
|
|
390
|
-
|
|
391
|
-
tool = 'yosys'
|
|
392
390
|
step = chip.get('arg', 'step')
|
|
393
391
|
index = chip.get('arg', 'index')
|
|
394
|
-
|
|
392
|
+
tool, task = get_tool_task(chip, step, index)
|
|
395
393
|
|
|
396
394
|
mainlib = get_mainlib(chip)
|
|
397
395
|
|
|
@@ -400,67 +398,16 @@ def get_abc_period(chip):
|
|
|
400
398
|
if abc_clock_period:
|
|
401
399
|
return abc_clock_period[0]
|
|
402
400
|
|
|
403
|
-
period = None
|
|
404
|
-
|
|
405
401
|
abc_clock_multiplier = float(chip.get('library', mainlib, 'option', 'var',
|
|
406
402
|
'yosys_abc_clock_multiplier')[0])
|
|
407
403
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
if
|
|
411
|
-
for sdc in chip.find_files('input', 'constraint', 'sdc', step=step, index=index):
|
|
412
|
-
lines = []
|
|
413
|
-
with sc_open(sdc) as f:
|
|
414
|
-
lines = f.read().splitlines()
|
|
415
|
-
|
|
416
|
-
# collect simple variables in case clock is specified with a variable
|
|
417
|
-
re_var = r"[A-Za-z0-9_]+"
|
|
418
|
-
re_num = r"[0-9\.]+"
|
|
419
|
-
sdc_vars = {}
|
|
420
|
-
for line in lines:
|
|
421
|
-
tcl_variable = re.findall(fr"^\s*set\s+({re_var})\s+({re_num})", line)
|
|
422
|
-
if tcl_variable:
|
|
423
|
-
var_name, var_value = tcl_variable[0]
|
|
424
|
-
sdc_vars[f'${var_name}'] = float(var_value)
|
|
425
|
-
|
|
426
|
-
# TODO: handle line continuations
|
|
427
|
-
for line in lines:
|
|
428
|
-
clock_period = re.findall(fr"create_clock\s.*-period\s+({re_num}|\${re_var})",
|
|
429
|
-
line)
|
|
430
|
-
if clock_period:
|
|
431
|
-
clock_period = clock_period[0]
|
|
432
|
-
if clock_period[0] == '$':
|
|
433
|
-
if clock_period in sdc_vars:
|
|
434
|
-
clock_period = sdc_vars[clock_period]
|
|
435
|
-
else:
|
|
436
|
-
chip.logger.warning('Unable to identify clock period from '
|
|
437
|
-
f'{clock_period}.')
|
|
438
|
-
continue
|
|
439
|
-
else:
|
|
440
|
-
clock_period = float(clock_period)
|
|
441
|
-
|
|
442
|
-
clock_period = clock_period * abc_clock_multiplier
|
|
443
|
-
|
|
444
|
-
if period is None:
|
|
445
|
-
period = clock_period
|
|
446
|
-
else:
|
|
447
|
-
period = min(period, clock_period)
|
|
448
|
-
|
|
449
|
-
if period is None:
|
|
450
|
-
# get clock information from defined clocks
|
|
451
|
-
for pin in chip.getkeys('datasheet', 'pin'):
|
|
452
|
-
for mode in chip.getkeys('datasheet', 'pin', pin, 'type'):
|
|
453
|
-
if chip.get('datasheet', 'pin', pin, 'type', mode) == 'clock':
|
|
454
|
-
clock_period = min(chip.get('datasheet', 'pin', pin, 'tperiod', mode)) * 1e12
|
|
455
|
-
|
|
456
|
-
if period is None:
|
|
457
|
-
period = clock_period
|
|
458
|
-
else:
|
|
459
|
-
period = min(period, clock_period)
|
|
460
|
-
|
|
461
|
-
if period is None:
|
|
404
|
+
_, period = get_clock_period(chip,
|
|
405
|
+
clock_units_multiplier=abc_clock_multiplier / 1000)
|
|
406
|
+
if not period:
|
|
462
407
|
return None
|
|
463
408
|
|
|
409
|
+
period *= 1000
|
|
410
|
+
|
|
464
411
|
abc_clock_derating = chip.get('tool', tool, 'task', task, 'var', 'abc_clock_derating',
|
|
465
412
|
step=step, index=index)
|
|
466
413
|
if abc_clock_derating:
|
|
@@ -38,44 +38,6 @@ proc get_modules { { find "*" } } {
|
|
|
38
38
|
return [lsort $modules]
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
proc determine_keep_hierarchy { iter cell_limit } {
|
|
42
|
-
global sc_design
|
|
43
|
-
|
|
44
|
-
# Grab only the modules and not the header and footer
|
|
45
|
-
set modules [get_modules]
|
|
46
|
-
|
|
47
|
-
# Save a copy of the current design so we can do a few optimizations and techmap
|
|
48
|
-
yosys design -save hierarchy_checkpoint
|
|
49
|
-
yosys techmap
|
|
50
|
-
yosys opt -fast -full -purge
|
|
51
|
-
|
|
52
|
-
set cell_counts [dict create]
|
|
53
|
-
|
|
54
|
-
foreach module $modules {
|
|
55
|
-
yosys stat -top $module
|
|
56
|
-
yosys echo off
|
|
57
|
-
set cells_count [yosys tee -q -s result.string scratchpad -get stat.num_cells]
|
|
58
|
-
yosys echo on
|
|
59
|
-
dict set cell_counts $module [expr { int($cells_count) }]
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
# Restore design
|
|
63
|
-
yosys design -load hierarchy_checkpoint
|
|
64
|
-
foreach module $modules {
|
|
65
|
-
yosys select -module $module
|
|
66
|
-
yosys setattr -mod -set keep_hierarchy \
|
|
67
|
-
[expr { [dict get $cell_counts $module] > $cell_limit }]
|
|
68
|
-
yosys select -clear
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
preserve_modules
|
|
72
|
-
|
|
73
|
-
# Rerun coarse synth with flatten
|
|
74
|
-
yosys synth -flatten -top $sc_design -run coarse:fine
|
|
75
|
-
|
|
76
|
-
return [expr { [llength $modules] != [llength [get_modules]] }]
|
|
77
|
-
}
|
|
78
|
-
|
|
79
41
|
####################
|
|
80
42
|
# DESIGNER's CHOICE
|
|
81
43
|
####################
|
|
@@ -171,11 +133,11 @@ proc get_buffer_cell { } {
|
|
|
171
133
|
########################################################
|
|
172
134
|
|
|
173
135
|
foreach lib_file "$sc_libraries $sc_macro_libraries" {
|
|
174
|
-
yosys read_liberty -lib $lib_file
|
|
136
|
+
yosys read_liberty -setattr liberty_cell -lib $lib_file
|
|
175
137
|
}
|
|
176
138
|
foreach bb_file $sc_blackboxes {
|
|
177
139
|
yosys log "Reading blackbox model file: $bb_file"
|
|
178
|
-
yosys read_verilog -sv $bb_file
|
|
140
|
+
yosys read_verilog -setattr blackbox -sv $bb_file
|
|
179
141
|
}
|
|
180
142
|
|
|
181
143
|
########################################################
|
|
@@ -216,7 +178,6 @@ if {
|
|
|
216
178
|
set sc_tbuf "true"
|
|
217
179
|
|
|
218
180
|
yosys tribuf
|
|
219
|
-
yosys stat
|
|
220
181
|
}
|
|
221
182
|
|
|
222
183
|
set flatten_design [expr {
|
|
@@ -245,18 +206,12 @@ sc_map_memory $sc_memory_libmap_files $sc_memory_techmap_files 0
|
|
|
245
206
|
|
|
246
207
|
# Perform hierarchy flattening
|
|
247
208
|
if { !$flatten_design && [lindex [sc_cfg_tool_task_get var auto_flatten] 0] == "true" } {
|
|
248
|
-
yosys log -push
|
|
249
|
-
yosys log -header "SC Auto flattening"
|
|
250
|
-
set sc_hier_iterations \
|
|
251
|
-
[lindex [sc_cfg_tool_task_get var hier_iterations] 0]
|
|
252
209
|
set sc_hier_threshold \
|
|
253
210
|
[lindex [sc_cfg_tool_task_get var hier_threshold] 0]
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
yosys log -pop
|
|
211
|
+
|
|
212
|
+
yosys keep_hierarchy -min_cost $sc_hier_threshold
|
|
213
|
+
|
|
214
|
+
yosys synth -flatten {*}$synth_args -top $sc_design -run coarse:fine
|
|
260
215
|
}
|
|
261
216
|
|
|
262
217
|
# Finish synthesis
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"openroad": {
|
|
3
3
|
"git-url": "https://github.com/The-OpenROAD-Project/OpenROAD.git",
|
|
4
|
-
"git-commit": "
|
|
4
|
+
"git-commit": "3258b30e2c47d695ff2bb6c14a23c6779ed130bb",
|
|
5
5
|
"docker-cmds": [
|
|
6
6
|
"# Remove OR-Tools files",
|
|
7
7
|
"RUN rm -f $SC_PREFIX/Makefile $SC_PREFIX/README.md",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"bluespec": {
|
|
34
34
|
"git-url": "https://github.com/B-Lang-org/bsc.git",
|
|
35
|
-
"git-commit": "
|
|
35
|
+
"git-commit": "2024.07",
|
|
36
36
|
"auto-update": false
|
|
37
37
|
},
|
|
38
38
|
"klayout": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"sv2v": {
|
|
47
47
|
"git-url": "https://github.com/zachjs/sv2v.git",
|
|
48
|
-
"git-commit": "
|
|
48
|
+
"git-commit": "4ec99fcffd2c533c4a2c74ad6f56278f2672f05d",
|
|
49
49
|
"auto-update": true
|
|
50
50
|
},
|
|
51
51
|
"verilator": {
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
},
|
|
92
92
|
"yosys": {
|
|
93
93
|
"git-url": "https://github.com/YosysHQ/yosys.git",
|
|
94
|
-
"git-commit": "v0.
|
|
94
|
+
"git-commit": "v0.50",
|
|
95
95
|
"version-prefix": "",
|
|
96
96
|
"auto-update": true
|
|
97
97
|
},
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"auto-update": false
|
|
129
129
|
},
|
|
130
130
|
"slang": {
|
|
131
|
-
"git-commit": "
|
|
131
|
+
"git-commit": "v8.0",
|
|
132
132
|
"git-url": "https://github.com/MikePopoloski/slang.git",
|
|
133
133
|
"auto-update": true
|
|
134
134
|
},
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)/..
|
|
6
|
+
|
|
7
|
+
mkdir -p deps
|
|
8
|
+
cd deps
|
|
9
|
+
|
|
10
|
+
git clone $(python3 ${src_path}/_tools.py --tool openroad --field git-url) openroad
|
|
11
|
+
cd openroad
|
|
12
|
+
git checkout $(python3 ${src_path}/_tools.py --tool openroad --field git-commit)
|
|
13
|
+
git submodule update --init --recursive
|
|
14
|
+
|
|
15
|
+
# Install missing dependencies
|
|
16
|
+
sudo yum install -y bison byacc
|
|
17
|
+
|
|
18
|
+
deps_args=""
|
|
19
|
+
if [ ! -z ${PREFIX} ]; then
|
|
20
|
+
deps_args="-prefix=$PREFIX"
|
|
21
|
+
fi
|
|
22
|
+
sudo ./etc/DependencyInstaller.sh -all $deps_args
|
|
23
|
+
|
|
24
|
+
cmake_args="-DENABLE_TESTS=OFF"
|
|
25
|
+
if [ ! -z ${PREFIX} ]; then
|
|
26
|
+
cmake_args="$cmake_args -DCMAKE_INSTALL_PREFIX=$PREFIX"
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
./etc/Build.sh -cmake="$cmake_args"
|
|
30
|
+
|
|
31
|
+
cd build
|
|
32
|
+
sudo make install
|
|
33
|
+
|
|
34
|
+
cd -
|