mirror of https://github.com/VLSIDA/OpenRAM.git
Improve debug messages. Remove add_inst for via in wire.
This commit is contained in:
parent
70365a8116
commit
51d7a673bd
|
|
@ -41,11 +41,11 @@ class instance(geometry):
|
|||
self.offset = vector(snap_to_grid(offset))
|
||||
self.mirror = mirror
|
||||
|
||||
|
||||
debug.info(3, "creating instance: " + self.name)
|
||||
|
||||
def gds_write_file(self, newLayout):
|
||||
"""Recursively writes all the sub-modules in this instance"""
|
||||
debug.info(3, "writing instance:" + self.name)
|
||||
debug.info(3, "writing instance: " + self.name)
|
||||
# make sure to write out my module/structure
|
||||
# (it will only be written the first time though)
|
||||
self.mod.gds_write_file(self.gds)
|
||||
|
|
@ -81,7 +81,7 @@ class path(geometry):
|
|||
|
||||
def gds_write_file(self, newLayout):
|
||||
"""Writes the path to GDS"""
|
||||
debug.info(3, "writing path (" + str(self.layerNumber) + "):" + self.coordinates)
|
||||
debug.info(3, "writing path (" + str(self.layerNumber) + "): " + self.coordinates)
|
||||
newLayout.addPath(layerNumber=self.layerNumber,
|
||||
purposeNumber=0,
|
||||
coordinates=self.coordinates,
|
||||
|
|
@ -109,9 +109,11 @@ class label(geometry):
|
|||
self.zoom = zoom
|
||||
self.size = 0
|
||||
|
||||
debug.info(3,"creating label " + self.text + " " + str(self.layerNumber) + " " + str(self.offset))
|
||||
|
||||
def gds_write_file(self, newLayout):
|
||||
"""Writes the text label to GDS"""
|
||||
debug.info(3, "writing label (" + str(self.layerNumber) + "):" + self.text)
|
||||
debug.info(3, "writing label (" + str(self.layerNumber) + "): " + self.text)
|
||||
newLayout.addText(text=self.text,
|
||||
layerNumber=self.layerNumber,
|
||||
purposeNumber=0,
|
||||
|
|
@ -140,14 +142,17 @@ class rectangle(geometry):
|
|||
self.width = self.size[0]
|
||||
self.height = self.size[1]
|
||||
|
||||
debug.info(3, "creating rectangle (" + str(self.layerNumber) + "): "
|
||||
+ str(self.width) + "x" + str(self.height) + " @ " + str(self.offset))
|
||||
|
||||
|
||||
def gds_write_file(self, newLayout):
|
||||
"""Writes the rectangular shape to GDS"""
|
||||
snapped_offset=snap_to_grid(self.offset)
|
||||
debug.info(3, "writing rectangle (" + str(self.layerNumber) + "):"
|
||||
+ str(self.width) + "x" + str(self.height) + " @ " + str(snapped_offset))
|
||||
debug.info(3, "writing rectangle (" + str(self.layerNumber) + "): "
|
||||
+ str(self.width) + "x" + str(self.height) + " @ " + str(self.offset))
|
||||
newLayout.addBox(layerNumber=self.layerNumber,
|
||||
purposeNumber=0,
|
||||
offsetInMicrons=snapped_offset,
|
||||
offsetInMicrons=self.offset,
|
||||
width=self.width,
|
||||
height=self.height,
|
||||
center=False)
|
||||
|
|
|
|||
|
|
@ -111,9 +111,6 @@ class layout:
|
|||
|
||||
def add_rect(self, layer, offset, width, height):
|
||||
"""Adds a rectangle on a given layer,offset with width and height"""
|
||||
debug.info(3, "adding rectangle (" + str(layer) + ") :"
|
||||
+ str(width) + "x" + str(height) + " @ " + str(offset))
|
||||
|
||||
# negative layers indicate "unused" layers in a given technology
|
||||
layerNumber = techlayer[layer]
|
||||
if layerNumber >= 0:
|
||||
|
|
@ -132,7 +129,6 @@ class layout:
|
|||
|
||||
def add_label(self, text, layer, offset=[0,0],zoom=1):
|
||||
"""Adds a text label on the given layer,offset, and zoom level"""
|
||||
debug.info(3,"add label " + text + " " + str(layer) + " " + str(offset))
|
||||
# negative layers indicate "unused" layers in a given technology
|
||||
layerNumber = techlayer[layer]
|
||||
if layerNumber >= 0:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ from tech import layer as techlayer
|
|||
import debug
|
||||
import design
|
||||
from vector import vector
|
||||
from utils import snap_to_grid
|
||||
|
||||
class path(design.design):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ class router:
|
|||
# add_wire will filter out duplicates
|
||||
pt = vector(p[0],p[1])
|
||||
pt=pt.scale(track_factor)+self.offset
|
||||
return snap_to_double_grid(pt)
|
||||
return snap_to_grid(pt)
|
||||
|
||||
def convert_shape_to_tracks(self,shape,round_bigger=True):
|
||||
"""
|
||||
|
|
@ -309,22 +309,6 @@ class router:
|
|||
|
||||
|
||||
# FIXME: This should be replaced with vector.snap_to_grid at some point
|
||||
def snap_to_double_grid(offset):
|
||||
"""
|
||||
Changes the coodrinate to match the grid settings
|
||||
"""
|
||||
# This is special because we are using the centerline
|
||||
# technique, so the edges could be off grid if we
|
||||
# have an odd width (e.g. metal1 width = 0.065)
|
||||
grid = 2*tech.drc["grid"]
|
||||
x = offset[0]
|
||||
y = offset[1]
|
||||
# this gets the nearest integer value
|
||||
xgrid = int(round(round((x / grid), 2), 0))
|
||||
ygrid = int(round(round((y / grid), 2), 0))
|
||||
xoff = xgrid * grid
|
||||
yoff = ygrid * grid
|
||||
return vector(xoff, yoff)
|
||||
|
||||
def snap_to_grid(offset):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import design
|
|||
from contact import contact
|
||||
from path import path
|
||||
|
||||
|
||||
class wire(path):
|
||||
"""
|
||||
Object metal wire; given the layer type
|
||||
|
|
@ -38,10 +37,7 @@ class wire(path):
|
|||
|
||||
def setup_layers(self):
|
||||
(horiz_layer, via_layer, vert_layer) = self.layer_stack
|
||||
if (via_layer != None):
|
||||
self.via_layer_name = via_layer
|
||||
else:
|
||||
self.via_layer_name = None
|
||||
self.via_layer_name = via_layer
|
||||
|
||||
self.vert_layer_name = vert_layer
|
||||
self.vert_layer_width = drc["minwidth_{0}".format(vert_layer)]
|
||||
|
|
@ -60,14 +56,9 @@ class wire(path):
|
|||
""" Add a via and corner square at every corner of the path."""
|
||||
pl = self.pairwise(self.position_list)
|
||||
from itertools import izip
|
||||
if self.via_layer_name == None:
|
||||
c_height = 0
|
||||
c_width = 0
|
||||
c = None
|
||||
else:
|
||||
c = self.c = contact(self.layer_stack, (1, 1))
|
||||
c_width = c.width
|
||||
c_height = c.height
|
||||
self.c=contact(self.layer_stack, (1, 1))
|
||||
c_width = self.c.width
|
||||
c_height = self.c.height
|
||||
orient = None # orientation toggler
|
||||
offset = [0, 0]
|
||||
|
||||
|
|
@ -96,11 +87,9 @@ class wire(path):
|
|||
offset[1] - 0.5*self.horiz_layer_width]
|
||||
self.switch_pos_list.append(temp_offset)
|
||||
via_offset = self.switch_pos_list[-1]
|
||||
if c:
|
||||
self.add_inst(name="via_{0}_{1}".format(v, w),
|
||||
mod=c,
|
||||
offset=via_offset,
|
||||
rotate=90)
|
||||
self.add_via(layers=self.layer_stack,
|
||||
offset=via_offset,
|
||||
rotate=90)
|
||||
corner_offset = [via_offset[0] \
|
||||
- 0.5*(c_height + self.vert_layer_width),
|
||||
via_offset[1] \
|
||||
|
|
@ -121,11 +110,9 @@ class wire(path):
|
|||
offset[1] - 0.5*c_width]
|
||||
self.switch_pos_list.append(temp_offset)
|
||||
via_offset = self.switch_pos_list[-1]
|
||||
if c:
|
||||
self.add_inst(name="via{0}_{1}".format(v, w),
|
||||
mod=c,
|
||||
offset=self.switch_pos_list[-1],
|
||||
rotate=90)
|
||||
self.add_via(layers=self.layer_stack,
|
||||
offset=self.switch_pos_list[-1],
|
||||
rotate=90)
|
||||
corner_offset = [via_offset[0] \
|
||||
- 0.5*(c_height + self.vert_layer_width),
|
||||
via_offset[1] \
|
||||
|
|
|
|||
Loading…
Reference in New Issue