siliconcompiler 0.29.1__py3-none-any.whl → 0.29.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- siliconcompiler/_metadata.py +1 -1
- siliconcompiler/apps/sc_install.py +2 -2
- siliconcompiler/core.py +18 -8
- siliconcompiler/flowgraph.py +23 -5
- siliconcompiler/scheduler/__init__.py +21 -9
- siliconcompiler/tools/__init__.py +2 -0
- siliconcompiler/tools/_common/asic.py +70 -0
- siliconcompiler/tools/_common/tcl/sc_pin_constraints.tcl +2 -2
- siliconcompiler/tools/bambu/convert.py +2 -1
- siliconcompiler/tools/bluespec/convert.py +2 -1
- siliconcompiler/tools/chisel/convert.py +2 -1
- siliconcompiler/tools/genfasm/bitstream.py +2 -2
- siliconcompiler/tools/ghdl/convert.py +2 -2
- siliconcompiler/tools/gtkwave/__init__.py +39 -0
- siliconcompiler/tools/gtkwave/scripts/sc_show.tcl +34 -0
- siliconcompiler/tools/gtkwave/show.py +71 -0
- siliconcompiler/tools/icarus/compile.py +6 -2
- siliconcompiler/tools/klayout/drc.py +2 -1
- siliconcompiler/tools/magic/magic.py +1 -1
- siliconcompiler/tools/netgen/lvs.py +2 -1
- siliconcompiler/tools/openroad/_apr.py +14 -5
- siliconcompiler/tools/openroad/global_placement.py +23 -2
- siliconcompiler/tools/openroad/rdlroute.py +2 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_clock_tree_synthesis.tcl +1 -1
- siliconcompiler/tools/openroad/scripts/apr/sc_global_placement.tcl +64 -1
- siliconcompiler/tools/openroad/scripts/apr/sc_macro_placement.tcl +78 -94
- siliconcompiler/tools/openroad/scripts/apr/sc_power_grid.tcl +11 -1
- siliconcompiler/tools/openroad/scripts/apr/sc_repair_design.tcl +4 -0
- siliconcompiler/tools/openroad/scripts/apr/sc_repair_timing.tcl +7 -1
- siliconcompiler/tools/openroad/scripts/common/procs.tcl +39 -3
- siliconcompiler/tools/openroad/scripts/common/reports.tcl +4 -0
- siliconcompiler/tools/openroad/scripts/common/write_data.tcl +2 -5
- siliconcompiler/tools/openroad/scripts/common/write_data_physical.tcl +3 -0
- siliconcompiler/tools/openroad/scripts/common/write_data_timing.tcl +1 -0
- siliconcompiler/tools/openroad/scripts/common/write_images.tcl +10 -1
- siliconcompiler/tools/openroad/scripts/sc_rdlroute.tcl +1 -1
- siliconcompiler/tools/opensta/__init__.py +2 -2
- siliconcompiler/tools/opensta/report_libraries.py +2 -2
- siliconcompiler/tools/opensta/timing.py +2 -1
- siliconcompiler/tools/slang/__init__.py +78 -2
- siliconcompiler/tools/slang/elaborate.py +46 -0
- siliconcompiler/tools/slang/lint.py +10 -76
- siliconcompiler/tools/surelog/parse.py +1 -1
- siliconcompiler/tools/sv2v/convert.py +2 -2
- siliconcompiler/tools/template/template.py +2 -2
- siliconcompiler/tools/verilator/compile.py +11 -0
- siliconcompiler/tools/verilator/verilator.py +3 -2
- siliconcompiler/tools/vivado/vivado.py +2 -1
- siliconcompiler/tools/vpr/place.py +2 -2
- siliconcompiler/tools/vpr/route.py +2 -2
- siliconcompiler/tools/vpr/show.py +2 -1
- siliconcompiler/tools/yosys/syn_asic.py +8 -0
- siliconcompiler/tools/yosys/syn_asic.tcl +4 -0
- siliconcompiler/toolscripts/_tools.json +8 -3
- siliconcompiler/toolscripts/rhel8/install-slang.sh +0 -0
- siliconcompiler/toolscripts/rhel8/install-sv2v.sh +7 -1
- siliconcompiler/toolscripts/rhel9/install-gtkwave.sh +40 -0
- siliconcompiler/toolscripts/rhel9/install-slang.sh +0 -0
- siliconcompiler/toolscripts/rhel9/install-sv2v.sh +7 -1
- siliconcompiler/toolscripts/ubuntu20/install-gtkwave.sh +28 -0
- siliconcompiler/toolscripts/ubuntu20/install-slang.sh +0 -0
- siliconcompiler/toolscripts/ubuntu20/install-surelog.sh +1 -0
- siliconcompiler/toolscripts/ubuntu20/install-sv2v.sh +7 -1
- siliconcompiler/toolscripts/ubuntu22/install-gtkwave.sh +28 -0
- siliconcompiler/toolscripts/ubuntu22/install-slang.sh +0 -0
- siliconcompiler/toolscripts/ubuntu22/install-surelog.sh +7 -1
- siliconcompiler/toolscripts/ubuntu22/install-sv2v.sh +7 -1
- siliconcompiler/toolscripts/ubuntu24/install-bambu.sh +3 -4
- siliconcompiler/toolscripts/ubuntu24/install-gtkwave.sh +29 -0
- siliconcompiler/toolscripts/ubuntu24/install-slang.sh +0 -0
- siliconcompiler/toolscripts/ubuntu24/install-surelog.sh +7 -1
- siliconcompiler/toolscripts/ubuntu24/install-sv2v.sh +7 -1
- siliconcompiler/utils/__init__.py +22 -0
- siliconcompiler/utils/logging.py +67 -0
- siliconcompiler/utils/showtools.py +3 -0
- {siliconcompiler-0.29.1.dist-info → siliconcompiler-0.29.3.dist-info}/METADATA +8 -8
- {siliconcompiler-0.29.1.dist-info → siliconcompiler-0.29.3.dist-info}/RECORD +76 -65
- {siliconcompiler-0.29.1.dist-info → siliconcompiler-0.29.3.dist-info}/LICENSE +0 -0
- {siliconcompiler-0.29.1.dist-info → siliconcompiler-0.29.3.dist-info}/WHEEL +0 -0
- {siliconcompiler-0.29.1.dist-info → siliconcompiler-0.29.3.dist-info}/entry_points.txt +0 -0
- {siliconcompiler-0.29.1.dist-info → siliconcompiler-0.29.3.dist-info}/top_level.txt +0 -0
siliconcompiler/_metadata.py
CHANGED
|
@@ -126,7 +126,7 @@ def _recommended_tool_groups(tools):
|
|
|
126
126
|
groups = {
|
|
127
127
|
"asic": {"surelog", "sv2v", "yosys", "openroad", "klayout"},
|
|
128
128
|
"fpga": {"surelog", "sv2v", "yosys", "vpr"},
|
|
129
|
-
"digital-simulation": {"verilator", "icarus"},
|
|
129
|
+
"digital-simulation": {"verilator", "icarus", "gtkwave"},
|
|
130
130
|
"analog-simulation": {"xyce"}
|
|
131
131
|
}
|
|
132
132
|
|
|
@@ -168,7 +168,7 @@ To system debugging information (this should only be used to debug):
|
|
|
168
168
|
parser = argparse.ArgumentParser(
|
|
169
169
|
prog=progname,
|
|
170
170
|
description=description,
|
|
171
|
-
formatter_class=argparse.
|
|
171
|
+
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
|
172
172
|
|
|
173
173
|
tools = _get_tools_list()
|
|
174
174
|
|
siliconcompiler/core.py
CHANGED
|
@@ -21,6 +21,7 @@ from siliconcompiler.remote import client
|
|
|
21
21
|
from siliconcompiler.schema import Schema, SCHEMA_VERSION
|
|
22
22
|
from siliconcompiler.schema import utils as schema_utils
|
|
23
23
|
from siliconcompiler import utils
|
|
24
|
+
from siliconcompiler.utils.logging import LoggerFormatter, ColorStreamFormatter
|
|
24
25
|
from siliconcompiler import _metadata
|
|
25
26
|
from siliconcompiler import NodeStatus, SiliconCompilerError
|
|
26
27
|
from siliconcompiler.report import _show_summary_table
|
|
@@ -225,7 +226,8 @@ class Chip:
|
|
|
225
226
|
else:
|
|
226
227
|
in_run = False
|
|
227
228
|
|
|
228
|
-
|
|
229
|
+
level_format = '%(levelname)-7s'
|
|
230
|
+
log_format = [level_format]
|
|
229
231
|
if loglevel == 'debug':
|
|
230
232
|
log_format.append('%(funcName)-10s')
|
|
231
233
|
log_format.append('%(lineno)-4s')
|
|
@@ -261,14 +263,17 @@ class Chip:
|
|
|
261
263
|
log_formatprefix = ""
|
|
262
264
|
|
|
263
265
|
log_format.append('%(message)s')
|
|
264
|
-
|
|
266
|
+
stream_logformat = log_formatprefix + ' | '.join(log_format[1:])
|
|
265
267
|
|
|
266
268
|
if not self.logger.hasHandlers():
|
|
267
269
|
stream_handler = logging.StreamHandler(stream=sys.stdout)
|
|
268
270
|
self.logger.addHandler(stream_handler)
|
|
269
271
|
|
|
270
272
|
for handler in self.logger.handlers:
|
|
271
|
-
|
|
273
|
+
if ColorStreamFormatter.supports_color(handler):
|
|
274
|
+
formatter = ColorStreamFormatter(log_formatprefix, level_format, stream_logformat)
|
|
275
|
+
else:
|
|
276
|
+
formatter = LoggerFormatter(log_formatprefix, level_format, stream_logformat)
|
|
272
277
|
handler.setFormatter(formatter)
|
|
273
278
|
|
|
274
279
|
self.logger.setLevel(schema_utils.translate_loglevel(loglevel))
|
|
@@ -500,6 +505,9 @@ class Chip:
|
|
|
500
505
|
'dependency-caching-rebase')
|
|
501
506
|
"""
|
|
502
507
|
|
|
508
|
+
if os.path.isfile(path):
|
|
509
|
+
path = os.path.dirname(os.path.abspath(path))
|
|
510
|
+
|
|
503
511
|
preset_path = self.get('package', 'source', name, 'path')
|
|
504
512
|
preset_ref = self.get('package', 'source', name, 'ref')
|
|
505
513
|
if preset_path and preset_path != path or preset_ref and preset_ref != ref:
|
|
@@ -3200,6 +3208,7 @@ class Chip:
|
|
|
3200
3208
|
sc_step = self.get('arg', 'step')
|
|
3201
3209
|
sc_index = self.get('arg', 'index')
|
|
3202
3210
|
sc_job = self.get('option', 'jobname')
|
|
3211
|
+
flow = self.get('option', 'flow')
|
|
3203
3212
|
|
|
3204
3213
|
has_filename = filename is not None
|
|
3205
3214
|
# Finding last layout if no argument specified
|
|
@@ -3210,14 +3219,15 @@ class Chip:
|
|
|
3210
3219
|
if sc_step and sc_index:
|
|
3211
3220
|
search_nodes.append((sc_step, sc_index))
|
|
3212
3221
|
elif sc_step:
|
|
3213
|
-
for check_step, check_index in nodes_to_execute(self,
|
|
3222
|
+
for check_step, check_index in nodes_to_execute(self, flow):
|
|
3214
3223
|
if sc_step == check_step:
|
|
3215
3224
|
search_nodes.append((check_step, check_index))
|
|
3216
3225
|
else:
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3226
|
+
if flow is not None:
|
|
3227
|
+
for nodes in _get_flowgraph_execution_order(self,
|
|
3228
|
+
flow,
|
|
3229
|
+
reverse=True):
|
|
3230
|
+
search_nodes.extend(nodes)
|
|
3221
3231
|
|
|
3222
3232
|
for ext in self._showtools.keys():
|
|
3223
3233
|
if extension and extension != ext:
|
siliconcompiler/flowgraph.py
CHANGED
|
@@ -205,18 +205,36 @@ def _get_flowgraph_execution_order(chip, flow, reverse=False):
|
|
|
205
205
|
else:
|
|
206
206
|
ex_map.setdefault((istep, iindex), set()).add((step, index))
|
|
207
207
|
|
|
208
|
+
rev_ex_map = {}
|
|
209
|
+
for node, edges in ex_map.items():
|
|
210
|
+
for step, index in edges:
|
|
211
|
+
rev_ex_map.setdefault((step, index), set()).add(node)
|
|
212
|
+
|
|
208
213
|
# Collect execution order of nodes
|
|
209
214
|
if reverse:
|
|
210
215
|
order = [set(_get_flowgraph_exit_nodes(chip, flow))]
|
|
211
216
|
else:
|
|
212
217
|
order = [set(_get_flowgraph_entry_nodes(chip, flow))]
|
|
213
218
|
|
|
219
|
+
visited = set()
|
|
214
220
|
while True:
|
|
215
221
|
next_level = set()
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
222
|
+
next_visited = set()
|
|
223
|
+
for step, index in sorted(order[-1]):
|
|
224
|
+
if (step, index) not in rev_ex_map:
|
|
225
|
+
# No edges so assume inputs are okay
|
|
226
|
+
inputs_valid = True
|
|
227
|
+
else:
|
|
228
|
+
inputs_valid = all([node in visited for node in rev_ex_map[(step, index)]])
|
|
229
|
+
|
|
230
|
+
if inputs_valid:
|
|
231
|
+
next_visited.add((step, index))
|
|
232
|
+
if (step, index) in ex_map:
|
|
233
|
+
next_level.update(ex_map.pop((step, index)))
|
|
234
|
+
else:
|
|
235
|
+
next_level.add((step, index))
|
|
236
|
+
|
|
237
|
+
visited.update(next_visited)
|
|
220
238
|
|
|
221
239
|
if not next_level:
|
|
222
240
|
break
|
|
@@ -233,7 +251,7 @@ def _get_flowgraph_execution_order(chip, flow, reverse=False):
|
|
|
233
251
|
|
|
234
252
|
exec_order.reverse()
|
|
235
253
|
|
|
236
|
-
return exec_order
|
|
254
|
+
return [sorted(level) for level in exec_order]
|
|
237
255
|
|
|
238
256
|
|
|
239
257
|
def get_executed_nodes(chip, flow):
|
|
@@ -55,6 +55,10 @@ def _get_callback(hook):
|
|
|
55
55
|
return None
|
|
56
56
|
|
|
57
57
|
|
|
58
|
+
# Max lines to print from failed node log
|
|
59
|
+
_failed_log_lines = 20
|
|
60
|
+
|
|
61
|
+
|
|
58
62
|
###############################################################################
|
|
59
63
|
class SiliconCompilerTimeout(Exception):
|
|
60
64
|
''' Minimal Exception wrapper used to raise sc timeout errors.
|
|
@@ -833,6 +837,8 @@ def _run_executable_or_builtin(chip, step, index, version, toolpath, workdir, ru
|
|
|
833
837
|
is_stderr_log = chip.get('tool', tool, 'task', task, 'stderr', 'destination',
|
|
834
838
|
step=step, index=index) == 'log' and stderr_file != stdout_file
|
|
835
839
|
|
|
840
|
+
chip.logger.info(f'Running in {workdir}')
|
|
841
|
+
|
|
836
842
|
retcode = 0
|
|
837
843
|
cmdlist = []
|
|
838
844
|
cmd_args = []
|
|
@@ -877,7 +883,6 @@ def _run_executable_or_builtin(chip, step, index, version, toolpath, workdir, ru
|
|
|
877
883
|
# Make record of tool options
|
|
878
884
|
__record_tool(chip, step, index, version, toolpath, cmd_args)
|
|
879
885
|
|
|
880
|
-
chip.logger.info('Running in %s', workdir)
|
|
881
886
|
chip.logger.info('%s', printable_cmd)
|
|
882
887
|
timeout = chip.get('option', 'timeout', step=step, index=index)
|
|
883
888
|
logfile = step + '.log'
|
|
@@ -988,10 +993,10 @@ def _run_executable_or_builtin(chip, step, index, version, toolpath, workdir, ru
|
|
|
988
993
|
msg = f'Command failed with code {retcode}.'
|
|
989
994
|
if logfile:
|
|
990
995
|
if quiet:
|
|
991
|
-
# Print last
|
|
996
|
+
# Print last N lines of log when in quiet mode
|
|
992
997
|
with sc_open(logfile) as logfd:
|
|
993
998
|
loglines = logfd.read().splitlines()
|
|
994
|
-
for logline in loglines[-
|
|
999
|
+
for logline in loglines[-_failed_log_lines:]:
|
|
995
1000
|
chip.logger.error(logline)
|
|
996
1001
|
# No log file for pure-Python tools.
|
|
997
1002
|
msg += f' See log file {os.path.abspath(logfile)}'
|
|
@@ -1239,6 +1244,13 @@ def _finalizenode(chip, step, index, replay):
|
|
|
1239
1244
|
|
|
1240
1245
|
if not is_skipped:
|
|
1241
1246
|
_check_logfile(chip, step, index, quiet, run_func)
|
|
1247
|
+
|
|
1248
|
+
# Report metrics
|
|
1249
|
+
for metric in ['errors', 'warnings']:
|
|
1250
|
+
val = chip.get('metric', metric, step=step, index=index)
|
|
1251
|
+
if val is not None:
|
|
1252
|
+
chip.logger.info(f'Number of {metric}: {val}')
|
|
1253
|
+
|
|
1242
1254
|
_hash_files(chip, step, index)
|
|
1243
1255
|
|
|
1244
1256
|
# Capture wall runtime and cpu cores
|
|
@@ -1535,12 +1547,13 @@ def _check_node_dependencies(chip, node, deps, deps_was_successful):
|
|
|
1535
1547
|
def _launch_nodes(chip, nodes_to_run, processes, local_processes):
|
|
1536
1548
|
running_nodes = {}
|
|
1537
1549
|
max_parallel_run = chip.get('option', 'scheduler', 'maxnodes')
|
|
1538
|
-
|
|
1550
|
+
max_cores = utils.get_cores(chip)
|
|
1551
|
+
max_threads = utils.get_cores(chip)
|
|
1539
1552
|
if not max_parallel_run:
|
|
1540
|
-
max_parallel_run =
|
|
1553
|
+
max_parallel_run = utils.get_cores(chip)
|
|
1541
1554
|
|
|
1542
|
-
# clip max parallel jobs to 1 <= jobs <=
|
|
1543
|
-
max_parallel_run = max(1, min(max_parallel_run,
|
|
1555
|
+
# clip max parallel jobs to 1 <= jobs <= max_cores
|
|
1556
|
+
max_parallel_run = max(1, min(max_parallel_run, max_cores))
|
|
1544
1557
|
|
|
1545
1558
|
def allow_start(node):
|
|
1546
1559
|
if node not in local_processes:
|
|
@@ -1561,7 +1574,7 @@ def _launch_nodes(chip, nodes_to_run, processes, local_processes):
|
|
|
1561
1574
|
# clamp to max_parallel to avoid getting locked up
|
|
1562
1575
|
requested_threads = max(1, min(requested_threads, max_threads))
|
|
1563
1576
|
|
|
1564
|
-
if requested_threads + sum(running_nodes.values()) >
|
|
1577
|
+
if requested_threads + sum(running_nodes.values()) > max_cores:
|
|
1565
1578
|
# delay until there are enough core available
|
|
1566
1579
|
return False, 0
|
|
1567
1580
|
|
|
@@ -2062,7 +2075,6 @@ def check_logfile(chip, jobname=None, step=None, index='0',
|
|
|
2062
2075
|
chip.logger.info(f'{suffix}: {line_with_num}')
|
|
2063
2076
|
|
|
2064
2077
|
for suffix in ordered_suffixes:
|
|
2065
|
-
chip.logger.info(f'Number of {suffix}: {matches[suffix]}')
|
|
2066
2078
|
checks[suffix]['report'].close()
|
|
2067
2079
|
|
|
2068
2080
|
return matches
|
|
@@ -5,6 +5,7 @@ from siliconcompiler.tools.chisel import chisel
|
|
|
5
5
|
from siliconcompiler.tools.execute import execute
|
|
6
6
|
from siliconcompiler.tools.genfasm import genfasm
|
|
7
7
|
from siliconcompiler.tools.ghdl import ghdl
|
|
8
|
+
from siliconcompiler.tools import gtkwave
|
|
8
9
|
from siliconcompiler.tools.icarus import icarus
|
|
9
10
|
from siliconcompiler.tools.icepack import icepack
|
|
10
11
|
from siliconcompiler.tools.klayout import klayout
|
|
@@ -38,6 +39,7 @@ def get_tools():
|
|
|
38
39
|
execute,
|
|
39
40
|
genfasm,
|
|
40
41
|
ghdl,
|
|
42
|
+
gtkwave,
|
|
41
43
|
icarus,
|
|
42
44
|
icepack,
|
|
43
45
|
klayout,
|
|
@@ -135,6 +135,76 @@ def set_tool_task_var(chip,
|
|
|
135
135
|
return value
|
|
136
136
|
|
|
137
137
|
|
|
138
|
+
def set_tool_task_lib_var(chip,
|
|
139
|
+
param_key,
|
|
140
|
+
default_value=None,
|
|
141
|
+
schelp=None,
|
|
142
|
+
option_key=None,
|
|
143
|
+
lib_key=None):
|
|
144
|
+
'''
|
|
145
|
+
Set parameter from libraries -> option -> default_value
|
|
146
|
+
'''
|
|
147
|
+
step = chip.get('arg', 'step')
|
|
148
|
+
index = chip.get('arg', 'index')
|
|
149
|
+
tool, task = get_tool_task(chip, step, index)
|
|
150
|
+
|
|
151
|
+
if schelp:
|
|
152
|
+
chip.set('tool', tool, 'task', task, 'var', param_key,
|
|
153
|
+
schelp, field='help')
|
|
154
|
+
|
|
155
|
+
if not option_key:
|
|
156
|
+
option_key = f'{tool}_{param_key}'
|
|
157
|
+
require_key, value = pick_key(chip, [('option', 'var', option_key)], step=step, index=index)
|
|
158
|
+
|
|
159
|
+
def check_value(val):
|
|
160
|
+
if isinstance(val, (list, tuple, set)):
|
|
161
|
+
return len(val) > 0
|
|
162
|
+
return val is not None
|
|
163
|
+
|
|
164
|
+
if check_value(value):
|
|
165
|
+
chip.set('tool', tool, 'task', task, 'var', param_key, value,
|
|
166
|
+
step=step, index=index, clobber=False)
|
|
167
|
+
|
|
168
|
+
if require_key:
|
|
169
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
170
|
+
','.join(('option', option_key)),
|
|
171
|
+
step=step, index=index)
|
|
172
|
+
|
|
173
|
+
return value
|
|
174
|
+
|
|
175
|
+
# Add library key
|
|
176
|
+
if not lib_key:
|
|
177
|
+
lib_key = f'{tool}_{param_key}'
|
|
178
|
+
lib_keys = []
|
|
179
|
+
for lib in get_libraries(chip, 'logic'):
|
|
180
|
+
if chip.valid('library', lib, 'option', 'var', lib_key) and \
|
|
181
|
+
chip.get('library', lib, 'option', 'var', lib_key):
|
|
182
|
+
lib_keys.append(('library', lib, 'option', 'var', lib_key))
|
|
183
|
+
|
|
184
|
+
values = set()
|
|
185
|
+
for lib_key in lib_keys:
|
|
186
|
+
chip.add('tool', tool, 'task', task, 'require', ','.join(lib_key), step=step, index=index)
|
|
187
|
+
|
|
188
|
+
get_step = step
|
|
189
|
+
get_index = index
|
|
190
|
+
|
|
191
|
+
if chip.get(*lib_key, field='pernode') == 'never':
|
|
192
|
+
get_step = None
|
|
193
|
+
get_index = None
|
|
194
|
+
|
|
195
|
+
values.update(chip.get(*lib_key, step=get_step, index=get_index))
|
|
196
|
+
|
|
197
|
+
if check_value(values):
|
|
198
|
+
chip.set('tool', tool, 'task', task, 'var', param_key, values,
|
|
199
|
+
step=step, index=index, clobber=False)
|
|
200
|
+
|
|
201
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
202
|
+
','.join(['tool', tool, 'task', task, 'var', param_key]),
|
|
203
|
+
step=step, index=index)
|
|
204
|
+
|
|
205
|
+
return values
|
|
206
|
+
|
|
207
|
+
|
|
138
208
|
def get_tool_task_var(chip,
|
|
139
209
|
param_key,
|
|
140
210
|
option_key=None,
|
|
@@ -49,8 +49,8 @@ proc sc_collect_pin_constraints {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
set side_pin_order []
|
|
52
|
-
|
|
53
|
-
lappend side_pin_order {*}$
|
|
52
|
+
foreach index [lsort -integer [dict keys $pins]] {
|
|
53
|
+
lappend side_pin_order {*}[dict get $pins $index]
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
set pin_layer_ordering [dict create]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import shutil
|
|
3
|
+
from siliconcompiler import utils
|
|
3
4
|
from siliconcompiler.tools._common import \
|
|
4
5
|
add_frontend_requires, add_require_input, get_frontend_options, get_input_files, \
|
|
5
6
|
get_tool_task, has_input_files
|
|
@@ -27,7 +28,7 @@ def setup(chip):
|
|
|
27
28
|
chip.set('tool', tool, 'task', task, 'refdir', refdir,
|
|
28
29
|
step=step, index=index,
|
|
29
30
|
package='siliconcompiler', clobber=False)
|
|
30
|
-
chip.set('tool', tool, 'task', task, 'threads',
|
|
31
|
+
chip.set('tool', tool, 'task', task, 'threads', utils.get_cores(chip),
|
|
31
32
|
step=step, index=index, clobber=False)
|
|
32
33
|
|
|
33
34
|
# Input/Output requirements
|
|
@@ -3,6 +3,7 @@ import shutil
|
|
|
3
3
|
from siliconcompiler.tools._common import \
|
|
4
4
|
add_require_input, add_frontend_requires, get_frontend_options, get_input_files, \
|
|
5
5
|
get_tool_task, has_input_files
|
|
6
|
+
from siliconcompiler import utils
|
|
6
7
|
from siliconcompiler import sc_open
|
|
7
8
|
|
|
8
9
|
# Directory inside step/index dir to store bsc intermediate results.
|
|
@@ -33,7 +34,7 @@ def setup(chip):
|
|
|
33
34
|
chip.set('tool', tool, 'task', task, 'refdir', refdir,
|
|
34
35
|
step=step, index=index,
|
|
35
36
|
package='siliconcompiler', clobber=False)
|
|
36
|
-
chip.set('tool', tool, 'task', task, 'threads',
|
|
37
|
+
chip.set('tool', tool, 'task', task, 'threads', utils.get_cores(chip),
|
|
37
38
|
step=step, index=index, clobber=False)
|
|
38
39
|
|
|
39
40
|
# Input/Output requirements
|
|
@@ -3,6 +3,7 @@ import shutil
|
|
|
3
3
|
import glob
|
|
4
4
|
from siliconcompiler.tools._common import add_frontend_requires, get_tool_task, has_input_files
|
|
5
5
|
from siliconcompiler import sc_open, SiliconCompilerError
|
|
6
|
+
from siliconcompiler import utils
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
def setup(chip):
|
|
@@ -28,7 +29,7 @@ def setup(chip):
|
|
|
28
29
|
chip.set('tool', tool, 'task', task, 'refdir', refdir,
|
|
29
30
|
step=step, index=index,
|
|
30
31
|
package='siliconcompiler', clobber=False)
|
|
31
|
-
chip.set('tool', tool, 'task', task, 'threads',
|
|
32
|
+
chip.set('tool', tool, 'task', task, 'threads', utils.get_cores(chip),
|
|
32
33
|
step=step, index=index, clobber=False)
|
|
33
34
|
|
|
34
35
|
chip.set('tool', tool, 'task', task, 'option', ['-batch',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import os
|
|
2
1
|
import shutil
|
|
2
|
+
from siliconcompiler import utils
|
|
3
3
|
from siliconcompiler.tools.genfasm import genfasm
|
|
4
4
|
from siliconcompiler.tools.vpr import vpr
|
|
5
5
|
from siliconcompiler.tools._common import get_tool_task
|
|
@@ -15,7 +15,7 @@ def setup(chip):
|
|
|
15
15
|
index = chip.get('arg', 'index')
|
|
16
16
|
tool, task = get_tool_task(chip, step, index)
|
|
17
17
|
|
|
18
|
-
chip.set('tool', tool, 'task', task, 'threads',
|
|
18
|
+
chip.set('tool', tool, 'task', task, 'threads', utils.get_cores(chip),
|
|
19
19
|
step=step, index=index, clobber=False)
|
|
20
20
|
|
|
21
21
|
chip.set('tool', tool, 'task', task, 'regex', 'warnings', "^Warning",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import os
|
|
2
1
|
from siliconcompiler.tools._common import add_require_input, add_frontend_requires, \
|
|
3
2
|
get_input_files, get_tool_task, has_input_files
|
|
3
|
+
from siliconcompiler import utils
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def setup(chip):
|
|
@@ -23,7 +23,7 @@ def setup(chip):
|
|
|
23
23
|
chip.set('tool', tool, 'vswitch', '--version')
|
|
24
24
|
chip.set('tool', tool, 'version', '>=4.0.0-dev', clobber=clobber)
|
|
25
25
|
|
|
26
|
-
chip.set('tool', tool, 'task', task, 'threads',
|
|
26
|
+
chip.set('tool', tool, 'task', task, 'threads', utils.get_cores(chip),
|
|
27
27
|
step=step, index=index, clobber=clobber)
|
|
28
28
|
chip.set('tool', tool, 'task', task, 'option', '',
|
|
29
29
|
step=step, index=index, clobber=clobber)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'''
|
|
2
|
+
GTKWave is a fully featured GTK+ based wave viewer for Unix, Win32, and
|
|
3
|
+
Mac OSX which reads LXT, LXT2, VZT, FST, and GHW files as well as standard
|
|
4
|
+
Verilog VCD/EVCD files and allows their viewing.
|
|
5
|
+
|
|
6
|
+
Documentation: https://gtkwave.github.io/gtkwave/
|
|
7
|
+
|
|
8
|
+
Sources: https://github.com/gtkwave/gtkwave
|
|
9
|
+
|
|
10
|
+
Installation: https://github.com/gtkwave/gtkwave
|
|
11
|
+
'''
|
|
12
|
+
|
|
13
|
+
from siliconcompiler.tools._common import \
|
|
14
|
+
get_tool_task
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def setup(chip):
|
|
18
|
+
step = chip.get('arg', 'step')
|
|
19
|
+
index = chip.get('arg', 'index')
|
|
20
|
+
tool, task = get_tool_task(chip, step, index)
|
|
21
|
+
|
|
22
|
+
chip.set('tool', tool, 'exe', 'gtkwave')
|
|
23
|
+
chip.set('tool', tool, 'vswitch', '--version')
|
|
24
|
+
chip.set('tool', tool, 'version', '>=v3.3.116', clobber=False)
|
|
25
|
+
chip.set('tool', tool, 'format', 'tcl', clobber=False)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
################################
|
|
29
|
+
# Version Check
|
|
30
|
+
################################
|
|
31
|
+
def parse_version(stdout):
|
|
32
|
+
# First line: GTKWave Analyzer v3.3.116 (w)1999-2023 BSI
|
|
33
|
+
return stdout.split()[2]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def normalize_version(version):
|
|
37
|
+
if version[0] == 'v':
|
|
38
|
+
return version[1:]
|
|
39
|
+
return version
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
###############################
|
|
2
|
+
# Reading SC Schema
|
|
3
|
+
###############################
|
|
4
|
+
|
|
5
|
+
source ./sc_manifest.tcl
|
|
6
|
+
|
|
7
|
+
##############################
|
|
8
|
+
# Schema Adapter
|
|
9
|
+
###############################
|
|
10
|
+
|
|
11
|
+
set sc_step [sc_cfg_get arg step]
|
|
12
|
+
set sc_index [sc_cfg_get arg index]
|
|
13
|
+
set sc_flow [sc_cfg_get option flow]
|
|
14
|
+
set sc_tool [sc_cfg_get flowgraph $sc_flow $sc_step $sc_index tool]
|
|
15
|
+
set sc_task [sc_cfg_get flowgraph $sc_flow $sc_step $sc_index task]
|
|
16
|
+
|
|
17
|
+
###############################
|
|
18
|
+
# Source pre-scripts
|
|
19
|
+
###############################
|
|
20
|
+
|
|
21
|
+
if { [sc_cfg_tool_task_exists prescript] } {
|
|
22
|
+
foreach sc_pre_script [sc_cfg_tool_task_get prescript] {
|
|
23
|
+
puts "Sourcing pre script: ${sc_pre_script}"
|
|
24
|
+
source $sc_pre_script
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
###############################
|
|
29
|
+
# Handle exit
|
|
30
|
+
###############################
|
|
31
|
+
|
|
32
|
+
if { [lindex [sc_cfg_tool_task_get {var} show_exit] 0] == "true" } {
|
|
33
|
+
exit
|
|
34
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
from siliconcompiler.tools.gtkwave import setup as tool_setup
|
|
4
|
+
from siliconcompiler.tools._common import \
|
|
5
|
+
add_require_input, get_tool_task, input_provides
|
|
6
|
+
from siliconcompiler import utils
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def setup(chip):
|
|
10
|
+
'''
|
|
11
|
+
Show a VCD file.
|
|
12
|
+
'''
|
|
13
|
+
|
|
14
|
+
tool_setup(chip)
|
|
15
|
+
|
|
16
|
+
step = chip.get('arg', 'step')
|
|
17
|
+
index = chip.get('arg', 'index')
|
|
18
|
+
tool, task = get_tool_task(chip, step, index)
|
|
19
|
+
|
|
20
|
+
chip.set('tool', tool, 'task', task, 'threads', utils.get_cores(chip),
|
|
21
|
+
step=step, index=index)
|
|
22
|
+
|
|
23
|
+
chip.set('tool', tool, 'task', task, 'refdir',
|
|
24
|
+
'tools/gtkwave/scripts',
|
|
25
|
+
step=step, index=index, package='siliconcompiler')
|
|
26
|
+
|
|
27
|
+
chip.set('tool', tool, 'task', task, 'refdir',
|
|
28
|
+
'tools/gtkwave/scripts',
|
|
29
|
+
step=step, index=index, package='siliconcompiler')
|
|
30
|
+
chip.set('tool', tool, 'task', task, 'script', 'sc_show.tcl',
|
|
31
|
+
step=step, index=index)
|
|
32
|
+
|
|
33
|
+
if f'{chip.top()}.vcd' in input_provides(chip, step, index):
|
|
34
|
+
chip.set('tool', tool, 'task', task, 'input', f'{chip.top()}.vcd', step=step, index=index)
|
|
35
|
+
elif chip.valid('tool', tool, 'task', task, 'var', 'show_filepath') and \
|
|
36
|
+
chip.get('tool', tool, 'task', task, 'var', 'show_filepath', step=step, index=index):
|
|
37
|
+
chip.add('tool', tool, 'task', task, 'require',
|
|
38
|
+
",".join(['tool', tool, 'task', task, 'var', 'show_filepath']),
|
|
39
|
+
step=step, index=index)
|
|
40
|
+
else:
|
|
41
|
+
add_require_input(chip, 'input', 'waveform', 'vcd')
|
|
42
|
+
|
|
43
|
+
chip.set('tool', tool, 'task', task, 'var', 'show_exit', False,
|
|
44
|
+
step=step, index=index, clobber=False)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def runtime_options(chip):
|
|
48
|
+
step = chip.get('arg', 'step')
|
|
49
|
+
index = chip.get('arg', 'index')
|
|
50
|
+
tool, task = get_tool_task(chip, step, index)
|
|
51
|
+
|
|
52
|
+
options = []
|
|
53
|
+
|
|
54
|
+
threads = chip.get('tool', tool, 'task', task, 'threads', step=step, index=index)
|
|
55
|
+
if threads:
|
|
56
|
+
options.append(f'--cpu={threads}')
|
|
57
|
+
|
|
58
|
+
script = chip.find_files('tool', tool, 'task', task, 'script', step=step, index=index)[0]
|
|
59
|
+
options.append(f'--script={script}')
|
|
60
|
+
|
|
61
|
+
if os.path.exists(f'inputs/{chip.top()}.vcd'):
|
|
62
|
+
dump = f'inputs/{chip.top()}.vcd'
|
|
63
|
+
elif chip.valid('tool', tool, 'task', task, 'var', 'show_filepath') and \
|
|
64
|
+
chip.get('tool', tool, 'task', task, 'var', 'show_filepath', step=step, index=index):
|
|
65
|
+
dump = chip.get('tool', tool, 'task', task, 'var', 'show_filepath',
|
|
66
|
+
step=step, index=index)[0]
|
|
67
|
+
else:
|
|
68
|
+
dump = chip.find_files('input', 'waveform', 'vcd', step=step, index=index)[0]
|
|
69
|
+
options.append(f'--dump={dump}')
|
|
70
|
+
|
|
71
|
+
return options
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import os
|
|
2
1
|
from siliconcompiler.tools._common import \
|
|
3
2
|
add_require_input, add_frontend_requires, get_input_files, get_frontend_options, \
|
|
4
3
|
get_tool_task
|
|
4
|
+
from siliconcompiler import utils
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
def setup(chip):
|
|
@@ -20,7 +20,7 @@ def setup(chip):
|
|
|
20
20
|
chip.set('tool', tool, 'vswitch', '-V')
|
|
21
21
|
chip.set('tool', tool, 'version', '>=10.3', clobber=False)
|
|
22
22
|
|
|
23
|
-
chip.set('tool', tool, 'task', task, 'threads',
|
|
23
|
+
chip.set('tool', tool, 'task', task, 'threads', utils.get_cores(chip),
|
|
24
24
|
step=step, index=index, clobber=False)
|
|
25
25
|
|
|
26
26
|
chip.set('tool', tool, 'task', task, 'var', 'verilog_generation',
|
|
@@ -75,6 +75,10 @@ def runtime_options(chip):
|
|
|
75
75
|
cmdlist.append('-I' + value)
|
|
76
76
|
for value in opts['define']:
|
|
77
77
|
cmdlist.append('-D' + value)
|
|
78
|
+
|
|
79
|
+
# add siliconcompiler specific defines
|
|
80
|
+
cmdlist.append(f"-DSILICONCOMPILER_TRACE_FILE=\\\"reports/{design}.vcd\\\"")
|
|
81
|
+
|
|
78
82
|
for value in get_input_files(chip, 'input', 'cmdfile', 'f'):
|
|
79
83
|
cmdlist.append('-f ' + value)
|
|
80
84
|
for value in get_input_files(chip, 'input', 'rtl', 'netlist'):
|
|
@@ -7,6 +7,7 @@ from siliconcompiler.tools._common.asic import set_tool_task_var, get_tool_task_
|
|
|
7
7
|
|
|
8
8
|
from siliconcompiler.tools.klayout.klayout import setup as setup_tool
|
|
9
9
|
import xml.etree.ElementTree as ET
|
|
10
|
+
from siliconcompiler import utils
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
def make_docs(chip):
|
|
@@ -35,7 +36,7 @@ def setup(chip):
|
|
|
35
36
|
chip.set('tool', tool, 'task', task, 'option', option,
|
|
36
37
|
step=step, index=index, clobber=clobber)
|
|
37
38
|
|
|
38
|
-
chip.set('tool', tool, 'task', task, 'threads',
|
|
39
|
+
chip.set('tool', tool, 'task', task, 'threads', utils.get_cores(chip),
|
|
39
40
|
step=step, index=index, clobber=clobber)
|
|
40
41
|
|
|
41
42
|
chip.add('tool', tool, 'task', task, 'require', 'option,pdk')
|
|
@@ -47,7 +47,7 @@ def setup(chip):
|
|
|
47
47
|
chip.set('tool', tool, 'version', '>=8.3.196', clobber=False)
|
|
48
48
|
chip.set('tool', tool, 'format', 'tcl')
|
|
49
49
|
|
|
50
|
-
chip.set('tool', tool, 'task', task, 'threads',
|
|
50
|
+
chip.set('tool', tool, 'task', task, 'threads', utils.get_cores(chip),
|
|
51
51
|
step=step, index=index, clobber=False)
|
|
52
52
|
chip.set('tool', tool, 'task', task, 'refdir', refdir,
|
|
53
53
|
step=step, index=index,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
2
|
|
|
3
|
+
from siliconcompiler import utils
|
|
3
4
|
from siliconcompiler.tools.netgen import count_lvs
|
|
4
5
|
from siliconcompiler import sc_open
|
|
5
6
|
from siliconcompiler.tools._common import get_tool_task, record_metric
|
|
@@ -24,7 +25,7 @@ def setup(chip):
|
|
|
24
25
|
chip.set('tool', tool, 'version', '>=1.5.192', clobber=False)
|
|
25
26
|
chip.set('tool', tool, 'format', 'tcl')
|
|
26
27
|
|
|
27
|
-
chip.set('tool', tool, 'task', task, 'threads',
|
|
28
|
+
chip.set('tool', tool, 'task', task, 'threads', utils.get_cores(chip),
|
|
28
29
|
step=step, index=index, clobber=False)
|
|
29
30
|
chip.set('tool', tool, 'task', task, 'refdir', refdir,
|
|
30
31
|
step=step, index=index,
|