The-OpenROAD-Project/OpenROAD-flow-scripts

Detailed placement check failure from within `global_route.tcl`

povik opened this issue · 12 comments

Subject

[Stage]: Global Router.

Describe the bug

On asap7/mock-cpu with some modification to the synthesis scripts I get the following failure at global_route time:

...
[INFO RSZ-0059] Removed 1 buffers.
[INFO RSZ-0045] Inserted 12 buffers, 1 to split loads.
[INFO RSZ-0041] Resized 13 instances.
[INFO RSZ-0043] Swapped pins on 15 instances.
[INFO RSZ-0049] Cloned 6 instances.
[WARNING RSZ-0062] Unable to repair all setup violations.
[INFO RSZ-0033] No hold violations found.
Placement Analysis
---------------------------------
total displacement         28.7 u
average displacement        0.0 u
max displacement            1.7 u
original HPWL           41727.9 u
legalized HPWL          41750.9 u
delta HPWL                    0 %

Repair antennas...
[WARNING GRT-0246] No diode with LEF class CORE ANTENNACELL found.
[WARNING DPL-0005] Overlap check failed (5).
 _39070_ overlaps _38820_
 fifo_in.fifomem.mem\[1\]\[16\]$_DFFE_PP_ overlaps _19706_
 mult_result\[2\]\[4\]$_DFF_P_ overlaps _24054_
 fifo_out.wptr_full.wbin\[3\]$_DFF_PN0__114 overlaps fifo_out.sync_w2r.rq1_wptr\[3\]$_DFF_PN0_
 rebuffer14 overlaps _19705_
[ERROR DPL-0033] detailed placement checks failed.
Error: global_route.tcl, 114 DPL-0033
       10.01 real         8.33 user         1.50 sys
make[1]: *** [Makefile:786: do-5_1_grt] Error 1
make: *** [Makefile:784: results/asap7/mock-cpu/baseline_gainbuf/5_1_grt.odb] Error 2

Expected Behavior

No failure

Environment

[WARNING] Your current OpenROAD version is outdated.
It is recommened to pull the latest changes.
If problem persists, file a github issue with the re-producible test case.
kernel: Darwin 23.1.0
os: macOS 14.1.2
cmake version 3.29.6
CMake Warning at src/CMakeLists.txt:267 (message):
  spdlog: SPDLOG_FMT_EXTERNAL=ON


CMake Warning (dev) at src/sta/CMakeLists.txt:32 (option):
  Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
  --help-policy CMP0077" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  For compatibility with older versions of CMake, option is clearing the
  normal variable 'USE_TCL_READLINE'.
This warning is for project developers.  Use -Wno-dev to suppress it.

Number of processor cores: 10
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
TCL_LIBRARY
    linked by target "openroad" in directory /Users/pk/repos/openroad/src
    linked by target "db" in directory /Users/pk/repos/openroad/src/odb/src/db
    linked by target "TestMaster" in directory /Users/pk/repos/openroad/src/odb/test/cpp
    linked by target "TestLef58Properties" in directory /Users/pk/repos/openroad/src/odb/test/cpp
    linked by target "TestNetTrack" in directory /Users/pk/repos/openroad/src/odb/test/cpp
    linked by target "TestGuide" in directory /Users/pk/repos/openroad/src/odb/test/cpp
    linked by target "TestGCellGrid" in directory /Users/pk/repos/openroad/src/odb/test/cpp
    linked by target "TestModule" in directory /Users/pk/repos/openroad/src/odb/test/cpp
    linked by target "TestCallBacks" in directory /Users/pk/repos/openroad/src/odb/test/cpp
    linked by target "TestGroup" in directory /Users/pk/repos/openroad/src/odb/test/cpp
    linked by target "TestGeom" in directory /Users/pk/repos/openroad/src/odb/test/cpp
    linked by target "TestAccessPoint" in directory /Users/pk/repos/openroad/src/odb/test/cpp
    linked by target "TestJournal" in directory /Users/pk/repos/openroad/src/odb/test/cpp
    linked by target "OdbGTests" in directory /Users/pk/repos/openroad/src/odb/test/cpp
    linked by target "TestScanChain" in directory /Users/pk/repos/openroad/src/odb/test/cpp/scan
    linked by target "odb_py" in directory /Users/pk/repos/openroad/src/odb/src/swig/python
    linked by target "odbtcl" in directory /Users/pk/repos/openroad/src/odb/src/swig/tcl
    linked by target "OpenSTA" in directory /Users/pk/repos/openroad/src/sta
    linked by target "TestBufRem1" in directory /Users/pk/repos/openroad/src/rsz/test/cpp
    linked by target "dpl" in directory /Users/pk/repos/openroad/src/dpl
    linked by target "RmpGTests" in directory /Users/pk/repos/openroad/src/rmp/test/cpp
    linked by target "dst" in directory /Users/pk/repos/openroad/src/dst
    linked by target "TestDistributed" in directory /Users/pk/repos/openroad/src/dst/test/cpp
    linked by target "TestBalancer" in directory /Users/pk/repos/openroad/src/dst/test/cpp
    linked by target "TestWorker" in directory /Users/pk/repos/openroad/src/dst/test/cpp

CMake Generate step failed.  Build files cannot be regenerated correctly.
-- The CXX compiler identification is Clang 16.0.6
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/8c3v3rdzvi5364x9m959ijyy6iamqf5f-clang-wrapper-16.0.6/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- OpenROAD version: v2.0-16316-gf9cfd9383
-- System name: Darwin
-- Compiler: Clang 16.0.6
-- Build type: RELEASE
-- Install prefix: /var/empty/local
-- C++ Standard: 17
-- C++ Standard Required: ON
-- C++ Extensions: OFF
-- The C compiler identification is Clang 16.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/8c3v3rdzvi5364x9m959ijyy6iamqf5f-clang-wrapper-16.0.6/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test C_COMPILER_SUPPORTS__-Wall
-- Performing Test C_COMPILER_SUPPORTS__-Wall - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wall
-- Performing Test CXX_COMPILER_SUPPORTS__-Wall - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-array-bounds
-- Performing Test C_COMPILER_SUPPORTS__-Wno-array-bounds - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-array-bounds
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-array-bounds - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-nonnull
-- Performing Test C_COMPILER_SUPPORTS__-Wno-nonnull - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-nonnull
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-nonnull - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-maybe-uninitialized
-- Performing Test C_COMPILER_SUPPORTS__-Wno-maybe-uninitialized - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-maybe-uninitialized
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-maybe-uninitialized - Failed
-- Performing Test C_COMPILER_SUPPORTS__-Wno-format-overflow
-- Performing Test C_COMPILER_SUPPORTS__-Wno-format-overflow - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-format-overflow
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-format-overflow - Failed
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-variable
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-variable - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-variable
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-variable - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-function
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-function - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-function
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-function - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-write-strings
-- Performing Test C_COMPILER_SUPPORTS__-Wno-write-strings - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-write-strings
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-write-strings - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-sign-compare
-- Performing Test C_COMPILER_SUPPORTS__-Wno-sign-compare - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-sign-compare
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-sign-compare - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-deprecated
-- Performing Test C_COMPILER_SUPPORTS__-Wno-deprecated - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-deprecated
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-deprecated - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-c++11-narrowing
-- Performing Test C_COMPILER_SUPPORTS__-Wno-c++11-narrowing - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-c++11-narrowing
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-c++11-narrowing - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-register
-- Performing Test C_COMPILER_SUPPORTS__-Wno-register - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-register
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-register - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-format
-- Performing Test C_COMPILER_SUPPORTS__-Wno-format - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-format
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-format - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-reserved-user-defined-literal
-- Performing Test C_COMPILER_SUPPORTS__-Wno-reserved-user-defined-literal - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-reserved-user-defined-literal
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-reserved-user-defined-literal - Success
-- Performing Test C_COMPILER_SUPPORTS__-fpermissive
-- Performing Test C_COMPILER_SUPPORTS__-fpermissive - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-fpermissive
-- Performing Test CXX_COMPILER_SUPPORTS__-fpermissive - Success
-- Performing Test C_COMPILER_SUPPORTS__-x
-- Performing Test C_COMPILER_SUPPORTS__-x - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__-x
-- Performing Test CXX_COMPILER_SUPPORTS__-x - Failed
-- Performing Test C_COMPILER_SUPPORTS__c++
-- Performing Test C_COMPILER_SUPPORTS__c++ - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__c++
-- Performing Test CXX_COMPILER_SUPPORTS__c++ - Failed
-- Performing Test C_COMPILER_SUPPORTS__-std=c++17
-- Performing Test C_COMPILER_SUPPORTS__-std=c++17 - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__-std=c++17
-- Performing Test CXX_COMPILER_SUPPORTS__-std=c++17 - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-but-set-variable
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-but-set-variable - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-but-set-variable
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-but-set-variable - Success
-- TCL library: TCL_LIBRARY-NOTFOUND
-- TCL header: TCL_HEADER-NOTFOUND
-- TCL readline library: /nix/store/9ikbq1zypamzdj5fgin2rrbpl1da8jab-tclreadline-2.3.8/lib/libtclreadline.dylib
-- TCL readline header: /nix/store/9ikbq1zypamzdj5fgin2rrbpl1da8jab-tclreadline-2.3.8/include
-- Found SWIG: /nix/store/ksn00l81mqqmcv61iy3bfn4zkdmdiz2g-swig-4.2.1/bin/swig (found suitable version "4.2.1", minimum required is "4.0")
-- Using SWIG >= 4.2.1 -flatstaticmethod flag for python
-- Found Boost: /nix/store/pjmwmbng25l1s4z3m4dvkxlp53pj8ps1-boost-1.83.0-dev/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0")
-- boost: 1.83.0
-- Found GTest: /nix/store/369drgwnj7di3z03k0f9slldjpmg67dm-gtest-1.14.0-dev/lib/cmake/GTest/GTestConfig.cmake (found version "1.14.0")
-- GTest: 1.14.0
-- Found Python3: /nix/store/9pj4rzx5pbynkkxq1srzwjhywmcfxws3-python3-3.12.5/include/python3.12 (found version "3.12.5") found components: Development Development.Module Development.Embed
-- Found ZLIB: /nix/store/9cpzwxa2fmkdl2da43968idffwfpcs53-zlib-1.3.1/lib/libz.dylib (found version "1.3.1")
-- Found Threads: TRUE
-- spdlog: 1.14.1
-- Found BISON: /nix/store/53pnjx9469dlz4qlisqwispf1zvpis6z-bison-3.8.2/bin/bison (found version "3.8.2")
-- Found Doxygen: /nix/store/f4mj6l71kal7381w88m8ln1q9dciyx82-doxygen-1.10.0/bin/doxygen (found version "1.10.0") found components: doxygen dot
-- STA version: 2.6.0
-- STA git sha: 20925bb00965c1199c45aca0318c2baeb4042c5a
-- System name: Darwin
-- Compiler: Clang 16.0.6
-- Build type: RELEASE
-- Build CXX_FLAGS: -O3 -DNDEBUG
-- Install prefix: /var/empty/local
-- Found FLEX: /nix/store/23izns4pj0mvd8bk8whm5gmxnqv8m2hg-flex-2.6.4/bin/flex (found version "2.6.4")
-- TCL library: TCL_LIBRARY-NOTFOUND
-- TCL header: TCL_HEADER-NOTFOUND
-- TCL readline library: /nix/store/9ikbq1zypamzdj5fgin2rrbpl1da8jab-tclreadline-2.3.8/lib/libtclreadline.dylib
-- TCL readline header: /nix/store/9ikbq1zypamzdj5fgin2rrbpl1da8jab-tclreadline-2.3.8/include/tclreadline.h
-- CUDD library: /nix/store/3r82ywjn1x3zg5ld64ds59nixvcnh81l-cudd-3.0.0/lib/libcudd.a
-- CUDD header: /nix/store/3r82ywjn1x3zg5ld64ds59nixvcnh81l-cudd-3.0.0/include/cudd.h
-- SSTA: 0
-- Found SWIG: /nix/store/ksn00l81mqqmcv61iy3bfn4zkdmdiz2g-swig-4.2.1/bin/swig (found suitable version "4.2.1", minimum required is "3.0")
-- STA executable: /Users/pk/repos/openroad/src/sta/app/sta
-- Found Protobuf: /nix/store/hn3c7xxmq6f2xlazj7082vjzyxpfwf36-protobuf-23.4/lib/libprotobuf.dylib (found version "4.23.4")
-- Found re2: /nix/store/3kri9f5i5k7fnl8dp95sw0h595cvkvvd-re2-2024-07-02-dev/lib/cmake/re2/re2Config.cmake (found version "11.0.0")
-- Found GLPK: /nix/store/fdaqxazq68agh5al7r0m9758z1b5akml-glpk-5.0/lib/libglpk.dylib
-- Found OpenMP_CXX: -fopenmp=libomp (found version "5.0")
-- Found OpenMP: TRUE (found version "5.0")
-- Found OR-Tools: /nix/store/kxlvs4bm3zcd4wjsv2dsygnbb987klwi-or-tools-9.7/lib/cmake/ortools (version: 9.7.9999)
-- TCL library: TCL_LIBRARY-NOTFOUND
-- TCL header: TCL_HEADER-NOTFOUND
-- Found OpenMP_C: -fopenmp=libomp (found version "5.0")
-- Found OpenMP: TRUE (found version "5.0")
-- Found OpenMP: TRUE (found version "5.0")
-- GUI is enabled
-- Charts widget is enabled
-- Found Boost: /nix/store/pjmwmbng25l1s4z3m4dvkxlp53pj8ps1-boost-1.83.0-dev/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0") found components: serialization
-- Could NOT find VTune (missing: VTune_LIBRARIES VTune_INCLUDE_DIRS) 
-- Found Boost: /nix/store/pjmwmbng25l1s4z3m4dvkxlp53pj8ps1-boost-1.83.0-dev/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found suitable version "1.83.0", minimum required is "1.78")
-- TCL library: TCL_LIBRARY-NOTFOUND
-- TCL header: TCL_HEADER-NOTFOUND
-- Found Boost: /nix/store/pjmwmbng25l1s4z3m4dvkxlp53pj8ps1-boost-1.83.0-dev/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0") found components: serialization system thread
-- Found Boost: /nix/store/pjmwmbng25l1s4z3m4dvkxlp53pj8ps1-boost-1.83.0-dev/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0")
-- Found Eigen3: /nix/store/cjs08d4r8id8h9dg29v6fcha6vq1mdgd-eigen-3.4.0/share/eigen3/cmake/Eigen3Config.cmake (found version "3.4.0")
-- TCL readline enabled
-- Tcl Extended disabled
-- Python3 enabled
-- Configuring done (22.9s)
-- Generating done (0.9s)

To Reproduce

Please see this test case extracted with make global_route_issue.

https://drive.google.com/file/d/1_HnpYS9mCNMZWu_FLQ5p7_XALSTJ7Ugj/view?usp=sharing

Note this reproduces with both f9cfd938 of openroad (the submodule revision) and 3a75eb5 (the current head)

Relevant log output

No response

Screenshots

No response

Additional Context

No response

The placement density is very high - do you know why?
image
The instance placement also have an odd 'stringy' character
image

The pins being off towards the side might be related to it. I also see a fair number of gain* buffers in the area near the pins. The density is pretty high at 71% so you could try reducing it a bit. You might also investigate the buffering happening in gpl.

I don't think this is fundamentally a dpl issue, I think that is the symptom.

The placement density is very high - do you know why?

No. I can compare against a clean run of asap7/mock-cpu to see if the synthesis changes caused it.

The instance placement also have an odd 'stringy' character

I noticed that too, it looked like a series of registers connected back-to-back, could those be expected with this design?

I don't think this is fundamentally a dpl issue, I think that is the symptom.

I'm surprised. Shouldn't the detailed placer fail if it's unable to place some instances, rather than leaving overlapping instances to be found by check_placement?

That's a fair point. I'll take a look.

Figures from a clean build below (one which finishes); The stringy features are there too which makes me suspect something is wrong with the design and most of it is getting optimized out

Screenshot 2024-10-14 at 17 56 36 Screenshot 2024-10-14 at 17 58 42

@oharboe you created this design - any comments?

I dont know what that error means.

It should just be like any garden variety logic.

Ah, the design is called mock-cpu but I see its sources are placed at ./designs/src/fifo/*.v -- stringy features are not unexpected with a FIFO, are they... :)

It looks like there is something wrong even in the incoming odb. How can I run this full flow (or least post-yosys onwards)?

Should I create a post floorplan checkpoint?

Yes please

It looks like the original archive by make global_route_issue contains odbs for the preceding stages of the flow too. In any case I was able to reproduce again with OR f9cfd938 and below is the export from make floorplan_issue. There are no changes to the scripts post floorplan, and the changed floorplan.tcl is part of the archive.

https://drive.google.com/file/d/1jD6J6BIq1RH0jw9MZ6GnjS4-LOPYQhe9/view?usp=sharing

@maliberty Let me know if this is usable by you as-is.