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.65k stars 571 forks source link

LEF 5.7 property not supported #3570

Closed Blebowski closed 1 year ago

Blebowski commented 1 year ago

Describe the bug

I am trying to read in tech LEF file for an older proprietary PDK, and I obtain following messages:

[INFO ODB-0222] Reading LEF file: xyz_tech.lef
[INFO ODB-0388] unsupported LEF57_ARRAYSPACING property for layer VI1 :" ARRAYSPACING WIDTH 0.56 CUTSPACING 0.13 ARRAYCUTS 3 SPACING 0.13 ; "
[INFO ODB-0388] unsupported LEF57_ARRAYSPACING property for layer VI2 :" ARRAYSPACING WIDTH 0.56 CUTSPACING 0.13 ARRAYCUTS 3 SPACING 0.13 ; "
[INFO ODB-0388] unsupported LEF57_ARRAYSPACING property for layer VI3 :" ARRAYSPACING WIDTH 0.56 CUTSPACING 0.13 ARRAYCUTS 3 SPACING 0.13 ; "
[INFO ODB-0388] unsupported LEF57_ARRAYSPACING property for layer VI4 :" ARRAYSPACING WIDTH 0.56 CUTSPACING 0.13 ARRAYCUTS 3 SPACING 0.13 ; "
[INFO ODB-0223]     Created 22 technology layers
[INFO ODB-0224]     Created 78 technology vias
[INFO ODB-0226] Finished LEF file:  xyz_tech.lef

Expected Behavior

I would expect that:

  1. This message is a warning (not an INFO)
  2. Support of also older LEF/DEF versions (e.g. the mentioned 5.7)

Environment

Git commit: 914d6d23c442175889a2cca9b8e6fc37fe66e244
kernel: Linux 4.18.0-425.10.1.el8_7.x86_64
os: Red Hat Enterprise Linux 8.7 (Ootpa)
cmake version 3.23.2
-- The CXX compiler identification is GNU 8.5.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: v2.0-9039-g914d6d23c
-- System name: Linux
-- Compiler: GNU 8.5.0
-- Build type: RELEASE
-- Install prefix: /usr/local
-- C++ Standard: 17
-- C++ Standard Required: ON
-- C++ Extensions: OFF
-- The C compiler identification is GNU 8.5.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: /tools/tropic/ts-python-env/virtualenvs/ts-python-env-yQ9mF3ZL-py3.8/bin/python3.8 (found version "3.8.13") found components: Interpreter 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- 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_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 - 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__-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/lib64/libtcl.so
-- TCL header: /usr/include/tcl.h
-- TCL readline library: /usr/lib64/libtclreadline.so
-- TCL readline header: /usr/include
-- Found SWIG: /usr/bin/swig (found suitable version "4.1.0", minimum required is "3.0")  
-- Using SWIG >= 4.1.0 -flatstaticmethod flag for python
-- Found Boost: /usr/local/lib/cmake/Boost-1.80.0/BoostConfig.cmake (found version "1.80.0")  
-- boost: 1.80.0
-- Found Python3: /usr/include/python3.8 (found version "3.8.13") found components: Development Development.Module Development.Embed 
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11") 
-- spdlog: 1.8.1
-- Found BISON: /usr/bin/bison (found version "3.0.4") 
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.14") found components: doxygen dot 
-- STA version: 2.4.0
-- STA git sha: 5b6a3edfb01b8250b2f03e1e338b44bd21f53d4d
-- System name: Linux
-- Compiler: GNU 8.5.0
-- Build type: RELEASE
-- Build CXX_FLAGS: -O3 -DNDEBUG
-- Install prefix: /usr/local
-- Found FLEX: /usr/bin/flex (found version "2.6.1") 
-- TCL library: /usr/lib64/libtcl.so
-- TCL header: /usr/include/tcl.h
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- SSTA: 0
-- STA executable: /tmp/OpenROAD/src/sta/app/sta
-- GPU is not enabled
-- TCL library: /usr/lib64/libtcl.so
-- TCL header: /usr/include/tcl.h
-- Found re2: /opt/or-tools/lib64/cmake/re2/re2Config.cmake (found version "9.0.0") 
-- Found Clp: /opt/or-tools/lib64/cmake/Clp/ClpConfig.cmake (found version "1.17.7") 
-- Found Cbc: /opt/or-tools/lib64/cmake/Cbc/CbcConfig.cmake (found version "2.10.7") 
-- Found Eigen3: /usr/local/share/eigen3/cmake/Eigen3Config.cmake (found version "3.4.0") 
-- Found SCIP: /opt/or-tools/lib/cmake/scip/scip-config.cmake (found version "8.0.1") 
-- GUI is enabled
-- Charts widget is not enabled
-- Found Boost: /usr/local/lib/cmake/Boost-1.80.0/BoostConfig.cmake (found version "1.80.0") found components: serialization 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Could NOT find VTune (missing: VTune_LIBRARIES VTune_INCLUDE_DIRS) 
-- Found Boost: /usr/local/lib/cmake/Boost-1.80.0/BoostConfig.cmake (found suitable version "1.80.0", minimum required is "1.78")  
-- TCL library: /usr/lib64/libtcl.so
-- TCL header: /usr/include/tcl.h
-- Found Boost: /usr/local/lib/cmake/Boost-1.80.0/BoostConfig.cmake (found version "1.80.0") found components: serialization system thread 
-- Found Boost: /usr/local/lib/cmake/Boost-1.80.0/BoostConfig.cmake (found version "1.80.0")  
-- TCL readline enabled
-- Tcl Extended disabled
-- Python3 enabled
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/tmp.75C7FiYRpS

To Reproduce

Unfortunately, I can't provide the whole PDK lef.

Small extract from the techlef demonstrating the issue.

In property definitions section:

  LAYER LEF57_SPACING STRING ;
  LAYER LEF57_SPACINGTABLE STRING ;
  LAYER LEF57_ARRAYSPACING STRING ;

The definition of the LEF rule is in the message above.

Relevant log output

No response

Screenshots

No response

Additional Context

No response

maliberty commented 1 year ago

@gadfort I suspect this world only affect pdn. Do you have any thoughts on support?

QuantamHD commented 1 year ago

@maliberty Don't we already support the 5.8 version of this https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/odb/src/lefin/ArraySpacingParser.cpp

If so, can't we just add a new parse handler for 5.7 and leverage the existing parser?

QuantamHD commented 1 year ago

@Blebowski If you want to give it a shot I'm pretty sure if you just add another else if for this property with the existing parser it will "just work" ™.

https://github.com/The-OpenROAD-Project/OpenROAD/blob/fcc7e5351b0f24dd62a26ddc929e299cb60a3793/src/odb/src/lefin/lefin.cpp#L711

gadfort commented 1 year ago

@maliberty @QuantamHD I think we should be able to use the same underlying code with minimal changes. But first we need a parser.

Blebowski commented 1 year ago

Hi @QuantamHD , I will give it a try. Altough, I don't think it is a good idea trying to hack this "quick and dirty" way. IMHO, this would deserve looking at the property differences between various LEF versions. Then, it may be good to adjust property parsing so that different LEF versions are handled correctly for all properties (if that is allowed by LEF spec). Let me see what I can do. Just a note, I don't really have much time lately, so it might take some time to produce a patch.

Blebowski commented 1 year ago

OK, this is weird. I am trying to search for LEF57_ prefixed properties in LEF 5.7 RM, however, I see only LEF58_ prefixed ones. The LEF file itself states that it uses LEF version 5.5, however, I am unable to find 5.5 RM. I am probably missing something, or properties with LEF57_ prefix is something that is not really according to LEF/DEF RM. Anyone has a clue where this is coming from?

maliberty commented 1 year ago

I don't think there is any such property as LEF57_ARRAYSPACING. Even if you look at an older 5.7 manual like https://www.ispd.cc/contests/18/lefdefref.pdf you don't find it (just ARRAYSPACING). Where did this LEF come from?

Blebowski commented 1 year ago

@maliberty, the file header states following:

LEF file generated by Abstract Generator version 5.5.9
maliberty commented 1 year ago

What tool is that? From what I can see it writes invalid LEF.

Blebowski commented 1 year ago

I don't know, but apparently it is a tool from Cadence, e.g.:

https://redirect.cs.umbc.edu/~tinoosh/cmpe641/slides/lect03_abstract.pdf

https://www.youtube.com/watch?v=c0IgLac4guI

maliberty commented 1 year ago

With no document defining this property it seem a bit odd to "support" it. Are you using an older version of Virtuoso?

Blebowski commented 1 year ago

Yup, I agree. I did not generate the LEF file, we have it delivered from fab. The date says 2014, so if it is a bug, it is possible that newer version of Virtuoso will have the issue fixed. I need to ask our fab if they can provide more up to date version.

maliberty commented 1 year ago

Worst case I would make a local copy and just change it to LEF58 and see if that works.

Blebowski commented 1 year ago

OK, I will give it a try.

Blebowski commented 1 year ago

After trying the "hack" to replace the LEF57_ with LEF58_ the LEF file loads in correctly, so I will close the issue.