README.md 8.46 KB
Newer Older
sakundu committed
1
# Synthesis, Place & Route (SP&R):
Ravi Varadarajan committed
2
The setup to run SP&R on the available test cases for the given enablements are available in *./<enablement_name>/<testcase_name>/* directories.  
sakundu committed
3 4 5
- [NanGate45](../Enablements/NanGate45/)
  - [Ariane136](./NanGate45/ariane136/)
  - [Ariane133](./NanGate45/ariane133/)
Ravi Varadarajan committed
6
  - [MemPool tile](./NanGate45/mempool_tile/)
sakundu committed
7
  - [NVDLA](./NanGate45/nvdla/)
sakundu committed
8 9 10
- [ASAP7](../Enablements/ASAP7/)
  - [Ariane136](./ASAP7/ariane136/)
  - [Ariane133](./ASAP7/ariane133/)
sakundu committed
11 12 13 14 15 16
  - [MemPool tile](./ASAP7/mempool_tile/)
  - [NVDLA](./ASAP7/nvdla/)
- [SKY130HD FakeStack](../Enablements/SKY130HD/)
  - [Ariane136](./SKY130HD/ariane136/)
  - [Ariane133](./SKY130HD/ariane133/)
  - [MemPool tile](./SKY130HD/mempool_tile/)
sakundu committed
17
  - [NVDLA](./SKY130HD/nvdla/)
sakundu committed
18 19
- [Utility](./util/)
  - Contains utility scripts for SP&R runs.
sakundu committed
20

sakundu committed
21 22 23 24 25 26 27 28
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.
sakundu committed
29

sakundu committed
30
The runscripts for all the flows are available in the *./\<enablement\>/\<testcase\>/scripts/* directory. Inside *script* directory are the following sub-directories.
sakundu committed
31
- *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.
sakundu committed
32
- *OpenROAD* directory contains the *<testcase>.tar.gz* file, which includes all the required files to run [Flow-3](./figures/flow-3.PNG) using OpenROAD-flow-scripts ([ORFS](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/)).
sakundu committed
33

sakundu committed
34 35 36
All the flows uses the *RTL* from the [*Testcases*](../Testcases/) directory and the *.lef*, *.lib* and *qrc* files from the [*Enablements*](../Enablements/) directory. The required SRAM models for each testcase are generated and also available under the [*Enablements*](../Enablements/) directory. The detailed steps for different tools are as follows.
  - [**Cadence tools**](#using-cadence-genus-and-innovus)
  - [**OpenROAD tools**](#using-openroad-flow-scripts)
sakundu committed
37
  
sakundu committed
38
## **Using Cadence Genus and Innovus:**
sakundu committed
39 40 41 42 43 44 45 46 47
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 ```


sakundu committed
48 49 50 51
**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 determine the flow. 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 copied into the *netlist* directory.
- 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 additional 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. The only difference is that the input def file does not include macro placement information.
sakundu committed
52

sakundu committed
53
The command to launch only the synthesis run is as follows.
sakundu committed
54
```
sakundu committed
55 56 57
# 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
sakundu committed
58
```  
sakundu committed
59
<!-- 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. -->
sakundu committed
60 61 62

**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
sakundu committed
63
  - 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 floorplan def file *\<design\>_fp.def* is created and copied into the def directory for place and route. The following command is used to place the pins.  
sakundu committed
64 65 66 67
  ```
  ### 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
  ```
sakundu committed
68 69 70 71 72 73
  - We use default HALO width based on the enablement for all the macros using the following command.  
  ```
  ### HALO_WIDTH is 2um for ASAP7 and 5um for NanGate45 and SKY130HD FakeStack enablements ###
  addHaloToBlock -allMacro $HALO_WIDTH $HALO_WIDTH $HALO_WIDTH $HALO_WIDTH
  ```
  - The *place_design -concurrent_macros* command is used to place the macros and the def file *\<design\>_fp_placed_macros.def* is created and copied into the def directory for synthesis using Flow-2.
sakundu committed
74 75 76 77
  - 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.
sakundu committed
78

sakundu committed
79
The command to launch the P&R run is as follows.  
sakundu committed
80
```
sakundu committed
81
### Make sure you have run the synthesis synthesis step. run_invs.tcl uses the output files generated synthesis ###
sakundu committed
82 83
# export PHY_SYNTH=0   #For Flow-1 uncomment this line
# export PHY_SYNTH=1   #For Flow-2 uncomment this line
sakundu committed
84 85 86
innovus -64 -init run_invs.tcl -log log/run.log
```  

87
The screenshot of the Ariane 136 testcase using the Cadence Flow-1 on NanGate45 enablement is shown below.  
sakundu committed
88 89
<img src="./NanGate45/ariane136/screenshots/Ariane136_Innovus_Genus.png" alt="ariane136_cadence" width="400"/>

sakundu committed
90
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.  
sakundu committed
91

sakundu committed
92 93
## **Using OpenROAD-flow-scripts:**
Clone ORFS and build OpenROAD tools following the steps given [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts). Use the following steps to run SP&R using OpenROAD tools:  
sakundu committed
94
1. Copy *./\<enablement\>/\<testcase\>/scripts/OpenROAD/\<design\>.tar.gz* file to *{ORFS Clone Directory}/OpenROAD-flow-scripts/flow/designs/\<enablement\>* area.
sakundu committed
95 96
2. Use the 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 make command
sakundu committed
97
  ```
sakundu committed
98
  make DESIGN_CONFIG=./designs/<enablement>/<design>/config_hier.mk
sakundu committed
99 100 101
  ```
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:
  ```
sakundu committed
102
  make DESIGN_CONFIG=./designs/<enablement>/<design>/config.mk
sakundu committed
103 104
  ```
  
105 106
The screenshot of the Ariane 136 testcase using the ORFS (RTL-MP) on NanGate45 enablement is shown below.  
<img src="./NanGate45/ariane136/screenshots/Ariane136_ORFS_SPNR.png" alt="ariane136_orfs" width="400"/>