siliconcompiler 0.29.3__py3-none-any.whl → 0.29.4__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 (42) hide show
  1. siliconcompiler/_metadata.py +1 -1
  2. siliconcompiler/apps/sc_install.py +18 -3
  3. siliconcompiler/remote/client.py +3 -0
  4. siliconcompiler/scheduler/__init__.py +9 -3
  5. siliconcompiler/tools/__init__.py +1 -1
  6. siliconcompiler/tools/_common/asic.py +3 -0
  7. siliconcompiler/tools/_common/asic_clock.py +101 -0
  8. siliconcompiler/tools/bambu/__init__.py +32 -0
  9. siliconcompiler/tools/bambu/convert.py +93 -12
  10. siliconcompiler/tools/openroad/_apr.py +11 -0
  11. siliconcompiler/tools/openroad/fillmetal_insertion.py +0 -1
  12. siliconcompiler/tools/openroad/init_floorplan.py +7 -1
  13. siliconcompiler/tools/openroad/macro_placement.py +1 -2
  14. siliconcompiler/tools/openroad/pin_placement.py +0 -1
  15. siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +3 -2
  16. siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +1 -0
  17. siliconcompiler/tools/openroad/scripts/apr/sc_power_grid.tcl +1 -0
  18. siliconcompiler/tools/openroad/scripts/apr/sc_repair_timing.tcl +24 -0
  19. siliconcompiler/tools/openroad/scripts/common/procs.tcl +2 -1
  20. siliconcompiler/tools/openroad/scripts/common/read_input_files.tcl +1 -0
  21. siliconcompiler/tools/openroad/scripts/common/reports.tcl +0 -13
  22. siliconcompiler/tools/slang/__init__.py +1 -0
  23. siliconcompiler/tools/verilator/verilator.py +1 -0
  24. siliconcompiler/tools/yosys/__init__.py +26 -23
  25. siliconcompiler/tools/yosys/procs.tcl +17 -0
  26. siliconcompiler/tools/yosys/syn_asic.py +12 -65
  27. siliconcompiler/tools/yosys/syn_asic.tcl +6 -51
  28. siliconcompiler/toolscripts/_tools.json +2 -2
  29. siliconcompiler/toolscripts/rhel8/install-yosys.sh +1 -1
  30. siliconcompiler/toolscripts/rhel9/install-openroad.sh +34 -0
  31. siliconcompiler/toolscripts/rhel9/install-yosys.sh +1 -1
  32. siliconcompiler/toolscripts/ubuntu20/install-yosys.sh +1 -1
  33. siliconcompiler/toolscripts/ubuntu22/install-yosys.sh +1 -1
  34. siliconcompiler/toolscripts/ubuntu24/install-yosys.sh +1 -1
  35. siliconcompiler/utils/__init__.py +2 -0
  36. {siliconcompiler-0.29.3.dist-info → siliconcompiler-0.29.4.dist-info}/METADATA +5 -5
  37. {siliconcompiler-0.29.3.dist-info → siliconcompiler-0.29.4.dist-info}/RECORD +41 -40
  38. siliconcompiler/tools/bambu/bambu.py +0 -32
  39. {siliconcompiler-0.29.3.dist-info → siliconcompiler-0.29.4.dist-info}/LICENSE +0 -0
  40. {siliconcompiler-0.29.3.dist-info → siliconcompiler-0.29.4.dist-info}/WHEEL +0 -0
  41. {siliconcompiler-0.29.3.dist-info → siliconcompiler-0.29.4.dist-info}/entry_points.txt +0 -0
  42. {siliconcompiler-0.29.3.dist-info → siliconcompiler-0.29.4.dist-info}/top_level.txt +0 -0
@@ -12,7 +12,7 @@ Sources: https://github.com/YosysHQ/yosys
12
12
 
13
13
  Installation: https://github.com/YosysHQ/yosys
14
14
  '''
15
-
15
+ import os
16
16
  import re
17
17
  import json
18
18
  from siliconcompiler import sc_open
@@ -107,28 +107,31 @@ def syn_post_process(chip):
107
107
  step = chip.get('arg', 'step')
108
108
  index = chip.get('arg', 'index')
109
109
 
110
- with sc_open("reports/stat.json") as f:
111
- metrics = json.load(f)
112
- if "design" in metrics:
113
- metrics = metrics["design"]
114
-
115
- if "area" in metrics:
116
- record_metric(chip, step, index, 'cellarea',
117
- float(metrics["area"]),
118
- "reports/stat.json",
119
- source_unit='um^2')
120
- if "num_cells" in metrics:
121
- record_metric(chip, step, index, 'cells',
122
- metrics["num_cells"],
123
- "reports/stat.json")
124
- if "num_wire_bits" in metrics:
125
- record_metric(chip, step, index, 'nets',
126
- metrics["num_wire_bits"],
127
- "reports/stat.json")
128
- if "num_port_bits" in metrics:
129
- record_metric(chip, step, index, 'pins',
130
- metrics["num_port_bits"],
131
- "reports/stat.json")
110
+ if os.path.exists("reports/stat.json"):
111
+ with sc_open("reports/stat.json") as f:
112
+ metrics = json.load(f)
113
+ if "design" in metrics:
114
+ metrics = metrics["design"]
115
+
116
+ if "area" in metrics:
117
+ record_metric(chip, step, index, 'cellarea',
118
+ float(metrics["area"]),
119
+ "reports/stat.json",
120
+ source_unit='um^2')
121
+ if "num_cells" in metrics:
122
+ record_metric(chip, step, index, 'cells',
123
+ metrics["num_cells"],
124
+ "reports/stat.json")
125
+ if "num_wire_bits" in metrics:
126
+ record_metric(chip, step, index, 'nets',
127
+ metrics["num_wire_bits"],
128
+ "reports/stat.json")
129
+ if "num_port_bits" in metrics:
130
+ record_metric(chip, step, index, 'pins',
131
+ metrics["num_port_bits"],
132
+ "reports/stat.json")
133
+ else:
134
+ chip.logger.warning("Yosys cell statistics are missing")
132
135
 
133
136
  registers = None
134
137
  with sc_open(f"{step}.log") as f:
@@ -52,3 +52,20 @@ proc sc_apply_params { } {
52
52
  }
53
53
  }
54
54
  }
55
+
56
+ proc sc_get_scratchpad { name } {
57
+ yosys echo off
58
+ set value [yosys tee -q -s result.string scratchpad -get $name]
59
+ yosys echo on
60
+
61
+ return $value
62
+ }
63
+
64
+ proc sc_load_plugin { name } {
65
+ catch { yosys tee -q -s sc.load.test plugin -i $name }
66
+ set load_test [sc_get_scratchpad sc.load.test]
67
+ if { [string first "ERROR" $load_test] == -1 } {
68
+ return 1
69
+ }
70
+ return 0
71
+ }
@@ -8,6 +8,7 @@ from siliconcompiler import sc_open
8
8
  from siliconcompiler import utils
9
9
  from siliconcompiler.tools._common.asic import set_tool_task_var, get_libraries, get_mainlib, \
10
10
  CellArea
11
+ from siliconcompiler.tools._common.asic_clock import get_clock_period
11
12
  from siliconcompiler.tools._common import get_tool_task
12
13
 
13
14
 
@@ -75,12 +76,11 @@ def setup_asic(chip):
75
76
  # set default control knobs
76
77
  mainlib = get_mainlib(chip)
77
78
  for option, value in [
78
- ('flatten', "true"),
79
- ('auto_flatten', "true"),
80
- ('hier_iterations', "10"),
81
- ('hier_threshold', "1000"),
82
- ('autoname', "true"),
83
- ('add_buffers', "true")]:
79
+ ('flatten', True),
80
+ ('auto_flatten', True),
81
+ ('hier_threshold', 1000),
82
+ ('autoname', True),
83
+ ('add_buffers', True)]:
84
84
  chip.set('tool', tool, 'task', task, 'var', option, value,
85
85
  step=step, index=index, clobber=False)
86
86
  chip.add('tool', tool, 'task', task, 'require',
@@ -387,11 +387,9 @@ def _get_synthesis_library_key(chip, lib, corners):
387
387
 
388
388
 
389
389
  def get_abc_period(chip):
390
-
391
- tool = 'yosys'
392
390
  step = chip.get('arg', 'step')
393
391
  index = chip.get('arg', 'index')
394
- _, task = get_tool_task(chip, step, index)
392
+ tool, task = get_tool_task(chip, step, index)
395
393
 
396
394
  mainlib = get_mainlib(chip)
397
395
 
@@ -400,67 +398,16 @@ def get_abc_period(chip):
400
398
  if abc_clock_period:
401
399
  return abc_clock_period[0]
402
400
 
403
- period = None
404
-
405
401
  abc_clock_multiplier = float(chip.get('library', mainlib, 'option', 'var',
406
402
  'yosys_abc_clock_multiplier')[0])
407
403
 
408
- # get clock information from sdc files
409
- # TODO: fix for fpga/asic differentiation later
410
- if chip.valid('input', 'constraint', 'sdc'):
411
- for sdc in chip.find_files('input', 'constraint', 'sdc', step=step, index=index):
412
- lines = []
413
- with sc_open(sdc) as f:
414
- lines = f.read().splitlines()
415
-
416
- # collect simple variables in case clock is specified with a variable
417
- re_var = r"[A-Za-z0-9_]+"
418
- re_num = r"[0-9\.]+"
419
- sdc_vars = {}
420
- for line in lines:
421
- tcl_variable = re.findall(fr"^\s*set\s+({re_var})\s+({re_num})", line)
422
- if tcl_variable:
423
- var_name, var_value = tcl_variable[0]
424
- sdc_vars[f'${var_name}'] = float(var_value)
425
-
426
- # TODO: handle line continuations
427
- for line in lines:
428
- clock_period = re.findall(fr"create_clock\s.*-period\s+({re_num}|\${re_var})",
429
- line)
430
- if clock_period:
431
- clock_period = clock_period[0]
432
- if clock_period[0] == '$':
433
- if clock_period in sdc_vars:
434
- clock_period = sdc_vars[clock_period]
435
- else:
436
- chip.logger.warning('Unable to identify clock period from '
437
- f'{clock_period}.')
438
- continue
439
- else:
440
- clock_period = float(clock_period)
441
-
442
- clock_period = clock_period * abc_clock_multiplier
443
-
444
- if period is None:
445
- period = clock_period
446
- else:
447
- period = min(period, clock_period)
448
-
449
- if period is None:
450
- # get clock information from defined clocks
451
- for pin in chip.getkeys('datasheet', 'pin'):
452
- for mode in chip.getkeys('datasheet', 'pin', pin, 'type'):
453
- if chip.get('datasheet', 'pin', pin, 'type', mode) == 'clock':
454
- clock_period = min(chip.get('datasheet', 'pin', pin, 'tperiod', mode)) * 1e12
455
-
456
- if period is None:
457
- period = clock_period
458
- else:
459
- period = min(period, clock_period)
460
-
461
- if period is None:
404
+ _, period = get_clock_period(chip,
405
+ clock_units_multiplier=abc_clock_multiplier / 1000)
406
+ if not period:
462
407
  return None
463
408
 
409
+ period *= 1000
410
+
464
411
  abc_clock_derating = chip.get('tool', tool, 'task', task, 'var', 'abc_clock_derating',
465
412
  step=step, index=index)
466
413
  if abc_clock_derating:
@@ -38,44 +38,6 @@ proc get_modules { { find "*" } } {
38
38
  return [lsort $modules]
39
39
  }
40
40
 
41
- proc determine_keep_hierarchy { iter cell_limit } {
42
- global sc_design
43
-
44
- # Grab only the modules and not the header and footer
45
- set modules [get_modules]
46
-
47
- # Save a copy of the current design so we can do a few optimizations and techmap
48
- yosys design -save hierarchy_checkpoint
49
- yosys techmap
50
- yosys opt -fast -full -purge
51
-
52
- set cell_counts [dict create]
53
-
54
- foreach module $modules {
55
- yosys stat -top $module
56
- yosys echo off
57
- set cells_count [yosys tee -q -s result.string scratchpad -get stat.num_cells]
58
- yosys echo on
59
- dict set cell_counts $module [expr { int($cells_count) }]
60
- }
61
-
62
- # Restore design
63
- yosys design -load hierarchy_checkpoint
64
- foreach module $modules {
65
- yosys select -module $module
66
- yosys setattr -mod -set keep_hierarchy \
67
- [expr { [dict get $cell_counts $module] > $cell_limit }]
68
- yosys select -clear
69
- }
70
-
71
- preserve_modules
72
-
73
- # Rerun coarse synth with flatten
74
- yosys synth -flatten -top $sc_design -run coarse:fine
75
-
76
- return [expr { [llength $modules] != [llength [get_modules]] }]
77
- }
78
-
79
41
  ####################
80
42
  # DESIGNER's CHOICE
81
43
  ####################
@@ -171,11 +133,11 @@ proc get_buffer_cell { } {
171
133
  ########################################################
172
134
 
173
135
  foreach lib_file "$sc_libraries $sc_macro_libraries" {
174
- yosys read_liberty -lib $lib_file
136
+ yosys read_liberty -setattr liberty_cell -lib $lib_file
175
137
  }
176
138
  foreach bb_file $sc_blackboxes {
177
139
  yosys log "Reading blackbox model file: $bb_file"
178
- yosys read_verilog -sv $bb_file
140
+ yosys read_verilog -setattr blackbox -sv $bb_file
179
141
  }
180
142
 
181
143
  ########################################################
@@ -216,7 +178,6 @@ if {
216
178
  set sc_tbuf "true"
217
179
 
218
180
  yosys tribuf
219
- yosys stat
220
181
  }
221
182
 
222
183
  set flatten_design [expr {
@@ -245,18 +206,12 @@ sc_map_memory $sc_memory_libmap_files $sc_memory_techmap_files 0
245
206
 
246
207
  # Perform hierarchy flattening
247
208
  if { !$flatten_design && [lindex [sc_cfg_tool_task_get var auto_flatten] 0] == "true" } {
248
- yosys log -push
249
- yosys log -header "SC Auto flattening"
250
- set sc_hier_iterations \
251
- [lindex [sc_cfg_tool_task_get var hier_iterations] 0]
252
209
  set sc_hier_threshold \
253
210
  [lindex [sc_cfg_tool_task_get var hier_threshold] 0]
254
- for { set i 0 } { $i < $sc_hier_iterations } { incr i } {
255
- if { [determine_keep_hierarchy $i $sc_hier_threshold] == 0 } {
256
- break
257
- }
258
- }
259
- yosys log -pop
211
+
212
+ yosys keep_hierarchy -min_cost $sc_hier_threshold
213
+
214
+ yosys synth -flatten {*}$synth_args -top $sc_design -run coarse:fine
260
215
  }
261
216
 
262
217
  # Finish synthesis
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "openroad": {
3
3
  "git-url": "https://github.com/The-OpenROAD-Project/OpenROAD.git",
4
- "git-commit": "44e36144112da6b2a3bb346ca0d0b692b6d117ca",
4
+ "git-commit": "6645a5370f109cff49d7a735d81dae239df387c0",
5
5
  "docker-cmds": [
6
6
  "# Remove OR-Tools files",
7
7
  "RUN rm -f $SC_PREFIX/Makefile $SC_PREFIX/README.md",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "bluespec": {
34
34
  "git-url": "https://github.com/B-Lang-org/bsc.git",
35
- "git-commit": "4cac6ebae076e8b8378597aba1d2119aa29ec419",
35
+ "git-commit": "2024.07",
36
36
  "auto-update": false
37
37
  },
38
38
  "klayout": {
@@ -18,6 +18,6 @@ cd yosys
18
18
  git checkout $(python3 ${src_path}/_tools.py --tool yosys --field git-commit)
19
19
  git submodule update --init --recursive
20
20
 
21
- make -j$(nproc)
21
+ make -j$(nproc) PREFIX="$PREFIX"
22
22
  sudo make install PREFIX="$PREFIX"
23
23
  cd -
@@ -0,0 +1,34 @@
1
+ #!/bin/sh
2
+
3
+ set -e
4
+
5
+ src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)/..
6
+
7
+ mkdir -p deps
8
+ cd deps
9
+
10
+ git clone $(python3 ${src_path}/_tools.py --tool openroad --field git-url) openroad
11
+ cd openroad
12
+ git checkout $(python3 ${src_path}/_tools.py --tool openroad --field git-commit)
13
+ git submodule update --init --recursive
14
+
15
+ # Install missing dependencies
16
+ sudo yum install -y bison byacc
17
+
18
+ deps_args=""
19
+ if [ ! -z ${PREFIX} ]; then
20
+ deps_args="-prefix=$PREFIX"
21
+ fi
22
+ sudo ./etc/DependencyInstaller.sh $deps_args
23
+
24
+ cmake_args="-DENABLE_TESTS=OFF"
25
+ if [ ! -z ${PREFIX} ]; then
26
+ cmake_args="$cmake_args -DCMAKE_INSTALL_PREFIX=$PREFIX"
27
+ fi
28
+
29
+ ./etc/Build.sh -cmake="$cmake_args"
30
+
31
+ cd build
32
+ sudo make install
33
+
34
+ cd -
@@ -18,6 +18,6 @@ cd yosys
18
18
  git checkout $(python3 ${src_path}/_tools.py --tool yosys --field git-commit)
19
19
  git submodule update --init --recursive
20
20
 
21
- make -j$(nproc)
21
+ make -j$(nproc) PREFIX="$PREFIX"
22
22
  sudo make install PREFIX="$PREFIX"
23
23
  cd -
@@ -19,6 +19,6 @@ cd yosys
19
19
  git checkout $(python3 ${src_path}/_tools.py --tool yosys --field git-commit)
20
20
  git submodule update --init --recursive
21
21
 
22
- make -j$(nproc)
22
+ make -j$(nproc) PREFIX="$PREFIX"
23
23
  sudo make install PREFIX="$PREFIX"
24
24
  cd -
@@ -19,6 +19,6 @@ cd yosys
19
19
  git checkout $(python3 ${src_path}/_tools.py --tool yosys --field git-commit)
20
20
  git submodule update --init --recursive
21
21
 
22
- make -j$(nproc)
22
+ make -j$(nproc) PREFIX="$PREFIX"
23
23
  sudo make install PREFIX="$PREFIX"
24
24
  cd -
@@ -19,6 +19,6 @@ cd yosys
19
19
  git checkout $(python3 ${src_path}/_tools.py --tool yosys --field git-commit)
20
20
  git submodule update --init --recursive
21
21
 
22
- make -j$(nproc)
22
+ make -j$(nproc) PREFIX="$PREFIX"
23
23
  sudo make install PREFIX="$PREFIX"
24
24
  cd -
@@ -85,6 +85,7 @@ def get_default_iomap():
85
85
 
86
86
  # High level languages
87
87
  hll_c = ('c', 'cc', 'cpp', 'c++', 'cp', 'cxx', 'hpp', 'h')
88
+ hll_llvm = ('ll',)
88
89
  hll_bsv = ('bsv',)
89
90
  hll_scala = ('scala',)
90
91
  hll_python = ('py',)
@@ -132,6 +133,7 @@ def get_default_iomap():
132
133
  # Build default map with fileset and type
133
134
  default_iomap = {}
134
135
  default_iomap.update({ext: ('hll', 'c') for ext in hll_c})
136
+ default_iomap.update({ext: ('hll', 'llvm') for ext in hll_llvm})
135
137
  default_iomap.update({ext: ('hll', 'bsv') for ext in hll_bsv})
136
138
  default_iomap.update({ext: ('hll', 'scala') for ext in hll_scala})
137
139
  default_iomap.update({ext: ('hll', 'python') for ext in hll_python})
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: siliconcompiler
3
- Version: 0.29.3
3
+ Version: 0.29.4
4
4
  Summary: A compiler framework that automates translation from source code to silicon.
5
5
  Author-email: Andreas Olofsson <andreas.d.olofsson@gmail.com>
6
6
  License: Apache License 2.0
@@ -38,7 +38,7 @@ Requires-Dist: psutil>=5.8.0
38
38
  Requires-Dist: Pillow==10.4.0; python_version <= "3.8"
39
39
  Requires-Dist: Pillow==11.1.0; python_version >= "3.9"
40
40
  Requires-Dist: GitPython==3.1.44
41
- Requires-Dist: lambdapdk>=0.1.46
41
+ Requires-Dist: lambdapdk>=0.1.47
42
42
  Requires-Dist: PyGithub==2.5.0
43
43
  Requires-Dist: urllib3>=1.26.0
44
44
  Requires-Dist: fasteners==0.19
@@ -58,7 +58,7 @@ Requires-Dist: pytest==8.3.4; extra == "test"
58
58
  Requires-Dist: pytest-xdist==3.6.1; extra == "test"
59
59
  Requires-Dist: pytest-timeout==2.3.1; extra == "test"
60
60
  Requires-Dist: pytest-asyncio==0.24.0; python_version <= "3.8" and extra == "test"
61
- Requires-Dist: pytest-asyncio==0.25.2; python_version >= "3.9" and extra == "test"
61
+ Requires-Dist: pytest-asyncio==0.25.3; python_version >= "3.9" and extra == "test"
62
62
  Requires-Dist: pytest-cov==5.0.0; python_version <= "3.8" and extra == "test"
63
63
  Requires-Dist: pytest-cov==6.0.0; python_version >= "3.9" and extra == "test"
64
64
  Requires-Dist: responses==0.25.6; extra == "test"
@@ -66,7 +66,7 @@ Requires-Dist: PyVirtualDisplay==3.0; extra == "test"
66
66
  Provides-Extra: lint
67
67
  Requires-Dist: flake8==7.1.1; extra == "lint"
68
68
  Requires-Dist: tclint==0.5.0; extra == "lint"
69
- Requires-Dist: codespell==2.4.0; extra == "lint"
69
+ Requires-Dist: codespell==2.4.1; extra == "lint"
70
70
  Provides-Extra: docs
71
71
  Requires-Dist: Sphinx==8.1.3; extra == "docs"
72
72
  Requires-Dist: pip-licenses==5.0.0; extra == "docs"
@@ -195,7 +195,7 @@ python3 -m pip install -e .[docs,test] # Optional install step for generating d
195
195
  Installation instructions for all external tools can be found in the
196
196
  [External Tools](https://docs.siliconcompiler.com/en/stable/user_guide/installation.html#external-tools) section
197
197
  of the user guide. We have included shell setup scripts (Ubuntu) for most of the supported tools.
198
- See the [./setup](./setup) directory for a complete set of scripts and [./setup/_tools.json](./setup/_tools.json) for the currently recommended tool versions.
198
+ See the [./siliconcompiler/toolscripts](./siliconcompiler/toolscripts) directory for a complete set of scripts and [./siliconcompiler/toolscripts/_tools.json](./siliconcompiler/toolscripts/_tools.json) for the currently recommended tool versions.
199
199
 
200
200
  # Contributing
201
201