siliconcompiler 0.26.3__cp310-cp310-win_amd64.whl → 0.26.4.post1__cp310-cp310-win_amd64.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.
@@ -1,5 +1,5 @@
1
1
  # Version number following semver standard.
2
- version = '0.26.3'
2
+ version = '0.26.4.post1'
3
3
 
4
4
  # Default server address for remote runs, if unspecified.
5
5
  default_server = 'https://server.siliconcompiler.com'
siliconcompiler/core.py CHANGED
@@ -15,6 +15,7 @@ import inspect
15
15
  import textwrap
16
16
  import graphviz
17
17
  import codecs
18
+ import copy
18
19
  from siliconcompiler.remote import client
19
20
  from siliconcompiler.schema import Schema, SCHEMA_VERSION
20
21
  from siliconcompiler.schema import utils as schema_utils
@@ -234,6 +235,7 @@ class Chip:
234
235
  for future_step, future_index in nodes_to_run:
235
236
  max_step_len = max(len(future_step), max_step_len)
236
237
  max_index_len = max(len(future_index), max_index_len)
238
+ max_step_len = min(max_step_len, 20)
237
239
 
238
240
  jobname = self.get('option', 'jobname')
239
241
 
@@ -243,7 +245,7 @@ class Chip:
243
245
  index = '-' * max(max_index_len // 4, 1)
244
246
 
245
247
  log_format.append(jobname)
246
- log_format.append(f'{step: <{max_step_len}}')
248
+ log_format.append(f'{utils.truncate_text(step, max_step_len): <{max_step_len}}')
247
249
  log_format.append(f'{index: >{max_index_len}}')
248
250
 
249
251
  log_format.append('%(message)s')
@@ -555,7 +557,12 @@ class Chip:
555
557
 
556
558
  elif isinstance(use_module, (Library, Chip)):
557
559
  self._loaded_modules['libs'].append(use_module.design)
558
- self.__import_library(use_module.design, use_module.schema.cfg)
560
+ cfg = use_module.schema.cfg
561
+ keep_inputs = True
562
+ if not isinstance(use_module, Library):
563
+ keep_inputs = False
564
+ self.__import_library(use_module.design, cfg,
565
+ keep_input=keep_inputs)
559
566
 
560
567
  is_auto_enable = getattr(use_module, 'is_auto_enable', None)
561
568
  if is_auto_enable:
@@ -1163,6 +1170,10 @@ class Chip:
1163
1170
 
1164
1171
  result = []
1165
1172
 
1173
+ collection_dir = self._getcollectdir(jobname=job)
1174
+ if not os.path.exists(collection_dir):
1175
+ collection_dir = None
1176
+
1166
1177
  # Special cases for various ['tool', ...] files that may be implicitly
1167
1178
  # under the workdir (or refdir in the case of scripts).
1168
1179
  # TODO: it may be cleaner to have a file resolution scope flag in schema
@@ -1191,10 +1202,8 @@ class Chip:
1191
1202
  search_paths = self.__convert_paths_to_posix(search_paths)
1192
1203
 
1193
1204
  for (dependency, path) in zip(dependencies, paths):
1194
- if not search_paths:
1195
- import_path = self.__find_sc_imported_file(path,
1196
- dependency,
1197
- self._getcollectdir(jobname=job))
1205
+ if not search_paths and collection_dir:
1206
+ import_path = self.__find_sc_imported_file(path, dependency, collection_dir)
1198
1207
  if import_path:
1199
1208
  result.append(import_path)
1200
1209
  continue
@@ -1239,6 +1248,10 @@ class Chip:
1239
1248
  if not path:
1240
1249
  return None
1241
1250
 
1251
+ collected_files = os.listdir(collected_dir)
1252
+ if not collected_files:
1253
+ return None
1254
+
1242
1255
  path_paths = pathlib.PurePosixPath(path).parts
1243
1256
  for n in range(len(path_paths)):
1244
1257
  # Search through the path elements to see if any of the previous path parts
@@ -1248,7 +1261,11 @@ class Chip:
1248
1261
  basename = str(pathlib.PurePosixPath(*path_paths[0:n]))
1249
1262
  endname = str(pathlib.PurePosixPath(*path_paths[n:]))
1250
1263
 
1251
- abspath = os.path.join(collected_dir, self.__get_imported_filename(basename, package))
1264
+ import_name = self.__get_imported_filename(basename, package)
1265
+ if import_name not in collected_files:
1266
+ continue
1267
+
1268
+ abspath = os.path.join(collected_dir, import_name)
1252
1269
  if endname:
1253
1270
  abspath = os.path.join(abspath, endname)
1254
1271
  abspath = os.path.abspath(abspath)
@@ -1257,19 +1274,18 @@ class Chip:
1257
1274
 
1258
1275
  return None
1259
1276
 
1260
- ###########################################################################
1261
- def find_result(self, filetype, step, jobname=None, index='0'):
1277
+ def find_node_file(self, path, step, jobname=None, index='0'):
1262
1278
  """
1263
- Returns the absolute path of a compilation result.
1279
+ Returns the absolute path of a file from a particular node.
1264
1280
 
1265
- Utility function that returns the absolute path to a results
1281
+ Utility function that returns the absolute path to a node
1266
1282
  file based on the provided arguments. The result directory
1267
1283
  structure is:
1268
1284
 
1269
- <dir>/<design>/<jobname>/<step>/<index>/outputs/<design>.filetype
1285
+ <dir>/<design>/<jobname>/<step>/<index>/<path>
1270
1286
 
1271
1287
  Args:
1272
- filetype (str): File extension (v, def, etc)
1288
+ path (str): Path to file inside node run directory
1273
1289
  step (str): Task step name ('syn', 'place', etc)
1274
1290
  jobname (str): Jobid directory name
1275
1291
  index (str): Task index
@@ -1278,23 +1294,54 @@ class Chip:
1278
1294
  Returns absolute path to file.
1279
1295
 
1280
1296
  Examples:
1281
- >>> manifest_filepath = chip.find_result('vg', 'syn')
1282
- Returns the absolute path to the manifest.
1297
+ >>> manifest_filepath = chip.find_node_file('outputs/heartbeat.vg', 'syn')
1298
+ Returns the absolute path to the gate level verilog.
1283
1299
  """
1284
1300
  if jobname is None:
1285
1301
  jobname = self.get('option', 'jobname')
1286
1302
 
1287
1303
  workdir = self.getworkdir(jobname, step, index)
1288
- design = self.top()
1289
- filename = f"{workdir}/outputs/{design}.{filetype}"
1304
+ filename = f"{workdir}/{path}"
1290
1305
 
1291
- self.logger.debug("Finding result %s", filename)
1306
+ self.logger.debug(f"Finding node file: {filename}")
1292
1307
 
1293
1308
  if os.path.exists(filename):
1294
1309
  return filename
1295
1310
  else:
1296
1311
  return None
1297
1312
 
1313
+ ###########################################################################
1314
+ def find_result(self, filetype, step, jobname=None, index='0'):
1315
+ """
1316
+ Returns the absolute path of a compilation result.
1317
+
1318
+ Utility function that returns the absolute path to a results
1319
+ file based on the provided arguments. The result directory
1320
+ structure is:
1321
+
1322
+ <dir>/<design>/<jobname>/<step>/<index>/outputs/<design>.filetype
1323
+
1324
+ Args:
1325
+ filetype (str): File extension (v, def, etc)
1326
+ step (str): Task step name ('syn', 'place', etc)
1327
+ jobname (str): Jobid directory name
1328
+ index (str): Task index
1329
+
1330
+ Returns:
1331
+ Returns absolute path to file.
1332
+
1333
+ Examples:
1334
+ >>> vg_filepath = chip.find_result('vg', 'syn')
1335
+ Returns the absolute path to the gate level verilog.
1336
+ """
1337
+
1338
+ design = self.top()
1339
+ return self.find_node_file(
1340
+ f"outputs/{design}.{filetype}",
1341
+ step=step,
1342
+ jobname=jobname,
1343
+ index=index)
1344
+
1298
1345
  ###########################################################################
1299
1346
  def __abspath(self):
1300
1347
  '''
@@ -1569,13 +1616,15 @@ class Chip:
1569
1616
  if not os.path.exists(os.path.dirname(filepath)):
1570
1617
  os.makedirs(os.path.dirname(filepath))
1571
1618
 
1619
+ schema = self.schema
1572
1620
  # resolve absolute paths
1573
1621
  if abspath:
1574
1622
  schema = self.__abspath()
1575
- else:
1576
- schema = self.schema.copy()
1577
1623
 
1578
1624
  if prune:
1625
+ if schema is self.schema:
1626
+ schema = schema.copy()
1627
+
1579
1628
  self.logger.debug('Pruning dictionary before writing file %s', filepath)
1580
1629
  schema.prune()
1581
1630
 
@@ -1798,7 +1847,7 @@ class Chip:
1798
1847
  return not error
1799
1848
 
1800
1849
  ###########################################################################
1801
- def __import_library(self, libname, libcfg, job=None, clobber=True):
1850
+ def __import_library(self, libname, libcfg, job=None, clobber=True, keep_input=True):
1802
1851
  '''Helper to import library with config 'libconfig' as a library
1803
1852
  'libname' in current Chip object.'''
1804
1853
  if job:
@@ -1809,19 +1858,22 @@ class Chip:
1809
1858
  if 'library' in libcfg:
1810
1859
  for sublib_name, sublibcfg in libcfg['library'].items():
1811
1860
  self.__import_library(sublib_name, sublibcfg,
1812
- job=job, clobber=clobber)
1813
-
1814
- del libcfg['library']
1861
+ job=job, clobber=clobber, keep_input=keep_input)
1815
1862
 
1816
1863
  if libname in cfg:
1817
1864
  if not clobber:
1818
1865
  return
1819
1866
 
1820
- cfg[libname] = libcfg
1821
1867
  self.__import_data_sources(libcfg)
1822
-
1823
- if 'pdk' in cfg[libname]:
1824
- del cfg[libname]['pdk']
1868
+ cfg[libname] = {}
1869
+
1870
+ # Only keep some sections to avoid recursive bloat
1871
+ keeps = ['asic', 'design', 'fpga', 'option', 'output', 'package']
1872
+ if keep_input:
1873
+ keeps.append('input')
1874
+ for section in list(libcfg.keys()):
1875
+ if section in keeps:
1876
+ cfg[libname][section] = copy.deepcopy(libcfg[section])
1825
1877
 
1826
1878
  ###########################################################################
1827
1879
  def write_flowgraph(self, filename, flow=None,
@@ -423,7 +423,8 @@ def _get_flowgraph_information(chip, flow, io=True):
423
423
  from siliconcompiler.tools._common import input_provides, input_file_node_name
424
424
 
425
425
  # Save schema to avoid making permanent changes
426
- org_schema = chip.schema.copy()
426
+ org_schema = chip.schema
427
+ chip.schema = chip.schema.copy()
427
428
 
428
429
  # Setup nodes
429
430
  node_exec_order = _get_flowgraph_execution_order(chip, flow)
@@ -1,6 +1,7 @@
1
1
  import siliconcompiler
2
2
 
3
3
  from siliconcompiler.tools.icarus import compile as icarus_compile
4
+ from siliconcompiler.tools.verilator import compile as verilator_compile
4
5
  from siliconcompiler.tools.execute import exec_input
5
6
 
6
7
 
@@ -44,17 +45,21 @@ def setup(chip,
44
45
  if tool == 'icarus':
45
46
  tasks['compile'] = icarus_compile
46
47
  tasks['sim'] = exec_input
47
- flowpipe = [
48
- 'compile',
49
- 'sim'
50
- ]
51
- flow_np = {
52
- 'compile': 1,
53
- 'sim': np
54
- }
48
+ elif tool == 'verilator':
49
+ tasks['compile'] = verilator_compile
50
+ tasks['sim'] = exec_input
55
51
  else:
56
52
  raise ValueError(f'{tool} is not a supported tool for {flowname}: icarus')
57
53
 
54
+ flowpipe = [
55
+ 'compile',
56
+ 'sim'
57
+ ]
58
+ flow_np = {
59
+ 'compile': 1,
60
+ 'sim': np
61
+ }
62
+
58
63
  prevstep = None
59
64
  # Flow setup
60
65
  for step in flowpipe:
@@ -14,7 +14,7 @@ def _generate_html_report(chip, flow, flowgraph_nodes, results_html):
14
14
  '''
15
15
 
16
16
  # only report tool based steps functions
17
- for (step, index) in flowgraph_nodes.copy():
17
+ for (step, index) in list(flowgraph_nodes):
18
18
  tool, task = get_tool_task(chip, step, '0', flow=flow)
19
19
  if tool == 'builtin':
20
20
  index = flowgraph_nodes.index((step, index))
@@ -1,7 +1,9 @@
1
1
  import pandas
2
+ import shutil
2
3
 
3
4
  from siliconcompiler.report.utils import _collect_data, _get_flowgraph_path
4
5
  from siliconcompiler.tools._common import get_tool_task
6
+ from siliconcompiler.utils import truncate_text
5
7
 
6
8
 
7
9
  def _show_summary_table(chip, flow, flowgraph_nodes, show_all_indices):
@@ -10,9 +12,10 @@ def _show_summary_table(chip, flow, flowgraph_nodes, show_all_indices):
10
12
  '''
11
13
 
12
14
  # Display data
13
- pandas.set_option('display.max_rows', 500)
14
- pandas.set_option('display.max_columns', 500)
15
- pandas.set_option('display.width', 100)
15
+ max_line_width = 135
16
+ column_width = 15
17
+
18
+ max_line_width = max(max_line_width, int(0.9*shutil.get_terminal_size((80, 20)).columns))
16
19
 
17
20
  nodes, _, metrics, metrics_unit, metrics_to_show, _ = \
18
21
  _collect_data(chip, flow, flowgraph_nodes)
@@ -21,7 +24,7 @@ def _show_summary_table(chip, flow, flowgraph_nodes, show_all_indices):
21
24
  _get_flowgraph_path(chip, flow, flowgraph_nodes, only_include_successful=True)
22
25
 
23
26
  # only report tool based steps functions
24
- for (step, index) in flowgraph_nodes.copy():
27
+ for (step, index) in list(flowgraph_nodes):
25
28
  if get_tool_task(chip, step, index, flow=flow)[0] == 'builtin':
26
29
  del flowgraph_nodes[flowgraph_nodes.index((step, index))]
27
30
 
@@ -40,21 +43,30 @@ def _show_summary_table(chip, flow, flowgraph_nodes, show_all_indices):
40
43
  else:
41
44
  paramstr = "None"
42
45
 
43
- colwidth = 8 # minimum col width
44
- row_labels = [' ' + metric for metric in metrics_to_show]
45
- column_labels = [f'{step}{index}'.center(colwidth)
46
- for step, index in nodes_to_show]
47
- column_labels.insert(0, 'units')
46
+ # trim labels to column width
47
+ column_labels = []
48
+ labels = [f'{step}{index}' for step, index in nodes_to_show]
49
+ if labels:
50
+ column_width = min([column_width, max([len(label) for label in labels])])
51
+
52
+ for label in labels:
53
+ column_labels.append(truncate_text(label, column_width).center(column_width))
54
+
55
+ row_labels = []
56
+ if metrics_to_show:
57
+ row_label_len = max([len(metric) for metric in metrics_to_show])
58
+ row_unit_len = max([len(metrics_unit[metric]) for metric in metrics_to_show])
59
+ for metric in metrics_to_show:
60
+ row_labels.append(f'{metric:<{row_label_len}} {metrics_unit[metric]:>{row_unit_len}}')
48
61
 
49
62
  data = []
50
63
  for metric in metrics_to_show:
51
64
  row = []
52
- row.append(metrics_unit[metric])
53
65
  for node in nodes_to_show:
54
66
  value = metrics[node][metric]
55
67
  if value is None:
56
68
  value = '---'
57
- value = ' ' + value.center(colwidth)
69
+ value = ' ' + value.center(column_width)
58
70
  row.append(value)
59
71
  data.append(row)
60
72
 
@@ -82,12 +94,12 @@ def _show_summary_table(chip, flow, flowgraph_nodes, show_all_indices):
82
94
 
83
95
  info = '\n'.join(info_list)
84
96
 
85
- print("-" * 135)
97
+ print("-" * max_line_width)
86
98
  print(info, "\n")
87
99
 
88
100
  df = pandas.DataFrame(data, row_labels, column_labels)
89
101
  if not df.empty:
90
- print(df.to_string())
102
+ print(df.to_string(line_width=max_line_width, col_space=2))
91
103
  else:
92
104
  print(' No metrics to display!')
93
- print("-" * 135)
105
+ print("-" * max_line_width)
@@ -43,7 +43,7 @@ def _collect_data(chip, flow=None, flowgraph_nodes=None, format_as_string=True):
43
43
  if not flowgraph_nodes:
44
44
  flowgraph_nodes = nodes_to_execute(chip)
45
45
  # only report tool based steps functions
46
- for (step, index) in flowgraph_nodes.copy():
46
+ for (step, index) in list(flowgraph_nodes):
47
47
  tool, task = get_tool_task(chip, step, '0', flow=flow)
48
48
  if tool == 'builtin':
49
49
  index = flowgraph_nodes.index((step, index))
@@ -1137,11 +1137,12 @@ def _hash_files(chip, step, index, setup=False):
1137
1137
  if not setup:
1138
1138
  # hash all outputs
1139
1139
  chip.hash_files('tool', tool, 'task', task, 'output',
1140
- step=step, index=index, check=False)
1140
+ step=step, index=index, check=False, verbose=False)
1141
1141
  else:
1142
1142
  for task_key in ('refdir', 'prescript', 'postscript', 'script'):
1143
1143
  chip.hash_files('tool', tool, 'task', task, task_key,
1144
- step=step, index=index, check=False, allow_cache=True)
1144
+ step=step, index=index, check=False,
1145
+ allow_cache=True, verbose=False)
1145
1146
 
1146
1147
  # hash all requirements
1147
1148
  for item in set(chip.get('tool', tool, 'task', task, 'require', step=step, index=index)):
@@ -1153,12 +1154,13 @@ def _hash_files(chip, step, index, setup=False):
1153
1154
  if not setup:
1154
1155
  if chip.get(*args, field='filehash'):
1155
1156
  continue
1156
- chip.hash_files(*args, check=False, allow_cache=True)
1157
+ chip.hash_files(*args, check=False, allow_cache=True, verbose=False)
1157
1158
  else:
1158
1159
  if not setup:
1159
1160
  if chip.get(*args, field='filehash', step=step, index=index):
1160
1161
  continue
1161
- chip.hash_files(*args, step=step, index=index, check=False, allow_cache=True)
1162
+ chip.hash_files(*args, step=step, index=index,
1163
+ check=False, allow_cache=True, verbose=False)
1162
1164
 
1163
1165
 
1164
1166
  def _finalizenode(chip, step, index, replay):
@@ -1353,7 +1355,7 @@ def _check_node_dependencies(chip, node, deps, deps_was_successful):
1353
1355
  tool, task = get_tool_task(chip, step, index)
1354
1356
 
1355
1357
  # Clear any nodes that have finished from dependency list.
1356
- for in_step, in_index in deps.copy():
1358
+ for in_step, in_index in list(deps):
1357
1359
  in_status = chip.get('record', 'status', step=in_step, index=in_index)
1358
1360
  if in_status != NodeStatus.PENDING:
1359
1361
  deps.remove((in_step, in_index))
@@ -1,7 +1,6 @@
1
1
  # Copyright 2022 Silicon Compiler Authors. All Rights Reserved.
2
2
 
3
3
  import json
4
- import re
5
4
 
6
5
  # Default import must be relative, to facilitate tools with Python interfaces
7
6
  # (such as KLayout) directly importing the schema package. However, the fallback
@@ -70,13 +69,14 @@ def scparam(cfg,
70
69
 
71
70
  # setting values based on types
72
71
  # note (bools are never lists)
73
- if re.match(r'bool', sctype):
72
+ if sctype == 'bool':
74
73
  if defvalue is None:
75
74
  defvalue = False
76
- if re.match(r'\[', sctype) and signature is None:
77
- signature = []
78
- if re.match(r'\[', sctype) and defvalue is None:
79
- defvalue = []
75
+ if '[' in sctype:
76
+ if signature is None:
77
+ signature = []
78
+ if defvalue is None:
79
+ defvalue = []
80
80
 
81
81
  # mandatory for all
82
82
  cfg['type'] = sctype
@@ -106,7 +106,7 @@ def scparam(cfg,
106
106
  cfg['unit'] = unit
107
107
 
108
108
  # file only values
109
- if re.search(r'file', sctype):
109
+ if 'file' in sctype:
110
110
  cfg['hashalgo'] = hashalgo
111
111
  cfg['copy'] = copy
112
112
  cfg['node']['default']['default']['date'] = []
@@ -114,7 +114,7 @@ def scparam(cfg,
114
114
  cfg['node']['default']['default']['filehash'] = []
115
115
  cfg['node']['default']['default']['package'] = []
116
116
 
117
- if re.search(r'dir', sctype):
117
+ if 'dir' in sctype:
118
118
  cfg['hashalgo'] = hashalgo
119
119
  cfg['copy'] = copy
120
120
  cfg['node']['default']['default']['filehash'] = []
@@ -1008,7 +1008,7 @@ class Schema:
1008
1008
 
1009
1009
  ###########################################################################
1010
1010
  def write_json(self, fout):
1011
- localcfg = self.copy().cfg
1011
+ localcfg = {**self.cfg}
1012
1012
  if self.__journal is not None:
1013
1013
  localcfg['__journal__'] = self.__journal
1014
1014
  fout.write(json.dumps(localcfg, indent=4))
@@ -1240,7 +1240,8 @@ class Schema:
1240
1240
  Reads a manifest and replays the journal
1241
1241
  '''
1242
1242
 
1243
- schema = Schema(manifest=filename, logger=self.logger)
1243
+ schema = Schema(logger=self.logger)
1244
+ _, schema.__journal = Schema.__read_manifest_file(str(filename))
1244
1245
  self._import_journal(schema)
1245
1246
 
1246
1247
  #######################################
@@ -1435,7 +1436,7 @@ class Schema:
1435
1436
  action='append',
1436
1437
  help=helpstr,
1437
1438
  default=argparse.SUPPRESS)
1438
- elif re.match(r'\[', typestr) or pernodestr != 'never':
1439
+ elif '[' in typestr or pernodestr != 'never':
1439
1440
  # list type arguments
1440
1441
  parser.add_argument(*switchstrs,
1441
1442
  metavar=metavar,
@@ -1708,7 +1709,7 @@ class Schema:
1708
1709
  if 'default' in keylist:
1709
1710
  continue
1710
1711
  typestr = schema.get(*keylist, field='type')
1711
- should_append = re.match(r'\[', typestr) and not clear
1712
+ should_append = '[' in typestr and not clear
1712
1713
 
1713
1714
  if allow_missing_keys and not self.valid(*keylist, default_valid=True):
1714
1715
  self.logger.warning(f'{keylist} not found in schema, skipping...')
@@ -1786,7 +1787,7 @@ class Schema:
1786
1787
  self.logger.warning(f'Keypath {keylist} is not valid')
1787
1788
  if key_valid and 'default' not in keylist:
1788
1789
  typestr = src.get(*keylist, field='type')
1789
- should_append = re.match(r'\[', typestr) and not clear
1790
+ should_append = '[' in typestr and not clear
1790
1791
  key_cfg = src.__search(*keylist)
1791
1792
  for val, step, index in src._getvals(*keylist, return_defvalue=False):
1792
1793
  # update value, handling scalars vs. lists
@@ -100,20 +100,26 @@ def runtime_options(chip):
100
100
 
101
101
  cmdlist.extend(['-o', f'../outputs/{design}.vexe'])
102
102
 
103
+ c_flags = chip.get('tool', tool, 'task', task, 'var', 'cflags', step=step, index=index)
104
+ c_includes = chip.find_files('tool', tool, 'task', task, 'dir', 'cincludes',
105
+ step=step, index=index)
106
+
103
107
  if chip.get('tool', tool, 'task', task, 'var', 'trace', step=step, index=index)[0] == 'true':
104
108
  trace_type = chip.get('tool', tool, 'task', task, 'var', 'trace_type',
105
109
  step=step, index=index)
106
110
 
107
111
  if trace_type == ['vcd']:
112
+ ext = 'vcd'
108
113
  trace_opt = '--trace'
109
114
  elif trace_type == ['fst']:
115
+ ext = 'fst'
110
116
  trace_opt = '--trace-fst'
111
117
 
112
118
  cmdlist.append(trace_opt)
113
119
 
114
- c_flags = chip.get('tool', tool, 'task', task, 'var', 'cflags', step=step, index=index)
115
- c_includes = chip.find_files('tool', tool, 'task', task, 'dir', 'cincludes',
116
- step=step, index=index)
120
+ # add siliconcompiler specific defines
121
+ c_flags.append("-DSILICONCOMPILER_TRACE_DIR=\\\"reports\\\"")
122
+ c_flags.append(f"-DSILICONCOMPILER_TRACE_FILE=\\\"reports/{design}.{ext}\\\"")
117
123
 
118
124
  if c_includes:
119
125
  c_flags.extend([f'-I{include}' for include in c_includes])
@@ -208,9 +208,10 @@ def prepare_synthesis_libraries(chip):
208
208
  # mark dff libery file with dont use
209
209
  dff_liberty_file = chip.find_files('tool', tool, 'task', task, 'file', 'dff_liberty',
210
210
  step=step, index=index)[0]
211
+ yosys_dff_file = chip.get('tool', tool, 'task', task, 'file', 'dff_liberty_file',
212
+ step=step, index=index)[0]
211
213
 
212
- with open(chip.get('tool', tool, 'task', task, 'file', 'dff_liberty_file',
213
- step=step, index=index)[0], 'w') as f:
214
+ with open(yosys_dff_file, 'w') as f:
214
215
  f.write(prepareLib.processLibertyFile(
215
216
  dff_liberty_file,
216
217
  logger=None if chip.get('option', 'quiet', step=step, index=index) else chip.logger
@@ -250,6 +251,11 @@ def prepare_synthesis_libraries(chip):
250
251
  lib_file_name = f'{lib_file_name_base}_{unique_ident}'
251
252
  unique_ident += 1
252
253
 
254
+ if lib_file == dff_liberty_file:
255
+ with sc_open(yosys_dff_file) as f:
256
+ lib_content[lib_file_name] = f.read()
257
+ continue
258
+
253
259
  lib_content[lib_file_name] = prepareLib.processLibertyFile(
254
260
  lib_file,
255
261
  logger=None if chip.get('option', 'quiet',
@@ -404,3 +404,20 @@ def get_plugins(system):
404
404
  plugins.append(plugin.load())
405
405
 
406
406
  return plugins
407
+
408
+
409
+ def truncate_text(text, width):
410
+ if len(text) <= width:
411
+ return text
412
+
413
+ keep_end = 0
414
+ while text[-1 - keep_end].isnumeric():
415
+ if keep_end >= 2:
416
+ break
417
+ keep_end += 1
418
+
419
+ while len(text) > width:
420
+ break_at = len(text) - keep_end - 3
421
+ text = text[:break_at-1] + '...' + text[break_at+3:]
422
+
423
+ return text
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siliconcompiler
3
- Version: 0.26.3
3
+ Version: 0.26.4.post1
4
4
  Summary: A compiler framework that automates translation from source code to silicon.
5
5
  Home-page: https://siliconcompiler.com
6
6
  Author: Andreas Olofsson
@@ -43,6 +43,8 @@ Requires-Dist: sc-leflib>=0.2.0; extra == "docs"
43
43
  Provides-Extra: examples
44
44
  Requires-Dist: migen==0.9.2; extra == "examples"
45
45
  Requires-Dist: lambdalib==0.2.9; extra == "examples"
46
+ Provides-Extra: profile
47
+ Requires-Dist: gprof2dot==2024.6.6; extra == "profile"
46
48
  Provides-Extra: test
47
49
  Requires-Dist: pytest==8.3.2; extra == "test"
48
50
  Requires-Dist: pytest-xdist==3.6.1; extra == "test"
@@ -1,9 +1,9 @@
1
1
  siliconcompiler/__init__.py,sha256=5T-mWDc05v0FEdwg2btphrAb_W7XaXUmKrRSxuSMNUQ,535
2
2
  siliconcompiler/__main__.py,sha256=x5bzv4spw66iQOldUM-iCWw2j5NxXkkkC_Wd2hGAAgo,182
3
3
  siliconcompiler/_common.py,sha256=27VU0PqZkD6-qz20brjzj-Z8cpDt0oyE6ZA6wARZvrk,1283
4
- siliconcompiler/_metadata.py,sha256=iO0XbuLpdQ8M_UIUfaYtJpaP2jX2xzy1DsX5ysoAZW0,1300
5
- siliconcompiler/core.py,sha256=nEi-kSkVsI3LcaYHeKm7avXTUqQFvsBZlQ521ORVa1E,131000
6
- siliconcompiler/flowgraph.py,sha256=aQh0VO7LVwGNJbWZcBIgzGRv_pDH72_ilMQtK906Rqk,22502
4
+ siliconcompiler/_metadata.py,sha256=7UWL37j0f1EGwXqC65d_g5vkEjwFTvCZX2FqQcV2xd0,1306
5
+ siliconcompiler/core.py,sha256=Sakw_lwdW6aFwIeI3UtT40LI3rxT2ToVvj4FytkWcQU,132906
6
+ siliconcompiler/flowgraph.py,sha256=1a6_hnAuxpGNevvF4EbrjW7PhhOjyQqQfeBuEiJXOUw,22533
7
7
  siliconcompiler/issue.py,sha256=wRRG3b5bz8IdcT__hJME1svZwbsh_fGQr4VR8sTnta8,11425
8
8
  siliconcompiler/package.py,sha256=Z2FqMRq8mtvmF6d_hyDOZN8DOZ8gu7zABDMWOfUGu-M,14463
9
9
  siliconcompiler/units.py,sha256=dYn185TzusMtBd69RFKhNlCky2td5jC__AJdPjqXELU,6069
@@ -27,7 +27,7 @@ siliconcompiler/flows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
27
27
  siliconcompiler/flows/_common.py,sha256=xu2k8gzE0RznrhXblSWLiuhvAqYRI4wbmd0JPepu_J8,2214
28
28
  siliconcompiler/flows/asicflow.py,sha256=pWonmU0iqKyk4KW4unKdAfgadp0l659NKbhXFyn6DRc,6298
29
29
  siliconcompiler/flows/asictopflow.py,sha256=EGzqEwTJLC983xA7J9Dky32sZeHQ-Ptn5uKh2DOQ70E,1207
30
- siliconcompiler/flows/dvflow.py,sha256=iTrmw2dRYEDCwNZysLx4N1YIe5KiVbZOnCUhmSYUsHE,2252
30
+ siliconcompiler/flows/dvflow.py,sha256=Wty9FQyPE3ssl0_Xf6UwpJu2Ow9RIPJK22zIM6jCzhk,2408
31
31
  siliconcompiler/flows/fpgaflow.py,sha256=_de2l4IqH3QQE0g1eWiXDgFsWfg5yy3gzTEPsBwgo-c,6679
32
32
  siliconcompiler/flows/generate_openroad_rcx.py,sha256=z3HcYFEyROqFe7QL3Bay16CrMvD7_BGB4DX8woiX9xU,2424
33
33
  siliconcompiler/flows/lintflow.py,sha256=Jg1WYVI4AXNybARXt-gbCi6KvxExQJYE0EKW7Tav3fU,1051
@@ -66,22 +66,22 @@ siliconcompiler/remote/server_schema/responses/delete_job.json,sha256=25qnemP53r
66
66
  siliconcompiler/remote/server_schema/responses/get_results.json,sha256=86jz_z3o8h-F3VEndX6Ap7YReTAmaEPOw07BI2Uz42U,409
67
67
  siliconcompiler/remote/server_schema/responses/remote_run.json,sha256=qOX3lAsm--aMqUNq3jCnspoyl4y-sv9xH64TeCMCKrg,500
68
68
  siliconcompiler/report/__init__.py,sha256=jdPkZx3csEPoWA_fJcdr5mSu5WOhrrGgcc1iot9fR1A,408
69
- siliconcompiler/report/html_report.py,sha256=82THDLkGhvOmnwgHnjgm958CfGdagCBdmJlSpyKn0FM,2672
69
+ siliconcompiler/report/html_report.py,sha256=HWLnKs8t3Ve0Nduw9h4hLpMS6JjA8-zRo3ZQktl5P4Y,2671
70
70
  siliconcompiler/report/report.py,sha256=8kMGjsRoqELFtGjujfUFhmyrhjKYwA1EEznI8k5ivlk,13937
71
71
  siliconcompiler/report/streamlit_report.py,sha256=GUwHgeMVOuETz8ZvYsEYv-uIDcV8KdLQX4xKJFS2a0M,4179
72
72
  siliconcompiler/report/streamlit_viewer.py,sha256=WbwcEf2t1gQihUnxnefwlAXKThwcNd4iQmeC8uDRY5c,41965
73
73
  siliconcompiler/report/summary_image.py,sha256=r8GbFJgD0ZLfYFFl8nmUhsh87wWP7evCljWWHx7_L8U,3687
74
- siliconcompiler/report/summary_table.py,sha256=NfSB8yHFirSCxvBROXURLzZM4UrYN2M050CScjeuFYk,2997
75
- siliconcompiler/report/utils.py,sha256=Yr-vcCoylN3HvlqAK0l6LLgdHfauezCmAhCzVqiHHpU,6603
76
- siliconcompiler/scheduler/__init__.py,sha256=0vwjttIOHxMBJBtYKgP9i4JE9DqPjbJ5j-kvcTutx30,82254
74
+ siliconcompiler/report/summary_table.py,sha256=WHzk710YeTZKzOVOYDtzoHMSnDRJ6GcCL5yO_q22NjE,3521
75
+ siliconcompiler/report/utils.py,sha256=daMAoRrRhRKfsVbPO5SIz8cvpGkFV12nkDNCdmUJCTU,6602
76
+ siliconcompiler/scheduler/__init__.py,sha256=mWbSq6oYAWUzBbwxWVVcAnqzs5w9qKAwheNQkDMSj28,82383
77
77
  siliconcompiler/scheduler/docker_runner.py,sha256=ZboFmi9C_TPkgQlizU3nLmdDUip5EqvN-1JoJZMFFTs,8318
78
78
  siliconcompiler/scheduler/run_node.py,sha256=Mmj2epARKCuwN6oW-PyvExwY3OzRxUrG0mPLr3SwQ6M,5201
79
79
  siliconcompiler/scheduler/send_messages.py,sha256=ZVO6923-EJWUMlDOOpLEhaSrsKtP-d4J_UcfRp6kJDo,6387
80
80
  siliconcompiler/scheduler/slurm.py,sha256=IaglZSvrHOqEDT46ZcJ19gXpJxiMm7AAO7EvVdrauZc,7305
81
81
  siliconcompiler/scheduler/validation/email_credentials.json,sha256=rJHUmTS0YyQVCeZpJI1D4WgxsXRHigZTJ6xToITziuo,1800
82
82
  siliconcompiler/schema/__init__.py,sha256=5MfwK7me_exH7qjcInSUSesM0kiGIx8FXQDj4Br2QAQ,127
83
- siliconcompiler/schema/schema_cfg.py,sha256=BXN-79sgYwA-pQLc7PlYwlQIA92jmvWNQWsGYC-pAV8,183570
84
- siliconcompiler/schema/schema_obj.py,sha256=R3rrGNgoyNakMmQ2HDW9XJwfar3WMKVyqWrClr38jR8,74403
83
+ siliconcompiler/schema/schema_cfg.py,sha256=NjBklevKitriRGNgMoQdSfxOdkkeGYjpKb9Gpga3F_c,183517
84
+ siliconcompiler/schema/schema_obj.py,sha256=7sQ7GfU0iWXqtGibp28sy2g7caKRnNinrEeu71QPcaE,74425
85
85
  siliconcompiler/schema/utils.py,sha256=KKWtwOkXcDjaxs2f4yIuE6JCFZaapGjdLG4dQLYmH08,4111
86
86
  siliconcompiler/sphinx_ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
87
87
  siliconcompiler/sphinx_ext/dynamicgen.py,sha256=bfGLUzggDEvw0GtWzt73LStlh1m90224KCPFj8PRz4s,35531
@@ -200,12 +200,12 @@ siliconcompiler/tools/slang/__init__.py,sha256=BMJjbTWCumTBbshaTc5Wgjcl3kxPiPjwc
200
200
  siliconcompiler/tools/slang/lint.py,sha256=eNe82gmZgCMvLEKQJHagyP1yNWRQ23agBE3n709-Lz4,3080
201
201
  siliconcompiler/tools/surelog/parse.py,sha256=i7mU6xIWrSfuTb9ov1ZSJKipyyhvlGFFmKf8y--Qrns,6208
202
202
  siliconcompiler/tools/surelog/surelog.py,sha256=PlkIjrFGq1t8U2gxFSKPouDmcnS6LE1oTZDrXtVJh7M,5034
203
- siliconcompiler/tools/surelog/bin/surelog.exe,sha256=ipLxuZRUeeUCfqcjOidbBfVN3mNJhuwmoXBqrmq9aqk,6422528
203
+ siliconcompiler/tools/surelog/bin/surelog.exe,sha256=4lIJbHFKDENE2nFR96oDSXzqHZjOElchVR6oiMA2SQ8,6422528
204
204
  siliconcompiler/tools/surelog/templates/output.v,sha256=NE9iQW-IEx0wanJSpbZQjRt-Qq2oIx78JOzlsBcd0Is,213
205
205
  siliconcompiler/tools/sv2v/convert.py,sha256=PG1cYSUil2sZDGh8Eb0dCvsTMnW7o2nUewv2LA23DCw,1837
206
206
  siliconcompiler/tools/sv2v/sv2v.py,sha256=AuMHqm109GJhz6oqvDyyrO9ICGI8FiDXKzBsdMFvDa0,1078
207
207
  siliconcompiler/tools/template/template.py,sha256=0UwvFxuNoop41gBgcP21AfmHL13C1HZOlCjPGEgz1S8,3531
208
- siliconcompiler/tools/verilator/compile.py,sha256=CrDpYqOPo7zgOWXAfadj4xI32OoJ3AJfU1KXXMqYGLs,5345
208
+ siliconcompiler/tools/verilator/compile.py,sha256=gpUpivElPccHkne4UFg8lr5hLw8dT6yOLnJb4sfAkFk,5604
209
209
  siliconcompiler/tools/verilator/lint.py,sha256=YAlWcpeSbCdBSDLU5-eJnKWQUv3cM3lQaGBUyWYqN78,539
210
210
  siliconcompiler/tools/verilator/parse.py,sha256=J8yCqLJ6TZTkloRnMcJIhOmAxIfUZmtgnVY7N8RVSjs,833
211
211
  siliconcompiler/tools/verilator/verilator.py,sha256=CDbLZauBXFbh2yC1I02FIahBOB0Sm0EeCPjNwryhpUM,6115
@@ -232,7 +232,7 @@ siliconcompiler/tools/yosys/lec.py,sha256=7kUpdcNnl1_YVJzD6ZQY2RFHCaucxJHboPRkK1
232
232
  siliconcompiler/tools/yosys/prepareLib.py,sha256=HdgZVK-zSuKdMIsGmpgmFjKpIE0PA6IVAF1YsGOAG7c,2326
233
233
  siliconcompiler/tools/yosys/sc_lec.tcl,sha256=ZmgCEA_cuwBk1E9d2PEOsdO1595VCEFy1d6J5_61Pfo,2373
234
234
  siliconcompiler/tools/yosys/sc_syn.tcl,sha256=dXghNwdrzh_ry_hfmgBMlnJATEPCvN2YfdtInJShEOk,2519
235
- siliconcompiler/tools/yosys/syn_asic.py,sha256=OheWDbk6_ZJypSr-XecQWUdzd-jTWD0Mwb4xhIrw7F4,24198
235
+ siliconcompiler/tools/yosys/syn_asic.py,sha256=p1adJk6-6hhf-T9CXPOeeSmwK95IpnbSuI1D-dtI9DY,24443
236
236
  siliconcompiler/tools/yosys/syn_asic.tcl,sha256=emAM1PS04Vw3dNK6M6D-pd7daOVKajxKHeey40AqYiQ,12262
237
237
  siliconcompiler/tools/yosys/syn_asic_fpga_shared.tcl,sha256=c9QcuhnYCkPWk-tO71TO3vrU1pDIx9jqomswpHAMKLY,746
238
238
  siliconcompiler/tools/yosys/syn_fpga.py,sha256=GZw4lI1veYn-LV8ELr9sPYpmENqPeMBRysqRD1o1poU,5533
@@ -241,12 +241,12 @@ siliconcompiler/tools/yosys/syn_strategies.tcl,sha256=lrjKiso1p5OfoyF-g6Eujt8aj3
241
241
  siliconcompiler/tools/yosys/yosys.py,sha256=xh1XmcA0liahy-QE6vSNbvjkcgOlKUk5BYAiAWDdwOk,5096
242
242
  siliconcompiler/tools/yosys/techmaps/lcu_kogge_stone.v,sha256=FqER4Zjjr5jC3TbM7ZX_pftAnlD4_uR6EJQpoII1WOU,812
243
243
  siliconcompiler/tools/yosys/templates/abc.const,sha256=2Ea7eZz2eHzar3RLf_l2Nb9dnr8A_Ax0Sxb8krA33hw,118
244
- siliconcompiler/utils/__init__.py,sha256=b3mhPeBb8HIqU-8w23h2IMLSxuDrXm53e5iSeqZrkDI,13168
244
+ siliconcompiler/utils/__init__.py,sha256=32FMHXVJWtbmvjIEVm2-XwX4A4GPHSTvkWzs0Pw1HWc,13545
245
245
  siliconcompiler/utils/asic.py,sha256=knq-raDWs1FKtfqkUbLOecdSwXezlmqb8gk9QPZWdqY,5144
246
246
  siliconcompiler/utils/showtools.py,sha256=kNaw97U6tV_MwLvWb1dme_k9E6dQVqnTT6y2zzMcXJk,1158
247
- siliconcompiler-0.26.3.dist-info/LICENSE,sha256=UJh7mqgsPZN3gg37jhwYnrtCUs1m19vkIA6Px7jAOPY,10956
248
- siliconcompiler-0.26.3.dist-info/METADATA,sha256=dfjuEAkNiUygxzFUch_VhbXAsBmumNqMEQzxZB_TdRQ,9612
249
- siliconcompiler-0.26.3.dist-info/WHEEL,sha256=TYUDfHBZQod294as1x7ro928Hk-WSGPsPZPVYrwc_bI,101
250
- siliconcompiler-0.26.3.dist-info/entry_points.txt,sha256=M3cpZxvqanXhVU9CuLTRDzBdDKmKz-t0p4DT57TyysU,451
251
- siliconcompiler-0.26.3.dist-info/top_level.txt,sha256=H8TOYhnEUZAV1RJTa8JRtjLIebwHzkQUhA2wkNU2O6M,16
252
- siliconcompiler-0.26.3.dist-info/RECORD,,
247
+ siliconcompiler-0.26.4.post1.dist-info/LICENSE,sha256=UJh7mqgsPZN3gg37jhwYnrtCUs1m19vkIA6Px7jAOPY,10956
248
+ siliconcompiler-0.26.4.post1.dist-info/METADATA,sha256=tLPcZlnq-IANGpk8VbV4hdfYNCD-LexQF8xmIIe84y0,9699
249
+ siliconcompiler-0.26.4.post1.dist-info/WHEEL,sha256=TYUDfHBZQod294as1x7ro928Hk-WSGPsPZPVYrwc_bI,101
250
+ siliconcompiler-0.26.4.post1.dist-info/entry_points.txt,sha256=M3cpZxvqanXhVU9CuLTRDzBdDKmKz-t0p4DT57TyysU,451
251
+ siliconcompiler-0.26.4.post1.dist-info/top_level.txt,sha256=H8TOYhnEUZAV1RJTa8JRtjLIebwHzkQUhA2wkNU2O6M,16
252
+ siliconcompiler-0.26.4.post1.dist-info/RECORD,,