|
| 1 | +# Management Area |
| 2 | + |
| 3 | +The managemet area is bottom area of the caravel chip. It houses the main processor and a couple of memory blocks. The litex version is composed of four main blocks: `mgmt_core_wrapper`, `mgmt_core`, `DFFRAM`, and a `2K SRAM` block. The `mgmt_core_wrapper` is the top level block. It encapsulates two macros the `DFFRAM` and the `mgmt_core` which has the `2K SRAM` block as a submacro. |
| 4 | + |
| 5 | +<img src="../docs/_static/caravel_mgmt.png" style="height: 550px; width:850px;"/> |
| 6 | + |
| 7 | +The litex version heirarchy: |
| 8 | + |
| 9 | +- mgmt_core_wrapper |
| 10 | + - DFFRAM |
| 11 | + - mgmt_core |
| 12 | + - 2K SRAM |
| 13 | + |
| 14 | +--- |
| 15 | +**NOTE** |
| 16 | + |
| 17 | +This heirarchy is flexible to change between the different versions of the managemt area. The only restriction is that different versions of the management area conform to the same pin order, pin placement, die area, and power delivery network. |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +# Management Core Wrapper |
| 22 | + |
| 23 | +This is the top level block. It encapsulates the `mgmt_core` and the `DFFRAM` and it has no standard cells on the top level. |
| 24 | + |
| 25 | +## Floorplan |
| 26 | + |
| 27 | +<img src="../docs/_static/mgmt_core_wrapper_fp.png" style="height: 400px; width:540px;"/> |
| 28 | + |
| 29 | +## Pin Placement |
| 30 | + |
| 31 | +The pin placement is specified by a custom pin order configuration file. The pins are placed in a such away to make them align with neighboring blocks in the top level. For example, the north edge has the mgmt_protect facing pins, and the east edge has the housekeeping facing pins. |
| 32 | + |
| 33 | +<img src="../docs/_static/mgmt_core_wrapper_pin_placement.png" style="height: 400px; width:540px;"/> |
| 34 | + |
| 35 | +--- |
| 36 | +**NOTE** |
| 37 | + |
| 38 | +The clock pin is centered in the south edge of the `mgmt_core_wrapper` to be as close as possible to the `mgmt_core` and the `DFFRAM` clock pins. |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | + |
| 43 | +The managent area pins are extended with ~2 microns outside the die area. This is because the top level routing is pre-planned with one version of the managent area wrapper. In the tapeout-job, this version can be swapped with a different flavor of the mgmt_core_wrapper. To ensure that no shorts happen between the pre-planned top level signal routing and the internal `mgmt_core_wrapper` routing, it is best to connect to the `mgmt_core_wrapper` pins outside its die area. Additionally, during the top level signal routing, an obstruction is placed on the `mgmt_core_wrapper` area to prevent any top level signal routing passing through it. |
| 44 | + |
| 45 | +## PDN |
| 46 | + |
| 47 | +The wrapper PDN is planned on horizontal metal 5 stripes. The `mgmt_core` and the `DFFRAM` each has a core ring planned on metal 4 vertically and metal 5 horizontally. The top level metal 5 straps connect to the `mgmt_core` and the `DFFRAM` core ring metal 4 straps. This is done by a specifying a negative horizontal halo for the pdn by setting the following in the `mgmt_core_wrapper` config.tcl: |
| 48 | + |
| 49 | +``` |
| 50 | +set ::env(FP_HORIZONTAL_HALO) -6 |
| 51 | +``` |
| 52 | + |
| 53 | +<img src="../docs/_static/mgmt_core_wrapper_pdn_2.png" style="height: 400px; width:540px;"/> |
| 54 | + |
| 55 | +--- |
| 56 | +**NOTE** |
| 57 | + |
| 58 | +The mgmt_core and the DFFRAM have the same height, and the same pdn pitch and width to make it easier to plan the top level power routing. |
| 59 | + |
| 60 | +<img src="../docs/_static/mgmt_core_wrapper_pdn.png" style="height: 400px; width:540px;"/> |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +# Management Core |
| 65 | + |
| 66 | +The management core (`mgmt_core`) block contains the litex generated processor and a couple of digital periphrals. It has a 2K SRAM block generated from OpenRAM as a submacro. |
| 67 | + |
| 68 | +## Floorplan |
| 69 | + |
| 70 | +<img src="../docs/_static/mgmt_core_fp.png" style="height: 300px; width:440px;"/> |
| 71 | + |
| 72 | +## Pin Placement |
| 73 | + |
| 74 | +The pins are placed with a custom pin order configuration file. The pins are placed in such away that makes them aligned with neighboring blocks (`DFFRAM`) and the top level block (`mgmt_core_wrapper`) pins. For example, the DFFRAM pins are placed in the west edge and the pins that connect to the top level are placed in the east, north, and south edges. |
| 75 | + |
| 76 | +<img src="../docs/_static/mgmt_core_pin_placement.png" style="height: 400px; width:540px;"/> |
| 77 | + |
| 78 | +--- |
| 79 | +**NOTE** |
| 80 | + |
| 81 | +The clock pin is placed in the middle of the south edge of the block. By trial, this placement gave the lowest clock skew. |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +## PDN |
| 86 | + |
| 87 | +The PDN is planned on metal 4 vertically and metal 5 horizontally. The block also contains a core ring on met4/met5 to enable automatic PDN generation on the top level with the negative halo method. |
| 88 | + |
| 89 | +<img src="../docs/_static/mgmt_core_pdn.png" style="height: 400px; width:540px;"/> |
| 90 | + |
| 91 | +## Timing Constraints |
| 92 | + |
| 93 | +- The `mgmt_core ` is hardened at `25 ns` (`40 MHz`). |
| 94 | + |
| 95 | +- The input delay for `DFFRAM` input date are manually generated by running STA on the DFFRAM block and reporting the delays on the `DFFRAM` output data through the following command: |
| 96 | + |
| 97 | +``` |
| 98 | +report_checks -to Do[*] |
| 99 | +``` |
| 100 | + |
| 101 | +- The input delays coming from the `housekeeping` were also manually computed from openSTA like the `DFFRAM` . |
| 102 | + |
| 103 | +- The input delays coming from the user project area are set to `1ns`. This is to prevent having any hold violations on these input ports. |
| 104 | + |
| 105 | +- The reset signal is set as a false path. |
| 106 | + |
| 107 | +## DFFRAM |
| 108 | + |
| 109 | +The DFFRAM is a 1K standard cell based memory. It acts as an auxiliary memory space for the management core. |
| 110 | + |
| 111 | +### Floorplan |
| 112 | + |
| 113 | +The DFFRAM is a standard cell based block. And, it has no internal macros. |
| 114 | + |
| 115 | +## PDN |
| 116 | + |
| 117 | +The PDN is planned on metal 4 vertically and metal 5 horizontally. The block also contains a core ring on met4/met5 to enable automatic PDN generation on the top level with the negative halo method. |
| 118 | + |
| 119 | +<img src="../docs/_static/dffram_pdn.png" style="height: 400px; width:400px;"/> |
| 120 | + |
| 121 | +## Pin Placement |
| 122 | + |
| 123 | +<img src="../docs/_static/dffram_pins.png" style="height: 400px; width:400px;"/> |
| 124 | + |
| 125 | +--- |
| 126 | +**NOTE** |
| 127 | + |
| 128 | +The clock pin is placed in the middle of the south edge of the block. By trial, this placement gave the lowest clock skew. |
| 129 | + |
| 130 | +--- |
| 131 | + |
| 132 | +## Timing Constraints |
| 133 | + |
| 134 | +- The `DFFRAM` operates at the same clock period as the `mgmt_core`. It is hardened at `25ns` (`40 MHz`). |
| 135 | + |
| 136 | +- The `DFFRAM` input and output delays are set to `5ns`. This is probably an area of optimization as these delays don't match the actual delays coming from the `mgmt_core`. |
| 137 | + |
| 138 | +- The DFFRAM has its clock tree pre-planned in the RTL. So, in the custom sdc file, we have to specify the clock net as a propagated clock, by adding the following command: |
| 139 | + |
| 140 | +``` |
| 141 | +set_propagated_clock [get_clocks $::env(CLOCK_PORT)] |
| 142 | +``` |
| 143 | + |
| 144 | +# Final Timing Signoff |
| 145 | + |
| 146 | +The final timing signoff on the `mgmt_core_wrapper` is done outside the openlane flow through the makefile targe `make mgmt_core_wrapper_timing`. This because as it stands today openlane doesn't support running heirarchal timing signoff. |
| 147 | + |
| 148 | +The method used for the timing signoff on heirarchal blocks is done as follows: |
| 149 | +- During physical implementation of each block, OpenLane generates a gate level netlist and a SPEF file. |
| 150 | +- During top level timing signoff, the gate-level netlists for all levels of heirarchy are loaded. Then, the SPEF file for each block is loaded using `read_spef -path`. |
| 151 | + |
| 152 | +> **_NOTE:_** If the block is instantiated more than once, you will need to load the SPEF file for each instance. |
| 153 | +
|
| 154 | +- After loading the needed SPEF/verilog files, STA can be perfomed. |
| 155 | + |
| 156 | + |
| 157 | +The `mgmt_core_wrapper` timing signoff script: |
| 158 | + |
| 159 | +``` |
| 160 | +read_liberty <leaf cell libs> |
| 161 | +# load verilog files |
| 162 | +read_verilog mgmt_core.v |
| 163 | +read_verilog DFFRAM.v |
| 164 | +read_verilog mgmt_core_wrapper.v |
| 165 | +link_design |
| 166 | +# load SPEF files |
| 167 | +read_spef -path soc/core mgmt_core.spef |
| 168 | +read_spef -path soc/DFFRAM DFFRAM.spef |
| 169 | +read_spef mgmt_core_wrapper.spef |
| 170 | +# perform STA |
| 171 | +report_checks .... |
| 172 | +``` |
| 173 | + |
| 174 | +# Hardening the blocks with OpenLane |
| 175 | + |
| 176 | +We rely on this `Makefile` for running openlane. |
| 177 | + |
| 178 | +First, go to the openlane directory: |
| 179 | + |
| 180 | +``` |
| 181 | +cd openlane |
| 182 | +``` |
| 183 | + |
| 184 | +Then, set the needed environment variables: |
| 185 | + |
| 186 | +``` |
| 187 | +export OPENLANE_ROOT=<openlane-repo-path> |
| 188 | +export PDK_ROOT=<pdk-installation-path> |
| 189 | +export OPENLANE_TAG=<openlane-docker-image-tag> |
| 190 | +``` |
| 191 | + |
| 192 | +Then, run the blocks: |
| 193 | + |
| 194 | +``` |
| 195 | +make DFFRAM |
| 196 | +make mgmt_core |
| 197 | +make mgmt_core_wrapper |
| 198 | +``` |
| 199 | + |
| 200 | +# Improvements/Suggestions |
| 201 | + |
| 202 | +- Increase the PDN width to avoid having IR drop. |
| 203 | +- Further optimize the timing for the mgmt_core. |
| 204 | +- Update the delays in the DFFRAM macro to match the actual delays coming from the mgmt_core. |
0 commit comments