floorplan: add some comments
@@ -958,9 +958,16 @@ class Floorplan:
}
def place_ring(self):
+ # TODO: implement
pass
def _determine_num_via_cols(self, viarule, width, height, lower_dir, upper_dir, stack_bottom, stack_top):
+ '''Determine number of via columns we can insert in a given intersection.
+
+ Based on OpenROAD TCL logic:
+ https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pdn/src/PdnGen.tcl#L2147
+ '''
+
lower_enclosure = viarule['bottom']['enclosure']
upper_enclosure = viarule['top']['enclosure']
cut_w, cut_h = viarule['cut']['size']
@@ -985,11 +992,15 @@ class Floorplan:
cols = max(1, i-1)
- # TODO: check constraints (how are these set?)
-
return cols
def _determine_num_via_rows(self, viarule, width, height, lower_dir, upper_dir, stack_bottom, stack_top):
+ '''Determine number of via rows we can insert in a given intersection.
+
+ Based on OpenROAD TCL logic:
+ https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pdn/src/PdnGen.tcl#L2228
+ '''
+
lower_enclosure = viarule['bottom']['enclosure']
upper_enclosure = viarule['top']['enclosure']
cut_w, cut_h = viarule['cut']['size']
@@ -1014,11 +1025,13 @@ class Floorplan:
rows = max(1, i-1)
- # TODO: check constraints (how are these set?)
-
return rows
def _generate_via(self, viarule, width, height, lower_dir, upper_dir, stack_bottom, stack_top):
+ '''Given a viarule and an intersection of metal layers, generate a via
+ array that can connect the intersection.
+ '''
+
lower_enclosure = viarule['bottom']['enclosure']
upper_enclosure = viarule['top']['enclosure']
cut_w, cut_h = viarule['cut']['size']
@@ -1069,6 +1082,8 @@ class Floorplan:
return score, via
def _insert_via(self, net, pos, bottom_layer, top_layer, bottom_dir, top_dir, width, height):
+ '''Insert vias between two given intersecting metal layers.'''
+
x, y = pos
stack_key = (bottom_layer, bottom_dir, top_layer, top_dir, width, height)
@@ -1108,6 +1123,13 @@ class Floorplan:
self.place_vias([net], x, y, 0, 0, layer, vianame)
def insert_vias(self):
+ '''Automatically insert vias.
+
+ Automatically inserts vias between common specialnets that intersect on
+ different metal layers. Via geometries are generated based on VIARULE
+ GENERATE statements found in the tech LEF.
+ '''
+
for net in self.nets:
# TODO: is this valid? trying to sort from bottom to top
wires = sorted(self.nets[net]['wires'], key=lambda w: w['sclayer'] )
