mirror of https://github.com/VLSIDA/OpenRAM.git
Use pins in computing bbox offsets
This commit is contained in:
parent
e706f776eb
commit
0e48e020c1
|
|
@ -15,6 +15,7 @@ from tech import layer_indices
|
||||||
from tech import layer_stacks
|
from tech import layer_stacks
|
||||||
from tech import preferred_directions
|
from tech import preferred_directions
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
from globals import OPTS
|
from globals import OPTS
|
||||||
from vector import vector
|
from vector import vector
|
||||||
from pin_layout import pin_layout
|
from pin_layout import pin_layout
|
||||||
|
|
@ -111,52 +112,44 @@ class layout():
|
||||||
Finds the lowest set of 2d cartesian coordinates within
|
Finds the lowest set of 2d cartesian coordinates within
|
||||||
this layout
|
this layout
|
||||||
"""
|
"""
|
||||||
|
lowestx = lowesty = sys.maxsize
|
||||||
|
|
||||||
if len(self.objs) > 0:
|
if len(self.objs) > 0:
|
||||||
lowestx1 = min(obj.lx() for obj in self.objs if obj.name != "label")
|
lowestx = min(min(obj.lx() for obj in self.objs if obj.name != "label"), lowestx)
|
||||||
lowesty1 = min(obj.by() for obj in self.objs if obj.name != "label")
|
lowesty = min(min(obj.by() for obj in self.objs if obj.name != "label"), lowesty)
|
||||||
else:
|
|
||||||
lowestx1 = lowesty1 = None
|
|
||||||
if len(self.insts) > 0:
|
if len(self.insts) > 0:
|
||||||
lowestx2 = min(inst.lx() for inst in self.insts)
|
lowestx = min(min(inst.lx() for inst in self.insts), lowestx)
|
||||||
lowesty2 = min(inst.by() for inst in self.insts)
|
lowesty = min(min(inst.by() for inst in self.insts), lowesty)
|
||||||
else:
|
|
||||||
lowestx2 = lowesty2 = None
|
|
||||||
|
|
||||||
if lowestx1 == None and lowestx2 == None:
|
if len(self.pin_map) > 0:
|
||||||
return None
|
for pin_set in self.pin_map.values():
|
||||||
elif lowestx1 == None:
|
lowestx = min(min(pin.lx() for pin in pin_set), lowestx)
|
||||||
return vector(lowestx2, lowesty2)
|
lowesty = min(min(pin.by() for pin in pin_set), lowesty)
|
||||||
elif lowestx2 == None:
|
|
||||||
return vector(lowestx1, lowesty1)
|
return vector(lowestx, lowesty)
|
||||||
else:
|
|
||||||
return vector(min(lowestx1, lowestx2), min(lowesty1, lowesty2))
|
|
||||||
|
|
||||||
def find_highest_coords(self):
|
def find_highest_coords(self):
|
||||||
"""
|
"""
|
||||||
Finds the highest set of 2d cartesian coordinates within
|
Finds the highest set of 2d cartesian coordinates within
|
||||||
this layout
|
this layout
|
||||||
"""
|
"""
|
||||||
|
highestx = highesty = -sys.maxsize - 1
|
||||||
|
|
||||||
if len(self.objs) > 0:
|
if len(self.objs) > 0:
|
||||||
highestx1 = max(obj.rx() for obj in self.objs if obj.name != "label")
|
highestx = max(max(obj.rx() for obj in self.objs if obj.name != "label"), highestx)
|
||||||
highesty1 = max(obj.uy() for obj in self.objs if obj.name != "label")
|
highesty = max(max(obj.uy() for obj in self.objs if obj.name != "label"), highesty)
|
||||||
else:
|
|
||||||
highestx1 = highesty1 = None
|
|
||||||
if len(self.insts) > 0:
|
|
||||||
highestx2 = max(inst.rx() for inst in self.insts)
|
|
||||||
highesty2 = max(inst.uy() for inst in self.insts)
|
|
||||||
else:
|
|
||||||
highestx2 = highesty2 = None
|
|
||||||
|
|
||||||
if highestx1 == None and highestx2 == None:
|
if len(self.insts) > 0:
|
||||||
return None
|
highestx = max(max(inst.rx() for inst in self.insts), highestx)
|
||||||
elif highestx1 == None:
|
highesty = max(max(inst.uy() for inst in self.insts), highesty)
|
||||||
return vector(highestx2, highesty2)
|
|
||||||
elif highestx2 == None:
|
if len(self.pin_map) > 0:
|
||||||
return vector(highestx1, highesty1)
|
for pin_set in self.pin_map.values():
|
||||||
else:
|
highestx = max(max(pin.rx() for pin in pin_set), highestx)
|
||||||
return vector(max(highestx1, highestx2),
|
highesty = max(max(pin.uy() for pin in pin_set), highesty)
|
||||||
max(highesty1, highesty2))
|
|
||||||
|
return vector(highestx, highesty)
|
||||||
|
|
||||||
def find_highest_layer_coords(self, layer):
|
def find_highest_layer_coords(self, layer):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue