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.41k stars 494 forks source link

Global router crash #5211

Closed edwardcwang closed 2 weeks ago

edwardcwang commented 2 weeks ago

Describe the bug

Using the below OpenROAD release on Ubuntu 22.04, I get the following crash when running global routing.

The layer in question is defined as TYPE ROUTING ; so not sure why layer->getType() call is resulting in a crash.

https://github.com/Precision-Innovations/OpenROAD/releases/download/2024-04-05/openroad_2.0_amd64-ubuntu22.04-2024-04-05.deb -O openroad.deb

$ openroad script.tcl 
OpenROAD db8cd961844d2abf17c5903a88051188f0379f24 
This program is licensed under the BSD-3 license. See the LICENSE file for details.
Components of this program may be licensed under more restrictive licenses which must be honored.
[INFO ODB-0227] LEF file: dummytech.lef, created 1 layers
[INFO ODB-0227] LEF file: dummytech_stdcell.lef, created 2 library cells
[WARNING ORD-2011] LEF master DFF_X1 has no liberty cell.
[WARNING ORD-2011] LEF master INV_X1 has no liberty cell.
[INFO IFP-0001] Added 66 rows of 133 site DUMMYTECH_site.
[INFO GPL-0002] DBU: 1000
[INFO GPL-0003] SiteSize: 150 300
[INFO GPL-0004] CoreAreaLxLy: 0 0
[INFO GPL-0005] CoreAreaUxUy: 19950 19800
[WARNING GPL-0001] io_input toplevel port is not placed!
       Replace will regard io_input is placed in (0, 0)
[WARNING GPL-0001] io_output toplevel port is not placed!
       Replace will regard io_output is placed in (0, 0)
[INFO GPL-0006] NumInstances: 5
[INFO GPL-0007] NumPlaceInstances: 5
[INFO GPL-0008] NumFixedInstances: 0
[INFO GPL-0009] NumDummyInstances: 0
[INFO GPL-0010] NumNets: 6
[INFO GPL-0011] NumPins: 12
[INFO GPL-0012] DieAreaLxLy: 0 0
[INFO GPL-0013] DieAreaUxUy: 20000 20000
[INFO GPL-0014] CoreAreaLxLy: 0 0
[INFO GPL-0015] CoreAreaUxUy: 19950 19800
[INFO GPL-0016] CoreArea: 395010000
[INFO GPL-0017] NonPlaceInstsArea: 0
[INFO GPL-0018] PlaceInstsArea: 345000
[INFO GPL-0019] Util(%): 0.09
[INFO GPL-0020] StdInstsArea: 345000
[INFO GPL-0021] MacroInstsArea: 0
[InitialPlace]  Iter: 1 CG residual: 0.00000007 HPWL: 3200
[InitialPlace]  Iter: 2 CG residual: 0.00000008 HPWL: 4012
[InitialPlace]  Iter: 3 CG residual: 0.00000000 HPWL: 3550
[InitialPlace]  Iter: 4 CG residual: 0.00000001 HPWL: 3548
[InitialPlace]  Iter: 5 CG residual: 0.00000001 HPWL: 3548
[INFO GPL-0031] FillerInit: NumGCells: 4096
[INFO GPL-0032] FillerInit: NumGNets: 6
[INFO GPL-0033] FillerInit: NumGPins: 12
[INFO GPL-0023] TargetDensity: 0.70
[INFO GPL-0024] AveragePlaceInstArea: 69000
[INFO GPL-0025] IdealBinArea: 98571
[INFO GPL-0026] IdealBinCnt: 4007
[INFO GPL-0027] TotalBinArea: 395010000
[INFO GPL-0028] BinCnt: 32 32
[INFO GPL-0029] BinSize: 624 619
[INFO GPL-0030] NumBins: 1024
[NesterovSolve] Iter: 1 overflow: 0 HPWL: 2995
[NesterovSolve] Finished with Overflow: 0.000000
[WARNING DPL-0038] No 1-site fill cells detected.  To remove 1-site gaps use the -disallow_one_site_gaps flag.
Placement Analysis
---------------------------------
total displacement          3.0 u
average displacement        0.6 u
max displacement            1.1 u
original HPWL               1.1 u
legalized HPWL              3.2 u
delta HPWL                  180 %

[WARNING GRT-0300] Timing is not available, setting critical nets percentage to 0.
Signal 11 received
Stack trace:
 0# 0x000057D1AEE6136D in openroad
 1# 0x00007C93B9642520 in /lib/x86_64-linux-gnu/libc.so.6
 2# odb::dbTechLayer::getType() in openroad
 3# grt::GlobalRouter::calcLayerPitches(int) in openroad
 4# grt::GlobalRouter::initRoutingTracks(int) in openroad
 5# grt::GlobalRouter::initFastRoute(int, int) in openroad
 6# grt::GlobalRouter::globalRoute(bool, bool, bool) in openroad
 7# 0x000057D1AF3B4A40 in openroad
 8# TclNRRunCallbacks in /lib/x86_64-linux-gnu/libtcl8.6.so
 9# 0x00007C93BDB81028 in /lib/x86_64-linux-gnu/libtcl8.6.so
10# Tcl_EvalEx in /lib/x86_64-linux-gnu/libtcl8.6.so
11# Tcl_Eval in /lib/x86_64-linux-gnu/libtcl8.6.so
12# sta::sourceTclFile(char const*, bool, bool, Tcl_Interp*) in openroad
13# ord::tclAppInit(Tcl_Interp*) in openroad
14# Tcl_MainEx in /lib/x86_64-linux-gnu/libtcl8.6.so
15# main in openroad
16# 0x00007C93B9629D90 in /lib/x86_64-linux-gnu/libc.so.6
17# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
18# _start in openroad

files.zip

Expected Behavior

OpenROAD should run and not crash.

Environment

(Note: I did not build OpenROAD from source but used a prebuilt release)

$ ./etc/Env.sh 
Git commit: e8a3ca4c774e958cb068cfcfd9d0dfdb9fbae882
kernel: Linux 6.5.0-1017-aws
os: Ubuntu 22.04.4 LTS (Jammy Jellyfish)
cmake version 3.22.1
CMake Warning at CMakeLists.txt:98 (message):
  OpenROAD git describe failed, using sha1 instead

CMake Error at third-party/CMakeLists.txt:58 (add_subdirectory):
  The source directory

    /home/ubuntu/OpenROAD/third-party/abc

  does not contain a CMakeLists.txt file.

CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR) (Required is at
  least version "4.0")
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.22/Modules/FindSWIG.cmake:153 (find_package_handle_standard_args)
  src/CMakeLists.txt:169 (find_package)

-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- OpenROAD version: e8a3ca4c774e958cb068cfcfd9d0dfdb9fbae882
-- System name: Linux
-- Compiler: GNU 11.4.0
-- Build type: RELEASE
-- Install prefix: /usr/local
-- C++ Standard: 17
-- C++ Standard Required: ON
-- C++ Extensions: OFF
-- The C compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Python: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- TCL library: /usr/lib/x86_64-linux-gnu/libtcl8.6.so
-- TCL header: TCL_HEADER-NOTFOUND
-- TCL readline library: /usr/lib/x86_64-linux-gnu/libtclreadline.so
-- TCL readline header: /usr/include/x86_64-linux-gnu
-- Configuring incomplete, errors occurred!

To Reproduce

see previous

Relevant log output

No response

Screenshots

No response

Additional Context

No response

eder-matheus commented 2 weeks ago

@edwardcwang The crash was caused by the global router tool not detecting the correct max routing layer of the design. This happened because your design doesn't have the tracks defined for the routing layers. You need to add the make_tracks command to create them.

You also miss the pin placement, so the global route will fail even after creating the tracks.

eder-matheus commented 2 weeks ago

@edwardcwang Just another comment: I believe this tech LEF is just for testing, but I suggest using at least two routing layers. The pin placer tool requires at least two layers with different preferred direction to place the pins properly since it doesn't allow wrong-way pins.

edwardcwang commented 2 weeks ago

@eder-matheus I see - thank you so much for your fast reply and diagnosis!