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.38k stars 485 forks source link

Missing metal fill in power ring and IO cells #5114

Open dnltz opened 2 weeks ago

dnltz commented 2 weeks ago

Describe the bug

OpenROAD can add metal fill correctly to the core area but is missing the area where the power ring and IO cells are located. See screenshots for more details.

The current design doesn't meet the ihp-sg13g2 DRC checks regarding some min density rules of 35%.

Expected Behavior

I was expecting the entire DIE area, not only the CORE area, gets filled with metal.

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: Linux 5.15.0-106-generic
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

-- 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: cfe92e17a7d986ea9bd82031a61d47120e30dc7a
-- 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/local/bin/python3.6 (found version "3.6.8") 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  
-- 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 - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-maybe-uninitialized
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-maybe-uninitialized - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-format-overflow
-- Performing Test C_COMPILER_SUPPORTS__-Wno-format-overflow - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-format-overflow
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-format-overflow - Success
-- 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 - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-c++11-narrowing
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-c++11-narrowing - Failed
-- Performing Test C_COMPILER_SUPPORTS__-Wno-register
-- Performing Test C_COMPILER_SUPPORTS__-Wno-register - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-register
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-register - Success
-- Performing Test C_COMPCMake Warning at src/CMakeLists.txt:245 (message):
  spdlog: SPDLOG_FMT_EXTERNAL=ON

CMake Error at src/stt/CMakeLists.txt:38 (find_package):
  Could not find a package configuration file provided by "LEMON" with any of
  the following names:

    LEMONConfig.cmake
    lemon-config.cmake
    lemonConfig.cmake
    lemon-config.cmake

  Add the installation prefix of "LEMON" to CMAKE_PREFIX_PATH or set
  "LEMON_DIR" to a directory containing one of the above files.  If "LEMON"
  provides a separate development package or SDK, be sure it has been
  installed.

ILER_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 - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-reserved-user-defined-literal
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-reserved-user-defined-literal - Failed
-- Performing Test C_COMPILER_SUPPORTS__-fpermissive
-- Performing Test C_COMPILER_SUPPORTS__-fpermissive - Failed
-- 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: /usr/lib/x86_64-linux-gnu/libtcl.so
-- TCL header: /usr/include/tcl/tcl.h
-- TCL readline library: /usr/lib/x86_64-linux-gnu/libtclreadline.so
-- TCL readline header: /usr/include/x86_64-linux-gnu
-- Found SWIG: /usr/bin/swig4.0 (found suitable version "4.0.2", minimum required is "4.0")  
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0")  
-- boost: 1.74.0
-- Found Python3: /usr/local/include/python3.6m (found version "3.6.8") found components: Development Development.Module Development.Embed 
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- spdlog: 1.9.2
-- Found BISON: /usr/bin/bison (found version "3.8.2") 
-- Found Doxygen: /usr/bin/doxygen (found version "1.9.1") found components: doxygen dot 
-- STA version: 2.5.0
-- STA git sha: f8a9e1771b80899ff43189362725dff70c2ed057
-- System name: Linux
-- Compiler: GNU 11.4.0
-- Build type: RELEASE
-- Build CXX_FLAGS: -O3 -DNDEBUG
-- Install prefix: /usr/local
-- Found FLEX: /usr/bin/flex (found version "2.6.4") 
-- TCL library: /usr/lib/x86_64-linux-gnu/libtcl.so
-- TCL header: /usr/include/tcl/tcl.h
-- SSTA: 0
-- Found SWIG: /usr/bin/swig4.0 (found suitable version "4.0.2", minimum required is "3.0")  
-- STA executable: /home/daniel/work/ElemRV/ElemRV-init/tools/OpenROAD-flow-scripts/tools/OpenROAD/src/sta/app/sta
-- Configuring incomplete, errors occurred!

I'm using https://github.com/Precision-Innovations/OpenROAD/releases/tag/2024-05-15
and https://github.com/dnltz/OpenROAD-flow-scripts/tree/IHP-May24
and https://github.com/SteffenReith/ElemRV

To Reproduce

External Link

Relevant log output

No response

Screenshots

Metal2 fill image

Metal3 fill image

Additional Context

No response

dnltz commented 2 weeks ago

Adding the DIE_AREA as parameter to density_fill seems to make it even worse and no filler cells are added anymore.

maliberty commented 2 weeks ago

You can put large files in gdrive (or equivalent) and provide a link here.

maliberty commented 2 weeks ago

It would be helpful to see what those layers look like in the OR gui. Perhaps the IOs are marked as OBS.

maliberty commented 2 weeks ago

By default we only fill the core area. If you want to fill the die area you can use the -area flag.

maliberty commented 2 weeks ago

Adding the DIE_AREA as parameter to density_fill seems to make it even worse and no filler cells are added anymore.

-area looks to be operating in dbu rather than microns. I'll fix that but you can scale the area to see if it helps.

dnltz commented 2 weeks ago

What's the difference between dbu and microns?

Edit: Found it https://openroad.readthedocs.io/en/latest/contrib/DatabaseMath.html

dnltz commented 2 weeks ago

You can put large files in gdrive (or equivalent) and provide a link here.

https://fileshare.phytec.com/index.php/s/4G7nFdTPLpNTRpc

Can you download that?

maliberty commented 2 weeks ago

Units addressed in #5115 - for IHP the conversion factor is 1000

maliberty commented 2 weeks ago

If you look at Metal3 in OR you'll see the IO cells are fully blocked: image

The most you could do if fill the gap between the ring and the die edge. Is that what you need?

maliberty commented 2 weeks ago

With the units fix + -area {0 0 1865.280 1867.320} I see it fully filled to the edges

image

dnltz commented 2 weeks ago

If you look at Metal3 in OR you'll see the IO cells are fully blocked: image

The most you could do if fill the gap between the ring and the die edge. Is that what you need?

I can build openroad manually tomorrow and try your patch. Where is the IO blockage coming from? Can I disable IO cells in the PDK?

maliberty commented 2 weeks ago

It comes from the LEF. Filling inside the cell would be dangerous as without the OBS we would likely see it all as empty space to be filled.

stefanottili commented 2 weeks ago

There are three ways to generate fill: openroad, magic and klayout.

1) openroad operates on lef MACRO PIN/OBS whereas magic and klayout use "layout" aka gds/oasis input. 2) magic (used for sky130) requires a "magic tech file", which isn't available for a lot of technologies. 3) If you require the "interior" of pads/analog blocks/ram/rom to be taken into account when adding fill, klayout seem to be the way to go. But you'll have to find a way for capacitance extraction to read the klayout layout fill data.

maliberty commented 2 weeks ago

OR doesn't do FEOL fill so you'll likely need a second tool to handle that in any case.

In the longer term I think it makes sense to fill the core with OR, once it is timing aware, and then fill the periphery with a pure GDS tool. That thinking is why the default is the core area.

stefanottili commented 2 weeks ago

Slightly off-topic, but using this design as an example:

The current design finish stage using klayout with klayout.tcl calling def2stream.py can be replaced by strm2gds or strm2oas.

The one thing strm2oas can't do is to add a searing reference to the def DESIGN. But one can use a klayout txt file to reference both the def DESIGN and the sealring$1 in a new top. I prefer this hierarchy, but this might be a matter of taste. It xor's cleanly (when taking the missing iopad and bondpad gds from 6_final.gds).

q1) Is there a specific reason to have 551894 instance and net names as properties in the gds ? I've never seen any use for either of these needlessly bloating 6_final.gds[.gz].

q2) it seem geometry and fill in the sealring is overlapping the bondpads, is this intentional ?

q3) nor2b_1 and nor2b_2 are the only cells with a boundary layer 235, is this intentional ?

q4) The following two entries in the .map file are ignored by strm2oas and should be commented out. No need for instance names and a boundary rectangle for each instance bloating gds. 150 NAME COMP 63 0 152 COMP ALL 235 0

strm2oas \
--lefdef-no-implicit-lef \
--lefdef-macro-resolution-mode 2 \
--lefdef-map=\
../../OpenROAD-flow-scripts/flow/platforms/ihp-sg13g2/sg13g2.map \
--lefdef-lefs=\
lef/bondpad_70x70.lef.gz,\
lef/sg13g2_io.lef.gz,\
lef/sg13g2_stdcell.lef.gz,\
lef/sg13g2_tech.lef.gz \
--lefdef-lef-layouts=\
../../OpenROAD-flow-scripts/flow/platforms/ihp-sg13g2/gds/sg13g2_stdcell.gds \
def/6_final.def.gz,\
ElemRV.txt \
6_final.oas

klayout ElemRV.txt

HEADER 600 
BGNLIB 5/15/2024 15:45:45 5/15/2024 15:45:45 
LIBNAME LIB
UNITS 0.001 1e-09 

BGNSTR 5/15/2024 15:45:45 5/15/2024 15:45:45 
STRNAME ElemRV
SREF 
SNAME ElemRVTop
XY 0: 0
ENDEL 
SREF 
SNAME sealring$1
XY 0: 0
ENDEL 
ENDSTR 
ENDLIB 
        strmxor \
        --debug-level=11 \
        --heal \
        --threads=8 \
        --tiles=500 \
        gds/6_final.gds.gz \
        6_final.oas