1 Star 0 Fork 0

OpenROAD-mirror / OpenLane

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

OpenLane

License Documentation Status CI Slack Invite Python code style: black

OpenLane is an automated RTL to GDSII flow based on several components including OpenROAD, Yosys, Magic, Netgen, Fault, CVC, SPEF-Extractor, CU-GR, Klayout and a number of custom scripts for design exploration and optimization. The flow performs full ASIC implementation steps from RTL all the way down to GDSII.

You can find the latest release of OpenLane here.

This documentation is also available at ReadTheDocs.

Table of contents

Prerequisites

At a minimum:

  • Docker 19.03.12+
  • GNU Make
  • Python 3.6+ with PIP
  • Click, Pyyaml: python3 -m pip install pyyaml click

Containerless Install

Please see here.

Setting Up OpenLane

You can start setting up the Sky130 PDK and OpenLane by running:

    git clone https://github.com/The-OpenROAD-Project/OpenLane.git
    cd OpenLane/
    make pull-openlane

    <configuration variables: see notes below>
    make pdk
  • The default pdk installation directory is $PWD/pdks. If you want to install the PDK at a different location, you'll need add this configuration variable:
    • export PDK_ROOT=<absolute path to where skywater-pdk and open_pdks will reside>
      • Be sure to add this to your shell's profile for future use.
  • If you want to include the precompiled OpenRAM SRAM modules, try make pdk-with-sram.
  • The default SCL to be installed is sky130_fd_sc_hd.
    • To change that, you can add this configuration variable: export STD_CELL_LIBRARY=<Library name, i.e. sky130_fd_sc_ls>, where the library name is one of:
      • sky130_fd_sc_hd
      • sky130_fd_sc_hs
      • sky130_fd_sc_ms
      • sky130_fd_sc_ls
      • sky130_fd_sc_hdll
    • You can install all Sky130 SCLs by invoking FULL_PDK=1 make pdk.
    • You can install the PDK manually, outside of the Makefile, by following the instructions provided here.
    • Refer to this for more details on OpenLane-compatible PDK structures.

    make test # This a ~5 minute test that verifies that the flow and the pdk were properly installed
  • The Makefile should do the following when you run the above:
    • Clone Skywater PDK and the specified STD_CELL_LIBRARY, SPECIAL_VOLTAGE_LIBRARY, and IO_LIBRARY and build it.
    • Clone open_pdks and set up the pdk for OpenLane use.
    • Pull the OpenLane Docker image.
    • Test the whole setup with a complete run on a small design, spm.

This should produce a clean run for the spm. The final layout will be generated at this path: ./designs/spm/runs/openlane_test/results/magic/spm.gds.

If everything is okay, you can skip forward to running OpenLane.

Updating OpenLane

If you already have the repo locally, then no need to re-clone it. You can directly run the following:

    cd openlane/
    git checkout master
    git pull
    export PDK_ROOT=<absolute path to where skywater-pdk and open_pdks will reside>
    make pull-openlane
    make pdk
    make test # This is to test that the flow and the pdk were properly installed

This should install the latest openlane docker container, and re-install the pdk for the latest used version.

Pulling or Building the OpenLane Docker Container

DISCLAIMER: This sub-section is to give you an understanding of what happens under the hood in the Makefile. You don't need to run the instructions here, if you already ran make pull-openlane.

For curious users: For more details about the docker container and its process, the following instructions walk you through the process of using docker containers to build the needed tools then integrate them into OpenLane flow. You Don't Need To Re-Build It.

Running OpenLane

You need to start the Docker container with proper paths mounted. There are two ways to do this.

The easiest way to mount the proper directories into the docker container would be to rely on the Makefile:

    make mount
  • Note:
    • Default PDK_ROOT is $(pwd)/pdks. If you have installed the PDK at a different location, run the following before make mount:
      export PDK_ROOT=<absolute path to where skywater-pdk, open_pdks, and sky130A reside>
    • Default OPENLANE_IMAGE_NAME is dynamically obtained using your current git version. If you want to use a specific image, run the following before make mount:
      export OPENLANE_IMAGE_NAME=<docker image name>

The following is roughly what happens under the hood when you run make mount + the required exports:

    export PDK_ROOT=<absolute path to where skywater-pdk and open_pdks will reside>
    export OPENLANE_IMAGE_NAME=<docker image name>
    docker run -it -v $(pwd):/openlane -v $PDK_ROOT:$PDK_ROOT -e PDK_ROOT=$PDK_ROOT -u $(id -u $USER):$(id -g $USER) $OPENLANE_IMAGE_NAME

Note: this will mount the OpenLane directory and the PDK_ROOT directory inside the container.

You can use the following example to check the overall setup:

./flow.tcl -design spm

To run OpenLane on multiple designs at the same time, check this section.

Having trouble running the flow? check FAQs

Command line arguments

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

Argument Description
-design <folder path>
(Required)
Specifies the design folder. A design folder should contain a config.tcl defining the design parameters.
If the folder is not found, ./designs directory is searched
-from <stage>
(Optional)
Specifies stage to start flow execution from
-to <stage>
(Optional)
Specifies stage to stop flow execution at (included)
-config_file <file>
(Optional)
Specifies the design's configuration file for running the flow.
For example, to run the flow using /spm/config2.tcl
Use run ./flow.tcl -design /spm -config_file /spm/config2.tcl
By default config.tcl is used.
-override_env
Optional
Allows you to override certain configuration environment variables for this run. Format: KEY1=VALUE1,KEY2=VALUE2
-config_tag <name>
(Optional)
Specifies the design's configuration file for running the flow.
For example, to run the flow using designs/spm/config2.tcl
Use run ./flow.tcl -design spm -config_tag config2
By default config 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
-src <verilog_source_file>
(Optional)
Sets the verilog source code file(s) in case of using -init\_design\_config.
The default is that the source code files are under design_path/src/, where the design path is the one passed to -design
-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
-synth_explore
(Boolean)
If enabled, synthesis exploration will be run (only synthesis exploration), which will try out the available synthesis strategies against the input design. The output will be the four possible gate level netlists under <run_path/results/synthesis> and a summary report under reports that compares the 4 outputs.
-lvs
(Boolean)
If enabled, only LVS will be run on the design. in which case the user must also pass: -design DESIGN_DIR -gds DESIGN_GDS -net DESIGN_NETLIST.
-drc
(Boolean)
If enabled, only DRC will be run on the design. in which case the user must also pass: -design DESIGN_DIR -gds DESIGN_GDS -report OUTPUT_REPORT_PATH -magicrc MAGICRC.
-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 option is to be used with the -save flag.

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,STD_CELL_LIBRARY) pair.

OpenLane Architecture

OpenLane Design Stages

OpenLane flow consists of several stages. By default all flow steps are run in sequence. Each stage may consist of multiple sub-stages. OpenLane can also be run interactively as shown here.

  1. Synthesis
    1. yosys - Performs RTL synthesis
    2. abc - Performs technology mapping
    3. OpenSTA - Performs 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. CU-GR - Another option for performing global routing.
    3. TritonRoute - Performs detailed routing
    4. SPEF-Extractor - Performs SPEF extraction
  6. GDSII Generation
    1. Magic - Streams out the final GDSII layout file from the routed def
    2. Klayout - Streams out the final GDSII layout file from the routed def as a back-up
  7. Checks
    1. Magic - Performs DRC Checks & Antenna Checks
    2. Klayout - Performs DRC Checks
    3. Netgen - Performs LVS Checks
    4. CVC - Performs Circuit Validity Checks

OpenLane integrated several key open source tools over the execution stages:

OpenLane Output

All output run data is placed by default under ./designs/design_name/runs. Each flow cycle will output a timestamp-marked folder containing the following file structure:

designs/<design_name>
├── config.tcl
├── runs
│   ├── <tag>
│   │   ├── config.tcl
│   │   ├── {logs, reports, tmp}
│   │   │   ├── cts
│   │   │   ├── finishing
│   │   │   ├── floorplan
│   │   │   ├── placement
│   │   │   ├── routing
│   │   │   └── synthesis
│   │   ├── results
│   │   │   ├── final
│   │   │   ├── cts
│   │   │   ├── finishing
│   │   │   ├── floorplan
│   │   │   ├── placement
│   │   │   ├── routing
│   │   │   └── synthesis

To delete all generated runs under all designs: make clean_runs

Flow configuration

  1. PDK / technology specific
  2. Flow specific
  3. Design specific
  • A PDK should define at least one standard cell library(SCL) for the PDK. A common configuration file for all SCLs is located in:

    $PDK_ROOT/$PDK/config.tcl
    • Sometimes the PDK comes with several standard cell libraries. Each has an own configuration file that defines extra variables specific to the SCL. It may also override variables in the common PDK configuration file which is located in:

      $PDK_ROOT/$PDK/$STD_CELL_LIBRARY/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.

Regression And Design Configurations Exploration

As mentioned earlier, everytime a new design or a new (PDK,STD_CELL_LIBRARY) 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,STD_CELL_LIBRARY) pair.

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 run: spm using its default configuration files config.tcl. :

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

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

Hardening Macros

This is discussed in more detail here.

Chip Integration

The first step of chip integration is hardening the macros. To learn more about this check this file.

Using OpenLane, you can produce a GDSII from a chip RTL. This is done by applying a certain methodology that we follow using our custom scripts and the integrated tools.

To learn more about Chip Integration. Check this file

Commands and Configurations

To get a full list of the OpenLane commands, first introduce yourself to the interactive mode of OpenLane here. Then check the full documentation of the OpenLane commands here.

The full documentation of OpenLane run configurations could be found here.

How To Contribute

We discuss the details of how to contribute to OpenLane in this documentation.

Authors

To check the original author list of OpenLane, check this.

Additional Material

Papers

  • Ahmed Ghazy and Mohamed Shalan, "OpenLANE: The Open-Source Digital ASIC Implementation Flow", Article No.21, Workshop on Open-Source EDA Technology (WOSET), 2020. Paper
  • M. Shalan and T. Edwards, "Building OpenLANE: A 130nm OpenROAD-based Tapeout- Proven Flow : Invited Paper," 2020 IEEE/ACM International Conference On Computer Aided Design (ICCAD), San Diego, CA, USA, 2020, pp. 1-6. Paper
  • R. Timothy Edwards, M. Shalan and M. Kassem, "Real Silicon using Open Source EDA," in IEEE Design & Test, doi: 10.1109/MDAT.2021.3050000. Paper

Videos and Tutorials

OpenLane Specific

Caravel & SkyWater PDK

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2020 efabless corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

暂无描述 展开 收起
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/OpenROAD-mirror/OpenLane.git
git@gitee.com:OpenROAD-mirror/OpenLane.git
OpenROAD-mirror
OpenLane
OpenLane
master

搜索帮助