Commit c25159bc by sakundu

Updated Flow and Main README

Signed-off-by: sakundu <sakundu@ucsd.edu>
parent 105441ab
......@@ -16,51 +16,87 @@ The setup to run SP&R on the available test cases for the given enablements are
- [MemPool tile](./SKY130HD/mempool_tile/)
- [NVDLA](./SKY130HD/nvdla/)
Inside each directory are the following sub-directories that contain all of the files required to run the full SP&R flow.
- *constraints* directory contians the SDC constraint file for current design and enablement.
- *def* directory contains the floorplan DEF file that is used in the SP&R flow. We provide two DEF files one with just the core.
area and pin placements that is used for the logical synthesis flow [Flow-1](./figures/flow-1.PNG) and another DEF file that also inlcudes macro placements that
is used in the physical synthesis iSpatial flow [Flow-2](./figures/flow-2.PNG).
- *netlist* directory contains the synthesized netlist from [Flow-1](./figures/flow-1.PNG).
- *scripts* directory contains the setup and scripts to run the full SP&R flow using both commercial and open-source tools.
- *run* directory to peform the SP&R runs using the runscripts available in the *scripts* direcotry.
# **Synthesis, Place \& Route (SP\&R):**
Here we provide the setup to run SP&R of Ariane design with 136 macros on NanGate45 using commercial and open-source tools.
We provide the runscripts for all the flows and they are available in the *./\<enablement\>/\<testcase\>/scripts/* directory. The sub-directories available in the scripts directory are as follows.
- *cadence* directory contains all the runscripts related to [Flow-1](./figures/flow-1.PNG), [Flow-2](./figures/flow-2.PNG). We will also add [Flow-4](./figures/flow-4.PNG) scripts here.
- *OpenROAD* directory contains the *<testcase>.tar.gz* file, which includes all the required file to run [Flow-3](./figures/flow-3.PNG) using OpenROAD-flow-scripts ([ORFS](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/tree/master/flow/platforms/nangate45)).
The detailed stpes to run SP&R using the proprietary (commercial) tools **Cadence Genus** (Synthesis) and **Cadence Innovus** (P&R), and the open-source tools **Yosys** (Synthesis) and **OpenROAD** (P&R) are as follows.
- [**SP\&R Flow**](#spr-flow)
- [**Cadence tools**](#using-cadence-genus-and-innovus)
- [**OpenROAD tools**](#using-openroad-flow-scripts)
## **SP\&R Flow:**
We implement Ariane design with [136 macros](../Testcases/ariane136/) on the NanGate45 platform using the proprietary (commercial) tools **Cadence Genus** (Synthesis) and **Cadence Innovus** (P&R), and the open-source tools **Yosys** (Synthesis) and **OpenROAD** (P&R). The required *.lef* and *.lib* files are downloaded from the OpenROAD-flow-scripts (ORFS) [GitHub](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/tree/master/flow/platforms/nangate45). We use the [fakeram](https://github.com/jjcherry56/bsg_fakeram) generator for the NanGate45 platform to generate the 16-bit (256x16, single-ported SRAM) memory. All the required *.lib* and *.lef* files are available in the [*Enablements/NanGate45*](../Enablements/NanGate45/) directory.
All the flows uses the *RTL* available under the [*Testcases*](../Testcases/) directory and the *.lef*, *.lib* and *qrc* files available under the [*Enablements*](../Enablements/) directory. All the required SRAM models are generated and available under the [*Enablements*](../Enablements/) directory.
### **Using Cadence Genus and Innovus:**
All the required scripts are available in the [*./scripts/cadence/*](./scripts/cadence/) directory.
**Synthesis:** [run_genus.tcl](./NanGate45/ariane136/scripts/cadence/run_genus.tcl) contains the setup for synthesis using Genus. It reads the .sv files based on the list in [*./scripts/cadence/rtl_list.tcl*](./NanGate45/ariane136/scripts/cadence/rtl_list.tcl) (changing the order of the file may cause errors). The timing constraints are provided in [*./constrains/ariane.sdc*](./NanGate45/ariane136/constraints/ariane.sdc) file. To launch the synthesis run please use the below command
All the required runscripts are available in the *./\<enablement\>/\<testcase\>/scripts/cadence/* directory. The steps to modify *run.sh* to launch SP&R runs for Flow-1 and Flow-2 are as follows.
- To launch Flow-1 set the **PHY_SYNTH** environment variable to *0* in the *run.sh* file.
``` export PHY_SYNTH=0 ```
- To laucnh Flow-2 set the **PHY_SYNTH** environment variable to *1* in the *run.sh* file.
``` export PHY_SYNTH=1 ```
- To start the SP&R run use the following command.
``` ./run.sh ```
**Synthesis:** The *run_genus_hybrid.tcl* is used to run the logical synthesis using Genus and physical synthesis using Genus iSpatial. It utilizes the **PHY_SYNTH** environment variable to choose which flow to run. Minor details of each synthesis flow are as follows.
- Logical synthesis using Genus (Flow-1): We use the *elaborate*, *syn_generic*, *syn_map* and *syn_opt* commands to generate the synthesized netlist. This synthesized netlist is available in the *netlist* directory for each testcase on all enablements.
- Physical synthesis using Genus iSpatial (Flow-2): We use the *elaborate*, *syn_generic -physical*, *syn_map -physical* and *syn_opt -iSpatial* commands to generate the sunthesized netlist. In this step we provide the floorplan def with placed macros and pins as an extra input compared to Flow-1. This def file is generate in Flow-1.
- Physical synthesis using Genus iSpatial for Circuit Training (Flow-4): This is same as Flow-2 synthesis flow. Only difference is the input def file contains only place pin information and no macro information.
The command to launch only the synthesis job is as follows.
```
genus -overwrite -log log/genus.log -no_gui -files run_genus.tcl
# export PHY_SYNTH=0 #For Flow-1 uncomment this line
# export PHY_SYNTH=1 #For Flow-2 uncomment this line
genus -overwrite -log log/genus.log -no_gui -files run_genus_hybrid.tcl
```
We also generate a synthesized netlist, which is available in the [*./netlist/*](./NanGate45/ariane136/netlist/) directory.
We use the constraint file available in the *constraint* directory for the synthesis run. We set the target clock period to a reasonable value that is not too easy or hard for the tool to achieve.
**P\&R:** [run_innovus.tcl](./NanGate45/ariane136/scripts/cadence/run_invs.tcl) contains the setup for the P&R run using Innvous. It reads the netlist provided in [*./netlist/*](./NanGate45/ariane136/netlist/) directory. To launch the P\&R run please use the below command.
**P\&R:** The *run_invs.tcl* is used to run the place and route using Cadence Innovus. The netlist and constraint generated during synthesis flow are used in this step. It also utilizes the **PHY_SYNTH** environment variable to choose which flow to run. Minor details of each P&R flow are as follows.
- Flow-1
- We use aspect ratio 1 and a utilization value in the range of 40% to 60%. All the pins are placed on the left side of the floorplan and the def file *\<design\>_fp.def* is available in the def directory. The following command is used to place the pins.
```
### pin_list contains the name of all the top level pins. Here Y1 < Y2. LAYER1 and LAYER2 are two horizontal layer above M1 or metal1 or met1 ###
editPin -pin $pin_list -edge 0 -start {0 Y1} -end {0 Y2} -fixedPin -layer {LAYER1 LAYER2} -spreadDirection clockwise -pattern fill_optimised
```
- The *place_design -concurrent_macros* command is used to place the macros and the def file *\<design\>_fp_placed_macros.def* is available in the def directory.
- It uses *place_opt_design*, *ccopt_design* and *routeDesign* commands for placement, CTS and routing of the design.
- Flow-2
- The *run_invs.tcl* script utilizes the *.def* file generated by the Genus iSpatial flow as a starting point.
- Similar to Flow-1 it uses *place_opt_design*, *ccopt_design* and *routeDesign* commands for placement, CTS and routing of the design.
The command to launch the SP&R job is as follows.
```
### Make sure you have ran the synthesis already. run_invs.tcl uses the output generated in synthesis stage ###
# export PHY_SYNTH=0 #For Flow-1 uncomment this line
# export PHY_SYNTH=1 #For Flow-2 uncomment this line
innovus -64 -init run_invs.tcl -log log/run.log
```
Innovus requires a configuration file to run the macro placement flow. For this we use *proto_design -constraints mp_config.tcl* command. The configuration file [*mp_config.tcl*](./NanGate45/ariane136/scripts/cadence/mp_config.tcl) is available in the *./<enablement>/<testcase>/scripts/cadence/* directory. Some details of the configuration files are as follows.
1. Provide the memory hierarchy name under the **SEED** section. If you do not provide the memory hierarchy here, then the macro placement constraints (e.g., cell orientation, spacing, etc.) related to that memory may be overlooked.
2. For each macro, valid orientation and spacing rules can be provided under the **MACRO** section. For example, we set valid macro orientation as *R0* for our run, horizontal spacing as *10um*, and vertical spacing as *5um*. Also, when you provide the cell name (ref name, not instance name) add the *isCell=true* option.
Below is the screenshot of the Ariane SP\&R database with 136 memory macros using Cadence flow on NanGate45 enablement.
<img src="./NanGate45/ariane136/screenshots/Ariane136_Innovus_Genus.png" alt="ariane136_cadence" width="400"/>
This script was written and developed by ABKGroup students at UCSD; however, the underlying commands and reports are copyrighted by Cadence. We thank Cadence for granting permission to share our research to help promote and foster the next generation of innovators.
### **Using OpenROAD-flow-scripts:**
Clone ORFS and build OpenROAD tools following the steps given [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts). To run SP&R using OpenROAD tools follow the below mentioned steps:
1. Copy [*./scripts/OpenROAD/ariane.tar.gz*](../NanGate45/ariane136/scripts/OpenROAD/ariane.tar.gz) file to *{ORFS Clone Directory}/OpenROAD-flow-scripts/flow/designs/nangate45* area.
2. Use command *tar -xvf ariane.tar.gz* to untar *ariane.tar.gz*. This will generate *ariane136* directory which contains all the files required to run SP&R using ORFS.
1. Copy *./\<enablement\>/\<testcase\>/scripts/OpenROAD/\<design\>.tar.gz* file to *{ORFS Clone Directory}/OpenROAD-flow-scripts/flow/designs/\<enablement\>* area.
2. Use command *tar -xvf \<design\>.tar.gz* to untar *\<design\>.tar.gz*. This will generate *\<design\>* directory which contains all the files required to run SP&R using ORFS.
3. To launch the SP&R job go to the flow directory and use the below command
```
make DESIGN_CONFIG=./designs/nangate45/ariane136/config_hier.mk
make DESIGN_CONFIG=./designs/<enablement>/<design>/config_hier.mk
```
4. config_hier.mk uses the **RTL-MP** (RTL Macro Placer) for macro placement. If you wish to run macro placement using the older **Triton Macro Placer**, please use the below command:
```
make DESIGN_CONFIG=./designs/nangate45/ariane136/config.mk
make DESIGN_CONFIG=./designs/<enablement>/<design>/config.mk
```
Below is the screenshot of the Ariane SP\&R database with 136 memory macros using the ORFS (RTL-MP) flow.
......
Flows/figures/flow-1.PNG

35.6 KB | W: | H:

Flows/figures/flow-1.PNG

35.7 KB | W: | H:

Flows/figures/flow-1.PNG
Flows/figures/flow-1.PNG
Flows/figures/flow-1.PNG
Flows/figures/flow-1.PNG
  • 2-up
  • Swipe
  • Onion skin
Flows/figures/flow-2.PNG

48.3 KB | W: | H:

Flows/figures/flow-2.PNG

50.9 KB | W: | H:

Flows/figures/flow-2.PNG
Flows/figures/flow-2.PNG
Flows/figures/flow-2.PNG
Flows/figures/flow-2.PNG
  • 2-up
  • Swipe
  • Onion skin
Flows/figures/flow-3.PNG

29 KB | W: | H:

Flows/figures/flow-3.PNG

29.4 KB | W: | H:

Flows/figures/flow-3.PNG
Flows/figures/flow-3.PNG
Flows/figures/flow-3.PNG
Flows/figures/flow-3.PNG
  • 2-up
  • Swipe
  • Onion skin
Flows/figures/flow-4.PNG

31.4 KB | W: | H:

Flows/figures/flow-4.PNG

39.1 KB | W: | H:

Flows/figures/flow-4.PNG
Flows/figures/flow-4.PNG
Flows/figures/flow-4.PNG
Flows/figures/flow-4.PNG
  • 2-up
  • Swipe
  • Onion skin
......@@ -207,5 +207,7 @@ while allowing soft macros (standard-cell clusters) to also find good locations.
- A. Mirhoseini, A. Goldie, M. Yazgan, J. Jiang, E. Songhori, et al.,
"Chip Placement with Deep Reinforcement Learning",
*arXiv:2004.10746*, 2020. \[[paper](https://arxiv.org/pdf/2004.10746.pdf)\]
- S. Yue, E. M. Songhori, J. W. Jiang, T. Boyd, A. Goldie, A. Mirhoseini and S. Guadarrama, "Scalability and Generalization of Circuit Training for Chip Floorplanning", *ISPD*, 2022. \[[paper](https://dl.acm.org/doi/abs/10.1145/3505170.3511478)\]\[[ppt](http://www.ispd.cc/slides/2021/protected/2_2_Goldie_Mirhoseini.pdf)\]
- Z. Jiang, E. Songhori, S. Wang, A. Goldie, A. Mirhoseini, et al., "Delving into Macro Placement with Reinforcement Learning", *MLCAD*, 2021. \[[paper](https://arxiv.org/pdf/2109.02587)\]
- A Gentle Introduction to Graph Neural Networks. [[Link](https://distill.pub/2021/gnn-intro/)]
- TILOS AI Institute. \[[link](https://tilos.ai/)\]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment