siliconcompiler 0.28.3__py3-none-any.whl → 0.28.5__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/_common.py +88 -56
- siliconcompiler/apps/sc.py +33 -14
- siliconcompiler/apps/sc_dashboard.py +17 -10
- siliconcompiler/apps/sc_show.py +17 -15
- siliconcompiler/core.py +95 -55
- siliconcompiler/flows/drcflow.py +13 -0
- siliconcompiler/flows/interposerflow.py +17 -0
- siliconcompiler/fpgas/vpr_example.py +8 -0
- siliconcompiler/libs/interposer.py +8 -0
- siliconcompiler/package.py +3 -2
- siliconcompiler/pdks/interposer.py +8 -0
- siliconcompiler/remote/schema.py +11 -1
- siliconcompiler/remote/server.py +7 -2
- siliconcompiler/report/dashboard/__init__.py +9 -0
- siliconcompiler/report/dashboard/components/__init__.py +13 -1
- siliconcompiler/report/dashboard/layouts/vertical_flowgraph.py +4 -3
- siliconcompiler/report/dashboard/layouts/vertical_flowgraph_node_tab.py +4 -1
- siliconcompiler/report/dashboard/layouts/vertical_flowgraph_sac_tabs.py +4 -1
- siliconcompiler/report/dashboard/state.py +3 -1
- siliconcompiler/report/summary_table.py +1 -2
- siliconcompiler/report/utils.py +1 -2
- siliconcompiler/scheduler/__init__.py +95 -0
- siliconcompiler/schema/schema_cfg.py +15 -3
- siliconcompiler/schema/schema_obj.py +51 -1
- siliconcompiler/sphinx_ext/dynamicgen.py +6 -0
- siliconcompiler/targets/interposer_demo.py +56 -0
- siliconcompiler/templates/tcl/manifest.tcl.j2 +2 -0
- siliconcompiler/tools/_common/__init__.py +44 -6
- siliconcompiler/tools/_common/asic.py +79 -23
- siliconcompiler/tools/genfasm/genfasm.py +7 -0
- siliconcompiler/tools/ghdl/convert.py +7 -0
- siliconcompiler/tools/klayout/convert_drc_db.py +60 -0
- siliconcompiler/tools/klayout/drc.py +156 -0
- siliconcompiler/tools/klayout/export.py +9 -4
- siliconcompiler/tools/klayout/klayout.py +0 -1
- siliconcompiler/tools/klayout/klayout_convert_drc_db.py +182 -0
- siliconcompiler/tools/klayout/klayout_export.py +3 -0
- siliconcompiler/tools/klayout/klayout_utils.py +8 -2
- siliconcompiler/tools/klayout/operations.py +2 -0
- siliconcompiler/tools/klayout/screenshot.py +2 -0
- siliconcompiler/tools/klayout/show.py +4 -4
- siliconcompiler/tools/magic/drc.py +21 -0
- siliconcompiler/tools/magic/extspice.py +21 -0
- siliconcompiler/tools/magic/magic.py +29 -0
- siliconcompiler/tools/magic/sc_drc.tcl +2 -12
- siliconcompiler/tools/magic/sc_extspice.tcl +3 -15
- siliconcompiler/tools/openroad/metrics.py +45 -0
- siliconcompiler/tools/openroad/openroad.py +47 -2
- siliconcompiler/tools/openroad/rdlroute.py +97 -0
- siliconcompiler/tools/openroad/scripts/sc_apr.tcl +16 -1
- siliconcompiler/tools/openroad/scripts/sc_floorplan.tcl +55 -9
- siliconcompiler/tools/openroad/scripts/sc_metrics.tcl +0 -159
- siliconcompiler/tools/openroad/scripts/sc_procs.tcl +3 -1
- siliconcompiler/tools/openroad/scripts/sc_rdlroute.tcl +184 -0
- siliconcompiler/tools/openroad/scripts/sc_report.tcl +170 -0
- siliconcompiler/tools/openroad/scripts/sc_route.tcl +8 -2
- siliconcompiler/tools/openroad/scripts/sc_screenshot.tcl +0 -5
- siliconcompiler/tools/openroad/scripts/sc_write_images.tcl +36 -6
- siliconcompiler/tools/opensta/scripts/sc_report_libraries.tcl +11 -1
- siliconcompiler/tools/surelog/__init__.py +12 -0
- siliconcompiler/tools/verilator/compile.py +27 -0
- siliconcompiler/tools/verilator/verilator.py +9 -0
- siliconcompiler/tools/vpr/vpr.py +18 -0
- siliconcompiler/tools/xyce/__init__.py +1 -1
- siliconcompiler/tools/yosys/{syn_asic_fpga_shared.tcl → procs.tcl} +23 -0
- siliconcompiler/tools/yosys/sc_screenshot.tcl +104 -0
- siliconcompiler/tools/yosys/sc_syn.tcl +7 -9
- siliconcompiler/tools/yosys/screenshot.py +153 -0
- siliconcompiler/tools/yosys/syn_asic.py +3 -0
- siliconcompiler/tools/yosys/syn_asic.tcl +1 -3
- siliconcompiler/tools/yosys/syn_fpga.tcl +3 -2
- siliconcompiler/toolscripts/_tools.json +5 -6
- siliconcompiler/toolscripts/rhel8/install-xyce.sh +4 -5
- siliconcompiler/toolscripts/rhel9/install-xyce.sh +4 -5
- siliconcompiler/toolscripts/ubuntu20/install-xyce.sh +5 -5
- siliconcompiler/toolscripts/ubuntu22/install-xyce.sh +2 -2
- siliconcompiler/toolscripts/ubuntu24/install-xyce.sh +2 -2
- siliconcompiler/utils/__init__.py +30 -1
- siliconcompiler/utils/showtools.py +4 -0
- {siliconcompiler-0.28.3.dist-info → siliconcompiler-0.28.5.dist-info}/METADATA +18 -5
- {siliconcompiler-0.28.3.dist-info → siliconcompiler-0.28.5.dist-info}/RECORD +86 -72
- {siliconcompiler-0.28.3.dist-info → siliconcompiler-0.28.5.dist-info}/WHEEL +1 -1
- {siliconcompiler-0.28.3.dist-info → siliconcompiler-0.28.5.dist-info}/LICENSE +0 -0
- {siliconcompiler-0.28.3.dist-info → siliconcompiler-0.28.5.dist-info}/entry_points.txt +0 -0
- {siliconcompiler-0.28.3.dist-info → siliconcompiler-0.28.5.dist-info}/top_level.txt +0 -0
|
@@ -226,6 +226,12 @@ proc sc_image_clocks { } {
|
|
|
226
226
|
proc sc_image_clocktree { } {
|
|
227
227
|
gui::show_widget "Clock Tree Viewer"
|
|
228
228
|
global sc_scenarios
|
|
229
|
+
global sc_design
|
|
230
|
+
|
|
231
|
+
sc_image_setup_default
|
|
232
|
+
gui::set_display_controls "Layers/*" visible true
|
|
233
|
+
gui::set_display_controls "Nets/*" visible false
|
|
234
|
+
gui::set_display_controls "Nets/Clock" visible true
|
|
229
235
|
|
|
230
236
|
set clock_state []
|
|
231
237
|
foreach clock [all_clocks] {
|
|
@@ -233,6 +239,7 @@ proc sc_image_clocktree { } {
|
|
|
233
239
|
}
|
|
234
240
|
set_propagated_clock [all_clocks]
|
|
235
241
|
|
|
242
|
+
file mkdir reports/images/clocks
|
|
236
243
|
foreach clock [get_clocks *] {
|
|
237
244
|
if { [llength [get_property $clock sources]] == 0 } {
|
|
238
245
|
# Skip virtual clocks
|
|
@@ -243,13 +250,18 @@ proc sc_image_clocktree { } {
|
|
|
243
250
|
set clock_name [get_name $clock]
|
|
244
251
|
foreach corner $sc_scenarios {
|
|
245
252
|
set path reports/images/clocktree/${clock_name}.${corner}.png
|
|
246
|
-
utl::info FLW 1 "Saving $clock_name clock tree for $corner
|
|
253
|
+
utl::info FLW 1 "Saving \"$clock_name\" clock tree for $corner to $path"
|
|
247
254
|
save_clocktree_image $path \
|
|
248
255
|
-clock $clock_name \
|
|
249
256
|
-width 1024 \
|
|
250
257
|
-height 1024 \
|
|
251
258
|
-corner $corner
|
|
252
259
|
}
|
|
260
|
+
|
|
261
|
+
if { [info commands gui::select_clockviewer_clock] != "" } {
|
|
262
|
+
gui::select_clockviewer_clock ${clock_name}
|
|
263
|
+
sc_save_image "clock - ${clock_name}" reports/images/clocks/${sc_design}.${clock_name}.png
|
|
264
|
+
}
|
|
253
265
|
}
|
|
254
266
|
|
|
255
267
|
foreach {clock state} $clock_state {
|
|
@@ -306,21 +318,39 @@ proc sc_image_optimizer { } {
|
|
|
306
318
|
sc_save_image "optimizer" reports/images/${sc_design}.optimizer.png
|
|
307
319
|
}
|
|
308
320
|
|
|
321
|
+
proc sc_image_markers { } {
|
|
322
|
+
global sc_design
|
|
323
|
+
sc_image_setup_default
|
|
324
|
+
|
|
325
|
+
file mkdir reports/images/markers
|
|
326
|
+
foreach markerdb [[ord::get_db_block] getMarkerCategories] {
|
|
327
|
+
if { [$markerdb getMarkerCount] == 0 } {
|
|
328
|
+
continue
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
gui::select_marker_category $markerdb
|
|
332
|
+
|
|
333
|
+
sc_save_image \
|
|
334
|
+
"markers - [$markerdb getName]" \
|
|
335
|
+
reports/images/markers/${sc_design}.[$markerdb getName].png
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
gui::select_marker_category NULL
|
|
339
|
+
}
|
|
340
|
+
|
|
309
341
|
# Setup
|
|
310
342
|
file mkdir reports/images
|
|
311
343
|
gui::save_display_controls
|
|
312
344
|
sc_image_setup_default
|
|
313
345
|
|
|
314
|
-
if { [file exists reports/${sc_design}_drc.rpt] } {
|
|
315
|
-
# Show the drc markers (if any)
|
|
316
|
-
gui::load_drc reports/${sc_design}_drc.rpt
|
|
317
|
-
}
|
|
318
|
-
|
|
319
346
|
# General images
|
|
320
347
|
sc_image_everything
|
|
321
348
|
sc_image_placement
|
|
322
349
|
sc_image_routing
|
|
323
350
|
|
|
351
|
+
# Markers
|
|
352
|
+
sc_image_markers
|
|
353
|
+
|
|
324
354
|
# Heatmaps
|
|
325
355
|
if { [sc_cfg_tool_task_check_in_list placement_density var reports] } {
|
|
326
356
|
sc_image_placement_density
|
|
@@ -55,7 +55,17 @@ foreach lib "$sc_targetlibs $sc_macrolibs" {
|
|
|
55
55
|
|
|
56
56
|
# Report cells
|
|
57
57
|
foreach cell [get_lib_cells *] {
|
|
58
|
-
|
|
58
|
+
set desc ""
|
|
59
|
+
if { [get_property $cell is_buffer] } {
|
|
60
|
+
set desc " (buffer)"
|
|
61
|
+
} elseif { [get_property $cell is_inverter] } {
|
|
62
|
+
set desc " (inverter)"
|
|
63
|
+
} elseif {
|
|
64
|
+
[llength [get_lib_pins -quiet [get_full_name $cell]/* -filter is_register_clock==1]] != 0
|
|
65
|
+
} {
|
|
66
|
+
set desc " (register)"
|
|
67
|
+
}
|
|
68
|
+
puts "[get_full_name $cell]$desc"
|
|
59
69
|
|
|
60
70
|
set pins [get_lib_pins -quiet [get_full_name $cell]/*]
|
|
61
71
|
if { [llength $pins] == 0 } {
|
|
@@ -61,24 +61,36 @@ def setup(chip):
|
|
|
61
61
|
field='help')
|
|
62
62
|
chip.set('tool', tool, 'task', task, 'var', 'enable_lowmem', 'false',
|
|
63
63
|
step=step, index=index, clobber=False)
|
|
64
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
65
|
+
','.join(['tool', tool, 'task', task, 'var', 'enable_lowmem']),
|
|
66
|
+
step=step, index=index)
|
|
64
67
|
|
|
65
68
|
chip.set('tool', tool, 'task', task, 'var', 'disable_write_cache',
|
|
66
69
|
'true/false, when true instructs Surelog to not write to its cache.',
|
|
67
70
|
field='help')
|
|
68
71
|
chip.set('tool', tool, 'task', task, 'var', 'disable_write_cache', 'false',
|
|
69
72
|
step=step, index=index, clobber=False)
|
|
73
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
74
|
+
','.join(['tool', tool, 'task', task, 'var', 'disable_write_cache']),
|
|
75
|
+
step=step, index=index)
|
|
70
76
|
|
|
71
77
|
chip.set('tool', tool, 'task', task, 'var', 'disable_info',
|
|
72
78
|
'true/false, when true instructs Surelog to not log infos.',
|
|
73
79
|
field='help')
|
|
74
80
|
chip.set('tool', tool, 'task', task, 'var', 'disable_info', 'false',
|
|
75
81
|
step=step, index=index, clobber=False)
|
|
82
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
83
|
+
','.join(['tool', tool, 'task', task, 'var', 'disable_info']),
|
|
84
|
+
step=step, index=index)
|
|
76
85
|
|
|
77
86
|
chip.set('tool', tool, 'task', task, 'var', 'disable_note',
|
|
78
87
|
'true/false, when true instructs Surelog to not log notes.',
|
|
79
88
|
field='help')
|
|
80
89
|
chip.set('tool', tool, 'task', task, 'var', 'disable_note', 'false',
|
|
81
90
|
step=step, index=index, clobber=False)
|
|
91
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
92
|
+
','.join(['tool', tool, 'task', task, 'var', 'disable_note']),
|
|
93
|
+
step=step, index=index)
|
|
82
94
|
|
|
83
95
|
|
|
84
96
|
def parse_version(stdout):
|
|
@@ -34,24 +34,42 @@ def setup(chip):
|
|
|
34
34
|
if mode not in (['cc'], ['systemc']):
|
|
35
35
|
chip.error(f"Invalid mode {mode} provided to verilator/compile. Expected one of 'cc' or "
|
|
36
36
|
"'systemc'")
|
|
37
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
38
|
+
','.join(['tool', tool, 'task', task, 'var', 'mode']),
|
|
39
|
+
step=step, index=index)
|
|
37
40
|
|
|
38
41
|
trace_type = chip.get('tool', tool, 'task', task, 'var', 'trace_type', step=step, index=index)
|
|
39
42
|
if trace_type not in (['vcd'], ['fst']):
|
|
40
43
|
chip.error(f"Invalid trace type {trace_type} provided to verilator/compile. Expected "
|
|
41
44
|
"one of 'vcd' or 'fst'.")
|
|
45
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
46
|
+
','.join(['tool', tool, 'task', task, 'var', 'trace_type']),
|
|
47
|
+
step=step, index=index)
|
|
42
48
|
|
|
43
49
|
chip.set('tool', tool, 'task', task, 'var', 'cflags',
|
|
44
50
|
'flags to provide to the C++ compiler invoked by Verilator',
|
|
45
51
|
field='help')
|
|
52
|
+
if chip.get('tool', tool, 'task', task, 'var', 'cflags', step=step, index=index):
|
|
53
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
54
|
+
','.join(['tool', tool, 'task', task, 'var', 'cflags']),
|
|
55
|
+
step=step, index=index)
|
|
46
56
|
|
|
47
57
|
chip.set('tool', tool, 'task', task, 'var', 'ldflags',
|
|
48
58
|
'flags to provide to the linker invoked by Verilator',
|
|
49
59
|
field='help')
|
|
60
|
+
if chip.get('tool', tool, 'task', task, 'var', 'ldflags', step=step, index=index):
|
|
61
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
62
|
+
','.join(['tool', tool, 'task', task, 'var', 'ldflags']),
|
|
63
|
+
step=step, index=index)
|
|
50
64
|
|
|
51
65
|
chip.set('tool', tool, 'task', task, 'var', 'pins_bv',
|
|
52
66
|
'controls datatypes used to represent SystemC inputs/outputs. See --pins-bv in '
|
|
53
67
|
'Verilator docs for more info.',
|
|
54
68
|
field='help')
|
|
69
|
+
if chip.get('tool', tool, 'task', task, 'var', 'pins_bv', step=step, index=index):
|
|
70
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
71
|
+
','.join(['tool', tool, 'task', task, 'var', 'pins_bv']),
|
|
72
|
+
step=step, index=index)
|
|
55
73
|
|
|
56
74
|
chip.set('tool', tool, 'task', task, 'var', 'mode',
|
|
57
75
|
"defines compilation mode for Verilator. Valid options are 'cc' for C++, or 'systemc' "
|
|
@@ -61,10 +79,19 @@ def setup(chip):
|
|
|
61
79
|
chip.set('tool', tool, 'task', task, 'dir', 'cincludes',
|
|
62
80
|
'include directories to provide to the C++ compiler invoked by Verilator',
|
|
63
81
|
field='help')
|
|
82
|
+
if chip.get('tool', tool, 'task', task, 'dir', 'cincludes', step=step, index=index):
|
|
83
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
84
|
+
','.join(['tool', tool, 'task', task, 'dir', 'cincludes']),
|
|
85
|
+
step=step, index=index)
|
|
64
86
|
|
|
65
87
|
chip.set('tool', tool, 'task', task, 'var', 'trace',
|
|
66
88
|
"if true, enables trace generation.",
|
|
67
89
|
field='help')
|
|
90
|
+
if chip.get('tool', tool, 'task', task, 'var', 'trace', step=step, index=index):
|
|
91
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
92
|
+
','.join(['tool', tool, 'task', task, 'var', 'trace']),
|
|
93
|
+
step=step, index=index)
|
|
94
|
+
|
|
68
95
|
chip.set('tool', tool, 'task', task, 'var', 'trace_type',
|
|
69
96
|
"specifies type of wave file to create when [trace] is set. Valid options are "
|
|
70
97
|
"'vcd' or 'fst'. Defaults to 'vcd'.",
|
|
@@ -71,6 +71,10 @@ def setup(chip):
|
|
|
71
71
|
chip.set('tool', tool, 'task', task, 'file', 'config',
|
|
72
72
|
'Verilator configuration file',
|
|
73
73
|
field='help')
|
|
74
|
+
if chip.get('tool', tool, 'task', task, 'file', 'config', step=step, index=index):
|
|
75
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
76
|
+
','.join(['tool', tool, 'task', task, 'file', 'config']),
|
|
77
|
+
step=step, index=index)
|
|
74
78
|
|
|
75
79
|
chip.set('tool', tool, 'task', task, 'var', 'enable_assert',
|
|
76
80
|
'true/false, when true assertions are enabled in Verilator.',
|
|
@@ -78,6 +82,11 @@ def setup(chip):
|
|
|
78
82
|
chip.set('tool', tool, 'task', task, 'var', 'enable_assert', 'false',
|
|
79
83
|
step=step, index=index, clobber=False)
|
|
80
84
|
|
|
85
|
+
if chip.get('tool', tool, 'task', task, 'var', 'enable_assert', step=step, index=index):
|
|
86
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
87
|
+
','.join(['tool', tool, 'task', task, 'var', 'enable_assert']),
|
|
88
|
+
step=step, index=index)
|
|
89
|
+
|
|
81
90
|
if f'{chip.top()}.v' not in input_provides(chip, step, index):
|
|
82
91
|
add_require_input(chip, 'input', 'rtl', 'verilog')
|
|
83
92
|
add_require_input(chip, 'input', 'rtl', 'systemverilog')
|
siliconcompiler/tools/vpr/vpr.py
CHANGED
|
@@ -66,6 +66,20 @@ def setup_tool(chip, clobber=True):
|
|
|
66
66
|
chip.add('tool', tool, 'task', task, 'require', f'fpga,{part_name},var,{resource}',
|
|
67
67
|
step=step, index=index)
|
|
68
68
|
|
|
69
|
+
add_tool_requirements(chip)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def add_tool_requirements(chip):
|
|
73
|
+
|
|
74
|
+
step = chip.get('arg', 'step')
|
|
75
|
+
index = chip.get('arg', 'index')
|
|
76
|
+
tool, task = get_tool_task(chip, step, index)
|
|
77
|
+
|
|
78
|
+
part_name = chip.get('fpga', 'partname')
|
|
79
|
+
|
|
80
|
+
chip.add('tool', tool, 'task', task, 'require', f'fpga,{part_name},var,vpr_device_code',
|
|
81
|
+
step=step, index=index)
|
|
82
|
+
|
|
69
83
|
|
|
70
84
|
def runtime_options(chip):
|
|
71
85
|
|
|
@@ -76,6 +90,10 @@ def runtime_options(chip):
|
|
|
76
90
|
|
|
77
91
|
options = []
|
|
78
92
|
|
|
93
|
+
device_code = chip.get('fpga', part_name, 'var', 'vpr_device_code')
|
|
94
|
+
|
|
95
|
+
options.append(f"--device {device_code[0]}")
|
|
96
|
+
|
|
79
97
|
options.append(f"--write_block_usage {__block_file}")
|
|
80
98
|
options.append("--outfile_prefix outputs/")
|
|
81
99
|
|
|
@@ -7,7 +7,7 @@ and small-scale parallel runs on Unix-like systems.
|
|
|
7
7
|
|
|
8
8
|
Documentation: https://xyce.sandia.gov/documentation-tutorials/
|
|
9
9
|
|
|
10
|
-
Sources: https://
|
|
10
|
+
Sources: https://xyce.sandia.gov/downloads/source-code/
|
|
11
11
|
|
|
12
12
|
Installation: https://xyce.sandia.gov/documentation-tutorials/building-guide/
|
|
13
13
|
|
|
@@ -29,3 +29,26 @@ proc sc_map_memory { lib_file techmap_file do_rom } {
|
|
|
29
29
|
|
|
30
30
|
return $design_mod
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
proc sc_apply_params { } {
|
|
34
|
+
global sc_design
|
|
35
|
+
|
|
36
|
+
yosys chparam -list $sc_design
|
|
37
|
+
if { [sc_cfg_exists option param] } {
|
|
38
|
+
yosys echo off
|
|
39
|
+
set module_params [yosys tee -q -s result.string chparam -list $sc_design]
|
|
40
|
+
yosys echo on
|
|
41
|
+
|
|
42
|
+
dict for {key value} [sc_cfg_get option param] {
|
|
43
|
+
if { ![string is integer $value] } {
|
|
44
|
+
set value [concat \"$value\"]
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if { [string first $key $module_params] != -1 } {
|
|
48
|
+
yosys chparam -set $key $value $sc_design
|
|
49
|
+
} else {
|
|
50
|
+
puts "Warning: $key is not a defined parameter in $sc_design"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
###############################
|
|
2
|
+
# Reading SC Schema
|
|
3
|
+
###############################
|
|
4
|
+
|
|
5
|
+
source ./sc_manifest.tcl
|
|
6
|
+
|
|
7
|
+
yosys echo on
|
|
8
|
+
|
|
9
|
+
###############################
|
|
10
|
+
# Schema Adapter
|
|
11
|
+
###############################
|
|
12
|
+
|
|
13
|
+
set sc_tool yosys
|
|
14
|
+
set sc_step [sc_cfg_get arg step]
|
|
15
|
+
set sc_index [sc_cfg_get arg index]
|
|
16
|
+
set sc_flow [sc_cfg_get option flow]
|
|
17
|
+
set sc_task [sc_cfg_get flowgraph $sc_flow $sc_step $sc_index task]
|
|
18
|
+
set sc_refdir [sc_cfg_tool_task_get refdir]
|
|
19
|
+
|
|
20
|
+
####################
|
|
21
|
+
# DESIGNER's CHOICE
|
|
22
|
+
####################
|
|
23
|
+
|
|
24
|
+
set sc_design [sc_top]
|
|
25
|
+
|
|
26
|
+
########################################################
|
|
27
|
+
# Helper function
|
|
28
|
+
########################################################
|
|
29
|
+
|
|
30
|
+
source "$sc_refdir/procs.tcl"
|
|
31
|
+
|
|
32
|
+
########################################################
|
|
33
|
+
# Design Inputs
|
|
34
|
+
########################################################
|
|
35
|
+
|
|
36
|
+
if { [file exists "inputs/$sc_design.v"] } {
|
|
37
|
+
set input_verilog "inputs/$sc_design.v"
|
|
38
|
+
yosys read_verilog -noblackbox -sv $input_verilog
|
|
39
|
+
set file_type "v"
|
|
40
|
+
} elseif { [file exists "inputs/$sc_design.vg"] } {
|
|
41
|
+
set input_verilog "inputs/$sc_design.vg"
|
|
42
|
+
yosys read_verilog -noblackbox -sv $input_verilog
|
|
43
|
+
set file_type "vg"
|
|
44
|
+
} elseif { [sc_cfg_tool_task_exists var show_filepath] } {
|
|
45
|
+
yosys read_verilog -noblackbox -sv [sc_cfg_tool_task_get var show_filepath]
|
|
46
|
+
set file_type [lindex [sc_cfg_tool_task_get var show_filetype] 0]
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
########################################################
|
|
50
|
+
# Override top level parameters
|
|
51
|
+
########################################################
|
|
52
|
+
|
|
53
|
+
sc_apply_params
|
|
54
|
+
|
|
55
|
+
########################################################
|
|
56
|
+
# Read Libraries
|
|
57
|
+
########################################################
|
|
58
|
+
|
|
59
|
+
set sc_logiclibs [sc_get_asic_libraries logic]
|
|
60
|
+
set sc_macrolibs [sc_get_asic_libraries macro]
|
|
61
|
+
|
|
62
|
+
set sc_libraries [sc_cfg_tool_task_get {file} synthesis_libraries]
|
|
63
|
+
if { [sc_cfg_tool_task_exists {file} synthesis_libraries_macros] } {
|
|
64
|
+
set sc_macro_libraries \
|
|
65
|
+
[sc_cfg_tool_task_get {file} synthesis_libraries_macros]
|
|
66
|
+
} else {
|
|
67
|
+
set sc_macro_libraries []
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
set sc_blackboxes []
|
|
71
|
+
foreach lib $sc_macrolibs {
|
|
72
|
+
if { [sc_cfg_exists library $lib output blackbox verilog] } {
|
|
73
|
+
foreach lib_f [sc_cfg_get library $lib output blackbox verilog] {
|
|
74
|
+
lappend sc_blackboxes $lib_f
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
foreach lib_file "$sc_libraries $sc_macro_libraries" {
|
|
80
|
+
yosys read_liberty -lib $lib_file
|
|
81
|
+
}
|
|
82
|
+
foreach bb_file $sc_blackboxes {
|
|
83
|
+
yosys log "Reading blackbox model file: $bb_file"
|
|
84
|
+
yosys read_verilog -sv $bb_file
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
########################################################
|
|
88
|
+
# Screenshot
|
|
89
|
+
########################################################
|
|
90
|
+
|
|
91
|
+
yosys hierarchy -top $sc_design
|
|
92
|
+
|
|
93
|
+
if { $file_type == "v" } {
|
|
94
|
+
yosys proc
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
yosys show \
|
|
98
|
+
-nobg \
|
|
99
|
+
-format png \
|
|
100
|
+
-width \
|
|
101
|
+
-signed \
|
|
102
|
+
-stretch \
|
|
103
|
+
-prefix outputs/${sc_design} \
|
|
104
|
+
$sc_design
|
|
@@ -26,6 +26,12 @@ set sc_flow [sc_cfg_get option flow]
|
|
|
26
26
|
set sc_optmode [sc_cfg_get option optmode]
|
|
27
27
|
set sc_pdk [sc_cfg_get option pdk]
|
|
28
28
|
|
|
29
|
+
########################################################
|
|
30
|
+
# Helper function
|
|
31
|
+
########################################################
|
|
32
|
+
|
|
33
|
+
source "$sc_refdir/procs.tcl"
|
|
34
|
+
|
|
29
35
|
########################################################
|
|
30
36
|
# Design Inputs
|
|
31
37
|
########################################################
|
|
@@ -57,15 +63,7 @@ if { [file exists "inputs/$sc_design.v"] } {
|
|
|
57
63
|
# Override top level parameters
|
|
58
64
|
########################################################
|
|
59
65
|
|
|
60
|
-
|
|
61
|
-
if { [sc_cfg_exists option param] } {
|
|
62
|
-
dict for {key value} [sc_cfg_get option param] {
|
|
63
|
-
if { ![string is integer $value] } {
|
|
64
|
-
set value [concat \"$value\"]
|
|
65
|
-
}
|
|
66
|
-
yosys chparam -set $key $value $sc_design
|
|
67
|
-
}
|
|
68
|
-
}
|
|
66
|
+
sc_apply_params
|
|
69
67
|
|
|
70
68
|
########################################################
|
|
71
69
|
# Synthesis based on mode
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
from siliconcompiler.tools.yosys.yosys import setup as tool_setup
|
|
2
|
+
import os
|
|
3
|
+
import siliconcompiler.tools.yosys.prepareLib as prepareLib
|
|
4
|
+
from siliconcompiler.tools._common.asic import get_libraries
|
|
5
|
+
from siliconcompiler.tools._common import get_tool_task
|
|
6
|
+
from siliconcompiler.targets import asap7_demo
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def make_docs(chip):
|
|
10
|
+
chip.use(asap7_demo)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def setup(chip):
|
|
14
|
+
'''
|
|
15
|
+
Generate a screenshot of the design
|
|
16
|
+
'''
|
|
17
|
+
|
|
18
|
+
# Generic tool setup.
|
|
19
|
+
tool_setup(chip)
|
|
20
|
+
|
|
21
|
+
# ASIC-specific setup.
|
|
22
|
+
# setup_asic(chip)
|
|
23
|
+
|
|
24
|
+
step = chip.get('arg', 'step')
|
|
25
|
+
index = chip.get('arg', 'index')
|
|
26
|
+
tool, task = get_tool_task(chip, step, index)
|
|
27
|
+
chip.set('tool', tool, 'task', task, 'input', [], step=step, index=index)
|
|
28
|
+
chip.set('tool', tool, 'task', task, 'script', 'sc_screenshot.tcl',
|
|
29
|
+
step=step, index=index)
|
|
30
|
+
|
|
31
|
+
design = chip.top()
|
|
32
|
+
chip.set('tool', tool, 'task', task, 'output', [design + '.dot', design + '.png'],
|
|
33
|
+
step=step, index=index)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
################################
|
|
37
|
+
# format liberty files for yosys
|
|
38
|
+
################################
|
|
39
|
+
def prepare_asic_libraries(chip):
|
|
40
|
+
step = chip.get('arg', 'step')
|
|
41
|
+
index = chip.get('arg', 'index')
|
|
42
|
+
tool, task = get_tool_task(chip, step, index)
|
|
43
|
+
|
|
44
|
+
# Clear in case of rerun
|
|
45
|
+
for libtype in ('synthesis_libraries', 'synthesis_libraries_macros'):
|
|
46
|
+
chip.set('tool', tool, 'task', task, 'file', libtype, [],
|
|
47
|
+
step=step, index=index)
|
|
48
|
+
|
|
49
|
+
# Generate synthesis_libraries and synthesis_macro_libraries for Yosys use
|
|
50
|
+
|
|
51
|
+
# mark libs with dont_use since ABC cannot get this information via its commands
|
|
52
|
+
# this also ensures the liberty files have been decompressed and corrected formatting
|
|
53
|
+
# issues that generally cannot be handled by yosys or yosys-abc
|
|
54
|
+
def get_synthesis_libraries(lib):
|
|
55
|
+
keypath = _get_synthesis_library_key(chip, lib)
|
|
56
|
+
if keypath and chip.valid(*keypath):
|
|
57
|
+
return chip.find_files(*keypath, step=step, index=index)
|
|
58
|
+
return []
|
|
59
|
+
|
|
60
|
+
for libtype in ('logic', 'macro'):
|
|
61
|
+
for lib in get_libraries(chip, libtype):
|
|
62
|
+
lib_content = {}
|
|
63
|
+
# Mark dont use
|
|
64
|
+
for lib_file in get_synthesis_libraries(lib):
|
|
65
|
+
# Ensure a unique name is used for library
|
|
66
|
+
lib_file_name_base = os.path.basename(lib_file)
|
|
67
|
+
if lib_file_name_base.lower().endswith('.gz'):
|
|
68
|
+
lib_file_name_base = lib_file_name_base[0:-3]
|
|
69
|
+
if lib_file_name_base.lower().endswith('.lib'):
|
|
70
|
+
lib_file_name_base = lib_file_name_base[0:-4]
|
|
71
|
+
|
|
72
|
+
lib_file_name = lib_file_name_base
|
|
73
|
+
unique_ident = 0
|
|
74
|
+
while lib_file_name in lib_content:
|
|
75
|
+
lib_file_name = f'{lib_file_name_base}_{unique_ident}'
|
|
76
|
+
unique_ident += 1
|
|
77
|
+
|
|
78
|
+
lib_content[lib_file_name] = prepareLib.processLibertyFile(
|
|
79
|
+
lib_file,
|
|
80
|
+
logger=None if chip.get('option', 'quiet',
|
|
81
|
+
step=step, index=index) else chip.logger)
|
|
82
|
+
|
|
83
|
+
if not lib_content:
|
|
84
|
+
continue
|
|
85
|
+
|
|
86
|
+
var_name = 'synthesis_libraries'
|
|
87
|
+
if libtype == "macro":
|
|
88
|
+
var_name = 'synthesis_libraries_macros'
|
|
89
|
+
|
|
90
|
+
for file, content in lib_content.items():
|
|
91
|
+
output_file = os.path.join(
|
|
92
|
+
chip.getworkdir(step=step, index=index),
|
|
93
|
+
'inputs',
|
|
94
|
+
f'sc_{libtype}_{lib}_{file}.lib'
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
with open(output_file, 'w') as f:
|
|
98
|
+
f.write(content)
|
|
99
|
+
|
|
100
|
+
chip.add('tool', tool, 'task', task, 'file', var_name, output_file,
|
|
101
|
+
step=step, index=index)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def get_synthesis_corner(chip):
|
|
105
|
+
tool = 'yosys'
|
|
106
|
+
step = chip.get('arg', 'step')
|
|
107
|
+
index = chip.get('arg', 'index')
|
|
108
|
+
_, task = get_tool_task(chip, step, index)
|
|
109
|
+
|
|
110
|
+
syn_corners = chip.get('tool', tool, 'task', task, 'var', 'synthesis_corner',
|
|
111
|
+
step=step, index=index)
|
|
112
|
+
if syn_corners:
|
|
113
|
+
return syn_corners
|
|
114
|
+
|
|
115
|
+
# determine corner based on setup corner from constraints
|
|
116
|
+
corner = None
|
|
117
|
+
for constraint in chip.getkeys('constraint', 'timing'):
|
|
118
|
+
checks = chip.get('constraint', 'timing', constraint, 'check', step=step, index=index)
|
|
119
|
+
if "setup" in checks and not corner:
|
|
120
|
+
corner = chip.get('constraint', 'timing', constraint, 'libcorner',
|
|
121
|
+
step=step, index=index)
|
|
122
|
+
|
|
123
|
+
if not corner:
|
|
124
|
+
# try getting it from first constraint with a valid libcorner
|
|
125
|
+
for constraint in chip.getkeys('constraint', 'timing'):
|
|
126
|
+
if not corner:
|
|
127
|
+
corner = chip.get('constraint', 'timing', constraint, 'libcorner',
|
|
128
|
+
step=step, index=index)
|
|
129
|
+
|
|
130
|
+
return corner
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def _get_synthesis_library_key(chip, lib):
|
|
134
|
+
if chip.valid('library', lib, 'option', 'file', 'yosys_synthesis_libraries'):
|
|
135
|
+
return ('library', lib, 'option', 'file', 'yosys_synthesis_libraries')
|
|
136
|
+
|
|
137
|
+
step = chip.get('arg', 'step')
|
|
138
|
+
index = chip.get('arg', 'index')
|
|
139
|
+
delaymodel = chip.get('asic', 'delaymodel', step=step, index=index)
|
|
140
|
+
|
|
141
|
+
for corner in chip.getkeys('library', lib, 'output'):
|
|
142
|
+
if chip.valid('library', lib, 'output', corner, delaymodel):
|
|
143
|
+
return ('library', lib, 'output', corner, delaymodel)
|
|
144
|
+
|
|
145
|
+
return None
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
##################################################
|
|
149
|
+
def pre_process(chip):
|
|
150
|
+
''' Tool specific function to run before step execution
|
|
151
|
+
'''
|
|
152
|
+
|
|
153
|
+
prepare_asic_libraries(chip)
|
|
@@ -74,6 +74,7 @@ def setup_asic(chip):
|
|
|
74
74
|
mainlib = get_mainlib(chip)
|
|
75
75
|
for option, value in [
|
|
76
76
|
('flatten', "true"),
|
|
77
|
+
('auto_flatten', "true"),
|
|
77
78
|
('hier_iterations', "10"),
|
|
78
79
|
('hier_threshold', "1000"),
|
|
79
80
|
('autoname', "true"),
|
|
@@ -171,6 +172,8 @@ def setup_asic(chip):
|
|
|
171
172
|
chip.set('tool', tool, 'task', task, 'var', 'add_buffers',
|
|
172
173
|
'true/false, flag to indicate whether to add buffers or not.', field='help')
|
|
173
174
|
|
|
175
|
+
chip.set('tool', tool, 'task', task, 'var', 'auto_flatten',
|
|
176
|
+
'true/false, attempt to determine how to flatten the design', field='help')
|
|
174
177
|
chip.set('tool', tool, 'task', task, 'var', 'hier_iterations',
|
|
175
178
|
'Number of iterations to attempt to determine the hierarchy to flatten',
|
|
176
179
|
field='help')
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
####################
|
|
2
2
|
# Helper functions
|
|
3
3
|
####################
|
|
4
|
-
source "$sc_refdir/syn_asic_fpga_shared.tcl"
|
|
5
|
-
|
|
6
4
|
proc preserve_modules { } {
|
|
7
5
|
global sc_cfg
|
|
8
6
|
global sc_tool
|
|
@@ -232,7 +230,7 @@ yosys synth {*}$synth_args -top $sc_design -run begin:fine
|
|
|
232
230
|
sc_map_memory $sc_memory_libmap_files $sc_memory_techmap_files 0
|
|
233
231
|
|
|
234
232
|
# Perform hierarchy flattening
|
|
235
|
-
if { !$flatten_design } {
|
|
233
|
+
if { !$flatten_design && [lindex [sc_cfg_tool_task_get var auto_flatten] 0] == "true" } {
|
|
236
234
|
set sc_hier_iterations \
|
|
237
235
|
[lindex [sc_cfg_tool_task_get var hier_iterations] 0]
|
|
238
236
|
set sc_hier_threshold \
|
|
@@ -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": "1531ad983bfe91384e9253769fdc5f8dcf24fea8",
|
|
5
5
|
"docker-cmds": [
|
|
6
6
|
"# Remove OR-Tools files",
|
|
7
7
|
"RUN rm -f $SC_PREFIX/Makefile $SC_PREFIX/README.md",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"auto-update": false
|
|
37
37
|
},
|
|
38
38
|
"klayout": {
|
|
39
|
-
"version": "0.29.
|
|
39
|
+
"version": "0.29.8",
|
|
40
40
|
"git-url": "https://github.com/KLayout/klayout.git",
|
|
41
41
|
"docker-skip": true,
|
|
42
42
|
"auto-update": true,
|
|
@@ -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": "7808819c48c167978aeb5ef34c6e5ed416e90875",
|
|
49
49
|
"auto-update": true
|
|
50
50
|
},
|
|
51
51
|
"verilator": {
|
|
@@ -91,13 +91,12 @@
|
|
|
91
91
|
},
|
|
92
92
|
"yosys": {
|
|
93
93
|
"git-url": "https://github.com/YosysHQ/yosys.git",
|
|
94
|
-
"git-commit": "0.
|
|
94
|
+
"git-commit": "0.47",
|
|
95
95
|
"version-prefix": "",
|
|
96
96
|
"auto-update": true
|
|
97
97
|
},
|
|
98
98
|
"xyce": {
|
|
99
|
-
"
|
|
100
|
-
"version": "7.8.0",
|
|
99
|
+
"version": "7.8",
|
|
101
100
|
"auto-update": false
|
|
102
101
|
},
|
|
103
102
|
"xdm": {
|