Skip to content

Commit

Permalink
PDK_VARIANT to a more proper name STD_CELL_LIBRARY
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3ghazy committed Jul 30, 2020
1 parent fa73b2c commit d4f670a
Show file tree
Hide file tree
Showing 59 changed files with 197 additions and 190 deletions.
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| O || _/ _]| | || |___ | || | || _]
| || | | [_ | | || || _ || | || [_
\___/ |__| |_____||__|__||_____||__|__||__|__||_____|


# Table of contents
- [Overview](#overview)
Expand All @@ -28,7 +28,7 @@ OpenLANE is an automated RTL to GDSII flow based on several components including
Join the community on [slack](https://join.slack.com/t/skywater-pdk/shared_invite/zt-fkl21w8j-qzxBK852XGR8EFMbRakTMw)!

# Prerequisites

- Docker (ensure docker daemon is running) -- tested with version 19.03.12, but any recent version should suffice
- Magic VLSI Layout Tool is needed to run open_pdks -- version >= 8.3.25

Expand Down Expand Up @@ -62,8 +62,8 @@ The following sections are to give you an understanding of what happens under th

# Setting up the PDK: skywater-pdk

- Clone and build one skywater-pdk variant(s) inside the pdks directory:
- To setup one variant only
- Clone and build at least one skywater-pdk standard cell Library inside the pdks directory:
- To setup one standard cell library only

```bash
export PDK_ROOT=<absolute path to where skywater-pdk and open_pdks will reside>
Expand All @@ -72,17 +72,17 @@ The following sections are to give you an understanding of what happens under th
cd skywater-pdk
git checkout 4e5e318e0cc578090e1ae7d6f2cb1ec99f363120
git submodule update --init libraries/sky130_fd_sc_hd/latest
make sky130_fd_sc_hd
make sky130_fd_sc_hd
```
- To setup other variants:
- To setup other SCLs:
- 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 for Magic, Netgen, OpenLANE using [open_pdks](https://github.com/efabless/open_pdks):

```bash
cd $PDK_ROOT
git clone git@github.com:efabless/open_pdks.git -b rc2
Expand All @@ -91,9 +91,9 @@ The following sections are to give you an understanding of what happens under th
make install-local
```

- To set the PDK_VARIANT (the default value is set to sky130_fd_sc_hd)
- To set the STD_CELL_LIBRARY (the default value is set to sky130_fd_sc_hd)
- Open [configuration/general.tcl](./configuration/general.tcl)
- set PDK_VARIANT to one of the following:
- set STD_CELL_LIBRARY to one of the following:

- sky130_fd_sc_hs
- sky130_fd_sc_ms
Expand Down Expand Up @@ -223,7 +223,7 @@ The following are arguments that can be passed to `flow.tcl`
<td align="justify">
Flag to overwirte an existing run with the same tag
</td>
</tr>
</tr>
<tr>
</tr>
<td align="center">
Expand All @@ -239,7 +239,7 @@ The following are arguments that can be passed to `flow.tcl`
<code>-file &lt;file_path&gt;</code> <br> (Optional)
</td>
<td align="justify">
Passes a script of interactive commands in interactive mode
Passes a script of interactive commands in interactive mode
</td>
</tr>
</table>
Expand All @@ -249,7 +249,7 @@ The following are arguments that can be passed to `flow.tcl`

To add a new design, follow the instructions provided [here](./designs/README.md)

This [file](./designs/README.md) 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.
This [file](./designs/README.md) 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

Expand Down Expand Up @@ -292,7 +292,7 @@ OpenLANE flow consists of several stages. By default all flow steps are run in s
OpenLANE integrated several key open source tools over the execution stages:
- RTL Synthesis, Technology Mapping, and Formal Verification : [yosys + abc][4]
- Static Timing Analysis: [OpenSTA][8]
- Floor Planning: [init_fp][5], [ioPlacer][6], [pdn][16] and [tapcell][7]
- Floor Planning: [init_fp][5], [ioPlacer][6], [pdn][16] and [tapcell][7]
- Placement: [RePLace][9] (Global), [Resizer][15] (Optimizations), and [OpenDP][10] (Detailed)
- Clock Tree Synthesis: [TritonCTS][11]
- Fill Insertion: [OpenDP/filler_placement][10]
Expand All @@ -304,7 +304,7 @@ 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 timestamp-marked foler containing the following file structure:
All output run data is placed by default under ./designs/design_name/runs. Each flow cycle will output timestamp-marked foler containing the following file structure:

```
designs/<design_name>
Expand Down Expand Up @@ -348,16 +348,16 @@ designs/<design_name>
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:
- 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 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:
- 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/$PDK_VARIANT/config.tcl
$PDK_ROOT/$PDK/$STD_CELL_LIBRARY/config.tcl
```
- More on configuring a new PDK in this [section](#setting-up-the-pdk-skywater-pdk)

Expand All @@ -380,11 +380,11 @@ A list of all available variables can be found [here][17].
# 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](#adding-a-design) that each design has multiple configuration files for each (PDK,PDK_VARIANT) pair.
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](#adding-a-design) that each design has multiple configuration files for each (PDK,STD_CELL_LIBRARY) 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).
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.` :
```
Expand All @@ -394,7 +394,7 @@ python3 run_designs.py --designs spm xtea md5 aes256 --tag test --threads 3
For more information on how to run this script, refer to this [file][21]
For more information on design configurations, how to update them, and the need for an exploration for each design, refer to this [file](./designs/README.md)
[1]: ./docker_build/README.md
[2]: ./configuration/README.md
Expand All @@ -406,7 +406,7 @@ For more information on design configurations, how to update them, and the need
[8]: https://github.com/The-OpenROAD-Project/OpenSTA
[9]: https://github.com/The-OpenROAD-Project/RePlAce
[10]: https://github.com/The-OpenROAD-Project/OpenROAD/tree/openroad/src/opendp
[11]: https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/TritonCTS
[11]: https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/TritonCTS
[12]: https://github.com/The-OpenROAD-Project/FastRoute/tree/openroad
[13]: https://github.com/The-OpenROAD-Project/TritonRoute
[14]: https://github.com/RTimothyEdwards/magic
Expand All @@ -419,4 +419,4 @@ For more information on design configurations, how to update them, and the need
[21]: ./regression_results/README.md
[22]: https://github.com/RTimothyEdwards/netgen
[24]: ./doc/PDK_STRUCTURE.md
[25]: ./advanced_readme.md
[25]: ./advanced_readme.md
6 changes: 3 additions & 3 deletions configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ These variables are optional that can be specified in the design configuration f
### Misc
| Variable | Description |
|---------------|---------------------------------------------------------------|
| `PDK` | Specifies the process design kit (pdk). <br> (Default: `ef-skywater-s8/EFS8A` )|
| `PDK_VARIANT` | Specifies the process design kit (pdk) variant. <br> (Default: `efs8hd` )|
| `PDK_ROOT` | Specifies the folder path of the pdk. It searches for a `config.tcl` in `$PDK_ROOT/$PDK/libs.tech/openlane/` directory and at least have one variant config defined in `$PDK_ROOT/$PDK/libs.tech/openlane/$PAD_VARIANT`. <br> See [this][3] pdk config file and [this][4] variant config file as an example . <br> (Default: `$OPENLANE_ROOT/pdks/` )|
| `PDK` | Specifies the process design kit (PDK). <br> (Default: `sky130A` )|
| `STD_CELL_LIBRARY` | Specifies the standard cell library to be used under the specified PDK. <br> (Default: `sky130_fd_sc_hd` )|
| `PDK_ROOT` | Specifies the folder path of the PDK. It searches for a `config.tcl` in `$PDK_ROOT/$PDK/libs.tech/openlane/` directory and at least have one standard cell library config defined in `$PDK_ROOT/$PDK/libs.tech/openlane/$STD_CELL_LIBRARY`. <br> See [this][3] PDK config file and [this][4] standard cell library config file as an example . <br> (Default: `$OPENLANE_ROOT/pdks/` )|
| `CELL_PAD` | Cell padding; increases the width of cells. <br> (Default: `2` microns -- 2 sites)|

### Flow control
Expand Down
2 changes: 1 addition & 1 deletion configuration/general.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# default pdk
set ::env(PDK) "sky130A"
set ::env(PDK_VARIANT) "sky130_fd_sc_hd"
set ::env(STD_CELL_LIBRARY) "sky130_fd_sc_hd"
set ::env(USE_GPIO_PADS) 0

# Flow control defaults
Expand Down
2 changes: 1 addition & 1 deletion designs/APU/config.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set ::env(CLOCK_PORT) "clk"
set ::env(CLOCK_NET) $::env(CLOCK_PORT)


set filename $::env(OPENLANE_ROOT)/designs/$::env(DESIGN_NAME)/$::env(PDK)_$::env(PDK_VARIANT)_config.tcl
set filename $::env(OPENLANE_ROOT)/designs/$::env(DESIGN_NAME)/$::env(PDK)_$::env(STD_CELL_LIBRARY)_config.tcl
if { [file exists $filename] == 1} {
source $filename
}
2 changes: 1 addition & 1 deletion designs/BM64/config.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set ::env(CLOCK_NET) $::env(CLOCK_PORT)



set filename $::env(OPENLANE_ROOT)/designs/$::env(DESIGN_NAME)/$::env(PDK)_$::env(PDK_VARIANT)_config.tcl
set filename $::env(OPENLANE_ROOT)/designs/$::env(DESIGN_NAME)/$::env(PDK)_$::env(STD_CELL_LIBRARY)_config.tcl
if { [file exists $filename] == 1} {
source $filename
}
2 changes: 1 addition & 1 deletion designs/PPU/config.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set ::env(CLOCK_PORT) "clk"

set ::env(CLOCK_NET) $::env(CLOCK_PORT)

set filename $::env(OPENLANE_ROOT)/designs/$::env(DESIGN_NAME)/$::env(PDK)_$::env(PDK_VARIANT)_config.tcl
set filename $::env(OPENLANE_ROOT)/designs/$::env(DESIGN_NAME)/$::env(PDK)_$::env(STD_CELL_LIBRARY)_config.tcl
if { [file exists $filename] == 1} {
source $filename
}
46 changes: 23 additions & 23 deletions designs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,31 @@ designs/<design_name>
```
The general rule generated by using -init_design_config when adding a design is that the global config.tcl should end with:
```tcl
set filename $::env(OPENLANE_ROOT)/designs/$::env(DESIGN_NAME)/$::env(PDK)_$::env(PDK_VARIANT)_config.tcl
set filename $::env(OPENLANE_ROOT)/designs/$::env(DESIGN_NAME)/$::env(PDK)_$::env(STD_CELL_LIBRARY)_config.tcl
if { [file exists $filename] == 1} {
source $filename
}
```
This implies that if the (PDK)_(PDK_VARIANT)_config.tcl doesn't exist the flow would resume normally with only the global config.tcl.
This implies that if the (PDK)_(STD_CELL_LIBRARY)_config.tcl doesn't exist the flow would resume normally with only the global config.tcl.

This structure allows for storing the best configurations for a given design on all different PDKs and their PDK_VARIANTs. The best configuration for a given design differ from one PDK and PDK_VARIANT to another.
For this reason, upon installing a new PDK/PDK_VARIANT or a new design, an exploration should be run on different configuration parameters to reach the best configuration. The script that enables this is [here][1].
After running the exploration, you will find in the logs two .csv newly generated files: {tag}_{timestamp}.csv and {tag}_{timestamp}_best.csv. The configuration name reported in the _best.csv file contains the best added configurations to the current run of the given design using the specified PDK/PDK_VARIANT.
This structure allows for storing the best configurations for a given design on all different PDKs and their STD_CELL_LIBRARYs. The best configuration for a given design differ from one PDK and STD_CELL_LIBRARY to another.
For this reason, upon installing a new PDK/STD_CELL_LIBRARY or a new design, an exploration should be run on different configuration parameters to reach the best configuration. The script that enables this is [here][1].
After running the exploration, you will find in the logs two .csv newly generated files: {tag}_{timestamp}.csv and {tag}_{timestamp}_best.csv. The configuration name reported in the _best.csv file contains the best added configurations to the current run of the given design using the specified PDK/STD_CELL_LIBRARY.

Two scripts were created for this purpose:
- A script to create a new configuration file for a given (PDK, PDK_VARIANT) pair, or replicate the configuration of a (PDK, PDK_VARIANT) to another (PDK, PDK_VARIANT).
- A script to update the configuration of a given (PDK, PDK_VARIANT) according to an exploration result provided by a {tag}_best.csv file.
- A script to create a new configuration file for a given (PDK, STD_CELL_LIBRARY) pair, or replicate the configuration of a (PDK, STD_CELL_LIBRARY) to another (PDK, STD_CELL_LIBRARY).
- A script to update the configuration of a given (PDK, STD_CELL_LIBRARY) according to an exploration result provided by a {tag}_best.csv file.

### Replicate/Create Design Configs for a (PDK,PDK_VARIANT) Pair:
### Replicate/Create Design Configs for a (PDK,STD_CELL_LIBRARY) Pair:

To run the script to create new (empty) configurations for a (PDK,PDK_VARIANT) pair:
To run the script to create new (empty) configurations for a (PDK,STD_CELL_LIBRARY) pair:
```bash
python3 ./scripts/replicateDesignsConfigs.py --pdkTo PDK --pdkVariantTo PDK_VARIANT
python3 ./scripts/replicateDesignsConfigs.py --pdkTo PDK --to-std-cell-lib STD_CELL_LIBRARY
```

To run the script to replicate configurations from one (PDK,PDK_VARIANT) pair to another:
To run the script to replicate configurations from one (PDK,STD_CELL_LIBRARY) pair to another:
```bash
python3 ./scripts/replicateDesignsConfigs.py --pdkFrom PDK_FROM --pdkVariantFrom PDK_VARIANT_FROM --pdkTo PDK --pdkVariantTo PDK_VARIANT
python3 ./scripts/replicateDesignsConfigs.py --pdkFrom PDK_FROM --from-std-cell-lib STD_CELL_LIBRARY_FROM --pdkTo PDK --to-std-cell-lib STD_CELL_LIBRARY
```

The following is the list of flags used with the script:
Expand Down Expand Up @@ -127,16 +127,16 @@ The following is the list of flags used with the script:
<code>--pdkFrom | -pf &lt;PDK&gt;</code> <br> (Optional)
</td>
<td align="justify">
The name of the PDK that the replicated design configuration belongs to. <br> if not specified along with pdkVariantFrom, the script will create a new configuration file for (pdkTo,pdkVariantTo) that is empty.
The name of the PDK that the replicated design configuration belongs to. <br> if not specified along with from-std-cell-lib, the script will create a new configuration file for (pdkTo,to_std_cell_lib) that is empty.
</td>
</tr>
<tr>
</tr>
<td align="center">
<code>--pdkVariantFrom | -pvf &lt;PDK_VARIANT&gt;</code> <br> (Optional)
<code>--from-std-cell-lib | -pvf &lt;STD_CELL_LIBRARY&gt;</code> <br> (Optional)
</td>
<td align="justify">
The name of the PDK_VARIANT that the replicated design configuration belongs to. <br> if not specified along with pdkVariantFrom, the script will create a new configuration file for (pdkTo,pdkVariantTo) that is empty.
The name of the STD_CELL_LIBRARY that the replicated design configuration belongs to. <br> if not specified along with from_std_cell_lib, the script will create a new configuration file for (pdkTo,to_std_cell_lib) that is empty.
</td>
</tr>
<tr>
Expand All @@ -150,19 +150,19 @@ The following is the list of flags used with the script:
<tr>
</tr>
<td align="center">
<code>--pdkVariantTo | -pvt &lt;PDK_VARIANT&gt;</code> <br> (Required)
<code>--to-std-cell-lib | -pvt &lt;STD_CELL_LIBRARY&gt;</code> <br> (Required)
</td>
<td align="justify">
The name of the PDK_VARIANT that the created design configurations belongs to.
The name of the STD_CELL_LIBRARY that the created design configurations belongs to.
</td>
</tr>
</table>

### Update Design Configs for a (PDK,PDK_VARIANT) Pair after an Exploration:
### Update Design Configs for a (PDK,STD_CELL_LIBRARY) Pair after an Exploration:

To run the script to update configurations for a (PDK,PDK_VARIANT) pair after an exploration:
To run the script to update configurations for a (PDK,STD_CELL_LIBRARY) pair after an exploration:
```bash
python3 ./scripts/updateDesignsConfigs.py --pdk PDK --pdkVariant PDK_VARIANT -log SW_exploration_best.csv
python3 ./scripts/updateDesignsConfigs.py --pdk PDK --std-cell-lib STD_CELL_LIBRARY -log SW_exploration_best.csv
```

Check [this][1] for more details on the log files.
Expand Down Expand Up @@ -205,10 +205,10 @@ The following is the list of flags used with the script:
<tr>
</tr>
<td align="center">
<code>--pdkVariant | -pv &lt;PDK_VARIANT&gt;</code> <br> (Optional)
<code>--std-cell-lib | -pv &lt;STD_CELL_LIBRARY&gt;</code> <br> (Optional)
</td>
<td align="justify">
The name of the PDK_VARIANT that the updated design(s) configuration belongs to.
The name of the STD_CELL_LIBRARY that the updated design(s) configuration belongs to.
</td>
</tr>
<tr>
Expand Down Expand Up @@ -236,4 +236,4 @@ The following is the list of flags used with the script:
**Important Note:** *The updateDesignsConfigs script only copies new configuration to the file. The new configurations are marked with a preceeding "# Regression" comment that is automatically written before them by the exploration script. However, the replicateDesignsConfigs copies the whole file.*

[1]: ../regression_results/README.md
[2]: ../configuration/README.md
[2]: ../configuration/README.md
2 changes: 1 addition & 1 deletion designs/aes/config.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set ::env(CLOCK_PORT) "clk"
set ::env(CLOCK_NET) $::env(CLOCK_PORT)


set filename $::env(OPENLANE_ROOT)/designs/$::env(DESIGN_NAME)/$::env(PDK)_$::env(PDK_VARIANT)_config.tcl
set filename $::env(OPENLANE_ROOT)/designs/$::env(DESIGN_NAME)/$::env(PDK)_$::env(STD_CELL_LIBRARY)_config.tcl
if { [file exists $filename] == 1} {
source $filename
}
Loading

0 comments on commit d4f670a

Please sign in to comment.