mirror of https://github.com/VLSIDA/OpenRAM.git
Merge branch 'dev' of github.com:VLSIDA/PrivateRAM into dev
This commit is contained in:
commit
852bfbc031
|
|
@ -62,14 +62,10 @@ class route(design):
|
|||
plist = list(pairwise(self.path))
|
||||
for p0,p1 in plist:
|
||||
if p0.z != p1.z: # via
|
||||
# offset if not rotated
|
||||
#via_offset = vector(p0.x+0.5*self.c.width,p0.y+0.5*self.c.height)
|
||||
# offset if rotated
|
||||
via_offset = vector(p0.x+0.5*self.c.height,p0.y-0.5*self.c.width)
|
||||
via_size = [self.num_vias]*2
|
||||
self.obj.add_via(self.layer_stack,via_offset,size=via_size,rotate=90)
|
||||
self.obj.add_via_center(self.layer_stack,vector(p0.x,p0.y),size=via_size,rotate=90)
|
||||
elif p0.x != p1.x and p0.y != p1.y: # diagonal!
|
||||
debug.error("Non-changing direction! {}".format(self.path))
|
||||
debug.error("Diagonal route! {}".format(self.path),-3)
|
||||
else:
|
||||
# this will draw an extra corner at the end but that is ok
|
||||
self.draw_corner_wire(p1)
|
||||
|
|
|
|||
|
|
@ -43,11 +43,14 @@ class direction(Enum):
|
|||
|
||||
return offset
|
||||
|
||||
def cardinal_directions():
|
||||
return [direction.NORTH, direction.EAST, direction.SOUTH, direction.WEST]
|
||||
def cardinal_directions(up_down_too=False):
|
||||
temp_dirs = [direction.NORTH, direction.EAST, direction.SOUTH, direction.WEST]
|
||||
if up_down_too:
|
||||
temp_dirs.extend([direction.UP, direction.DOWN])
|
||||
return temp_dirs
|
||||
|
||||
def cardinal_offsets():
|
||||
return [direction.get_offset(d) for d in direction.cardinal_directions()]
|
||||
def cardinal_offsets(up_down_too=False):
|
||||
return [direction.get_offset(d) for d in direction.cardinal_directions(up_down_too)]
|
||||
|
||||
def all_directions():
|
||||
return [direction.NORTH, direction.EAST, direction.SOUTH, direction.WEST,
|
||||
|
|
|
|||
|
|
@ -22,6 +22,11 @@ class grid_cell:
|
|||
self.source=False
|
||||
self.target=False
|
||||
|
||||
def get_cost(self):
|
||||
# We can display the cost of the frontier
|
||||
if self.min_cost > 0:
|
||||
return self.min_cost
|
||||
|
||||
|
||||
def get_type(self):
|
||||
if self.blocked:
|
||||
|
|
@ -36,8 +41,4 @@ class grid_cell:
|
|||
if self.path:
|
||||
return "P"
|
||||
|
||||
# We can display the cost of the frontier
|
||||
if self.min_cost > 0:
|
||||
return self.min_cost
|
||||
|
||||
return None
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ class grid_path:
|
|||
|
||||
return cost
|
||||
|
||||
def expand_dirs(self,up_down_too=True):
|
||||
def expand_dirs(self):
|
||||
"""
|
||||
Expand from the end in each of the four cardinal directions plus up
|
||||
or down but not expanding to blocked cells. Expands in all
|
||||
|
|
@ -162,9 +162,7 @@ class grid_path:
|
|||
"""
|
||||
neighbors = []
|
||||
|
||||
for d in list(direction):
|
||||
if not up_down_too and (d==direction.UP or d==direction.DOWN):
|
||||
continue
|
||||
for d in direction.cardinal_directions(True):
|
||||
n = self.neighbor(d)
|
||||
if n:
|
||||
neighbors.append(n)
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ class router(router_tech):
|
|||
|
||||
# FIXME: These duplicate a bit of work
|
||||
# These are the paths that have already been routed.
|
||||
self.set_path_blockages()
|
||||
self.set_blockages(self.path_blockages)
|
||||
|
||||
# Don't mark the other components as targets since we want to route
|
||||
# directly to a rail, but unblock all the source components so we can
|
||||
|
|
@ -404,13 +404,6 @@ class router(router_tech):
|
|||
""" Flag the blockages in the grid """
|
||||
self.rg.set_blocked(blockages, value)
|
||||
|
||||
def set_path_blockages(self,value=True):
|
||||
""" Flag the paths as blockages """
|
||||
# These are the paths that have already been routed.
|
||||
for path_set in self.path_blockages:
|
||||
for c in path_set:
|
||||
self.rg.set_blocked(c,value)
|
||||
|
||||
def get_blockage_tracks(self, ll, ur, z):
|
||||
debug.info(3,"Converting blockage ll={0} ur={1} z={2}".format(str(ll),str(ur),z))
|
||||
|
||||
|
|
@ -924,11 +917,13 @@ class router(router_tech):
|
|||
if path:
|
||||
debug.info(2,"Found path: cost={0} ".format(cost))
|
||||
debug.info(3,str(path))
|
||||
|
||||
self.paths.append(path)
|
||||
self.add_route(path)
|
||||
|
||||
path_set = grid_utils.flatten_set(path)
|
||||
inflated_path = grid_utils.inflate_set(path_set,self.supply_rail_space_width)
|
||||
self.path_blockages.append(inflated_path)
|
||||
self.add_route(path)
|
||||
else:
|
||||
self.write_debug_gds("failed_route.gds")
|
||||
# clean up so we can try a reroute
|
||||
|
|
@ -985,16 +980,30 @@ class router(router_tech):
|
|||
# midpoint offset
|
||||
off=vector((shape[1].x+shape[0].x)/2,
|
||||
(shape[1].y+shape[0].y)/2)
|
||||
if g[2]==1:
|
||||
# Upper layer is upper right label
|
||||
type_off=off+partial_track
|
||||
else:
|
||||
# Lower layer is lower left label
|
||||
type_off=off-partial_track
|
||||
if t!=None:
|
||||
if g[2]==1:
|
||||
# Upper layer is upper right label
|
||||
type_off=off+partial_track
|
||||
else:
|
||||
# Lower layer is lower left label
|
||||
type_off=off-partial_track
|
||||
self.cell.add_label(text=str(t),
|
||||
layer="text",
|
||||
offset=type_off)
|
||||
|
||||
t=self.rg.map[g].get_cost()
|
||||
partial_track=vector(self.track_width/6.0,0)
|
||||
if t!=None:
|
||||
if g[2]==1:
|
||||
# Upper layer is right label
|
||||
type_off=off+partial_track
|
||||
else:
|
||||
# Lower layer is left label
|
||||
type_off=off-partial_track
|
||||
self.cell.add_label(text=str(t),
|
||||
layer="text",
|
||||
offset=type_off)
|
||||
|
||||
self.cell.add_label(text="{0},{1}".format(g[0],g[1]),
|
||||
layer="text",
|
||||
offset=shape[0],
|
||||
|
|
@ -1008,9 +1017,9 @@ class router(router_tech):
|
|||
"""
|
||||
debug.info(0,"Adding router info")
|
||||
|
||||
show_blockages = True
|
||||
show_blockage_grids = True
|
||||
show_enclosures = True
|
||||
show_blockages = False
|
||||
show_blockage_grids = False
|
||||
show_enclosures = False
|
||||
show_all_grids = True
|
||||
|
||||
if show_all_grids:
|
||||
|
|
|
|||
Loading…
Reference in New Issue