Skip to content

OpenLANE is an automated RTL to GDSII flow based on several components including OpenRoad, Yosys, Magic, Netgen, Fault and custom methodology scripts for design exploration and optimization.

License

Notifications You must be signed in to change notification settings

ourfool/openlane

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 Cannot retrieve latest commit at this time.

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  ___   ____   ___  ____   _       ____  ____     ___
 /   \ |    \ /  _]|    \ | |     /    ||    \   /  _]
|     ||  o  )  [_ |  _  || |    |  o  ||  _  | /  [_
|  O  ||   _/    _]|  |  || |___ |     ||  |  ||    _]
|     ||  | |   [_ |  |  ||     ||  _  ||  |  ||   [_
 \___/ |__| |_____||__|__||_____||__|__||__|__||_____|

Table of contents

Overview

OpenLaneは、OpenRoad、Yosys、Magic、Netgen、Fault、およびデザインの探索と最適化のためのカスタムメソドロジースクリプトを含むいくつかのコンポーネントをベースにした、RTLからGDSIIまでの自動化されたフローです。このフローは、RTLからGDSIIに至るまで、ASICの完全な実装ステップを実行します。この機能は、SkyWaterにファブリケーションのために送られた完成したSoCデザインの例とともに、近日中にリリースされる予定です。

Prerequisites

  • Docker

Getting Started - Directory Setup

実行プロセスを簡単にするために、以下の設定が推奨されています:

openlane_working_dir
├── pdks
├── openlane

So before you start run the following commands:

    mkdir openlane_working_dir
    cd openlane_working_dir
    mkdir pdks
    mkdir openlane 

Getting Started - OpenLANE Flow Setup

Clone & build OpenLANE:

    git clone https://github.com/efabless/openlane --branch rc1
    cd openlane/docker_build
    make merge
    cd ..
    cd ..

dockerコンテナとそのプロセスの詳細については、 following instructions では、dockerコンテナを使用して必要なツールを構築し、それをOpenLaneフローに統合するプロセスを説明しています。

Getting Started - PDK Setup

フローを実行する前に、少なくとも1つのPDKを openlane_working_dir/pdks/ に設定しておく必要があります。

Setting up skywater-pdk

このセクションでは、オープンレーン上での skywater-pdk の設定方法を説明します。説明した手順は、他のPDKのセットアップ方法の際にも参考となるでしょう。

  • Clone and build one skywwater-pdk variant(s) inside the pdks directory:

    • To setup one variant only
        cd pdks
        git clone https://github.com/google/skywater-pdk.git
        cd skywater-pdk
        git checkout 4e5e318e0cc578090e1ae7d6f2cb1ec99f363120
        git submodule update --init libraries/sky130_fd_sc_hd/latest
        make sky130_fd_sc_hd 
        cd ..
    • To setup other variants:
      • replace sky130_fd_sc_hd with any of the following list:
        • sky130_fd_sc_hs
        • sky130_fd_sc_ms
        • sky130_fd_sc_ls
        • sky130_fd_sc_hdll
  • Setup the configurations and tech files:

    • To perform physical verification you need to use the magic tool. Therefore, you need to setup the pdk using open-pdks:
        git clone https://github.com/efabless/open_pdks.git
        cd open_pdks
        git checkout c2fec9fe64146000236dd807165b80b6a8b82b89
        make
        make install-local
        cd ..
        cd ..

    Note: You may want to change the pdk installation directory or control other options explained here.

    Note: If you don't want to use open_pdks and want to create the setup manually (This will only allow you to run the flow up to a routed-def), make sure you provide what is expected here.

  • Point to the (PDK,PDK_VARIANT) pair:

Refer to this for more details on the structure.

Setting up other PDKs

  • Provide the setup expected here.
  • To perform physical verification you need to use the magic tool setup.
  • Point to the (PDK,PDK_VARIANT) pair:
    • Go into ./configuration/general.tcl
    • set PDK to the name of the folder containing the pdk under PDK_ROOT.
    • set PDK_VARIANT to the name of the library as it exists under libs.tech

Refer to this for more details on the structure.

Getting Started - How to Run

Running the flow

dockerイメージをビルドした後、以下のコマンドを実行してプロジェクトのルートからdockerコンテナを開き、コンテナを終了した後も出力ファイルが持続するようにします。:

    docker run -itv $(pwd)/openlane:/openLANE_flow -v $(pwd)/pdks/open_pdks/sky130/pdks:/openLANE_flow/pdks -u $(id -u $USER):$(id -g $USER) openlane:rc1

Note: this will mirror the openlane directory inside the container.

This will mount the docker with the root folder being ./openLANE_flow containing inside it the working directory specified, as well as the pdks directory in which you installed the pdks as a sub-directory

Then, you can test the flow using one of the provided designs (spm: Serial-Parallel Adder) by running:

./flow.tcl -design spm

To start a batch run (multiple designs at the same time), check this section.

More details on running different designs in the following sections.

Command line arguments

The following are arguments that can be passed to flow.tcl

Argument Description
-design
(Required)
Specifies the design folder. A design folder should contain a config.tcl definig the design parameters.
If the folder is not found, ./designs directory is searched
-config <name>
(Optional)
Specifies the design's configuration file for while running the flow.
For example, to run the flow using designs/spm/config2.tcl
Use run ./flow.tcl -design spm -config config2.tcl
By default config.tcl is used.
-tag <name>
(Optional)
Specifies a name for a specific run. If the tag is not specified, a timestamp is generated for identification of that run.
Can Specify the configuration file name in case of using -init_design_config
-run_path <path>
(Optional)
Specifies a path to save the run in. By default the run is in design_path/, where the design path is the one passed to -design
-save
(Optional)
A flag to save a runs results like .mag and .lef in the design's folder
-save_path <path>
(Optional)
Specifies a different path to save the design's result. This options is to be used with the -save flag
-init_design_config
(Optional)
Creates a tcl configuration file for a design. -tag <name> can be added to rename the config file to <name>.tcl
-overwrite
(Optional)
Flag to overwirte an existing run with the same tag
-interactive
(Optional)
Flag to run openlane flow in interactive mode
-file <file_path>
(Optional)
Passes a script of interactive commands in interactive mode

Adding a design

To add a new design, follow the instructions provided here

This file also includes useful information about the design configuration files. It also includes useful utilities for exploring and updating design configurations for each (PDK,PDK_VARIANT) pair.

The Flow

Stages

OpenLaneの実行フローは複数のステージから構成されています。各ステージは複数のサブステージで構成されます。OpenLaneは対話的に実行(設計者がフローのステップを一つずつ実行する)または、非対話的に実行することができます(デフォルトでは、すべてのフローのステップを順に実行する):

  1. Synthesis
    1. yosys - Performs RTL synthesis
    2. abc - Performs technology mapping
    3. OpenSTA - Pefroms static timing analysis on the resulting netlist to generate timing reports
  2. Floorplan and PDN
    1. init_fp - Defines the core area for the macro as well as the rows (used for placement) and the tracks (used for routing)
    2. ioplacer - Places the macro input and output ports
    3. pdn - Generates the power distribution network
    4. tapcell - Inserts welltap and decap cells in the floorplan
  3. Placement
    1. RePLace - Performs global placement
    2. Resizer - Performs optional optimizations on the design
    3. OpenDP - Perfroms detailed placement to legalize the globally placed components
  4. CTS
    1. TritonCTS - Synthesizes the clock distribution network (the clock tree)
  5. Routing *
    1. FastRoute - Performs global routing to generate a guide file for the detailed router
    2. TritonRoute - Performs detailed routing
  6. GDSII Generation
    1. magic - Streams out the final GDSII layout file from the routed def
  7. Checks
    1. magic - Performs DRC Checks & Antenna Checks
    2. Netgen - Performs LVS Checks

OpenLane uses the following tools:

Flow output

After running a design, a directory called runs is created inside that design folder. Each run is placed under that directory. A run is either named after -tag or named with a timestamp of that run. A run folder contains:

  1. The run configuration
  2. Four directories. Inside each, there is a folder per stage of the flow
    1. logs - Runtime log of each tool. Can be useful in case of a crash.
    2. reports - Reports generated by some of the tools. (i.e. synthesis report, timing report, etc...)
    3. results - Final files created by completing a stage. Can either be .def or .v or .gds.
    4. tmp - Files created by substages.

The resulting directory tree is as follows:

designs/spm
├── config.tcl
├── runs
│   ├── <tag>
│   │   ├── config.tcl
│   │   ├── logs
│   │   │   ├── cts
│   │   │   ├── floorplan
│   │   │   ├── magic
│   │   │   ├── placement
│   │   │   ├── routing
│   │   │   └── synthesis
│   │   ├── reports
│   │   │   ├── cts
│   │   │   ├── floorplan
│   │   │   ├── magic
│   │   │   ├── placement
│   │   │   ├── routing
│   │   │   └── synthesis
│   │   ├── results
│   │   │   ├── cts
│   │   │   ├── floorplan
│   │   │   ├── magic
│   │   │   ├── placement
│   │   │   ├── routing
│   │   │   └── synthesis
│   │   └── tmp
│   │       ├── cts
│   │       ├── floorplan
│   │       ├── magic
│   │       ├── placement
│   │       ├── routing
│   │       └── synthesis

Flow configuration

OpenLaneの利用にあたっていくつかの環境変数を定義する必要があります。これらの環境変数は以下の3つのカテゴリに分かれています:

  1. PDK specific
  2. Flow specific
  3. Design specific
  • A PDK should define at least one variant for the PDK. A common configuration file for all PDK variants is located in:

    ./pdks/<pdk>/common_config.tcl
    
    • Sometimes the PDK comes with several Standard Cell Libraries or Metal Stacks. Each is considered as a PDK variant. A variant configuration file defines extra variables specific to the variant. It may also override variables in the common PDK configuration file which is located in:

      ./pdks/<pdk>/<variant>/config.tcl
      
    • More on configuring a new PDK in this section

  • Flow specific variables are related to the flow and are initialized with default values in:

    ./configuration/
    
  • Finally, each design should have it's own configuration file with some required variables which are available in this list. A design configuration file may override any of the variables defined in PDK or flow configuration files. This is the global configurations for the design:

    ./designs/<design>/config.tcl
    
    • More on design configurations in here

A list of all available variables can be found here.

Interactive Mode

You may run the flow interactively by using the -interactive option:

./flow.tcl -interactive

A tcl shell will be opened where the openlane package is automatically sourced:

% package require openlane 0.9

Then, you should be able to run the following commands:

  1. Any tcl command.
  2. prep -design <design> -tag <tag> -config <config> -init_design_config -overwrite similar to the command line arguments, design is required and the rest is optional
  3. run_synthesis
  4. run_floorplan
  5. run_placement
  6. run_cts
  7. run_routing
  8. run_magic
  9. run_magic_spice_export
  10. run_magic_drc
  11. run_netgen
  12. run_magic_antenna_check

The above commands can also be written in a file and passed to flow.tcl:

./flow.tcl -interactive -file <file>

Note 1: Currently, configuration variables have higher priority over the above commands so if RUN_MAGIC is 0, command run_magic will have no effect.

Note 2: Currently, all these commands must be run in sequence and none should be omitted.

Regression And Design Configurations Exploration

As mentioned earlier, everytime a new design or a new (PDK,PDK_VARIANT) pair is added, or any update happens in the flow tools, a re-configuration for the designs is needed. The reconfiguration is methodical and so an exploration script was developed to aid the designer in reconfiguring his designs if needed. As explained here that each design has multiple configuration files for each (PDK,PDK_VARIANT) pair.

Overview

OpenLane provides run_designs.py, a script that can do multiple runs in a parallel using different configurations. A run consists of a set of designs and a configuration file that contains the configuration values. It is useful to explore the design implementation using different configurations to figure out the best one(s).

Also, it can be used for testing the flow by running the flow against several designs using their best configurations. For example the following has two runs: spm and xtea using their default configuration files config.tcl. :

python3 run_designs.py --designs spm xtea des aes256 --tag test --threads 3

For more information on how to run this script, refer to this file

For more information on design configurations, how to update them, and the need for an exploration for each design, refer to this file

About

OpenLANE is an automated RTL to GDSII flow based on several components including OpenRoad, Yosys, Magic, Netgen, Fault and custom methodology scripts for design exploration and optimization.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Verilog 99.1%
  • Coq 0.4%
  • Python 0.3%
  • Tcl 0.2%
  • Dockerfile 0.0%
  • Logos 0.0%