siliconcompiler 0.32.1__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.
Files changed (41) hide show
  1. siliconcompiler/_metadata.py +1 -1
  2. siliconcompiler/apps/sc_install.py +13 -5
  3. siliconcompiler/apps/sc_remote.py +2 -1
  4. siliconcompiler/core.py +30 -13
  5. siliconcompiler/scheduler/__init__.py +37 -8
  6. siliconcompiler/scheduler/docker_runner.py +2 -1
  7. siliconcompiler/sphinx_ext/dynamicgen.py +11 -11
  8. siliconcompiler/templates/tcl/manifest.tcl.j2 +4 -120
  9. siliconcompiler/tools/_common/tcl/sc_schema_access.tcl +126 -0
  10. siliconcompiler/tools/openroad/_apr.py +3 -0
  11. siliconcompiler/tools/openroad/scripts/apr/sc_repair_timing.tcl +53 -7
  12. siliconcompiler/tools/openroad/scripts/common/procs.tcl +19 -1
  13. siliconcompiler/tools/openroad/scripts/common/reports.tcl +16 -5
  14. siliconcompiler/tools/slang/__init__.py +7 -8
  15. siliconcompiler/tools/sv2v/sv2v.py +4 -1
  16. siliconcompiler/tools/yosys/__init__.py +4 -36
  17. siliconcompiler/tools/yosys/lec.py +3 -4
  18. siliconcompiler/tools/yosys/{syn_asic.tcl → sc_synth_asic.tcl} +79 -0
  19. siliconcompiler/tools/yosys/{syn_fpga.tcl → sc_synth_fpga.tcl} +78 -0
  20. siliconcompiler/tools/yosys/syn_asic.py +26 -10
  21. siliconcompiler/tools/yosys/syn_fpga.py +23 -16
  22. siliconcompiler/toolscripts/_tools.json +17 -8
  23. siliconcompiler/toolscripts/rhel9/install-gtkwave.sh +1 -1
  24. siliconcompiler/toolscripts/rhel9/install-vpr.sh +29 -0
  25. siliconcompiler/toolscripts/rhel9/install-yosys-parmys.sh +59 -0
  26. siliconcompiler/toolscripts/ubuntu20/install-yosys-parmys.sh +59 -0
  27. siliconcompiler/toolscripts/ubuntu22/install-bluespec.sh +25 -2
  28. siliconcompiler/toolscripts/ubuntu22/install-ghdl.sh +2 -2
  29. siliconcompiler/toolscripts/ubuntu22/install-yosys-parmys.sh +59 -0
  30. siliconcompiler/toolscripts/ubuntu24/install-ghdl.sh +2 -2
  31. siliconcompiler/toolscripts/ubuntu24/install-yosys-parmys.sh +59 -0
  32. siliconcompiler/utils/__init__.py +4 -1
  33. siliconcompiler/utils/logging.py +1 -1
  34. {siliconcompiler-0.32.1.dist-info → siliconcompiler-0.32.2.dist-info}/METADATA +12 -9
  35. {siliconcompiler-0.32.1.dist-info → siliconcompiler-0.32.2.dist-info}/RECORD +39 -35
  36. {siliconcompiler-0.32.1.dist-info → siliconcompiler-0.32.2.dist-info}/WHEEL +1 -1
  37. siliconcompiler/tools/yosys/sc_syn.tcl +0 -87
  38. siliconcompiler/toolscripts/ubuntu20/install-yosys-slang.sh +0 -22
  39. {siliconcompiler-0.32.1.dist-info → siliconcompiler-0.32.2.dist-info}/entry_points.txt +0 -0
  40. {siliconcompiler-0.32.1.dist-info → siliconcompiler-0.32.2.dist-info/licenses}/LICENSE +0 -0
  41. {siliconcompiler-0.32.1.dist-info → siliconcompiler-0.32.2.dist-info}/top_level.txt +0 -0
@@ -15,6 +15,11 @@ source -echo "$sc_refdir/apr/preamble.tcl"
15
15
  # Timing Repair
16
16
  ###############################
17
17
 
18
+ set parasitics_stage -placement
19
+ if { false } {
20
+ set parasitics_stage -global_routing
21
+ }
22
+
18
23
  set rsz_setup_slack_margin [lindex [sc_cfg_tool_task_get {var} rsz_setup_slack_margin] 0]
19
24
  set rsz_hold_slack_margin [lindex [sc_cfg_tool_task_get {var} rsz_hold_slack_margin] 0]
20
25
  set rsz_slew_margin [lindex [sc_cfg_tool_task_get {var} rsz_slew_margin] 0]
@@ -30,6 +35,42 @@ if { [lindex [sc_cfg_tool_task_get {var} rsz_skip_gate_cloning] 0] == "true" } {
30
35
  lappend repair_timing_args "-skip_gate_cloning"
31
36
  }
32
37
 
38
+ set repair_design_args []
39
+ set rsz_cap_margin [lindex [sc_cfg_tool_task_get {var} rsz_cap_margin] 0]
40
+ if { $rsz_cap_margin != "false" } {
41
+ lappend repair_design_args "-cap_margin" $rsz_cap_margin
42
+ }
43
+ set rsz_slew_margin [lindex [sc_cfg_tool_task_get {var} rsz_slew_margin] 0]
44
+ if { $rsz_slew_margin != "false" } {
45
+ lappend repair_design_args "-slew_margin" $rsz_slew_margin
46
+ }
47
+
48
+ set total_insts [llength [[ord::get_db_block] getInsts]]
49
+ # Remove filler cells before attempting to repair timing
50
+ remove_fillers
51
+ set removed_fillers [expr { $total_insts - [llength [[ord::get_db_block] getInsts]] }]
52
+
53
+ if { [lindex [sc_cfg_tool_task_get var rsz_skip_drv_repair] 0] != "true" } {
54
+ ###############################
55
+ # DRV Repair
56
+ ###############################
57
+
58
+ # Enable ffs for resizing
59
+ sc_set_dont_use -scanchain -multibit -report dont_use.repair_timing.drv
60
+
61
+ estimate_parasitics $parasitics_stage
62
+
63
+ sc_report_args -command repair_design -args $repair_design_args
64
+ repair_design \
65
+ -verbose \
66
+ {*}$repair_design_args
67
+
68
+ sc_detailed_placement -congestion_report reports/congestion.drv.rpt
69
+
70
+ # Restore dont use
71
+ sc_set_dont_use
72
+ }
73
+
33
74
  if { [lindex [sc_cfg_tool_task_get var rsz_skip_setup_repair] 0] != "true" } {
34
75
  ###############################
35
76
  # Setup Repair
@@ -38,7 +79,7 @@ if { [lindex [sc_cfg_tool_task_get var rsz_skip_setup_repair] 0] != "true" } {
38
79
  # Enable ffs for resizing
39
80
  sc_set_dont_use -scanchain -multibit -report dont_use.repair_timing.setup
40
81
 
41
- estimate_parasitics -placement
82
+ estimate_parasitics $parasitics_stage
42
83
 
43
84
  sc_report_args -command repair_timing -args $repair_timing_args
44
85
  repair_timing \
@@ -49,7 +90,7 @@ if { [lindex [sc_cfg_tool_task_get var rsz_skip_setup_repair] 0] != "true" } {
49
90
  -repair_tns $rsz_repair_tns \
50
91
  {*}$repair_timing_args
51
92
 
52
- sc_detailed_placement
93
+ sc_detailed_placement -congestion_report reports/congestion.setup_repair.rpt
53
94
 
54
95
  # Restore dont use
55
96
  sc_set_dont_use
@@ -60,7 +101,7 @@ if { [lindex [sc_cfg_tool_task_get var rsz_skip_hold_repair] 0] != "true" } {
60
101
  # Hold Repair
61
102
  ###############################
62
103
 
63
- estimate_parasitics -placement
104
+ estimate_parasitics $parasitics_stage
64
105
 
65
106
  # Enable hold cells
66
107
  sc_set_dont_use -hold -scanchain -multibit -report dont_use.repair_timing.hold
@@ -74,7 +115,7 @@ if { [lindex [sc_cfg_tool_task_get var rsz_skip_hold_repair] 0] != "true" } {
74
115
  -repair_tns $rsz_repair_tns \
75
116
  {*}$repair_timing_args
76
117
 
77
- sc_detailed_placement
118
+ sc_detailed_placement -congestion_report reports/congestion.hold_repair.rpt
78
119
 
79
120
  # Restore dont use
80
121
  sc_set_dont_use
@@ -85,7 +126,7 @@ if { [lindex [sc_cfg_tool_task_get var rsz_skip_recover_power] 0] != "true" } {
85
126
  # Recover power
86
127
  ###############################
87
128
 
88
- estimate_parasitics -placement
129
+ estimate_parasitics $parasitics_stage
89
130
 
90
131
  # Enable cells
91
132
  sc_set_dont_use -hold -scanchain -multibit -report dont_use.repair_timing.power
@@ -98,16 +139,21 @@ if { [lindex [sc_cfg_tool_task_get var rsz_skip_recover_power] 0] != "true" } {
98
139
  -hold_margin $rsz_hold_slack_margin \
99
140
  {*}$repair_timing_args
100
141
 
101
- sc_detailed_placement
142
+ sc_detailed_placement -congestion_report reports/congestion.power_recovery.rpt
102
143
 
103
144
  # Restore dont use
104
145
  sc_set_dont_use
105
146
  }
106
147
 
148
+ if { $removed_fillers > 0 } {
149
+ # Add filler cells back
150
+ sc_insert_fillers
151
+ }
152
+
107
153
  global_connect
108
154
 
109
155
  # estimate for metrics
110
- estimate_parasitics -placement
156
+ estimate_parasitics $parasitics_stage
111
157
 
112
158
  ###############################
113
159
  # Task Postamble
@@ -97,7 +97,12 @@ proc sc_global_placement { args } {
97
97
  # Detailed Placement
98
98
  ###########################
99
99
 
100
- proc sc_detailed_placement { } {
100
+ proc sc_detailed_placement { args } {
101
+ sta::parse_key_args "sc_detailed_placement" args \
102
+ keys {-congestion_report} \
103
+ flags {}
104
+ sta::check_argc_eq0 "sc_detailed_placement" $args
105
+
101
106
  set dpl_padding [lindex [sc_cfg_tool_task_get var pad_detail_place] 0]
102
107
  set dpl_disallow_one_site [lindex [sc_cfg_tool_task_get var dpl_disallow_one_site] 0]
103
108
  set dpl_max_displacement [lindex [sc_cfg_tool_task_get var dpl_max_displacement] 0]
@@ -111,10 +116,23 @@ proc sc_detailed_placement { } {
111
116
  lappend dpl_args "-disallow_one_site_gaps"
112
117
  }
113
118
 
119
+ set incremental_route false
120
+
121
+ if { $incremental_route } {
122
+ global_route -start_incremental
123
+ }
124
+
114
125
  sc_report_args -command detailed_placement -args $dpl_args
126
+
115
127
  detailed_placement \
116
128
  -max_displacement $dpl_max_displacement \
117
129
  {*}$dpl_args
130
+
131
+ if { $incremental_route } {
132
+ global_route -end_incremental \
133
+ -congestion_report_file $keys(-congestion_report)
134
+ }
135
+
118
136
  check_placement -verbose
119
137
  }
120
138
 
@@ -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
- set max_path_delay [$max_path data_arrival_time]
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
- set min_path_delay [$min_path data_arrival_time]
119
- set path_delay [expr { $max_path_delay - min(0, $min_path_delay) }]
120
- if { $path_delay > 0 } {
121
- set fmax_metric [expr { 1.0 / $path_delay }]
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
- elif not chip.get('option', 'quiet', step=step, index=index):
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 not chip.get('option', 'quiet', step=step, index=index):
204
- if report["warning"]:
205
- for line in report["warning"]:
206
- chip.logger.warning(line)
207
- if report["error"]:
208
- for line in report["error"]:
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
- return '-'.join(stdout.split('-')[:-1])
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
- _, task = get_tool_task(chip, step, index)
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', refdir, step=step, index=index,
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 syn_post_process(chip):
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 setup_asic, prepare_synthesis_libraries
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
- # Generic setup.
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
- _, task = get_tool_task(chip, step, index)
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
- syn_setup(chip)
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
- _, task = get_tool_task(chip, step, index)
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
- syn_post_process(chip)
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 syn_setup, syn_post_process
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
- # Generic synthesis task setup.
22
- syn_setup(chip)
23
-
24
- # FPGA-specific setup.
25
- setup_fpga(chip)
26
-
21
+ tool_setup(chip)
27
22
 
28
- def setup_fpga(chip):
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
- _, task = get_tool_task(chip, step, index)
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
- syn_post_process(chip)
112
+ synth_post_process(chip)
106
113
 
107
114
  with sc_open("reports/stat.json") as f:
108
115
  metrics = json.load(f)