siliconcompiler 0.28.3__py3-none-any.whl → 0.28.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 (60) hide show
  1. siliconcompiler/_metadata.py +1 -1
  2. siliconcompiler/apps/sc_dashboard.py +1 -1
  3. siliconcompiler/core.py +93 -55
  4. siliconcompiler/fpgas/vpr_example.py +8 -0
  5. siliconcompiler/package.py +3 -2
  6. siliconcompiler/report/dashboard/__init__.py +9 -0
  7. siliconcompiler/report/dashboard/components/__init__.py +13 -1
  8. siliconcompiler/report/dashboard/layouts/vertical_flowgraph.py +4 -3
  9. siliconcompiler/report/dashboard/layouts/vertical_flowgraph_node_tab.py +4 -1
  10. siliconcompiler/report/dashboard/layouts/vertical_flowgraph_sac_tabs.py +4 -1
  11. siliconcompiler/report/dashboard/state.py +3 -1
  12. siliconcompiler/report/summary_table.py +1 -2
  13. siliconcompiler/report/utils.py +1 -2
  14. siliconcompiler/scheduler/__init__.py +2 -0
  15. siliconcompiler/sphinx_ext/dynamicgen.py +6 -0
  16. siliconcompiler/tools/_common/__init__.py +44 -6
  17. siliconcompiler/tools/_common/asic.py +79 -23
  18. siliconcompiler/tools/genfasm/genfasm.py +7 -0
  19. siliconcompiler/tools/ghdl/convert.py +7 -0
  20. siliconcompiler/tools/klayout/convert_drc_db.py +60 -0
  21. siliconcompiler/tools/klayout/drc.py +156 -0
  22. siliconcompiler/tools/klayout/export.py +2 -0
  23. siliconcompiler/tools/klayout/klayout.py +0 -1
  24. siliconcompiler/tools/klayout/klayout_convert_drc_db.py +182 -0
  25. siliconcompiler/tools/klayout/operations.py +2 -0
  26. siliconcompiler/tools/klayout/screenshot.py +2 -0
  27. siliconcompiler/tools/klayout/show.py +4 -4
  28. siliconcompiler/tools/magic/drc.py +21 -0
  29. siliconcompiler/tools/magic/extspice.py +21 -0
  30. siliconcompiler/tools/magic/magic.py +29 -0
  31. siliconcompiler/tools/magic/sc_drc.tcl +2 -12
  32. siliconcompiler/tools/magic/sc_extspice.tcl +3 -15
  33. siliconcompiler/tools/openroad/openroad.py +44 -2
  34. siliconcompiler/tools/openroad/scripts/sc_apr.tcl +15 -0
  35. siliconcompiler/tools/openroad/scripts/sc_floorplan.tcl +55 -9
  36. siliconcompiler/tools/openroad/scripts/sc_metrics.tcl +10 -0
  37. siliconcompiler/tools/openroad/scripts/sc_procs.tcl +3 -1
  38. siliconcompiler/tools/openroad/scripts/sc_route.tcl +8 -2
  39. siliconcompiler/tools/openroad/scripts/sc_screenshot.tcl +0 -5
  40. siliconcompiler/tools/openroad/scripts/sc_write_images.tcl +36 -6
  41. siliconcompiler/tools/surelog/__init__.py +12 -0
  42. siliconcompiler/tools/verilator/compile.py +27 -0
  43. siliconcompiler/tools/verilator/verilator.py +9 -0
  44. siliconcompiler/tools/vpr/vpr.py +18 -0
  45. siliconcompiler/tools/yosys/{syn_asic_fpga_shared.tcl → procs.tcl} +23 -0
  46. siliconcompiler/tools/yosys/sc_screenshot.tcl +104 -0
  47. siliconcompiler/tools/yosys/sc_syn.tcl +7 -9
  48. siliconcompiler/tools/yosys/screenshot.py +153 -0
  49. siliconcompiler/tools/yosys/syn_asic.py +3 -0
  50. siliconcompiler/tools/yosys/syn_asic.tcl +1 -3
  51. siliconcompiler/tools/yosys/syn_fpga.tcl +3 -2
  52. siliconcompiler/toolscripts/_tools.json +3 -3
  53. siliconcompiler/utils/__init__.py +30 -1
  54. siliconcompiler/utils/showtools.py +4 -0
  55. {siliconcompiler-0.28.3.dist-info → siliconcompiler-0.28.4.dist-info}/METADATA +16 -3
  56. {siliconcompiler-0.28.3.dist-info → siliconcompiler-0.28.4.dist-info}/RECORD +60 -55
  57. {siliconcompiler-0.28.3.dist-info → siliconcompiler-0.28.4.dist-info}/WHEEL +1 -1
  58. {siliconcompiler-0.28.3.dist-info → siliconcompiler-0.28.4.dist-info}/LICENSE +0 -0
  59. {siliconcompiler-0.28.3.dist-info → siliconcompiler-0.28.4.dist-info}/entry_points.txt +0 -0
  60. {siliconcompiler-0.28.3.dist-info → siliconcompiler-0.28.4.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,7 @@
1
1
  from siliconcompiler.tools.magic.magic import setup as setup_tool
2
+ from siliconcompiler.tools.magic.magic import process_file
2
3
  from siliconcompiler.tools._common import get_tool_task
4
+ from siliconcompiler.tools._common.asic import get_mainlib, get_libraries
3
5
 
4
6
 
5
7
  def setup(chip):
@@ -17,3 +19,22 @@ def setup(chip):
17
19
  design = chip.top()
18
20
 
19
21
  chip.add('tool', tool, 'task', task, 'output', f'{design}.spice', step=step, index=index)
22
+
23
+
24
+ def pre_process(chip):
25
+ step = chip.get('arg', 'step')
26
+ index = chip.get('arg', 'index')
27
+ tool, task = get_tool_task(chip, step, index)
28
+
29
+ pdk = chip.get('option', 'pdk')
30
+ stackup = chip.get('option', 'stackup')
31
+ mainlib = get_mainlib(chip)
32
+ libtype = chip.get('library', mainlib, 'asic', 'libarch', step=step, index=index)
33
+ process_file('lef', chip, 'pdk', pdk, 'aprtech', 'magic', stackup, libtype, 'lef')
34
+
35
+ for lib in get_libraries(chip, 'logic'):
36
+ process_file('lef', chip, 'library', lib, 'output', stackup, 'lef')
37
+
38
+ for lib in get_libraries(chip, 'macro'):
39
+ if lib in chip.get('tool', tool, 'task', task, 'var', 'exclude', step=step, index=index):
40
+ process_file('lef', chip, 'library', lib, 'output', stackup, 'lef')
@@ -9,9 +9,12 @@ Installation: https://github.com/RTimothyEdwards/magic
9
9
  Sources: https://github.com/RTimothyEdwards/magic
10
10
  '''
11
11
 
12
+ import gzip
13
+ import shutil
12
14
  import os
13
15
  from siliconcompiler.tools._common import input_provides, get_tool_task
14
16
  from siliconcompiler.targets import freepdk45_demo
17
+ from siliconcompiler import utils
15
18
 
16
19
 
17
20
  ####################################################################
@@ -79,6 +82,32 @@ def parse_version(stdout):
79
82
  return stdout.strip('\n')
80
83
 
81
84
 
85
+ def process_file(file_type, chip, *key):
86
+ step = chip.get('arg', 'step')
87
+ index = chip.get('arg', 'index')
88
+ tool, task = get_tool_task(chip, step, index)
89
+
90
+ if chip.get(*key, field='pernode') == 'never':
91
+ files = chip.find_files(*key)
92
+ else:
93
+ files = chip.find_files(*key, step=step, index=index)
94
+
95
+ for file in files:
96
+ if file.lower().endswith('.gz'):
97
+ new_file_name = f'inputs/sc_{utils.get_hashed_filename(file[:-3])}'
98
+
99
+ with gzip.open(file, 'rt', encoding="utf-8") as fin:
100
+ with open(new_file_name, 'w') as fout:
101
+ fout.write(fin.read().encode("ascii", "ignore").decode("ascii"))
102
+ else:
103
+ new_file_name = f'inputs/sc_{utils.get_hashed_filename(file)}'
104
+ shutil.copy(file, new_file_name)
105
+
106
+ chip.add('tool', tool, 'task', task, 'file', f'read_{file_type}',
107
+ os.path.join(chip.getworkdir(step=step, index=index), new_file_name),
108
+ step=step, index=index)
109
+
110
+
82
111
  ##################################################
83
112
  if __name__ == "__main__":
84
113
 
@@ -23,18 +23,8 @@ set sc_design [sc_top]
23
23
  set sc_macrolibs [sc_get_asic_libraries macro]
24
24
  set sc_stackup [sc_cfg_get option stackup]
25
25
 
26
- if { [sc_cfg_tool_task_exists var exclude] } {
27
- set sc_exclude [sc_cfg_tool_task_get var exclude]
28
- } else {
29
- set sc_exclude [list]
30
- }
31
-
32
- # Ignore specific libraries by reading their LEFs (causes magic to abstract them)
33
- foreach lib $sc_macrolibs {
34
- puts $lib
35
- if { [lsearch -exact $sc_exclude $lib] >= 0 } {
36
- lef read [sc_cfg_get library $lib output $sc_stackup lef]
37
- }
26
+ foreach sc_lef [sc_cfg_tool_task_get file read_lef] {
27
+ lef read $sc_lef
38
28
  }
39
29
 
40
30
  gds noduplicates true
@@ -14,21 +14,9 @@ set sc_techlef [sc_cfg_get pdk $sc_pdk aprtech magic $sc_stackup $sc_libtype lef
14
14
  set sc_liblef [sc_cfg_get library $sc_mainlib output $sc_stackup lef]
15
15
  set sc_macrolibs [sc_get_asic_libraries macro]
16
16
 
17
- if { [sc_cfg_tool_task_exists var exclude] } {
18
- set sc_exclude [sc_cfg_tool_task_get var exclude]
19
- } else {
20
- set sc_exclude [list]
21
- }
22
-
23
- lef read $sc_techlef
24
- lef read $sc_liblef
25
-
26
- # Ignore specific libraries by reading their LEFs (causes magic to abstract them)
27
- foreach lib $sc_macrolibs {
28
- puts $lib
29
- if { [lsearch -exact $sc_exclude $lib] >= 0 } {
30
- lef read [sc_cfg_get library $lib output $sc_stackup lef]
31
- }
17
+ foreach sc_lef [sc_cfg_tool_task_get file read_lef] {
18
+ puts "Reading LEF $sc_lef"
19
+ lef read $sc_lef
32
20
  }
33
21
 
34
22
  if { [file exists "inputs/$sc_design.gds"] } {
@@ -38,7 +38,7 @@ def setup_tool(chip, exit=True, clobber=True):
38
38
 
39
39
  chip.set('tool', tool, 'exe', tool)
40
40
  chip.set('tool', tool, 'vswitch', '-version')
41
- chip.set('tool', tool, 'version', '>=v2.0-13145', clobber=clobber)
41
+ chip.set('tool', tool, 'version', '>=v2.0-16580', clobber=clobber)
42
42
  chip.set('tool', tool, 'format', 'tcl', clobber=clobber)
43
43
 
44
44
  # exit automatically in batch mode and not breakpoint
@@ -274,7 +274,10 @@ def post_process(chip):
274
274
  "floating_nets.rpt",
275
275
  f"{chip.design}_antenna.rpt",
276
276
  f"{chip.design}_antenna_post_repair.rpt"],
277
- "drcs": [f"{chip.design}_drc.rpt"]
277
+ "drcs": [f"{chip.design}_drc.rpt",
278
+ f"markers/{chip.design}.drc.rpt",
279
+ f"markers/{chip.design}.drc.json",
280
+ f"images/markers/{chip.design}.drc.png"]
278
281
  }
279
282
  metric_reports["leakagepower"] = metric_reports["peakpower"]
280
283
 
@@ -673,6 +676,10 @@ def _define_dpl_params(chip):
673
676
  default_value='false',
674
677
  schelp='true/false, disallow single site gaps in detail placement')
675
678
 
679
+ set_tool_task_var(chip, param_key='dpl_use_decap_fillers',
680
+ default_value='true',
681
+ schelp='true/false, use decap fillers along with non-decap fillers')
682
+
676
683
 
677
684
  def _define_cts_params(chip):
678
685
  step = chip.get('arg', 'step')
@@ -852,6 +859,41 @@ def _define_mpl_params(chip):
852
859
  schelp='minimum number of macros to use while clustering for macro placement')
853
860
  set_tool_task_var(chip, param_key='rtlmp_max_macros',
854
861
  schelp='maximum number of macros to use while clustering for macro placement')
862
+ set_tool_task_var(chip, param_key='rtlmp_max_levels',
863
+ schelp='maximum depth of physical hierarchical tree')
864
+ set_tool_task_var(chip, param_key='rtlmp_min_aspect_ratio',
865
+ schelp='Specifies the minimum aspect ratio of its width to height of a '
866
+ 'standard cell cluster')
867
+ set_tool_task_var(chip, param_key='rtlmp_fence',
868
+ schelp='Defines the global fence bounding box coordinates '
869
+ '(llx, lly, urx, ury)')
870
+ set_tool_task_var(chip, param_key='rtlmp_bus_planning',
871
+ schelp='Flag to enable bus planning')
872
+ set_tool_task_var(chip, param_key='rtlmp_target_dead_space',
873
+ schelp='Specifies the target dead space percentage, which influences '
874
+ 'the utilization of standard cell clusters')
875
+
876
+ set_tool_task_var(chip, param_key='rtlmp_area_weight',
877
+ schelp='Weight for the area of current floorplan')
878
+ set_tool_task_var(chip, param_key='rtlmp_outline_weight',
879
+ schelp='Weight for violating the fixed outline constraint, meaning that all '
880
+ 'clusters should be placed within the shape of their parent cluster')
881
+ set_tool_task_var(chip, param_key='rtlmp_wirelength_weight',
882
+ schelp='Weight for half-perimeter wirelength')
883
+ set_tool_task_var(chip, param_key='rtlmp_guidance_weight',
884
+ schelp='Weight for guidance cost or clusters being placed near specified '
885
+ 'regions if users provide such constraints')
886
+ set_tool_task_var(chip, param_key='rtlmp_fence_weight',
887
+ schelp='Weight for fence cost, or how far the macro is from zero '
888
+ 'fence violation')
889
+ set_tool_task_var(chip, param_key='rtlmp_blockage_weight',
890
+ schelp='Weight for the boundary, or how far the hard macro clusters are '
891
+ 'from boundaries')
892
+ set_tool_task_var(chip, param_key='rtlmp_notch_weight',
893
+ schelp='Weight for the notch, or the existence of dead space that cannot be '
894
+ 'used for placement & routing')
895
+ set_tool_task_var(chip, param_key='rtlmp_macro_blockage_weight',
896
+ schelp='Weight for macro blockage, or the overlapping instances of the macro')
855
897
 
856
898
 
857
899
  def _define_ord_params(chip):
@@ -265,10 +265,24 @@ set openroad_mpl_macro_place_channel [dict get $openroad_task_vars macro_place_c
265
265
  set openroad_ppl_arguments [dict get $openroad_task_vars ppl_arguments]
266
266
 
267
267
  set openroad_rtlmp_enable [lindex [dict get $openroad_task_vars rtlmp_enable] 0]
268
+ set openroad_rtlmp_max_levels [lindex [dict get $openroad_task_vars rtlmp_max_levels] 0]
268
269
  set openroad_rtlmp_min_instances [lindex [dict get $openroad_task_vars rtlmp_min_instances] 0]
269
270
  set openroad_rtlmp_max_instances [lindex [dict get $openroad_task_vars rtlmp_max_instances] 0]
270
271
  set openroad_rtlmp_min_macros [lindex [dict get $openroad_task_vars rtlmp_min_macros] 0]
271
272
  set openroad_rtlmp_max_macros [lindex [dict get $openroad_task_vars rtlmp_max_macros] 0]
273
+ set openroad_rtlmp_min_aspect_ratio [lindex [dict get $openroad_task_vars rtlmp_min_aspect_ratio] 0]
274
+ set openroad_rtlmp_fence [dict get $openroad_task_vars rtlmp_fence]
275
+ set openroad_rtlmp_bus_planning [lindex [dict get $openroad_task_vars rtlmp_bus_planning] 0]
276
+ set openroad_rtlmp_target_dead_space \
277
+ [lindex [dict get $openroad_task_vars rtlmp_target_dead_space] 0]
278
+ set openroad_rtlmp_area_weight [lindex [dict get $openroad_task_vars rtlmp_area_weight] 0]
279
+ set openroad_rtlmp_outline_weight [lindex [dict get $openroad_task_vars rtlmp_outline_weight] 0]
280
+ set openroad_rtlmp_wirelength_weight \
281
+ [lindex [dict get $openroad_task_vars rtlmp_wirelength_weight] 0]
282
+ set openroad_rtlmp_guidance_weight [lindex [dict get $openroad_task_vars rtlmp_guidance_weight] 0]
283
+ set openroad_rtlmp_fence_weight [lindex [dict get $openroad_task_vars rtlmp_fence_weight] 0]
284
+ set openroad_rtlmp_notch_weight [lindex [dict get $openroad_task_vars rtlmp_notch_weight] 0]
285
+ set openroad_rtlmp_blockage_weight [lindex [dict get $openroad_task_vars rtlmp_blockage_weight] 0]
272
286
 
273
287
  set openroad_gpl_place_density [lindex [dict get $openroad_task_vars place_density] 0]
274
288
  set openroad_gpl_padding [lindex [dict get $openroad_task_vars pad_global_place] 0]
@@ -427,6 +441,7 @@ if { $sc_task != "floorplan" } {
427
441
  # Setup reports directories
428
442
  file mkdir reports/timing
429
443
  file mkdir reports/power
444
+ file mkdir reports/markers
430
445
 
431
446
  if { $sc_task == "show" || $sc_task == "screenshot" } {
432
447
  if { $sc_task == "screenshot" } {
@@ -290,12 +290,12 @@ if { $do_automatic_pins } {
290
290
  # since we get an error otherwise.
291
291
  if { [sc_design_has_unplaced_macros] } {
292
292
  if { $openroad_rtlmp_enable == "true" } {
293
- set halo_max [expr {
294
- max([lindex $openroad_mpl_macro_place_halo 0],
295
- [lindex $openroad_mpl_macro_place_halo 1])
296
- }]
293
+ lassign $openroad_mpl_macro_place_halo halo_x halo_y
297
294
 
298
295
  set rtlmp_args []
296
+ if { $openroad_rtlmp_max_levels != "" } {
297
+ lappend rtlmp_args -max_num_level $openroad_rtlmp_max_levels
298
+ }
299
299
  if { $openroad_rtlmp_min_instances != "" } {
300
300
  lappend rtlmp_args -min_num_inst $openroad_rtlmp_min_instances
301
301
  }
@@ -308,9 +308,48 @@ if { [sc_design_has_unplaced_macros] } {
308
308
  if { $openroad_rtlmp_max_macros != "" } {
309
309
  lappend rtlmp_args -max_num_macro $openroad_rtlmp_max_macros
310
310
  }
311
+ if { $openroad_rtlmp_min_aspect_ratio != "" } {
312
+ lappend rtlmp_args -min_ar $openroad_rtlmp_min_aspect_ratio
313
+ }
314
+ if { $openroad_rtlmp_fence != "" } {
315
+ lappend rtlmp_args -fence_lx [lindex $openroad_rtlmp_fence 0]
316
+ lappend rtlmp_args -fence_ly [lindex $openroad_rtlmp_fence 1]
317
+ lappend rtlmp_args -fence_ux [lindex $openroad_rtlmp_fence 2]
318
+ lappend rtlmp_args -fence_uy [lindex $openroad_rtlmp_fence 3]
319
+ }
320
+ if { $openroad_rtlmp_bus_planning == "true" } {
321
+ lappend rtlmp_args -bus_planning
322
+ }
323
+ if { $openroad_rtlmp_target_dead_space != "" } {
324
+ lappend rtlmp_args -target_dead_space $openroad_rtlmp_target_dead_space
325
+ }
326
+
327
+ if { $openroad_rtlmp_area_weight != "" } {
328
+ lappend rtlmp_args -area_weight $openroad_rtlmp_area_weight
329
+ }
330
+ if { $openroad_rtlmp_outline_weight != "" } {
331
+ lappend rtlmp_args -outline_weight $openroad_rtlmp_outline_weight
332
+ }
333
+ if { $openroad_rtlmp_wirelength_weight != "" } {
334
+ lappend rtlmp_args -wirelength_weight $openroad_rtlmp_wirelength_weight
335
+ }
336
+ if { $openroad_rtlmp_guidance_weight != "" } {
337
+ lappend rtlmp_args -guidance_weight $openroad_rtlmp_guidance_weight
338
+ }
339
+ if { $openroad_rtlmp_fence_weight != "" } {
340
+ lappend rtlmp_args -fence_weight $openroad_rtlmp_fence_weight
341
+ }
342
+ if { $openroad_rtlmp_notch_weight != "" } {
343
+ lappend rtlmp_args -notch_weight $openroad_rtlmp_notch_weight
344
+ }
345
+ if { $openroad_rtlmp_blockage_weight != "" } {
346
+ lappend rtlmp_args -blockage_weight $openroad_rtlmp_blockage_weight
347
+ }
311
348
 
312
349
  rtl_macro_placer -report_directory reports/rtlmp \
313
- -halo_width $halo_max \
350
+ -halo_width $halo_x \
351
+ -halo_height $halo_y \
352
+ -target_util [sc_global_placement_density] \
314
353
  {*}$rtlmp_args
315
354
  } else {
316
355
  ###########################
@@ -352,11 +391,18 @@ global_connect
352
391
  # Tap Cells
353
392
  ###########################
354
393
 
355
- if { [sc_cfg_tool_task_exists {file} ifp_tapcell] } {
356
- set tapcell_file [lindex [sc_cfg_tool_task_get {file} ifp_tapcell] 0]
357
- puts "Sourcing tapcell file: ${tapcell_file}"
358
- source $tapcell_file
394
+ if {
395
+ [sc_cfg_tool_task_exists {file} ifp_tapcell] &&
396
+ [llength [sc_cfg_tool_task_get {file} ifp_tapcell]] > 0
397
+ } {
398
+ foreach tapcell_file [sc_cfg_tool_task_get {file} ifp_tapcell] {
399
+ puts "Sourcing tapcell file: ${tapcell_file}"
400
+ source $tapcell_file
401
+ }
359
402
  global_connect
403
+ } else {
404
+ utl::warn FLW 1 "Tapcell configuration not provided"
405
+ cut_rows
360
406
  }
361
407
 
362
408
  ###########################
@@ -158,3 +158,13 @@ if { $unconstrained_endpoints == "" } {
158
158
  set unconstrained_endpoints 0
159
159
  }
160
160
  utl::metric_int "timing__unconstrained" $unconstrained_endpoints
161
+
162
+ # Write markers
163
+ foreach markerdb [[ord::get_db_block] getMarkerCategories] {
164
+ if { [$markerdb getMarkerCount] == 0 } {
165
+ continue
166
+ }
167
+
168
+ $markerdb writeTR "reports/markers/${sc_design}.[$markerdb getName].rpt"
169
+ $markerdb writeJSON "reports/markers/${sc_design}.[$markerdb getName].json"
170
+ }
@@ -72,8 +72,10 @@ proc sc_global_placement { args } {
72
72
  lappend openroad_gpl_args "-skip_io"
73
73
  }
74
74
 
75
+ set density [sc_global_placement_density]
76
+
75
77
  global_placement {*}$openroad_gpl_args \
76
- -density [sc_global_placement_density] \
78
+ -density $density \
77
79
  -pad_left $openroad_gpl_padding \
78
80
  -pad_right $openroad_gpl_padding
79
81
  }
@@ -8,8 +8,14 @@
8
8
 
9
9
  proc insert_fillers { } {
10
10
  upvar sc_filler sc_filler
11
- if { $sc_filler != "" } {
12
- filler_placement $sc_filler
11
+ global sc_mainlib
12
+
13
+ set fillers $sc_filler
14
+ if { [lindex [sc_cfg_tool_task_get var dpl_use_decap_fillers] 0] == "true" } {
15
+ lappend fillers {*}[sc_cfg_get library $sc_mainlib asic cells decap]
16
+ }
17
+ if { $fillers != "" } {
18
+ filler_placement $fillers
13
19
  }
14
20
 
15
21
  check_placement -verbose
@@ -3,11 +3,6 @@ gui::save_display_controls
3
3
  set sc_resolution \
4
4
  [lindex [sc_cfg_tool_task_get {var} show_vertical_resolution] 0]
5
5
 
6
- # Show the drc markers (if any)
7
- if { [file exists reports/${sc_design}_drc.rpt] } {
8
- gui::load_drc reports/${sc_design}_drc.rpt
9
- }
10
-
11
6
  sc_image_setup_default
12
7
 
13
8
  sc_save_image "screenshot" "outputs/${sc_design}.png" $sc_resolution
@@ -226,6 +226,12 @@ proc sc_image_clocks { } {
226
226
  proc sc_image_clocktree { } {
227
227
  gui::show_widget "Clock Tree Viewer"
228
228
  global sc_scenarios
229
+ global sc_design
230
+
231
+ sc_image_setup_default
232
+ gui::set_display_controls "Layers/*" visible true
233
+ gui::set_display_controls "Nets/*" visible false
234
+ gui::set_display_controls "Nets/Clock" visible true
229
235
 
230
236
  set clock_state []
231
237
  foreach clock [all_clocks] {
@@ -233,6 +239,7 @@ proc sc_image_clocktree { } {
233
239
  }
234
240
  set_propagated_clock [all_clocks]
235
241
 
242
+ file mkdir reports/images/clocks
236
243
  foreach clock [get_clocks *] {
237
244
  if { [llength [get_property $clock sources]] == 0 } {
238
245
  # Skip virtual clocks
@@ -243,13 +250,18 @@ proc sc_image_clocktree { } {
243
250
  set clock_name [get_name $clock]
244
251
  foreach corner $sc_scenarios {
245
252
  set path reports/images/clocktree/${clock_name}.${corner}.png
246
- utl::info FLW 1 "Saving $clock_name clock tree for $corner in $path"
253
+ utl::info FLW 1 "Saving \"$clock_name\" clock tree for $corner to $path"
247
254
  save_clocktree_image $path \
248
255
  -clock $clock_name \
249
256
  -width 1024 \
250
257
  -height 1024 \
251
258
  -corner $corner
252
259
  }
260
+
261
+ if { [info commands gui::select_clockviewer_clock] != "" } {
262
+ gui::select_clockviewer_clock ${clock_name}
263
+ sc_save_image "clock - ${clock_name}" reports/images/clocks/${sc_design}.${clock_name}.png
264
+ }
253
265
  }
254
266
 
255
267
  foreach {clock state} $clock_state {
@@ -306,21 +318,39 @@ proc sc_image_optimizer { } {
306
318
  sc_save_image "optimizer" reports/images/${sc_design}.optimizer.png
307
319
  }
308
320
 
321
+ proc sc_image_markers { } {
322
+ global sc_design
323
+ sc_image_setup_default
324
+
325
+ file mkdir reports/images/markers
326
+ foreach markerdb [[ord::get_db_block] getMarkerCategories] {
327
+ if { [$markerdb getMarkerCount] == 0 } {
328
+ continue
329
+ }
330
+
331
+ gui::select_marker_category $markerdb
332
+
333
+ sc_save_image \
334
+ "markers - [$markerdb getName]" \
335
+ reports/images/markers/${sc_design}.[$markerdb getName].png
336
+ }
337
+
338
+ gui::select_marker_category NULL
339
+ }
340
+
309
341
  # Setup
310
342
  file mkdir reports/images
311
343
  gui::save_display_controls
312
344
  sc_image_setup_default
313
345
 
314
- if { [file exists reports/${sc_design}_drc.rpt] } {
315
- # Show the drc markers (if any)
316
- gui::load_drc reports/${sc_design}_drc.rpt
317
- }
318
-
319
346
  # General images
320
347
  sc_image_everything
321
348
  sc_image_placement
322
349
  sc_image_routing
323
350
 
351
+ # Markers
352
+ sc_image_markers
353
+
324
354
  # Heatmaps
325
355
  if { [sc_cfg_tool_task_check_in_list placement_density var reports] } {
326
356
  sc_image_placement_density
@@ -61,24 +61,36 @@ def setup(chip):
61
61
  field='help')
62
62
  chip.set('tool', tool, 'task', task, 'var', 'enable_lowmem', 'false',
63
63
  step=step, index=index, clobber=False)
64
+ chip.add('tool', tool, 'task', task, 'require',
65
+ ','.join(['tool', tool, 'task', task, 'var', 'enable_lowmem']),
66
+ step=step, index=index)
64
67
 
65
68
  chip.set('tool', tool, 'task', task, 'var', 'disable_write_cache',
66
69
  'true/false, when true instructs Surelog to not write to its cache.',
67
70
  field='help')
68
71
  chip.set('tool', tool, 'task', task, 'var', 'disable_write_cache', 'false',
69
72
  step=step, index=index, clobber=False)
73
+ chip.add('tool', tool, 'task', task, 'require',
74
+ ','.join(['tool', tool, 'task', task, 'var', 'disable_write_cache']),
75
+ step=step, index=index)
70
76
 
71
77
  chip.set('tool', tool, 'task', task, 'var', 'disable_info',
72
78
  'true/false, when true instructs Surelog to not log infos.',
73
79
  field='help')
74
80
  chip.set('tool', tool, 'task', task, 'var', 'disable_info', 'false',
75
81
  step=step, index=index, clobber=False)
82
+ chip.add('tool', tool, 'task', task, 'require',
83
+ ','.join(['tool', tool, 'task', task, 'var', 'disable_info']),
84
+ step=step, index=index)
76
85
 
77
86
  chip.set('tool', tool, 'task', task, 'var', 'disable_note',
78
87
  'true/false, when true instructs Surelog to not log notes.',
79
88
  field='help')
80
89
  chip.set('tool', tool, 'task', task, 'var', 'disable_note', 'false',
81
90
  step=step, index=index, clobber=False)
91
+ chip.add('tool', tool, 'task', task, 'require',
92
+ ','.join(['tool', tool, 'task', task, 'var', 'disable_note']),
93
+ step=step, index=index)
82
94
 
83
95
 
84
96
  def parse_version(stdout):
@@ -34,24 +34,42 @@ def setup(chip):
34
34
  if mode not in (['cc'], ['systemc']):
35
35
  chip.error(f"Invalid mode {mode} provided to verilator/compile. Expected one of 'cc' or "
36
36
  "'systemc'")
37
+ chip.add('tool', tool, 'task', task, 'require',
38
+ ','.join(['tool', tool, 'task', task, 'var', 'mode']),
39
+ step=step, index=index)
37
40
 
38
41
  trace_type = chip.get('tool', tool, 'task', task, 'var', 'trace_type', step=step, index=index)
39
42
  if trace_type not in (['vcd'], ['fst']):
40
43
  chip.error(f"Invalid trace type {trace_type} provided to verilator/compile. Expected "
41
44
  "one of 'vcd' or 'fst'.")
45
+ chip.add('tool', tool, 'task', task, 'require',
46
+ ','.join(['tool', tool, 'task', task, 'var', 'trace_type']),
47
+ step=step, index=index)
42
48
 
43
49
  chip.set('tool', tool, 'task', task, 'var', 'cflags',
44
50
  'flags to provide to the C++ compiler invoked by Verilator',
45
51
  field='help')
52
+ if chip.get('tool', tool, 'task', task, 'var', 'cflags', step=step, index=index):
53
+ chip.add('tool', tool, 'task', task, 'require',
54
+ ','.join(['tool', tool, 'task', task, 'var', 'cflags']),
55
+ step=step, index=index)
46
56
 
47
57
  chip.set('tool', tool, 'task', task, 'var', 'ldflags',
48
58
  'flags to provide to the linker invoked by Verilator',
49
59
  field='help')
60
+ if chip.get('tool', tool, 'task', task, 'var', 'ldflags', step=step, index=index):
61
+ chip.add('tool', tool, 'task', task, 'require',
62
+ ','.join(['tool', tool, 'task', task, 'var', 'ldflags']),
63
+ step=step, index=index)
50
64
 
51
65
  chip.set('tool', tool, 'task', task, 'var', 'pins_bv',
52
66
  'controls datatypes used to represent SystemC inputs/outputs. See --pins-bv in '
53
67
  'Verilator docs for more info.',
54
68
  field='help')
69
+ if chip.get('tool', tool, 'task', task, 'var', 'pins_bv', step=step, index=index):
70
+ chip.add('tool', tool, 'task', task, 'require',
71
+ ','.join(['tool', tool, 'task', task, 'var', 'pins_bv']),
72
+ step=step, index=index)
55
73
 
56
74
  chip.set('tool', tool, 'task', task, 'var', 'mode',
57
75
  "defines compilation mode for Verilator. Valid options are 'cc' for C++, or 'systemc' "
@@ -61,10 +79,19 @@ def setup(chip):
61
79
  chip.set('tool', tool, 'task', task, 'dir', 'cincludes',
62
80
  'include directories to provide to the C++ compiler invoked by Verilator',
63
81
  field='help')
82
+ if chip.get('tool', tool, 'task', task, 'dir', 'cincludes', step=step, index=index):
83
+ chip.add('tool', tool, 'task', task, 'require',
84
+ ','.join(['tool', tool, 'task', task, 'dir', 'cincludes']),
85
+ step=step, index=index)
64
86
 
65
87
  chip.set('tool', tool, 'task', task, 'var', 'trace',
66
88
  "if true, enables trace generation.",
67
89
  field='help')
90
+ if chip.get('tool', tool, 'task', task, 'var', 'trace', step=step, index=index):
91
+ chip.add('tool', tool, 'task', task, 'require',
92
+ ','.join(['tool', tool, 'task', task, 'var', 'trace']),
93
+ step=step, index=index)
94
+
68
95
  chip.set('tool', tool, 'task', task, 'var', 'trace_type',
69
96
  "specifies type of wave file to create when [trace] is set. Valid options are "
70
97
  "'vcd' or 'fst'. Defaults to 'vcd'.",
@@ -71,6 +71,10 @@ def setup(chip):
71
71
  chip.set('tool', tool, 'task', task, 'file', 'config',
72
72
  'Verilator configuration file',
73
73
  field='help')
74
+ if chip.get('tool', tool, 'task', task, 'file', 'config', step=step, index=index):
75
+ chip.add('tool', tool, 'task', task, 'require',
76
+ ','.join(['tool', tool, 'task', task, 'file', 'config']),
77
+ step=step, index=index)
74
78
 
75
79
  chip.set('tool', tool, 'task', task, 'var', 'enable_assert',
76
80
  'true/false, when true assertions are enabled in Verilator.',
@@ -78,6 +82,11 @@ def setup(chip):
78
82
  chip.set('tool', tool, 'task', task, 'var', 'enable_assert', 'false',
79
83
  step=step, index=index, clobber=False)
80
84
 
85
+ if chip.get('tool', tool, 'task', task, 'var', 'enable_assert', step=step, index=index):
86
+ chip.add('tool', tool, 'task', task, 'require',
87
+ ','.join(['tool', tool, 'task', task, 'var', 'enable_assert']),
88
+ step=step, index=index)
89
+
81
90
  if f'{chip.top()}.v' not in input_provides(chip, step, index):
82
91
  add_require_input(chip, 'input', 'rtl', 'verilog')
83
92
  add_require_input(chip, 'input', 'rtl', 'systemverilog')
@@ -66,6 +66,20 @@ def setup_tool(chip, clobber=True):
66
66
  chip.add('tool', tool, 'task', task, 'require', f'fpga,{part_name},var,{resource}',
67
67
  step=step, index=index)
68
68
 
69
+ add_tool_requirements(chip)
70
+
71
+
72
+ def add_tool_requirements(chip):
73
+
74
+ step = chip.get('arg', 'step')
75
+ index = chip.get('arg', 'index')
76
+ tool, task = get_tool_task(chip, step, index)
77
+
78
+ part_name = chip.get('fpga', 'partname')
79
+
80
+ chip.add('tool', tool, 'task', task, 'require', f'fpga,{part_name},var,vpr_device_code',
81
+ step=step, index=index)
82
+
69
83
 
70
84
  def runtime_options(chip):
71
85
 
@@ -76,6 +90,10 @@ def runtime_options(chip):
76
90
 
77
91
  options = []
78
92
 
93
+ device_code = chip.get('fpga', part_name, 'var', 'vpr_device_code')
94
+
95
+ options.append(f"--device {device_code[0]}")
96
+
79
97
  options.append(f"--write_block_usage {__block_file}")
80
98
  options.append("--outfile_prefix outputs/")
81
99
 
@@ -29,3 +29,26 @@ proc sc_map_memory { lib_file techmap_file do_rom } {
29
29
 
30
30
  return $design_mod
31
31
  }
32
+
33
+ proc sc_apply_params { } {
34
+ global sc_design
35
+
36
+ yosys chparam -list $sc_design
37
+ if { [sc_cfg_exists option param] } {
38
+ yosys echo off
39
+ set module_params [yosys tee -q -s result.string chparam -list $sc_design]
40
+ yosys echo on
41
+
42
+ dict for {key value} [sc_cfg_get option param] {
43
+ if { ![string is integer $value] } {
44
+ set value [concat \"$value\"]
45
+ }
46
+
47
+ if { [string first $key $module_params] != -1 } {
48
+ yosys chparam -set $key $value $sc_design
49
+ } else {
50
+ puts "Warning: $key is not a defined parameter in $sc_design"
51
+ }
52
+ }
53
+ }
54
+ }