siliconcompiler 0.32.0__py3-none-any.whl → 0.32.2__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 +23 -6
- siliconcompiler/apps/sc_dashboard.py +7 -1
- siliconcompiler/apps/sc_install.py +13 -5
- siliconcompiler/apps/sc_remote.py +2 -1
- siliconcompiler/apps/sc_show.py +6 -0
- siliconcompiler/core.py +34 -16
- siliconcompiler/fpgas/lattice_ice40.py +6 -16
- siliconcompiler/package/__init__.py +11 -55
- siliconcompiler/package/github.py +124 -0
- siliconcompiler/package/https.py +6 -0
- siliconcompiler/report/dashboard/components/__init__.py +2 -1
- siliconcompiler/report/dashboard/components/flowgraph.py +3 -0
- siliconcompiler/report/dashboard/utils/__init__.py +5 -2
- siliconcompiler/report/utils.py +3 -0
- siliconcompiler/scheduler/__init__.py +37 -8
- siliconcompiler/scheduler/docker_runner.py +2 -1
- siliconcompiler/schema/schema_obj.py +3 -2
- siliconcompiler/schema/utils.py +0 -3
- siliconcompiler/sphinx_ext/dynamicgen.py +11 -11
- siliconcompiler/targets/fpgaflow_demo.py +0 -2
- siliconcompiler/templates/tcl/manifest.tcl.j2 +4 -120
- siliconcompiler/tools/_common/tcl/sc_schema_access.tcl +126 -0
- siliconcompiler/tools/openroad/_apr.py +3 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_repair_timing.tcl +53 -7
- siliconcompiler/tools/openroad/scripts/common/procs.tcl +19 -1
- siliconcompiler/tools/openroad/scripts/common/reports.tcl +16 -5
- siliconcompiler/tools/slang/__init__.py +7 -8
- siliconcompiler/tools/sv2v/sv2v.py +4 -1
- siliconcompiler/tools/yosys/__init__.py +4 -36
- siliconcompiler/tools/yosys/lec.py +3 -4
- siliconcompiler/tools/yosys/{syn_asic.tcl → sc_synth_asic.tcl} +79 -0
- siliconcompiler/tools/yosys/{syn_fpga.tcl → sc_synth_fpga.tcl} +78 -0
- siliconcompiler/tools/yosys/syn_asic.py +26 -10
- siliconcompiler/tools/yosys/syn_fpga.py +23 -16
- siliconcompiler/toolscripts/_tools.json +18 -9
- siliconcompiler/toolscripts/rhel9/install-gtkwave.sh +1 -1
- siliconcompiler/toolscripts/rhel9/install-vpr.sh +29 -0
- siliconcompiler/toolscripts/rhel9/install-yosys-parmys.sh +59 -0
- siliconcompiler/toolscripts/ubuntu20/install-yosys-parmys.sh +59 -0
- siliconcompiler/toolscripts/ubuntu22/install-bluespec.sh +25 -2
- siliconcompiler/toolscripts/ubuntu22/install-ghdl.sh +2 -2
- siliconcompiler/toolscripts/ubuntu22/install-yosys-parmys.sh +59 -0
- siliconcompiler/toolscripts/ubuntu24/install-ghdl.sh +2 -2
- siliconcompiler/toolscripts/ubuntu24/install-icarus.sh +2 -1
- siliconcompiler/toolscripts/ubuntu24/install-netgen.sh +1 -1
- siliconcompiler/toolscripts/ubuntu24/install-yosys-parmys.sh +59 -0
- siliconcompiler/utils/__init__.py +9 -15
- siliconcompiler/utils/logging.py +1 -1
- {siliconcompiler-0.32.0.dist-info → siliconcompiler-0.32.2.dist-info}/METADATA +12 -9
- {siliconcompiler-0.32.0.dist-info → siliconcompiler-0.32.2.dist-info}/RECORD +55 -55
- {siliconcompiler-0.32.0.dist-info → siliconcompiler-0.32.2.dist-info}/WHEEL +1 -1
- {siliconcompiler-0.32.0.dist-info → siliconcompiler-0.32.2.dist-info}/entry_points.txt +1 -0
- siliconcompiler/fpgas/vpr_example.py +0 -116
- siliconcompiler/tools/yosys/sc_syn.tcl +0 -87
- siliconcompiler/toolscripts/rhel8/install-ghdl.sh +0 -25
- siliconcompiler/toolscripts/rhel8/install-yosys-moosic.sh +0 -17
- siliconcompiler/toolscripts/rhel8/install-yosys-slang.sh +0 -22
- siliconcompiler/toolscripts/rhel8/install-yosys.sh +0 -23
- siliconcompiler/toolscripts/ubuntu20/install-yosys-slang.sh +0 -22
- {siliconcompiler-0.32.0.dist-info → siliconcompiler-0.32.2.dist-info/licenses}/LICENSE +0 -0
- {siliconcompiler-0.32.0.dist-info → siliconcompiler-0.32.2.dist-info}/top_level.txt +0 -0
|
@@ -112,13 +112,24 @@ if { [sc_cfg_tool_task_check_in_list fmax var reports] } {
|
|
|
112
112
|
}
|
|
113
113
|
if { $fmax_metric == 0 } {
|
|
114
114
|
# attempt to compute based on combinatorial path
|
|
115
|
+
set fmax_valid true
|
|
115
116
|
set max_path [find_timing_paths -unconstrained -path_delay max]
|
|
116
|
-
|
|
117
|
+
if { $max_path == "" } {
|
|
118
|
+
set fmax_valid false
|
|
119
|
+
} else {
|
|
120
|
+
set max_path_delay [$max_path data_arrival_time]
|
|
121
|
+
}
|
|
117
122
|
set min_path [find_timing_paths -unconstrained -path_delay min]
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
set
|
|
123
|
+
if { $min_path == "" } {
|
|
124
|
+
set fmax_valid false
|
|
125
|
+
} else {
|
|
126
|
+
set min_path_delay [$min_path data_arrival_time]
|
|
127
|
+
}
|
|
128
|
+
if { $fmax_valid } {
|
|
129
|
+
set path_delay [expr { $max_path_delay - min(0, $min_path_delay) }]
|
|
130
|
+
if { $path_delay > 0 } {
|
|
131
|
+
set fmax_metric [expr { 1.0 / $path_delay }]
|
|
132
|
+
}
|
|
122
133
|
}
|
|
123
134
|
}
|
|
124
135
|
if { $fmax_metric > 0 } {
|
|
@@ -151,7 +151,7 @@ def _get_driver(chip, options_func, ignored_diagnotics=None):
|
|
|
151
151
|
driver.diagEngine.setSeverity(
|
|
152
152
|
getattr(pyslang.Diags, warning),
|
|
153
153
|
pyslang.DiagnosticSeverity.Ignored)
|
|
154
|
-
|
|
154
|
+
else:
|
|
155
155
|
chip.logger.warning(f'{warning} is not a valid slang category')
|
|
156
156
|
|
|
157
157
|
if not ignored_diagnotics:
|
|
@@ -200,13 +200,12 @@ def _diagnostics(chip, driver, compilation):
|
|
|
200
200
|
|
|
201
201
|
report[report_level].append(line)
|
|
202
202
|
|
|
203
|
-
if
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
chip.logger.error(line)
|
|
203
|
+
if report["warning"]:
|
|
204
|
+
for line in report["warning"]:
|
|
205
|
+
chip.logger.warning(line)
|
|
206
|
+
if report["error"]:
|
|
207
|
+
for line in report["error"]:
|
|
208
|
+
chip.logger.error(line)
|
|
210
209
|
|
|
211
210
|
diags.clearCounts()
|
|
212
211
|
for diag in compilation.getAllDiagnostics():
|
|
@@ -26,7 +26,10 @@ def make_docs(chip):
|
|
|
26
26
|
|
|
27
27
|
def parse_version(stdout):
|
|
28
28
|
# 0.0.7-130-g1aa30ea
|
|
29
|
-
|
|
29
|
+
stdout = stdout.strip()
|
|
30
|
+
if '-' in stdout:
|
|
31
|
+
return '-'.join(stdout.split('-')[:-1])
|
|
32
|
+
return stdout
|
|
30
33
|
|
|
31
34
|
|
|
32
35
|
##################################################
|
|
@@ -34,12 +34,9 @@ def setup(chip):
|
|
|
34
34
|
''' Tool specific function to run before step execution
|
|
35
35
|
'''
|
|
36
36
|
|
|
37
|
-
# If the 'lock' bit is set, don't reconfigure.
|
|
38
|
-
tool = 'yosys'
|
|
39
|
-
refdir = 'tools/' + tool
|
|
40
37
|
step = chip.get('arg', 'step')
|
|
41
38
|
index = chip.get('arg', 'index')
|
|
42
|
-
|
|
39
|
+
tool, task = get_tool_task(chip, step, index)
|
|
43
40
|
|
|
44
41
|
# Standard Setup
|
|
45
42
|
chip.set('tool', tool, 'exe', 'yosys')
|
|
@@ -54,7 +51,8 @@ def setup(chip):
|
|
|
54
51
|
option.append('-C')
|
|
55
52
|
option.append('-c')
|
|
56
53
|
chip.set('tool', tool, 'task', task, 'option', option, step=step, index=index, clobber=False)
|
|
57
|
-
chip.set('tool', tool, 'task', task, 'refdir',
|
|
54
|
+
chip.set('tool', tool, 'task', task, 'refdir', os.path.join('tools', tool),
|
|
55
|
+
step=step, index=index,
|
|
58
56
|
package='siliconcompiler', clobber=False)
|
|
59
57
|
chip.set('tool', tool, 'task', task, 'regex', 'warnings', "Warning:",
|
|
60
58
|
step=step, index=index, clobber=False)
|
|
@@ -76,38 +74,8 @@ def normalize_version(version):
|
|
|
76
74
|
return version.replace('+', '-')
|
|
77
75
|
|
|
78
76
|
|
|
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
|
-
chip.set('tool', tool, 'task', task, 'var', 'use_slang', False,
|
|
102
|
-
step=step, index=index,
|
|
103
|
-
clobber=False)
|
|
104
|
-
chip.set('tool', tool, 'task', task, 'var', 'use_slang',
|
|
105
|
-
'true/false, if true will attempt to use the slang frontend',
|
|
106
|
-
field='help')
|
|
107
|
-
|
|
108
|
-
|
|
109
77
|
##################################################
|
|
110
|
-
def
|
|
78
|
+
def synth_post_process(chip):
|
|
111
79
|
''' Tool specific function to run after step execution
|
|
112
80
|
'''
|
|
113
81
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import re
|
|
2
2
|
|
|
3
3
|
from siliconcompiler.tools.yosys import setup as setup_tool
|
|
4
|
-
from siliconcompiler.tools.yosys.syn_asic import
|
|
4
|
+
from siliconcompiler.tools.yosys.syn_asic import prepare_synthesis_libraries, setup_asic
|
|
5
5
|
from siliconcompiler import sc_open
|
|
6
6
|
from siliconcompiler.tools._common import get_tool_task, record_metric, input_provides
|
|
7
7
|
|
|
@@ -14,13 +14,12 @@ def setup(chip):
|
|
|
14
14
|
# Generic tool setup.
|
|
15
15
|
setup_tool(chip)
|
|
16
16
|
|
|
17
|
-
#
|
|
17
|
+
# Setup for asic
|
|
18
18
|
setup_asic(chip)
|
|
19
19
|
|
|
20
|
-
tool = 'yosys'
|
|
21
20
|
step = chip.get('arg', 'step')
|
|
22
21
|
index = chip.get('arg', 'index')
|
|
23
|
-
|
|
22
|
+
tool, task = get_tool_task(chip, step, index)
|
|
24
23
|
design = chip.top()
|
|
25
24
|
|
|
26
25
|
# Set yosys script path.
|
|
@@ -1,3 +1,76 @@
|
|
|
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
|
+
set sc_flow [sc_cfg_get option flow]
|
|
26
|
+
set sc_optmode [sc_cfg_get option optmode]
|
|
27
|
+
set sc_pdk [sc_cfg_get option pdk]
|
|
28
|
+
|
|
29
|
+
########################################################
|
|
30
|
+
# Helper function
|
|
31
|
+
########################################################
|
|
32
|
+
|
|
33
|
+
source "$sc_refdir/procs.tcl"
|
|
34
|
+
|
|
35
|
+
########################################################
|
|
36
|
+
# Design Inputs
|
|
37
|
+
########################################################
|
|
38
|
+
|
|
39
|
+
set input_verilog "inputs/$sc_design.v"
|
|
40
|
+
if { [file exists $input_verilog] } {
|
|
41
|
+
if { [lindex [sc_cfg_tool_task_get var use_slang] 0] == "true" && [sc_load_plugin slang] } {
|
|
42
|
+
# This needs some reordering of loaded to ensure blackboxes are handled
|
|
43
|
+
# before this
|
|
44
|
+
set slang_params []
|
|
45
|
+
if { [sc_cfg_exists option param] } {
|
|
46
|
+
dict for {key value} [sc_cfg_get option param] {
|
|
47
|
+
if { ![string is integer $value] } {
|
|
48
|
+
set value [concat \"$value\"]
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
lappend slang_params -G "${key}=${value}"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
yosys read_slang \
|
|
55
|
+
-D SYNTHESIS \
|
|
56
|
+
--keep-hierarchy \
|
|
57
|
+
--top $sc_design \
|
|
58
|
+
{*}$slang_params \
|
|
59
|
+
$input_verilog
|
|
60
|
+
} else {
|
|
61
|
+
# Use -noblackbox to correctly interpret empty modules as empty,
|
|
62
|
+
# actual black boxes are read in later
|
|
63
|
+
# https://github.com/YosysHQ/yosys/issues/1468
|
|
64
|
+
yosys read_verilog -noblackbox -sv $input_verilog
|
|
65
|
+
|
|
66
|
+
########################################################
|
|
67
|
+
# Override top level parameters
|
|
68
|
+
########################################################
|
|
69
|
+
|
|
70
|
+
sc_apply_params
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
1
74
|
####################
|
|
2
75
|
# Helper functions
|
|
3
76
|
####################
|
|
@@ -416,3 +489,9 @@ foreach lib_file "$sc_libraries $sc_macro_libraries" {
|
|
|
416
489
|
yosys echo off
|
|
417
490
|
yosys tee -o ./reports/stat.json stat -json -top $sc_design {*}$stat_libs
|
|
418
491
|
yosys echo on
|
|
492
|
+
|
|
493
|
+
########################################################
|
|
494
|
+
# Write Netlist
|
|
495
|
+
########################################################
|
|
496
|
+
yosys write_verilog -noexpr -nohex -nodec "outputs/${sc_design}.vg"
|
|
497
|
+
yosys write_json "outputs/${sc_design}.netlist.json"
|
|
@@ -1,3 +1,79 @@
|
|
|
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
|
+
set sc_flow [sc_cfg_get option flow]
|
|
26
|
+
set sc_optmode [sc_cfg_get option optmode]
|
|
27
|
+
set sc_pdk [sc_cfg_get option pdk]
|
|
28
|
+
|
|
29
|
+
########################################################
|
|
30
|
+
# Helper function
|
|
31
|
+
########################################################
|
|
32
|
+
|
|
33
|
+
source "$sc_refdir/procs.tcl"
|
|
34
|
+
|
|
35
|
+
########################################################
|
|
36
|
+
# Design Inputs
|
|
37
|
+
########################################################
|
|
38
|
+
|
|
39
|
+
# TODO: the original OpenFPGA synth script used read_verilog with -nolatches. Is
|
|
40
|
+
# that a flag we might want here?
|
|
41
|
+
|
|
42
|
+
set input_verilog "inputs/$sc_design.v"
|
|
43
|
+
if { [file exists $input_verilog] } {
|
|
44
|
+
if { [lindex [sc_cfg_tool_task_get var use_slang] 0] == "true" && [sc_load_plugin slang] } {
|
|
45
|
+
# This needs some reordering of loaded to ensure blackboxes are handled
|
|
46
|
+
# before this
|
|
47
|
+
set slang_params []
|
|
48
|
+
if { [sc_cfg_exists option param] } {
|
|
49
|
+
dict for {key value} [sc_cfg_get option param] {
|
|
50
|
+
if { ![string is integer $value] } {
|
|
51
|
+
set value [concat \"$value\"]
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
lappend slang_params -G "${key}=${value}"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
yosys read_slang \
|
|
58
|
+
-D SYNTHESIS \
|
|
59
|
+
--keep-hierarchy \
|
|
60
|
+
--top $sc_design \
|
|
61
|
+
{*}$slang_params \
|
|
62
|
+
$input_verilog
|
|
63
|
+
} else {
|
|
64
|
+
# Use -noblackbox to correctly interpret empty modules as empty,
|
|
65
|
+
# actual black boxes are read in later
|
|
66
|
+
# https://github.com/YosysHQ/yosys/issues/1468
|
|
67
|
+
yosys read_verilog -noblackbox -sv $input_verilog
|
|
68
|
+
|
|
69
|
+
########################################################
|
|
70
|
+
# Override top level parameters
|
|
71
|
+
########################################################
|
|
72
|
+
|
|
73
|
+
sc_apply_params
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
1
77
|
####################
|
|
2
78
|
# Helper functions
|
|
3
79
|
####################
|
|
@@ -241,4 +317,6 @@ yosys echo on
|
|
|
241
317
|
########################################################
|
|
242
318
|
# Write Netlist
|
|
243
319
|
########################################################
|
|
320
|
+
yosys write_verilog -noexpr -nohex -nodec "outputs/${sc_design}.vg"
|
|
321
|
+
yosys write_json "outputs/${sc_design}.netlist.json"
|
|
244
322
|
yosys write_blif "outputs/${sc_design}.blif"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
from siliconcompiler.tools.yosys import syn_setup, syn_post_process
|
|
1
|
+
from siliconcompiler.tools.yosys import synth_post_process, setup as tool_setup
|
|
3
2
|
import os
|
|
4
3
|
import json
|
|
5
4
|
import re
|
|
@@ -22,22 +21,39 @@ def setup(chip):
|
|
|
22
21
|
Perform ASIC synthesis
|
|
23
22
|
'''
|
|
24
23
|
|
|
24
|
+
tool_setup(chip)
|
|
25
|
+
|
|
25
26
|
# Generic synthesis task setup.
|
|
26
|
-
|
|
27
|
+
step = chip.get('arg', 'step')
|
|
28
|
+
index = chip.get('arg', 'index')
|
|
29
|
+
tool, task = get_tool_task(chip, step, index)
|
|
30
|
+
design = chip.top()
|
|
31
|
+
|
|
32
|
+
# Set yosys script path.
|
|
33
|
+
chip.set('tool', tool, 'task', task, 'script', 'sc_synth_asic.tcl',
|
|
34
|
+
step=step, index=index, clobber=False)
|
|
35
|
+
|
|
36
|
+
# Input/output requirements.
|
|
37
|
+
chip.set('tool', tool, 'task', task, 'input', design + '.v', step=step, index=index)
|
|
38
|
+
chip.set('tool', tool, 'task', task, 'output', design + '.vg', step=step, index=index)
|
|
39
|
+
chip.add('tool', tool, 'task', task, 'output', design + '.netlist.json', step=step, index=index)
|
|
40
|
+
|
|
41
|
+
chip.set('tool', tool, 'task', task, 'var', 'use_slang', False,
|
|
42
|
+
step=step, index=index,
|
|
43
|
+
clobber=False)
|
|
44
|
+
chip.set('tool', tool, 'task', task, 'var', 'use_slang',
|
|
45
|
+
'true/false, if true will attempt to use the slang frontend',
|
|
46
|
+
field='help')
|
|
27
47
|
|
|
28
|
-
# ASIC-specific setup.
|
|
29
48
|
setup_asic(chip)
|
|
30
49
|
|
|
31
50
|
|
|
32
51
|
def setup_asic(chip):
|
|
33
|
-
''' Helper method for configs specific to ASIC steps (both syn and lec).
|
|
34
|
-
'''
|
|
35
|
-
|
|
36
|
-
tool = 'yosys'
|
|
37
52
|
step = chip.get('arg', 'step')
|
|
38
53
|
index = chip.get('arg', 'index')
|
|
39
|
-
|
|
54
|
+
tool, task = get_tool_task(chip, step, index)
|
|
40
55
|
|
|
56
|
+
# Setup ASIC params
|
|
41
57
|
chip.add('tool', tool, 'task', task, 'require',
|
|
42
58
|
",".join(['asic', 'logiclib']),
|
|
43
59
|
step=step, index=index)
|
|
@@ -506,7 +522,7 @@ def pre_process(chip):
|
|
|
506
522
|
|
|
507
523
|
|
|
508
524
|
def post_process(chip):
|
|
509
|
-
|
|
525
|
+
synth_post_process(chip)
|
|
510
526
|
_generate_cell_area_report(chip)
|
|
511
527
|
|
|
512
528
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from siliconcompiler.tools.yosys import
|
|
1
|
+
from siliconcompiler.tools.yosys import synth_post_process, setup as tool_setup
|
|
2
2
|
import json
|
|
3
3
|
from siliconcompiler import sc_open
|
|
4
4
|
from siliconcompiler.tools._common import get_tool_task, record_metric
|
|
@@ -18,23 +18,32 @@ def setup(chip):
|
|
|
18
18
|
Perform FPGA synthesis
|
|
19
19
|
'''
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
syn_setup(chip)
|
|
23
|
-
|
|
24
|
-
# FPGA-specific setup.
|
|
25
|
-
setup_fpga(chip)
|
|
26
|
-
|
|
21
|
+
tool_setup(chip)
|
|
27
22
|
|
|
28
|
-
|
|
29
|
-
''' Helper method for configs specific to FPGA steps (both syn and lec).
|
|
30
|
-
'''
|
|
31
|
-
|
|
32
|
-
tool = 'yosys'
|
|
23
|
+
# Generic synthesis task setup.
|
|
33
24
|
step = chip.get('arg', 'step')
|
|
34
25
|
index = chip.get('arg', 'index')
|
|
35
|
-
|
|
26
|
+
tool, task = get_tool_task(chip, step, index)
|
|
36
27
|
design = chip.top()
|
|
37
28
|
|
|
29
|
+
# Set yosys script path.
|
|
30
|
+
chip.set('tool', tool, 'task', task, 'script', 'sc_synth_fpga.tcl',
|
|
31
|
+
step=step, index=index, clobber=False)
|
|
32
|
+
|
|
33
|
+
# Input/output requirements.
|
|
34
|
+
chip.set('tool', tool, 'task', task, 'input', design + '.v', step=step, index=index)
|
|
35
|
+
chip.set('tool', tool, 'task', task, 'output', design + '.vg', step=step, index=index)
|
|
36
|
+
chip.add('tool', tool, 'task', task, 'output', design + '.netlist.json', step=step, index=index)
|
|
37
|
+
chip.add('tool', tool, 'task', task, 'output', design + '.blif', step=step, index=index)
|
|
38
|
+
|
|
39
|
+
chip.set('tool', tool, 'task', task, 'var', 'use_slang', False,
|
|
40
|
+
step=step, index=index,
|
|
41
|
+
clobber=False)
|
|
42
|
+
chip.set('tool', tool, 'task', task, 'var', 'use_slang',
|
|
43
|
+
'true/false, if true will attempt to use the slang frontend',
|
|
44
|
+
field='help')
|
|
45
|
+
|
|
46
|
+
# Setup FPGA params
|
|
38
47
|
part_name = chip.get('fpga', 'partname')
|
|
39
48
|
|
|
40
49
|
# Require that a lut size is set for FPGA scripts.
|
|
@@ -93,8 +102,6 @@ def setup_fpga(chip):
|
|
|
93
102
|
",".join(['fpga', part_name, 'file', 'yosys_memory_techmap']),
|
|
94
103
|
step=step, index=index)
|
|
95
104
|
|
|
96
|
-
chip.add('tool', tool, 'task', task, 'output', design + '.blif', step=step, index=index)
|
|
97
|
-
|
|
98
105
|
|
|
99
106
|
##################################################
|
|
100
107
|
def post_process(chip):
|
|
@@ -102,7 +109,7 @@ def post_process(chip):
|
|
|
102
109
|
index = chip.get('arg', 'index')
|
|
103
110
|
part_name = chip.get('fpga', 'partname')
|
|
104
111
|
|
|
105
|
-
|
|
112
|
+
synth_post_process(chip)
|
|
106
113
|
|
|
107
114
|
with sc_open("reports/stat.json") as f:
|
|
108
115
|
metrics = json.load(f)
|
|
@@ -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": "10c0e05959e169ec9740d83e80bb4f2395afcc7b",
|
|
5
5
|
"docker-cmds": [
|
|
6
6
|
"# Remove OR-Tools files",
|
|
7
7
|
"RUN rm -f $SC_PREFIX/Makefile $SC_PREFIX/README.md",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"ghdl": {
|
|
24
24
|
"git-url": "https://github.com/ghdl/ghdl.git",
|
|
25
|
-
"git-commit": "
|
|
25
|
+
"git-commit": "v5.0.1",
|
|
26
26
|
"auto-update": false
|
|
27
27
|
},
|
|
28
28
|
"magic": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"auto-update": false
|
|
37
37
|
},
|
|
38
38
|
"klayout": {
|
|
39
|
-
"version": "0.
|
|
39
|
+
"version": "0.30.0",
|
|
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": "e5effb5e1ea4e0cf9b4af2c769d364e0ed4b6d84",
|
|
49
49
|
"auto-update": true
|
|
50
50
|
},
|
|
51
51
|
"verilator": {
|
|
@@ -66,17 +66,17 @@
|
|
|
66
66
|
},
|
|
67
67
|
"vpr": {
|
|
68
68
|
"git-url": "https://github.com/verilog-to-routing/vtr-verilog-to-routing.git",
|
|
69
|
-
"git-commit": "
|
|
69
|
+
"git-commit": "2a4e92181280a235315621253d1dc9eb8826bc53",
|
|
70
70
|
"auto-update": false
|
|
71
71
|
},
|
|
72
72
|
"icepack": {
|
|
73
73
|
"git-url": "https://github.com/YosysHQ/icestorm.git",
|
|
74
|
-
"git-commit": "
|
|
74
|
+
"git-commit": "7fbf8c0afbcf7665c45499b090409859b1815184",
|
|
75
75
|
"auto-update": false
|
|
76
76
|
},
|
|
77
77
|
"nextpnr": {
|
|
78
78
|
"git-url": "https://github.com/YosysHQ/nextpnr.git",
|
|
79
|
-
"git-commit": "
|
|
79
|
+
"git-commit": "nextpnr-0.7",
|
|
80
80
|
"docker-depends": "icepack"
|
|
81
81
|
},
|
|
82
82
|
"chisel": {
|
|
@@ -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.51",
|
|
95
95
|
"version-prefix": "",
|
|
96
96
|
"auto-update": true
|
|
97
97
|
},
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
},
|
|
140
140
|
"yosys-slang": {
|
|
141
141
|
"git-url": "https://github.com/povik/yosys-slang.git",
|
|
142
|
-
"git-commit": "
|
|
142
|
+
"git-commit": "e23228f4b4ec5ec0b4b17f1f675debfa29458665",
|
|
143
143
|
"docker-depends": "yosys",
|
|
144
144
|
"auto-update": true
|
|
145
145
|
},
|
|
@@ -148,5 +148,14 @@
|
|
|
148
148
|
"git-commit": "5dd1d8a60d0cc7228be856350bb90faad24dae9e",
|
|
149
149
|
"docker-depends": "yosys",
|
|
150
150
|
"auto-update": true
|
|
151
|
+
},
|
|
152
|
+
"yosys-parmys": {
|
|
153
|
+
"git-url": "https://github.com/verilog-to-routing/vtr-verilog-to-routing.git",
|
|
154
|
+
"git-commit": "2a4e92181280a235315621253d1dc9eb8826bc53",
|
|
155
|
+
"docker-depends": [
|
|
156
|
+
"yosys",
|
|
157
|
+
"vpr"
|
|
158
|
+
],
|
|
159
|
+
"auto-update": false
|
|
151
160
|
}
|
|
152
161
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
# Get directory of script
|
|
6
|
+
src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)/..
|
|
7
|
+
|
|
8
|
+
mkdir -p deps
|
|
9
|
+
cd deps
|
|
10
|
+
|
|
11
|
+
git clone $(python3 ${src_path}/_tools.py --tool vpr --field git-url) vpr
|
|
12
|
+
cd vpr
|
|
13
|
+
git checkout $(python3 ${src_path}/_tools.py --tool vpr --field git-commit)
|
|
14
|
+
git submodule update --init --recursive
|
|
15
|
+
|
|
16
|
+
sudo dnf config-manager --set-enabled devel || true
|
|
17
|
+
./install_dnf_packages.sh
|
|
18
|
+
|
|
19
|
+
sudo yum install -y tbb-devel
|
|
20
|
+
sudo dnf config-manager --set-disabled devel || true
|
|
21
|
+
|
|
22
|
+
args=
|
|
23
|
+
if [ ! -z ${PREFIX} ]; then
|
|
24
|
+
args="-DCMAKE_INSTALL_PREFIX=$PREFIX"
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
make CMAKE_PARAMS="$args -DWITH_PARMYS=OFF -DWITH_ABC=OFF -DYOSYS_F4PGA_PLUGINS=OFF" -j$(nproc)
|
|
28
|
+
cd build
|
|
29
|
+
sudo make install
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
# Get directory of script
|
|
6
|
+
src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)/..
|
|
7
|
+
|
|
8
|
+
mkdir -p deps
|
|
9
|
+
cd deps
|
|
10
|
+
|
|
11
|
+
git clone $(python3 ${src_path}/_tools.py --tool yosys-parmys --field git-url) yosys-parmys
|
|
12
|
+
cd yosys-parmys
|
|
13
|
+
git checkout $(python3 ${src_path}/_tools.py --tool yosys-parmys --field git-commit)
|
|
14
|
+
git submodule update --init --recursive
|
|
15
|
+
|
|
16
|
+
# apply patch
|
|
17
|
+
cat > build_patch <<EOF
|
|
18
|
+
diff --git a/parmys/parmys-plugin/Makefile b/parmys/parmys-plugin/Makefile
|
|
19
|
+
index dbb3eb11e..cb85631bc 100644
|
|
20
|
+
--- a/parmys/parmys-plugin/Makefile
|
|
21
|
+
+++ b/parmys/parmys-plugin/Makefile
|
|
22
|
+
@@ -49,7 +49,7 @@ VTR_INSTALL_DIR ?= /usr/local
|
|
23
|
+
|
|
24
|
+
include ../Makefile_plugin.common
|
|
25
|
+
|
|
26
|
+
-CXXFLAGS += -std=c++14 -Wall -W -Wextra \\
|
|
27
|
+
+CXXFLAGS += -std=c++17 -Wall -W -Wextra \\
|
|
28
|
+
-Wno-deprecated-declarations \\
|
|
29
|
+
-Wno-unused-parameter \\
|
|
30
|
+
-I. \\
|
|
31
|
+
diff --git a/parmys/parmys-plugin/parmys_update.cc b/parmys/parmys-plugin/parmys_update.cc
|
|
32
|
+
index ef55213c5..4e4d6dd15 100644
|
|
33
|
+
--- a/parmys/parmys-plugin/parmys_update.cc
|
|
34
|
+
+++ b/parmys/parmys-plugin/parmys_update.cc
|
|
35
|
+
@@ -506,9 +506,9 @@ void define_logical_function_yosys(nnode_t *node, Module *module)
|
|
36
|
+
lutptr = &cell->parameters.at(ID::LUT);
|
|
37
|
+
for (int i = 0; i < (1 << node->num_input_pins); i++) {
|
|
38
|
+
if (i == 3 || i == 5 || i == 6 || i == 7) //"011 1\n101 1\n110 1\n111 1\n"
|
|
39
|
+
- lutptr->bits.at(i) = RTLIL::State::S1;
|
|
40
|
+
+ lutptr->bits().at(i) = RTLIL::State::S1;
|
|
41
|
+
else
|
|
42
|
+
- lutptr->bits.at(i) = RTLIL::State::S0;
|
|
43
|
+
+ lutptr->bits().at(i) = RTLIL::State::S0;
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
cell->parameters[ID::A_WIDTH] = RTLIL::Const(int(node->num_input_pins));
|
|
47
|
+
EOF
|
|
48
|
+
|
|
49
|
+
git apply build_patch
|
|
50
|
+
|
|
51
|
+
export VTR_INSTALL_DIR=$(dirname $(which vpr))/..
|
|
52
|
+
YOSYS_PLUGIN=$(yosys-config --datdir)/plugins/
|
|
53
|
+
|
|
54
|
+
cd parmys
|
|
55
|
+
|
|
56
|
+
make -j$(nproc)
|
|
57
|
+
sudo mkdir -p $YOSYS_PLUGIN
|
|
58
|
+
sudo cp parmys-plugin/build/parmys.so $YOSYS_PLUGIN
|
|
59
|
+
cd -
|