The-OpenROAD-Project / OpenROAD

OpenROAD's unified application implementing an RTL-to-GDS Flow. Documentation at https://openroad.readthedocs.io/en/latest/
https://theopenroadproject.org/
BSD 3-Clause "New" or "Revised" License
1.64k stars 564 forks source link

Segmentation Fault in OpenROAD During Multi-Corner STA (sky130A PDK) #6227

Open weafo opened 2 days ago

weafo commented 2 days ago

Describe the bug

OpenROAD crashes with a segmentation fault during the execution of the multi-corner static timing analysis (STA) step in OpenLane. The crash occurs when using the sky130A PDK, and the log reports a segmentation violation in libc. The issue is reproducible across multiple runs with the same configuration.

Steps I do:

  1. Clone the OpenLane repository and set up the environment.
  2. Install the sky130A PDK and set the PDK_ROOT environment variable.
  3. Run the following command: ./flow.tcl -design -run_full_flow
  4. The segmentation fault occurs during the STA step in OpenROAD.

Expected Behavior

OpenROAD should complete the multi-corner STA step without crashing and generate timing reports.

OpenROAD Environment

I am using OpenROAD through the OpenLane Docker image: efabless/openlane-tools:openroad_app-cdf98f3571ef892d091b6825c5d473bcfbf6e167-centos-7-amd64 with OpenROAD.

OpenLane Environment

open_pdks cdf98f3571ef892d091b6825c5d473bcfbf6e167
Kernel: 5.15.0-122-generic
Description: Ubuntu 20.04.6 LTS
Docker version 27.3.1, build ce12230
Python 3.11.10
cdf98f35 Thu Jul 18 14:28:46 2024 +0300 Propagate the clock in some STA reports (#2134)
python-venv: INSTALLED

To Reproduce

  1. Clone the OpenLane repository.
  2. Install the sky130A PDK and set PDK_ROOT to point to the installation.
  3. Navigate to the OpenLane directory.
  4. run make mount
  5. Run the following command:
    
    ./flow.tcl -design adder_depth_2023 -init_design_config -add_to_designs
    ./flow.tcl -design adder_depth_2023 -init_design_config -add_to_designs -config_file config.tcl
    ./flow.tcl -design adder_depth_2023 ```
  6. The segmentation fault occurs during the multi-corner STA step in OpenROAD.

I've also attached a zip of the issue reproducible folder. issue_reproducible.zip

Relevant log output

OpenLane cdf98f3571ef892d091b6825c5d473bcfbf6e167
All rights reserved. (c) 2020-2023 Efabless Corporation and contributors.
Available under the Apache License, version 2.0. See the LICENSE file for more details.

[INFO]: Using configuration in 'designs/adder_depth_2023/config.tcl'...
[INFO]: Process Design Kit: sky130A
[INFO]: PDK Root: /home/mvguser/.volare
[INFO]: Standard Cell Library: sky130_fd_sc_hd
[INFO]: Optimization Standard Cell Library: sky130_fd_sc_hd
[INFO]: Run Directory: /openlane/designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20
[INFO]: Saving runtime environment...
[INFO]: Preparing LEF files for the nom corner...
[INFO]: Preparing LEF files for the min corner...
[INFO]: Preparing LEF files for the max corner...
[INFO]: Running linter (Verilator) (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/synthesis/linter.log)...
[INFO]: 0 errors found by linter
[INFO]: 0 warnings found by linter
[STEP 1]
[INFO]: Running Synthesis (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/synthesis/1-synthesis.log)...
[STEP 2]
[INFO]: Running Single-Corner Static Timing Analysis (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/synthesis/2-sta.log)...
[STEP 3]
[INFO]: Running Initial Floorplanning (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/floorplan/3-initial_fp.log)...
[INFO]: Floorplanned with width 1488.56 and height 1476.96.
[STEP 4]
[INFO]: Running IO Placement (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/floorplan/4-io.log)...
[STEP 5]
[INFO]: Running Tap/Decap Insertion (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/floorplan/5-tap.log)...
[INFO]: Power planning with power {VPWR} and ground {VGND}...
[STEP 6]
[INFO]: Generating PDN (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/floorplan/6-pdn.log)...
[STEP 7]
[INFO]: Running Global Placement (skip_io) (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/placement/6-global_skip_io.log)...
[STEP 8]
[INFO]: Running Single-Corner Static Timing Analysis (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/placement/8-gpl_sta.log)...
[STEP 9]
[INFO]: Running IO Placement (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/placement/9-io.log)...
[STEP 10]
[INFO]: Running Global Placement (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/placement/9-global.log)...
[STEP 11]
[INFO]: Running Single-Corner Static Timing Analysis (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/placement/11-gpl_sta.log)...
[STEP 12]
[INFO]: Running Placement Resizer Design Optimizations (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/placement/12-resizer.log)...
[STEP 13]
[INFO]: Running Detailed Placement (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/placement/13-detailed.log)...
[STEP 14]
[INFO]: Running Single-Corner Static Timing Analysis (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/placement/14-dpl_sta.log)...
[INFO]: ::env(CLOCK_PORT) is not set
[WARNING]: Skipping CTS...
[STEP 15]
[INFO]: Running Placement Resizer Timing Optimizations (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/cts/15-resizer.log)...
[STEP 16]
[INFO]: Running Global Routing Resizer Design Optimizations (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/routing/16-resizer_design.log)...
[STEP 17]
[INFO]: Running Single-Corner Static Timing Analysis (log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/routing/17-rsz_design_sta.log)...
[ERROR]: during executing openroad script /openlane/scripts/openroad/sta/multi_corner.tcl
[ERROR]: Log: designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/routing/17-rsz_design_sta.log
[ERROR]: Last 10 lines:
12# Tcl_EvalEx in /nix/store/p16s3zg96afj68mfp17m03svhwmdgcz8-tcl-8.6.13/lib/libtcl.so
13# Tcl_Eval in /nix/store/p16s3zg96afj68mfp17m03svhwmdgcz8-tcl-8.6.13/lib/libtcl.so
14# sta::sourceTclFile(char const*, bool, bool, Tcl_Interp*) in openroad
15# ord::tclAppInit(Tcl_Interp*) in openroad
16# Tcl_MainEx in /nix/store/p16s3zg96afj68mfp17m03svhwmdgcz8-tcl-8.6.13/lib/libtcl.so
17# main in openroad
18# 0x00007FEB8734910E in /nix/store/k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52/lib/libc.so.6
19# __libc_start_main in /nix/store/k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52/lib/libc.so.6
20# _start in openroad
child killed: segmentation violation

[ERROR]: Creating issue reproducible...
[INFO]: Saving runtime environment...
OpenLane TCL Issue Packager

EFABLESS CORPORATION AND ALL AUTHORS OF THE OPENLANE PROJECT SHALL NOT BE HELD
LIABLE FOR ANY LEAKS THAT MAY OCCUR TO ANY PROPRIETARY DATA AS A RESULT OF USING
THIS SCRIPT. THIS SCRIPT IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND.

BY USING THIS SCRIPT, YOU ACKNOWLEDGE THAT YOU FULLY UNDERSTAND THIS DISCLAIMER
AND ALL IT ENTAILS.

Parsing config file(s)…
Setting up /openlane/designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/issue_reproducible…
Done.
[INFO]: Reproducible packaged: Please tarball and upload 'designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/issue_reproducible' if you're going to submit an issue.
[ERROR]: Step 17 (routing) failed with error:
-code 1 -level 0 -errorstack {INNER {invokeStk1 throw_error} CALL {run_tcl_script -tool openroad -no_consume /openlane/scripts/openroad/sta/multi_corner.tcl -indexed_log /openlane/designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/routing/17-rsz_design_sta.log -save to=/openlane/designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/results/signoff,noindex,sdf,lib} CALL {run_openroad_script /openlane/scripts/openroad/sta/multi_corner.tcl -indexed_log /openlane/designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/routing/17-rsz_design_sta.log -save to=/openlane/designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/results/signoff,noindex,sdf,lib} CALL {run_sta -propagate_all_clocks -estimate_global -no_save -log /openlane/designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/logs/routing/rsz_design_sta.log} CALL run_resizer_design_routing CALL run_routing CALL run_routing_step CALL {run_non_interactive_mode -design adder_depth_2023}} -errorcode NONE -errorinfo {
    while executing
"throw_error"
    (procedure "run_tcl_script" line 219)
    invoked from within
"run_tcl_script -tool openroad -no_consume {*}$args"
    (procedure "run_openroad_script" line 2)
    invoked from within
"run_$arg_values(-tool)_script $::env(SCRIPTS_DIR)/openroad/sta/multi_corner.tcl {*}$arg_list"
    (procedure "run_sta" line 109)
    invoked from within
"run_sta -propagate_all_clocks -estimate_global -no_save -log $::env(routing_logs)/rsz_design_sta.log"
    (procedure "run_resizer_design_routing" line 13)
    invoked from within
"run_resizer_design_routing"
    (procedure "run_routing" line 8)
    invoked from within
"run_routing"
    (procedure "run_routing_step" line 7)
    invoked from within
"run_routing_step"} -errorline 1
[INFO]: Saving current set of views in 'designs/adder_depth_2023/runs/RUN_2024.11.24_14.53.20/results/final'...
[INFO]: Generating final set of reports...
[ERROR]: Failed to create manufacturability and metric reports:
[ERROR]: Traceback (most recent call last):
  File "/openlane/scripts/generate_reports.py", line 184, in <module>
    cli()
  File "/nix/store/vr8dx2vs7nhz4cz2vfyypx69vbwwrmk5-python3-3.11.9-env/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/vr8dx2vs7nhz4cz2vfyypx69vbwwrmk5-python3-3.11.9-env/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/nix/store/vr8dx2vs7nhz4cz2vfyypx69vbwwrmk5-python3-3.11.9-env/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/vr8dx2vs7nhz4cz2vfyypx69vbwwrmk5-python3-3.11.9-env/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/openlane/scripts/generate_reports.py", line 51, in cli
    report = Report(design, tag, design_name, params, run_path).get_report()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/openlane/scripts/report/report.py", line 809, in get_report
    *self.extract_all_values(),
     ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/openlane/scripts/report/report.py", line 359, in extract_all_values
    power_report = Artifact(
                   ^^^^^^^^^
  File "/openlane/scripts/report/report.py", line 62, in __init__
    self.pathname = matches[0]
                    ~~~~~~~^^^
IndexError: list index out of range
[INFO]: Saving runtime environment...
[ERROR]: Flow failed.
[INFO]: The failure may have been because of the following warnings:
[WARNING]: Skipping CTS...

Screenshots

No response

Additional Context

No response

maliberty commented 2 days ago

I can't find that image

Unable to find image 'efabless/openlane-tools:openroad_app-cdf98f3571ef892d091b6825c5d473bcfbf6e167-centos-7-amd64' locally
docker: Error response from daemon: manifest for efabless/openlane-tools:openroad_app-cdf98f3571ef892d091b6825c5d473bcfbf6e167-centos-7-amd64 not found: manifest unknown: manifest unknown.

what version of OpenROAD is in that image? If it is not very current then please try with the head of OR first.

maliberty commented 2 days ago

You need to make a self contained test case. The steps to reproduce should be untar & run, not install OL.

weafo commented 2 days ago

Sorry for the confusion, I am not using a separate Docker image of OpenROAD. Instead, I use it as a dependency within OpenLane. The version of OpenROAD in my setup is: OpenROAD b16bda7e82721d10566ff7e2b68f1ff0be9f9e38.

maliberty commented 1 day ago

That commit is from Jun 3. Please try with the head of OR.