Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 1 | # Power nets |
Ahmed Ghazy | 32cdb20 | 2020-12-10 20:24:37 +0200 | [diff] [blame] | 2 | |
| 3 | if { ! [info exists ::env(VDD_NET)] } { |
| 4 | set ::env(VDD_NET) $::env(VDD_PIN) |
| 5 | } |
| 6 | |
| 7 | if { ! [info exists ::env(GND_NET)] } { |
| 8 | set ::env(GND_NET) $::env(GND_PIN) |
| 9 | } |
| 10 | |
| 11 | set ::power_nets $::env(VDD_NET) |
| 12 | set ::ground_nets $::env(GND_NET) |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 13 | |
agorararmard | db87598 | 2020-11-30 19:40:31 +0200 | [diff] [blame] | 14 | if { [info exists ::env(FP_PDN_ENABLE_GLOBAL_CONNECTIONS)] } { |
Ahmed Ghazy | 32cdb20 | 2020-12-10 20:24:37 +0200 | [diff] [blame] | 15 | if { $::env(FP_PDN_ENABLE_GLOBAL_CONNECTIONS) == 1 } { |
agorararmard | db87598 | 2020-11-30 19:40:31 +0200 | [diff] [blame] | 16 | # to parameterize -- needs a PDNGEN fix |
| 17 | set pdngen::global_connections { |
| 18 | VPWR { |
| 19 | {inst_name .* pin_name VPWR} |
| 20 | {inst_name .* pin_name VPB} |
| 21 | } |
| 22 | VGND { |
| 23 | {inst_name .* pin_name VGND} |
| 24 | {inst_name .* pin_name VNB} |
| 25 | } |
| 26 | } |
| 27 | } |
Ahmed Ghazy | 885c10a | 2020-11-24 17:00:17 +0200 | [diff] [blame] | 28 | } |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 29 | |
agorararmard | 4ddcc61 | 2020-10-08 17:05:03 +0200 | [diff] [blame] | 30 | # Used if the design is the core of the chip |
| 31 | set stdcell_core { |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 32 | name grid |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 33 | straps { |
Ahmed Ghazy | 32cdb20 | 2020-12-10 20:24:37 +0200 | [diff] [blame] | 34 | $::env(FP_PDN_LOWER_LAYER) {width $::env(FP_PDN_VWIDTH) pitch $::env(FP_PDN_VPITCH) offset $::env(FP_PDN_VOFFSET)} |
| 35 | $::env(FP_PDN_UPPER_LAYER) {width $::env(FP_PDN_HWIDTH) pitch $::env(FP_PDN_HPITCH) offset $::env(FP_PDN_HOFFSET)} |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 36 | } |
Ahmed Ghazy | 32cdb20 | 2020-12-10 20:24:37 +0200 | [diff] [blame] | 37 | connect {{$::env(FP_PDN_LOWER_LAYER) $::env(FP_PDN_UPPER_LAYER)}} |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 38 | } |
| 39 | |
agorararmard | 4ddcc61 | 2020-10-08 17:05:03 +0200 | [diff] [blame] | 40 | # Used if the design is a macro in the core |
| 41 | set stdcell_macro { |
| 42 | name grid |
agorararmard | 4ddcc61 | 2020-10-08 17:05:03 +0200 | [diff] [blame] | 43 | straps { |
Ahmed Ghazy | 32cdb20 | 2020-12-10 20:24:37 +0200 | [diff] [blame] | 44 | $::env(FP_PDN_LOWER_LAYER) {width $::env(FP_PDN_VWIDTH) pitch $::env(FP_PDN_VPITCH) offset $::env(FP_PDN_VOFFSET)} |
agorararmard | 4ddcc61 | 2020-10-08 17:05:03 +0200 | [diff] [blame] | 45 | } |
Ahmed Ghazy | 32cdb20 | 2020-12-10 20:24:37 +0200 | [diff] [blame] | 46 | connect {} |
agorararmard | 4ddcc61 | 2020-10-08 17:05:03 +0200 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | # Assesses whether the deisgn is the core of the chip or not based on the value of $::env(DESIGN_IS_CORE) and uses the appropriate stdcell section |
| 50 | if { [info exists ::env(DESIGN_IS_CORE)] } { |
| 51 | if { $::env(DESIGN_IS_CORE) == 1 } { |
| 52 | set stdcell $stdcell_core |
| 53 | } else { |
| 54 | set stdcell $stdcell_macro |
| 55 | } |
| 56 | } else { |
| 57 | set stdcell $stdcell_core |
| 58 | } |
| 59 | |
| 60 | # Adds the core ring if enabled. |
| 61 | if { [info exists ::env(FP_PDN_CORE_RING)] } { |
| 62 | if { $::env(FP_PDN_CORE_RING) == 1 } { |
| 63 | dict append stdcell core_ring { |
Ahmed Ghazy | 32cdb20 | 2020-12-10 20:24:37 +0200 | [diff] [blame] | 64 | $::env(FP_PDN_LOWER_LAYER) {width $::env(FP_PDN_CORE_RING_VWIDTH) spacing $::env(FP_PDN_CORE_RING_VSPACING) core_offset $::env(FP_PDN_CORE_RING_VOFFSET)} |
| 65 | $::env(FP_PDN_UPPER_LAYER) {width $::env(FP_PDN_CORE_RING_HWIDTH) spacing $::env(FP_PDN_CORE_RING_HSPACING) core_offset $::env(FP_PDN_CORE_RING_HOFFSET)} |
agorararmard | 4ddcc61 | 2020-10-08 17:05:03 +0200 | [diff] [blame] | 66 | } |
| 67 | } |
| 68 | } |
| 69 | |
Ahmed Ghazy | 32cdb20 | 2020-12-10 20:24:37 +0200 | [diff] [blame] | 70 | # Adds the core ring if enabled. |
| 71 | if { [info exists ::env(FP_PDN_ENABLE_RAILS)] } { |
| 72 | if { $::env(FP_PDN_ENABLE_RAILS) == 1 } { |
| 73 | dict append stdcell rails { |
| 74 | $::env(FP_PDN_RAILS_LAYER) {width $::env(FP_PDN_RAIL_WIDTH) pitch $::env(PLACE_SITE_HEIGHT) offset $::env(FP_PDN_RAIL_OFFSET)} |
| 75 | } |
| 76 | dict update stdcell connect current_connect { |
| 77 | append current_connect { {$::env(FP_PDN_RAILS_LAYER) $::env(FP_PDN_LOWER_LAYER)}} |
| 78 | } |
| 79 | } else { |
| 80 | dict append stdcell rails {} |
| 81 | } |
| 82 | } |
| 83 | |
Ahmed Ghazy | e993c83 | 2021-02-08 20:51:04 +0200 | [diff] [blame] | 84 | pdngen::specify_grid stdcell [subst $stdcell] |
agorararmard | 4ddcc61 | 2020-10-08 17:05:03 +0200 | [diff] [blame] | 85 | |
| 86 | # A general macro that follows the premise of the set heirarchy. You may want to modify this or add other macro configs |
Ahmed Ghazy | 32cdb20 | 2020-12-10 20:24:37 +0200 | [diff] [blame] | 87 | # TODO: generate automatically per instance: |
Ahmed Ghazy | e993c83 | 2021-02-08 20:51:04 +0200 | [diff] [blame] | 88 | set macro { |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 89 | orient {R0 R180 MX MY R90 R270 MXR90 MYR90} |
Ahmed Ghazy | 32cdb20 | 2020-12-10 20:24:37 +0200 | [diff] [blame] | 90 | power_pins $::env(VDD_NET) |
| 91 | ground_pins $::env(GND_NET) |
Ahmed Ghazy | 7f45409 | 2020-11-08 17:32:18 +0200 | [diff] [blame] | 92 | blockages "li1 met1 met2 met3 met4" |
| 93 | straps { |
| 94 | } |
Ahmed Ghazy | 32cdb20 | 2020-12-10 20:24:37 +0200 | [diff] [blame] | 95 | connect {{$::env(FP_PDN_LOWER_LAYER)_PIN_ver $::env(FP_PDN_UPPER_LAYER)}} |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 96 | } |
| 97 | |
Ahmed Ghazy | e993c83 | 2021-02-08 20:51:04 +0200 | [diff] [blame] | 98 | pdngen::specify_grid macro [subst $macro] |
| 99 | |
Ahmed Ghazy | 7f45409 | 2020-11-08 17:32:18 +0200 | [diff] [blame] | 100 | set ::halo [expr min($::env(FP_HORIZONTAL_HALO), $::env(FP_VERTICAL_HALO))] |
| 101 | |
Tim Edwards | 55f4d0e | 2020-07-05 15:41:02 -0400 | [diff] [blame] | 102 | # POWER or GROUND #Std. cell rails starting with power or ground rails at the bottom of the core area |
| 103 | set ::rails_start_with "POWER" ; |
| 104 | |
| 105 | # POWER or GROUND #Upper metal stripes starting with power or ground rails at the left/bottom of the core area |
| 106 | set ::stripes_start_with "POWER" ; |