blob: 93c2e23a209f47c7819a44754201450442d388c7 [file] [log] [blame]
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001# Power nets
Ahmed Ghazy32cdb202020-12-10 20:24:37 +02002
3if { ! [info exists ::env(VDD_NET)] } {
4 set ::env(VDD_NET) $::env(VDD_PIN)
5}
6
7if { ! [info exists ::env(GND_NET)] } {
8 set ::env(GND_NET) $::env(GND_PIN)
9}
10
11set ::power_nets $::env(VDD_NET)
12set ::ground_nets $::env(GND_NET)
Tim Edwards55f4d0e2020-07-05 15:41:02 -040013
agorararmarddb875982020-11-30 19:40:31 +020014if { [info exists ::env(FP_PDN_ENABLE_GLOBAL_CONNECTIONS)] } {
Ahmed Ghazy32cdb202020-12-10 20:24:37 +020015 if { $::env(FP_PDN_ENABLE_GLOBAL_CONNECTIONS) == 1 } {
agorararmarddb875982020-11-30 19:40:31 +020016 # 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 Ghazy885c10a2020-11-24 17:00:17 +020028}
Tim Edwards55f4d0e2020-07-05 15:41:02 -040029
agorararmard4ddcc612020-10-08 17:05:03 +020030# Used if the design is the core of the chip
31set stdcell_core {
Tim Edwards55f4d0e2020-07-05 15:41:02 -040032 name grid
Tim Edwards55f4d0e2020-07-05 15:41:02 -040033 straps {
Ahmed Ghazy32cdb202020-12-10 20:24:37 +020034 $::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 Edwards55f4d0e2020-07-05 15:41:02 -040036 }
Ahmed Ghazy32cdb202020-12-10 20:24:37 +020037 connect {{$::env(FP_PDN_LOWER_LAYER) $::env(FP_PDN_UPPER_LAYER)}}
Tim Edwards55f4d0e2020-07-05 15:41:02 -040038}
39
agorararmard4ddcc612020-10-08 17:05:03 +020040# Used if the design is a macro in the core
41set stdcell_macro {
42 name grid
agorararmard4ddcc612020-10-08 17:05:03 +020043 straps {
Ahmed Ghazy32cdb202020-12-10 20:24:37 +020044 $::env(FP_PDN_LOWER_LAYER) {width $::env(FP_PDN_VWIDTH) pitch $::env(FP_PDN_VPITCH) offset $::env(FP_PDN_VOFFSET)}
agorararmard4ddcc612020-10-08 17:05:03 +020045 }
Ahmed Ghazy32cdb202020-12-10 20:24:37 +020046 connect {}
agorararmard4ddcc612020-10-08 17:05:03 +020047}
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
50if { [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.
61if { [info exists ::env(FP_PDN_CORE_RING)] } {
62 if { $::env(FP_PDN_CORE_RING) == 1 } {
63 dict append stdcell core_ring {
Ahmed Ghazy32cdb202020-12-10 20:24:37 +020064 $::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)}
agorararmard4ddcc612020-10-08 17:05:03 +020066 }
67 }
68}
69
Ahmed Ghazy32cdb202020-12-10 20:24:37 +020070# Adds the core ring if enabled.
71if { [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 Ghazye993c832021-02-08 20:51:04 +020084pdngen::specify_grid stdcell [subst $stdcell]
agorararmard4ddcc612020-10-08 17:05:03 +020085
86# A general macro that follows the premise of the set heirarchy. You may want to modify this or add other macro configs
Ahmed Ghazy32cdb202020-12-10 20:24:37 +020087# TODO: generate automatically per instance:
Ahmed Ghazye993c832021-02-08 20:51:04 +020088set macro {
Tim Edwards55f4d0e2020-07-05 15:41:02 -040089 orient {R0 R180 MX MY R90 R270 MXR90 MYR90}
Ahmed Ghazy32cdb202020-12-10 20:24:37 +020090 power_pins $::env(VDD_NET)
91 ground_pins $::env(GND_NET)
Ahmed Ghazy7f454092020-11-08 17:32:18 +020092 blockages "li1 met1 met2 met3 met4"
93 straps {
94 }
Ahmed Ghazy32cdb202020-12-10 20:24:37 +020095 connect {{$::env(FP_PDN_LOWER_LAYER)_PIN_ver $::env(FP_PDN_UPPER_LAYER)}}
Tim Edwards55f4d0e2020-07-05 15:41:02 -040096}
97
Ahmed Ghazye993c832021-02-08 20:51:04 +020098pdngen::specify_grid macro [subst $macro]
99
Ahmed Ghazy7f454092020-11-08 17:32:18 +0200100set ::halo [expr min($::env(FP_HORIZONTAL_HALO), $::env(FP_VERTICAL_HALO))]
101
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400102# POWER or GROUND #Std. cell rails starting with power or ground rails at the bottom of the core area
103set ::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
106set ::stripes_start_with "POWER" ;