siliconcompiler 0.28.9__py3-none-any.whl → 0.29.1__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/__init__.py +26 -0
- siliconcompiler/apps/sc_remote.py +15 -14
- siliconcompiler/apps/sc_show.py +5 -5
- siliconcompiler/apps/utils/replay.py +194 -0
- siliconcompiler/checklists/__init__.py +12 -0
- siliconcompiler/core.py +89 -22
- siliconcompiler/flows/__init__.py +34 -0
- siliconcompiler/flows/_common.py +11 -13
- siliconcompiler/flows/asicflow.py +83 -42
- siliconcompiler/flows/showflow.py +1 -1
- siliconcompiler/libs/__init__.py +5 -0
- siliconcompiler/optimizer/__init__.py +199 -0
- siliconcompiler/optimizer/vizier.py +259 -0
- siliconcompiler/pdks/__init__.py +5 -0
- siliconcompiler/remote/__init__.py +11 -0
- siliconcompiler/remote/client.py +753 -815
- siliconcompiler/report/report.py +2 -0
- siliconcompiler/report/summary_table.py +1 -1
- siliconcompiler/scheduler/__init__.py +118 -58
- siliconcompiler/scheduler/send_messages.py +1 -1
- siliconcompiler/schema/schema_cfg.py +16 -4
- siliconcompiler/schema/schema_obj.py +29 -10
- siliconcompiler/schema/utils.py +2 -0
- siliconcompiler/sphinx_ext/__init__.py +85 -0
- siliconcompiler/sphinx_ext/dynamicgen.py +19 -34
- siliconcompiler/sphinx_ext/schemagen.py +3 -2
- siliconcompiler/targets/__init__.py +26 -0
- siliconcompiler/targets/gf180_demo.py +3 -3
- siliconcompiler/templates/replay/replay.py.j2 +62 -0
- siliconcompiler/templates/replay/requirements.txt +7 -0
- siliconcompiler/templates/replay/setup.sh +130 -0
- siliconcompiler/tools/__init__.py +60 -0
- siliconcompiler/tools/_common/__init__.py +15 -1
- siliconcompiler/tools/_common/asic.py +17 -9
- siliconcompiler/tools/builtin/concatenate.py +1 -1
- siliconcompiler/tools/ghdl/ghdl.py +1 -2
- siliconcompiler/tools/klayout/convert_drc_db.py +1 -1
- siliconcompiler/tools/klayout/drc.py +1 -1
- siliconcompiler/tools/klayout/export.py +8 -1
- siliconcompiler/tools/klayout/klayout.py +2 -2
- siliconcompiler/tools/klayout/klayout_convert_drc_db.py +2 -2
- siliconcompiler/tools/klayout/klayout_export.py +7 -5
- siliconcompiler/tools/klayout/klayout_operations.py +4 -3
- siliconcompiler/tools/klayout/klayout_show.py +3 -2
- siliconcompiler/tools/klayout/klayout_utils.py +1 -1
- siliconcompiler/tools/klayout/operations.py +8 -0
- siliconcompiler/tools/klayout/screenshot.py +6 -1
- siliconcompiler/tools/klayout/show.py +8 -1
- siliconcompiler/tools/magic/magic.py +1 -1
- siliconcompiler/tools/openroad/__init__.py +103 -0
- siliconcompiler/tools/openroad/{openroad.py → _apr.py} +415 -423
- siliconcompiler/tools/openroad/antenna_repair.py +78 -0
- siliconcompiler/tools/openroad/clock_tree_synthesis.py +64 -0
- siliconcompiler/tools/openroad/detailed_placement.py +59 -0
- siliconcompiler/tools/openroad/detailed_route.py +62 -0
- siliconcompiler/tools/openroad/endcap_tapcell_insertion.py +52 -0
- siliconcompiler/tools/openroad/fillercell_insertion.py +58 -0
- siliconcompiler/tools/openroad/{dfm.py → fillmetal_insertion.py} +35 -19
- siliconcompiler/tools/openroad/global_placement.py +58 -0
- siliconcompiler/tools/openroad/global_route.py +63 -0
- siliconcompiler/tools/openroad/init_floorplan.py +103 -0
- siliconcompiler/tools/openroad/macro_placement.py +65 -0
- siliconcompiler/tools/openroad/metrics.py +23 -8
- siliconcompiler/tools/openroad/pin_placement.py +56 -0
- siliconcompiler/tools/openroad/power_grid.py +65 -0
- siliconcompiler/tools/openroad/rcx_bench.py +7 -4
- siliconcompiler/tools/openroad/rcx_extract.py +2 -1
- siliconcompiler/tools/openroad/rdlroute.py +4 -4
- siliconcompiler/tools/openroad/repair_design.py +59 -0
- siliconcompiler/tools/openroad/repair_timing.py +63 -0
- siliconcompiler/tools/openroad/screenshot.py +9 -20
- siliconcompiler/tools/openroad/scripts/apr/postamble.tcl +44 -0
- siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +95 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_antenna_repair.tcl +51 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_clock_tree_synthesis.tcl +66 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_detailed_placement.tcl +41 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_detailed_route.tcl +71 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_endcap_tapcell_insertion.tcl +55 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_fillercell_insertion.tcl +27 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_fillmetal_insertion.tcl +36 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_global_placement.tcl +26 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_global_route.tcl +61 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +333 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_macro_placement.tcl +123 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_metrics.tcl +22 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_pin_placement.tcl +41 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_power_grid.tcl +60 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_repair_design.tcl +68 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_repair_timing.tcl +83 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_write_data.tcl +125 -0
- siliconcompiler/tools/openroad/scripts/common/debugging.tcl +28 -0
- siliconcompiler/tools/openroad/scripts/common/procs.tcl +727 -0
- siliconcompiler/tools/openroad/scripts/common/read_input_files.tcl +59 -0
- siliconcompiler/tools/openroad/scripts/common/read_liberty.tcl +20 -0
- siliconcompiler/tools/openroad/scripts/common/read_timing_constraints.tcl +16 -0
- siliconcompiler/tools/openroad/scripts/common/reports.tcl +180 -0
- siliconcompiler/tools/openroad/scripts/common/screenshot.tcl +18 -0
- siliconcompiler/tools/openroad/scripts/common/write_images.tcl +395 -0
- siliconcompiler/tools/openroad/scripts/{sc_rcx_bench.tcl → rcx/sc_rcx_bench.tcl} +5 -5
- siliconcompiler/tools/openroad/scripts/{sc_rcx_extract.tcl → rcx/sc_rcx_extract.tcl} +0 -0
- siliconcompiler/tools/openroad/scripts/sc_rcx.tcl +5 -16
- siliconcompiler/tools/openroad/scripts/sc_rdlroute.tcl +51 -51
- siliconcompiler/tools/openroad/scripts/sc_show.tcl +110 -0
- siliconcompiler/tools/openroad/show.py +28 -23
- siliconcompiler/tools/openroad/{export.py → write_data.py} +31 -26
- siliconcompiler/tools/opensta/__init__.py +2 -2
- siliconcompiler/tools/opensta/check_library.py +27 -0
- siliconcompiler/tools/opensta/scripts/sc_check_library.tcl +255 -0
- siliconcompiler/tools/opensta/scripts/sc_timing.tcl +1 -1
- siliconcompiler/tools/sv2v/sv2v.py +1 -2
- siliconcompiler/tools/verilator/verilator.py +6 -7
- siliconcompiler/tools/vivado/vivado.py +1 -1
- siliconcompiler/tools/yosys/__init__.py +149 -0
- siliconcompiler/tools/yosys/lec.py +22 -9
- siliconcompiler/tools/yosys/sc_lec.tcl +94 -49
- siliconcompiler/tools/yosys/sc_syn.tcl +1 -0
- siliconcompiler/tools/yosys/screenshot.py +2 -2
- siliconcompiler/tools/yosys/syn_asic.py +105 -74
- siliconcompiler/tools/yosys/syn_asic.tcl +58 -12
- siliconcompiler/tools/yosys/syn_fpga.py +2 -3
- siliconcompiler/tools/yosys/syn_fpga.tcl +26 -19
- siliconcompiler/toolscripts/_tools.json +5 -5
- siliconcompiler/utils/__init__.py +7 -3
- {siliconcompiler-0.28.9.dist-info → siliconcompiler-0.29.1.dist-info}/METADATA +22 -17
- {siliconcompiler-0.28.9.dist-info → siliconcompiler-0.29.1.dist-info}/RECORD +131 -114
- {siliconcompiler-0.28.9.dist-info → siliconcompiler-0.29.1.dist-info}/WHEEL +1 -1
- {siliconcompiler-0.28.9.dist-info → siliconcompiler-0.29.1.dist-info}/entry_points.txt +13 -0
- siliconcompiler/libs/asap7sc7p5t.py +0 -8
- siliconcompiler/libs/gf180mcu.py +0 -8
- siliconcompiler/libs/interposer.py +0 -8
- siliconcompiler/libs/nangate45.py +0 -8
- siliconcompiler/libs/sg13g2_stdcell.py +0 -8
- siliconcompiler/libs/sky130hd.py +0 -8
- siliconcompiler/libs/sky130io.py +0 -8
- siliconcompiler/pdks/asap7.py +0 -8
- siliconcompiler/pdks/freepdk45.py +0 -8
- siliconcompiler/pdks/gf180.py +0 -8
- siliconcompiler/pdks/ihp130.py +0 -8
- siliconcompiler/pdks/interposer.py +0 -8
- siliconcompiler/pdks/skywater130.py +0 -8
- siliconcompiler/tools/openroad/cts.py +0 -45
- siliconcompiler/tools/openroad/floorplan.py +0 -75
- siliconcompiler/tools/openroad/physyn.py +0 -27
- siliconcompiler/tools/openroad/place.py +0 -41
- siliconcompiler/tools/openroad/route.py +0 -45
- siliconcompiler/tools/openroad/scripts/__init__.py +0 -0
- siliconcompiler/tools/openroad/scripts/sc_apr.tcl +0 -514
- siliconcompiler/tools/openroad/scripts/sc_cts.tcl +0 -68
- siliconcompiler/tools/openroad/scripts/sc_dfm.tcl +0 -22
- siliconcompiler/tools/openroad/scripts/sc_export.tcl +0 -100
- siliconcompiler/tools/openroad/scripts/sc_floorplan.tcl +0 -456
- siliconcompiler/tools/openroad/scripts/sc_metrics.tcl +0 -1
- siliconcompiler/tools/openroad/scripts/sc_physyn.tcl +0 -6
- siliconcompiler/tools/openroad/scripts/sc_place.tcl +0 -84
- siliconcompiler/tools/openroad/scripts/sc_procs.tcl +0 -494
- siliconcompiler/tools/openroad/scripts/sc_report.tcl +0 -189
- siliconcompiler/tools/openroad/scripts/sc_route.tcl +0 -143
- siliconcompiler/tools/openroad/scripts/sc_screenshot.tcl +0 -18
- siliconcompiler/tools/openroad/scripts/sc_write_images.tcl +0 -393
- siliconcompiler/tools/yosys/yosys.py +0 -148
- /siliconcompiler/tools/openroad/scripts/{sc_write.tcl → common/write_data.tcl} +0 -0
- {siliconcompiler-0.28.9.dist-info → siliconcompiler-0.29.1.dist-info}/LICENSE +0 -0
- {siliconcompiler-0.28.9.dist-info → siliconcompiler-0.29.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
###############################
|
|
2
|
+
# Reading SC Schema
|
|
3
|
+
###############################
|
|
4
|
+
|
|
5
|
+
source ./sc_manifest.tcl > /dev/null
|
|
6
|
+
|
|
7
|
+
##############################
|
|
8
|
+
# Schema Adapter
|
|
9
|
+
###############################
|
|
10
|
+
|
|
11
|
+
set sc_tool opensta
|
|
12
|
+
set sc_step [sc_cfg_get arg step]
|
|
13
|
+
set sc_index [sc_cfg_get arg index]
|
|
14
|
+
set sc_flow [sc_cfg_get option flow]
|
|
15
|
+
set sc_task [sc_cfg_get flowgraph $sc_flow $sc_step $sc_index task]
|
|
16
|
+
|
|
17
|
+
set sc_refdir [sc_cfg_tool_task_get refdir]
|
|
18
|
+
|
|
19
|
+
# Design
|
|
20
|
+
set sc_design [sc_top]
|
|
21
|
+
|
|
22
|
+
# APR Parameters
|
|
23
|
+
set sc_targetlibs [sc_get_asic_libraries logic]
|
|
24
|
+
set sc_delaymodel [sc_cfg_get asic delaymodel]
|
|
25
|
+
set sc_scenarios [dict keys [sc_cfg_get constraint timing]]
|
|
26
|
+
|
|
27
|
+
###############################
|
|
28
|
+
# Optional
|
|
29
|
+
###############################
|
|
30
|
+
|
|
31
|
+
# MACROS
|
|
32
|
+
set sc_macrolibs [sc_get_asic_libraries macro]
|
|
33
|
+
|
|
34
|
+
###############################
|
|
35
|
+
# Read Files
|
|
36
|
+
###############################
|
|
37
|
+
|
|
38
|
+
# Read Liberty
|
|
39
|
+
puts "Defining timing corners: $sc_scenarios"
|
|
40
|
+
define_corners {*}$sc_scenarios
|
|
41
|
+
foreach lib "$sc_targetlibs $sc_macrolibs" {
|
|
42
|
+
#Liberty
|
|
43
|
+
foreach corner $sc_scenarios {
|
|
44
|
+
foreach libcorner [sc_cfg_get constraint timing $corner libcorner] {
|
|
45
|
+
if { [sc_cfg_exists library $lib output $libcorner $sc_delaymodel] } {
|
|
46
|
+
foreach lib_file [sc_cfg_get library $lib output $libcorner $sc_delaymodel] {
|
|
47
|
+
puts "Reading liberty file for ${corner} ($libcorner): ${lib_file}"
|
|
48
|
+
read_liberty -corner $corner $lib_file
|
|
49
|
+
}
|
|
50
|
+
break
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
proc assert_glob { str } {
|
|
57
|
+
if { [string first "*" $str] != -1 } {
|
|
58
|
+
puts "\[ERROR] Regex detected: $str"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
# Check cells
|
|
63
|
+
# check for globbing and report list if globs are detected
|
|
64
|
+
# check each cell
|
|
65
|
+
foreach lib $sc_targetlibs {
|
|
66
|
+
dict for {cell_type cells} [sc_cfg_get library $lib asic cells] {
|
|
67
|
+
if { [llength $cells] == 0 } {
|
|
68
|
+
continue
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
puts "Checking: $lib / asic / cells / $cell_type"
|
|
72
|
+
|
|
73
|
+
foreach cell $cells {
|
|
74
|
+
puts " $cell:"
|
|
75
|
+
|
|
76
|
+
if { $cell_type != "dontuse" } {
|
|
77
|
+
assert_glob $cell
|
|
78
|
+
}
|
|
79
|
+
set libcells [get_lib_cells $cell]
|
|
80
|
+
foreach libcell $libcells {
|
|
81
|
+
puts " [get_full_name $libcell]"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
# Check yosys setup
|
|
88
|
+
# yosys_driver_cell
|
|
89
|
+
foreach lib $sc_targetlibs {
|
|
90
|
+
puts "Checking $lib yosys_driver_cell"
|
|
91
|
+
assert_glob [sc_cfg_get library $lib option var yosys_driver_cell]
|
|
92
|
+
if { [get_lib_cells [sc_cfg_get library $lib option var yosys_driver_cell]] == 0 } {
|
|
93
|
+
puts "\[ERROR] missing"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
# yosys_buffer_cell
|
|
97
|
+
foreach lib $sc_targetlibs {
|
|
98
|
+
puts "Checking $lib yosys_buffer_cell"
|
|
99
|
+
assert_glob [sc_cfg_get library $lib option var yosys_buffer_cell]
|
|
100
|
+
if { [get_lib_cells [sc_cfg_get library $lib option var yosys_buffer_cell]] == 0 } {
|
|
101
|
+
puts "\[ERROR] missing"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
# yosys_buffer_input
|
|
105
|
+
foreach lib $sc_targetlibs {
|
|
106
|
+
puts "Checking $lib yosys_buffer_input"
|
|
107
|
+
assert_glob [sc_cfg_get library $lib option var yosys_buffer_input]
|
|
108
|
+
set cellname [sc_cfg_get library $lib option var yosys_buffer_cell]
|
|
109
|
+
set pins [get_lib_pins $cellname/[sc_cfg_get library $lib option var yosys_buffer_input]]
|
|
110
|
+
if { [llength $pins] != [llength [sta::corners]] } {
|
|
111
|
+
puts "\[ERROR] mismatch"
|
|
112
|
+
}
|
|
113
|
+
foreach pin $pins {
|
|
114
|
+
if { [get_property $pin direction] != "input" } {
|
|
115
|
+
puts "\[ERROR] [get_full_name $pin] incorrect direction"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
# yosys_buffer_output
|
|
120
|
+
foreach lib $sc_targetlibs {
|
|
121
|
+
puts "Checking $lib yosys_buffer_output"
|
|
122
|
+
assert_glob [sc_cfg_get library $lib option var yosys_buffer_output]
|
|
123
|
+
set cellname [sc_cfg_get library $lib option var yosys_buffer_cell]
|
|
124
|
+
set pins [get_lib_pins $cellname/[sc_cfg_get library $lib option var yosys_buffer_output]]
|
|
125
|
+
if { [llength $pins] != [llength [sta::corners]] } {
|
|
126
|
+
puts "\[ERROR] mismatch"
|
|
127
|
+
}
|
|
128
|
+
foreach pin $pins {
|
|
129
|
+
if { [get_property $pin direction] != "output" } {
|
|
130
|
+
puts "\[ERROR] [get_full_name $pin] incorrect direction"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
# yosys_tiehigh_cell
|
|
135
|
+
foreach lib $sc_targetlibs {
|
|
136
|
+
puts "Checking $lib yosys_tiehigh_cell"
|
|
137
|
+
assert_glob [sc_cfg_get library $lib option var yosys_tiehigh_cell]
|
|
138
|
+
if { [get_lib_cells [sc_cfg_get library $lib option var yosys_tiehigh_cell]] == 0 } {
|
|
139
|
+
puts "\[ERROR] missing"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
# yosys_tiehigh_port
|
|
143
|
+
foreach lib $sc_targetlibs {
|
|
144
|
+
puts "Checking $lib yosys_tiehigh_port"
|
|
145
|
+
assert_glob [sc_cfg_get library $lib option var yosys_tiehigh_port]
|
|
146
|
+
set cellname [sc_cfg_get library $lib option var yosys_tiehigh_cell]
|
|
147
|
+
set pins [get_lib_pins $cellname/[sc_cfg_get library $lib option var yosys_tiehigh_port]]
|
|
148
|
+
if { [llength $pins] != [llength [sta::corners]] } {
|
|
149
|
+
puts "\[ERROR] mismatch"
|
|
150
|
+
}
|
|
151
|
+
foreach pin $pins {
|
|
152
|
+
if { [get_property $pin direction] != "output" } {
|
|
153
|
+
puts "\[ERROR] [get_full_name $pin] incorrect direction"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
# yosys_tielow_cell
|
|
158
|
+
foreach lib $sc_targetlibs {
|
|
159
|
+
puts "Checking $lib yosys_tielow_cell"
|
|
160
|
+
assert_glob [sc_cfg_get library $lib option var yosys_tielow_cell]
|
|
161
|
+
if { [get_lib_cells [sc_cfg_get library $lib option var yosys_tielow_cell]] == 0 } {
|
|
162
|
+
puts "\[ERROR] missing"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
# yosys_tielow_port
|
|
166
|
+
foreach lib $sc_targetlibs {
|
|
167
|
+
puts "Checking $lib yosys_tielow_port"
|
|
168
|
+
assert_glob [sc_cfg_get library $lib option var yosys_tielow_port]
|
|
169
|
+
set cellname [sc_cfg_get library $lib option var yosys_tielow_cell]
|
|
170
|
+
set pins [get_lib_pins $cellname/[sc_cfg_get library $lib option var yosys_tielow_port]]
|
|
171
|
+
if { [llength $pins] != [llength [sta::corners]] } {
|
|
172
|
+
puts "\[ERROR] mismatch"
|
|
173
|
+
}
|
|
174
|
+
foreach pin $pins {
|
|
175
|
+
if { [get_property $pin direction] != "output" } {
|
|
176
|
+
puts "\[ERROR] [get_full_name $pin] incorrect direction"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
# yosys_abc_constraint_load
|
|
181
|
+
foreach lib $sc_targetlibs {
|
|
182
|
+
set cap 0.0
|
|
183
|
+
puts "Checking $lib yosys_abc_constraint_load"
|
|
184
|
+
set cellname [sc_cfg_get library $lib option var yosys_buffer_cell]
|
|
185
|
+
set pins [get_lib_pins $cellname/[sc_cfg_get library $lib option var yosys_buffer_input]]
|
|
186
|
+
foreach pin $pins {
|
|
187
|
+
set cap [expr { max($cap, [get_property $pin capacitance]) }]
|
|
188
|
+
}
|
|
189
|
+
set lib_cap [sc_cfg_get library $lib option var yosys_abc_constraint_load]
|
|
190
|
+
set cap [expr { 4 * $cap }]
|
|
191
|
+
set cap "[format "%.3f" $cap][sta::unit_scaled_suffix capacitance]"
|
|
192
|
+
|
|
193
|
+
if { $lib_cap != $cap } {
|
|
194
|
+
puts "\[ERROR] mismatch, should be $cap, not $lib_cap"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
# yosys_abc_clock_multiplier
|
|
199
|
+
foreach lib $sc_targetlibs {
|
|
200
|
+
puts "Checking $lib yosys_abc_clock_multiplier"
|
|
201
|
+
set ps_convert [expr { round(1.0 / [sta::time_sta_ui 1e-12]) }]
|
|
202
|
+
set convert [sc_cfg_get library $lib option var yosys_abc_clock_multiplier]
|
|
203
|
+
if { $convert != $ps_convert } {
|
|
204
|
+
puts "\[ERROR] incorrect multiplier: should be $ps_convert, not $convert"
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
# Check openroad setup
|
|
209
|
+
# openroad_tiehigh_cell
|
|
210
|
+
foreach lib $sc_targetlibs {
|
|
211
|
+
puts "Checking $lib openroad_tiehigh_cell"
|
|
212
|
+
assert_glob [sc_cfg_get library $lib option var openroad_tiehigh_cell]
|
|
213
|
+
if { [get_lib_cells [sc_cfg_get library $lib option var openroad_tiehigh_cell]] == 0 } {
|
|
214
|
+
puts "\[ERROR] missing"
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
# openroad_tiehigh_port
|
|
218
|
+
foreach lib $sc_targetlibs {
|
|
219
|
+
puts "Checking $lib openroad_tiehigh_port"
|
|
220
|
+
assert_glob [sc_cfg_get library $lib option var openroad_tiehigh_port]
|
|
221
|
+
set cellname [sc_cfg_get library $lib option var openroad_tiehigh_cell]
|
|
222
|
+
set pins [get_lib_pins $cellname/[sc_cfg_get library $lib option var openroad_tiehigh_port]]
|
|
223
|
+
if { [llength $pins] != [llength [sta::corners]] } {
|
|
224
|
+
puts "\[ERROR] mismatch"
|
|
225
|
+
}
|
|
226
|
+
foreach pin $pins {
|
|
227
|
+
if { [get_property $pin direction] != "output" } {
|
|
228
|
+
puts "\[ERROR] [get_full_name $pin] incorrect direction"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
# openroad_tielow_cell
|
|
234
|
+
foreach lib $sc_targetlibs {
|
|
235
|
+
puts "Checking $lib openroad_tielow_cell"
|
|
236
|
+
assert_glob [sc_cfg_get library $lib option var openroad_tielow_cell]
|
|
237
|
+
if { [get_lib_cells [sc_cfg_get library $lib option var openroad_tielow_cell]] == 0 } {
|
|
238
|
+
puts "\[ERROR] missing"
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
# openroad_tielow_port
|
|
242
|
+
foreach lib $sc_targetlibs {
|
|
243
|
+
puts "Checking $lib openroad_tielow_port"
|
|
244
|
+
assert_glob [sc_cfg_get library $lib option var openroad_tielow_port]
|
|
245
|
+
set cellname [sc_cfg_get library $lib option var openroad_tielow_cell]
|
|
246
|
+
set pins [get_lib_pins $cellname/[sc_cfg_get library $lib option var openroad_tielow_port]]
|
|
247
|
+
if { [llength $pins] != [llength [sta::corners]] } {
|
|
248
|
+
puts "\[ERROR] mismatch"
|
|
249
|
+
}
|
|
250
|
+
foreach pin $pins {
|
|
251
|
+
if { [get_property $pin direction] != "output" } {
|
|
252
|
+
puts "\[ERROR] [get_full_name $pin] incorrect direction"
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
@@ -128,7 +128,7 @@ source "$sc_refdir/sc_procs.tcl"
|
|
|
128
128
|
|
|
129
129
|
set opensta_top_n_paths [lindex [sc_cfg_tool_task_get var top_n_paths] 0]
|
|
130
130
|
|
|
131
|
-
set fields "{capacitance slew input_pins
|
|
131
|
+
set fields "{capacitance slew input_pins hierarcial_pins net fanout}"
|
|
132
132
|
set PREFIX "SC_METRIC:"
|
|
133
133
|
|
|
134
134
|
puts "$PREFIX timeunit"
|
|
@@ -14,13 +14,12 @@ Sources: https://github.com/zachjs/sv2v
|
|
|
14
14
|
Installation: https://github.com/zachjs/sv2v
|
|
15
15
|
'''
|
|
16
16
|
|
|
17
|
-
from siliconcompiler.tools.sv2v import convert
|
|
18
|
-
|
|
19
17
|
|
|
20
18
|
####################################################################
|
|
21
19
|
# Make Docs
|
|
22
20
|
####################################################################
|
|
23
21
|
def make_docs(chip):
|
|
22
|
+
from siliconcompiler.tools.sv2v import convert
|
|
24
23
|
convert.setup(chip)
|
|
25
24
|
return chip
|
|
26
25
|
|
|
@@ -32,13 +32,13 @@ from siliconcompiler.tools._common import (
|
|
|
32
32
|
get_tool_task,
|
|
33
33
|
input_provides
|
|
34
34
|
)
|
|
35
|
-
from siliconcompiler.targets import freepdk45_demo
|
|
36
35
|
|
|
37
36
|
|
|
38
37
|
####################################################################
|
|
39
38
|
# Make Docs
|
|
40
39
|
####################################################################
|
|
41
40
|
def make_docs(chip):
|
|
41
|
+
from siliconcompiler.targets import freepdk45_demo
|
|
42
42
|
chip.use(freepdk45_demo)
|
|
43
43
|
|
|
44
44
|
|
|
@@ -71,10 +71,8 @@ def setup(chip):
|
|
|
71
71
|
chip.set('tool', tool, 'task', task, 'file', 'config',
|
|
72
72
|
'Verilator configuration file',
|
|
73
73
|
field='help')
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
','.join(['tool', tool, 'task', task, 'file', 'config']),
|
|
77
|
-
step=step, index=index)
|
|
74
|
+
add_require_input(chip, 'tool', tool, 'task', task, 'file', 'config')
|
|
75
|
+
add_require_input(chip, 'option', 'file', 'verilator_config')
|
|
78
76
|
|
|
79
77
|
chip.set('tool', tool, 'task', task, 'var', 'enable_assert',
|
|
80
78
|
'true/false, when true assertions are enabled in Verilator.',
|
|
@@ -132,8 +130,9 @@ def runtime_options(chip):
|
|
|
132
130
|
cmdlist.append(libext_option)
|
|
133
131
|
|
|
134
132
|
# Verilator docs recommend this file comes first in CLI arguments
|
|
135
|
-
for value in chip
|
|
136
|
-
|
|
133
|
+
for value in get_input_files(chip, 'tool', tool, 'task', task, 'file', 'config'):
|
|
134
|
+
cmdlist.append(value)
|
|
135
|
+
for value in get_input_files(chip, 'option', 'file', 'verilator_config'):
|
|
137
136
|
cmdlist.append(value)
|
|
138
137
|
|
|
139
138
|
for param, value in frontend_opts['param']:
|
|
@@ -10,10 +10,10 @@ import os
|
|
|
10
10
|
import re
|
|
11
11
|
from siliconcompiler import sc_open
|
|
12
12
|
from siliconcompiler.tools._common import record_metric
|
|
13
|
-
from siliconcompiler.targets import fpgaflow_demo
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
def make_docs(chip):
|
|
16
|
+
from siliconcompiler.targets import fpgaflow_demo
|
|
17
17
|
chip.set('fpga', 'partname', 'ice40up5k-sg48')
|
|
18
18
|
chip.use(fpgaflow_demo)
|
|
19
19
|
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
'''
|
|
2
|
+
Yosys is a framework for RTL synthesis that takes synthesizable
|
|
3
|
+
Verilog-2005 design and converts it to BLIF, EDIF, BTOR, SMT,
|
|
4
|
+
Verilog netlist etc. The tool supports logical synthesis and
|
|
5
|
+
tech mapping to ASIC standard cell libraries, FPGA architectures.
|
|
6
|
+
In addition it has built in formal methods for property and
|
|
7
|
+
equivalence checking.
|
|
8
|
+
|
|
9
|
+
Documentation: https://yosyshq.readthedocs.io/projects/yosys/en/latest/
|
|
10
|
+
|
|
11
|
+
Sources: https://github.com/YosysHQ/yosys
|
|
12
|
+
|
|
13
|
+
Installation: https://github.com/YosysHQ/yosys
|
|
14
|
+
'''
|
|
15
|
+
|
|
16
|
+
import re
|
|
17
|
+
import json
|
|
18
|
+
from siliconcompiler import sc_open
|
|
19
|
+
from siliconcompiler.tools._common import get_tool_task, record_metric
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
######################################################################
|
|
23
|
+
# Make Docs
|
|
24
|
+
######################################################################
|
|
25
|
+
def make_docs(chip):
|
|
26
|
+
from siliconcompiler.targets import asap7_demo
|
|
27
|
+
chip.use(asap7_demo)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
################################
|
|
31
|
+
# Setup Tool (pre executable)
|
|
32
|
+
################################
|
|
33
|
+
def setup(chip):
|
|
34
|
+
''' Tool specific function to run before step execution
|
|
35
|
+
'''
|
|
36
|
+
|
|
37
|
+
# If the 'lock' bit is set, don't reconfigure.
|
|
38
|
+
tool = 'yosys'
|
|
39
|
+
refdir = 'tools/' + tool
|
|
40
|
+
step = chip.get('arg', 'step')
|
|
41
|
+
index = chip.get('arg', 'index')
|
|
42
|
+
_, task = get_tool_task(chip, step, index)
|
|
43
|
+
|
|
44
|
+
# Standard Setup
|
|
45
|
+
chip.set('tool', tool, 'exe', 'yosys')
|
|
46
|
+
chip.set('tool', tool, 'vswitch', '--version')
|
|
47
|
+
chip.set('tool', tool, 'version', '>=0.48', clobber=False)
|
|
48
|
+
chip.set('tool', tool, 'format', 'tcl', clobber=False)
|
|
49
|
+
|
|
50
|
+
# Task Setup
|
|
51
|
+
# common to all
|
|
52
|
+
option = []
|
|
53
|
+
if chip.get('option', 'breakpoint', step=step, index=index):
|
|
54
|
+
option.append('-C')
|
|
55
|
+
option.append('-c')
|
|
56
|
+
chip.set('tool', tool, 'task', task, 'option', option, step=step, index=index, clobber=False)
|
|
57
|
+
chip.set('tool', tool, 'task', task, 'refdir', refdir, step=step, index=index,
|
|
58
|
+
package='siliconcompiler', clobber=False)
|
|
59
|
+
chip.set('tool', tool, 'task', task, 'regex', 'warnings', "Warning:",
|
|
60
|
+
step=step, index=index, clobber=False)
|
|
61
|
+
chip.set('tool', tool, 'task', task, 'regex', 'errors', "^ERROR",
|
|
62
|
+
step=step, index=index, clobber=False)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
################################
|
|
66
|
+
# Version Check
|
|
67
|
+
################################
|
|
68
|
+
def parse_version(stdout):
|
|
69
|
+
# Yosys 0.9+3672 (git sha1 014c7e26, gcc 7.5.0-3ubuntu1~18.04 -fPIC -Os)
|
|
70
|
+
return stdout.split()[1]
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def normalize_version(version):
|
|
74
|
+
# Replace '+', which represents a "local version label", with '-', which is
|
|
75
|
+
# an "implicit post release number".
|
|
76
|
+
return version.replace('+', '-')
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def syn_setup(chip):
|
|
80
|
+
''' Helper method for configs specific to synthesis tasks.
|
|
81
|
+
'''
|
|
82
|
+
|
|
83
|
+
# Generic tool setup.
|
|
84
|
+
setup(chip)
|
|
85
|
+
|
|
86
|
+
tool = 'yosys'
|
|
87
|
+
step = chip.get('arg', 'step')
|
|
88
|
+
index = chip.get('arg', 'index')
|
|
89
|
+
_, task = get_tool_task(chip, step, index)
|
|
90
|
+
design = chip.top()
|
|
91
|
+
|
|
92
|
+
# Set yosys script path.
|
|
93
|
+
chip.set('tool', tool, 'task', task, 'script', 'sc_syn.tcl',
|
|
94
|
+
step=step, index=index, clobber=False)
|
|
95
|
+
|
|
96
|
+
# Input/output requirements.
|
|
97
|
+
chip.set('tool', tool, 'task', task, 'input', design + '.v', step=step, index=index)
|
|
98
|
+
chip.set('tool', tool, 'task', task, 'output', design + '.vg', step=step, index=index)
|
|
99
|
+
chip.add('tool', tool, 'task', task, 'output', design + '.netlist.json', step=step, index=index)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
##################################################
|
|
103
|
+
def syn_post_process(chip):
|
|
104
|
+
''' Tool specific function to run after step execution
|
|
105
|
+
'''
|
|
106
|
+
|
|
107
|
+
step = chip.get('arg', 'step')
|
|
108
|
+
index = chip.get('arg', 'index')
|
|
109
|
+
|
|
110
|
+
with sc_open("reports/stat.json") as f:
|
|
111
|
+
metrics = json.load(f)
|
|
112
|
+
if "design" in metrics:
|
|
113
|
+
metrics = metrics["design"]
|
|
114
|
+
|
|
115
|
+
if "area" in metrics:
|
|
116
|
+
record_metric(chip, step, index, 'cellarea',
|
|
117
|
+
float(metrics["area"]),
|
|
118
|
+
"reports/stat.json",
|
|
119
|
+
source_unit='um^2')
|
|
120
|
+
if "num_cells" in metrics:
|
|
121
|
+
record_metric(chip, step, index, 'cells',
|
|
122
|
+
metrics["num_cells"],
|
|
123
|
+
"reports/stat.json")
|
|
124
|
+
if "num_wire_bits" in metrics:
|
|
125
|
+
record_metric(chip, step, index, 'nets',
|
|
126
|
+
metrics["num_wire_bits"],
|
|
127
|
+
"reports/stat.json")
|
|
128
|
+
if "num_port_bits" in metrics:
|
|
129
|
+
record_metric(chip, step, index, 'pins',
|
|
130
|
+
metrics["num_port_bits"],
|
|
131
|
+
"reports/stat.json")
|
|
132
|
+
|
|
133
|
+
registers = None
|
|
134
|
+
with sc_open(f"{step}.log") as f:
|
|
135
|
+
for line in f:
|
|
136
|
+
line_registers = re.findall(r"^\s*mapped ([0-9]+) \$_DFF.*", line)
|
|
137
|
+
if line_registers:
|
|
138
|
+
if registers is None:
|
|
139
|
+
registers = 0
|
|
140
|
+
registers += int(line_registers[0])
|
|
141
|
+
if registers is not None:
|
|
142
|
+
record_metric(chip, step, index, 'registers', registers, f"{step}.log")
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
##################################################
|
|
146
|
+
if __name__ == "__main__":
|
|
147
|
+
|
|
148
|
+
chip = make_docs()
|
|
149
|
+
chip.write_manifest("yosys.json")
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import re
|
|
2
2
|
|
|
3
|
-
from siliconcompiler.tools.yosys
|
|
4
|
-
from siliconcompiler.tools.yosys.syn_asic import setup_asic
|
|
3
|
+
from siliconcompiler.tools.yosys import setup as setup_tool
|
|
4
|
+
from siliconcompiler.tools.yosys.syn_asic import setup_asic, prepare_synthesis_libraries
|
|
5
5
|
from siliconcompiler import sc_open
|
|
6
|
-
from siliconcompiler.tools._common import get_tool_task, record_metric
|
|
6
|
+
from siliconcompiler.tools._common import get_tool_task, record_metric, input_provides
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def setup(chip):
|
|
@@ -28,12 +28,25 @@ def setup(chip):
|
|
|
28
28
|
step=step, index=index, clobber=False)
|
|
29
29
|
|
|
30
30
|
# Input/output requirements.
|
|
31
|
-
if
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
if f"{design}.lec.vg" in input_provides(chip, step, index):
|
|
32
|
+
chip.set('tool', tool, 'task', task, 'input', design + '.lec.vg',
|
|
33
|
+
step=step, index=index)
|
|
34
|
+
elif f"{design}.vg" in input_provides(chip, step, index):
|
|
35
|
+
chip.set('tool', tool, 'task', task, 'input', design + '.vg',
|
|
36
|
+
step=step, index=index)
|
|
37
|
+
else:
|
|
38
|
+
chip.add('tool', tool, 'task', task, 'require', 'input,netlist,verilog',
|
|
39
|
+
step=step, index=index)
|
|
40
|
+
|
|
41
|
+
chip.set('tool', tool, 'task', task, 'var', 'induction_steps', '10',
|
|
42
|
+
step=step, index=index, clobber=False)
|
|
43
|
+
chip.set('tool', tool, 'task', task, 'var', 'induction_steps',
|
|
44
|
+
'Number of induction steps for yosys equivalence checking',
|
|
45
|
+
field='help')
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def pre_process(chip):
|
|
49
|
+
prepare_synthesis_libraries(chip)
|
|
37
50
|
|
|
38
51
|
|
|
39
52
|
##################################################
|