The-OpenROAD-Project / OpenROAD-flow-scripts

OpenROAD's scripts implementing an RTL-to-GDS Flow. Documentation at https://openroad-flow-scripts.readthedocs.io/en/latest/
https://theopenroadproject.org/
Other
315 stars 275 forks source link

Attempting to Run 3rd party cell for sky130hd (and furthermore sky130hs) #1295

Closed dalyles closed 1 year ago

dalyles commented 1 year ago

Subject

[Documentation] for documentation errors.

Describe the bug

I'm currently trying to run a cell named picor32.v with the autotuner, however upon completion of the runs, the output results are incomplete as shown here:

image

From my understanding, it doesn't seem to sucessfully make it through the placement stage.

Expected Behavior

What is expected is to have all output files in logs completed for further analysis.

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-76-generic
os: Ubuntu 20.04.6 LTS (Focal Fossa)
cmake version 3.26.4
-- The CXX compiler identification is GNU 9.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: v2.0-9070-gbb341ffb9
-- System name: Linux
-- Compiler: GNU 9.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 9.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: /home/dlyles/mambaforge/bin/python3.10 (found version "3.10.9") found components: Interpreter 
-- 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/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/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: /home/dlyles/mambaforge/include/python3.10 (found version "3.10.9") found components: Development Development.Module Development.Embed 
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")  
-- spdlog: 1.8.1
-- Found BISON: /usr/bin/bison (found version "3.5.1") 
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- STA version: 2.4.0
-- STA git sha: d26f41708ed89d467c033334b0a3895558c003b4
-- System name: Linux
-- Compiler: GNU 9.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
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- SSTA: 0
-- STA executable: /home/dlyles/OpenROAD-flow-scripts/tools/OpenROAD/src/sta/app/sta
-- GPU is not enabled
-- TCL library: /usr/lib/x86_64-linux-gnu/libtcl.so
-- TCL header: /usr/include/tcl/tcl.h
-- Found re2: /opt/or-tools/lib/cmake/re2/re2Config.cmake (found version "9.0.0") 
-- Found Clp: /opt/or-tools/lib/cmake/Clp/ClpConfig.cmake (found version "1.17.7") 
-- Found Cbc: /opt/or-tools/lib/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/lib/x86_64-linux-gnu/libtcl.so
-- TCL header: /usr/include/tcl/tcl.h
-- Found Boost: /usr/local/lib/cmake/Boost-1.80CMake Warning at src/CMakeLists.txt:276 (add_executable):
  Cannot generate a safe runtime search path for target openroad because
  files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtcl8.6.so] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/dlyles/mambaforge/lib
    runtime library [libz.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/dlyles/mambaforge/lib
    runtime library [libgomp.so.1] in /usr/lib/gcc/x86_64-linux-gnu/9 may be hidden by files in:
      /home/dlyles/mambaforge/lib

  Some of these libraries may not be found correctly.

CMake Warning at src/odb/src/swig/python/CMakeLists.txt:28 (add_executable):
  Cannot generate a safe runtime search path for target odb_py-bin because
  files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libtcl8.6.so] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/dlyles/mambaforge/lib
    runtime library [libz.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/dlyles/mambaforge/lib

  Some of these libraries may not be found correctly.

.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 (6.0s)
-- Generating done (0.5s)
-- Build files have been written to: /tmp/tmp.5QGeZX0gbd

To Reproduce

To Reproduce this bug youll need the following files (this is with sky130hd)

The RTL which is found here: https://github.com/YosysHQ/picorv32/blob/master/picorv32.v

The Autotuner file autotuner.json:

{
    "_SDC_FILE_PATH": "constraint.sdc",
    "_SDC_CLK_PERIOD": {
        "type": "float",
        "minmax": [
            1.0,
            4.3647
        ],
        "step": 0
    },
    "CORE_UTILIZATION": {
        "type": "int",
        "minmax": [
            5,
            100
        ],
        "step": 1
    },
    "CAP_MARGIN": {
            "type":"int",
            "minmax": [
                    5,
                    100
            ],
            "step": 1
    },
    "CORE_ASPECT_RATIO": {
        "type": "float",
        "minmax": [
            0.5,
            2.0
        ],
        "step": 0
    },
    "CORE_MARGIN": {
        "type": "int",
        "minmax": [
            2,
            2
        ],
        "step": 0
    },
    "CELL_PAD_IN_SITES_GLOBAL_PLACEMENT": {
        "type": "int",
        "minmax": [
            0,
            5
        ],
        "step": 1
    },
    "CELL_PAD_IN_SITES_DETAIL_PLACEMENT": {
        "type": "int",
        "minmax": [
            0,
            5
        ],
        "step": 1
    },
    "_FR_LAYER_ADJUST": {
        "type": "float",
        "minmax": [
            0.1,
            0.7
        ],
        "step": 0
    },
    "PLACE_DENSITY_LB_ADDON": {
        "type": "float",
        "minmax": [
            0.0,
            0.99
        ],
        "step": 0
    },
    "_PINS_DISTANCE": {
        "type": "int",
        "minmax": [
            1,
            4
        ],
        "step": 1
    },
    "CTS_CLUSTER_SIZE": {
        "type": "int",
        "minmax": [
            10,
            200
        ],
        "step": 1
    },
    "CTS_CLUSTER_DIAMETER": {
        "type": "int",
        "minmax": [
            20,
            400
        ],
        "step": 1
    },
    "_FR_FILE_PATH": "../../../platforms/nangate45/fastroute.tcl",
    "_FR_GR_OVERFLOW": {
        "type": "int",
        "minmax": [
            1,
            1
        ],
        "step": 0
    }
}

The file config.mk:

export DESIGN_NAME = picorv32
export PLATFORM    = sky130hd

export VERILOG_FILES = ./designs/src/$(DESIGN_NAME)/picorv32.v
export SDC_FILE      = ./designs/$(PLATFORM)/$(DESIGN_NAME)/constraint.sdc
export ABC_AREA      = 1

# Adders degrade GCD
export ADDER_MAP_FILE :=

export CORE_UTILIZATION ?= 55
export PLACE_DENSITY_LB_ADDON = 0.20
export TNS_END_PERCENT = 100

The file constraint.sdc

current_design picorv32

set clk_name  core_clock
set clk_port_name clk
set clk_period 0.46 
set clk_io_pct 0.2

set clk_port [get_ports $clk_port_name]

create_clock -name $clk_name -period $clk_period $clk_port

set non_clock_inputs [lsearch -inline -all -not -exact [all_inputs] $clk_port]

set_input_delay  [expr $clk_period * $clk_io_pct] -clock $clk_name $non_clock_inputs 
set_output_delay [expr $clk_period * $clk_io_pct] -clock $clk_name [all_outputs]

Relevant log output

No response

Screenshots

More Detailed Screenshot of output of autotuner at terminating stage:

image

Additional Context

No response

maliberty commented 1 year ago

Please package a specific test case showing the issue (eg make issue). Setting up and re-running the autotuner to recreate the issue is impractical.

dalyles commented 1 year ago

Hi @maliberty

I did a simple make run and I have the results of the run here:

picorv32_sky130hd.log

maliberty commented 1 year ago

Thanks but a log is not a test case. I need a package set of files and scripts representing a single run of OR that reproduces your result. If you are using ORFS you can use 'make global_place_issue' to create such.

This will include you cell library so make sure it is ok to make public.

dalyles commented 1 year ago

Yes it's fine to for me to have it public. I think what I can do is tar.gz my workspace and the hand it over. Here it is: https://drive.google.com/file/d/1DtPxpZ8b4lO0sEOaZ5QO8GNJwG18_63L/view?usp=sharing

The makefile is already configured to the run described above.

vijayank88 commented 1 year ago

@dalyles Can you confirm with Best parameters found run tag not contain complete log files? Screenshot from 2023-08-01 10-59-38

dalyles commented 1 year ago

Yes it does not contain complete log files. It ends at files starting with prefix 3, which assumes that placement failed.

vijayank88 commented 1 year ago

@dalyles In sky130hd platform why used nangate45 fastroute.tcl in autotuner.json?

    "_FR_FILE_PATH": "../../../platforms/nangate45/fastroute.tcl",
    "_FR_GR_OVERFLOW": {
        "type": "int",
        "minmax": [
            1,
            1
        ],
        "step": 0

But sample make run failed during global routing

[ERROR GRT-0119] Routing congestion too high. Check the congestion heatmap in the GUI and load ./reports/sky130hd/picorv32/base/congestion.rpt in the DRC viewer.
Error: global_route.tcl, 21 GRT-0119
Command exited with non-zero status 1
Elapsed time: 0:07.67[h:]min:sec. CPU time: user 7.60 sys 0.07 (99%). Peak memory: 192836KB.
make: *** [Makefile:625: results/sky130hd/picorv32/base/5_1_grt.odb] Error 1

Seems something wrong with your configuration itself?

dalyles commented 1 year ago

Hi @vijayank88,

Yes, you're right. It seems to be an oversight on my part. I'll follow up once I can confirm that the runs are complete and working properly. Please stayed tuned.

vijayank88 commented 1 year ago

Maybe you can try with clock period value of 20ns and core utilization of 35

dalyles commented 1 year ago

@vijayank88 Thank you. Instead I made sure the run went through properly and then let the autotuner optimize it before I saw your comment. Everything seems to be working well.

maliberty commented 1 year ago

ok to close?