Fixed rotated via bug. May still have a via-to-via spacing problem.

This commit is contained in:
mguthaus 2017-04-24 13:47:56 -07:00
parent 8a185ffc1a
commit 9b86083524
8 changed files with 13 additions and 6 deletions

View File

@ -57,8 +57,11 @@ class route(design.design):
plist = pairwise(self.path)
for p0,p1 in plist:
if p0.z != p1.z: # via
via_offset = vector(p0.x-0.5*self.c.width,p0.y-0.5*self.c.height)
self.add_via(self.layer_stack,via_offset)
# 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)
self.add_via(self.layer_stack,via_offset,rotate=90)
elif p0.x != p1.x and p0.y != p1.y: # diagonal!
debug.error("Non-changing direction!")
else:

View File

@ -178,13 +178,13 @@ class router:
# Make sure there's a pin enclosure on the source and dest
src_shape = self.convert_track_to_shape(contracted_path[0])
cell.add_rect(layer=self.layers[contracted_path[0].z],
cell.add_rect(layer=self.layers[2*contracted_path[0].z],
offset=src_shape[0],
width=src_shape[1].x-src_shape[0].x,
height=src_shape[1].y-src_shape[0].y)
dest_shape = self.convert_track_to_shape(contracted_path[-1])
cell.add_rect(layer=self.layers[contracted_path[-1].z],
cell.add_rect(layer=self.layers[2*contracted_path[-1].z],
offset=dest_shape[0],
width=dest_shape[1].x-dest_shape[0].x,
height=dest_shape[1].y-dest_shape[0].y)

View File

@ -10,6 +10,7 @@ import globals
import debug
import calibre
OPTS = globals.OPTS
class no_blockages_test(unittest.TestCase):
"""

View File

@ -10,6 +10,7 @@ import globals
import debug
import calibre
OPTS = globals.OPTS
class blockages_test(unittest.TestCase):
"""

View File

@ -10,6 +10,7 @@ import globals
import debug
import calibre
OPTS = globals.OPTS
class same_layer_pins_test(unittest.TestCase):
"""

View File

@ -10,6 +10,7 @@ import globals
import debug
import calibre
OPTS = globals.OPTS
class diff_layer_pins_test(unittest.TestCase):
"""

View File

@ -10,6 +10,7 @@ import globals
import debug
import calibre
OPTS = globals.OPTS
class two_nets_test(unittest.TestCase):
"""
@ -55,11 +56,9 @@ class two_nets_test(unittest.TestCase):
layer_stack =("metal1","via1","metal2")
r.route(layer_stack,src="A",dest="B")
r.add_route(self)
#self.gds_write("temp1.gds")
r.route(layer_stack,src="C",dest="D")
r.add_route(self)
#self.gds_write("temp2.gds")

View File

@ -4,6 +4,7 @@ import re
import unittest
import sys,os
sys.path.append(os.path.join(sys.path[0],".."))
sys.path.append(os.path.join(sys.path[0],"../.."))
import globals
(OPTS, args) = globals.parse_args()