wire.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:OpenRAM 作者: mguthaus 项目源码 文件源码
def create_vias(self):
        """ Add a via and corner square at every corner of the path."""
        self.c=contact(self.layer_stack, (1, 1))
        c_width = self.c.width
        c_height = self.c.height

        from itertools import tee,islice
        nwise = lambda g,n=2: zip(*(islice(g,i,None) for i,g in enumerate(tee(g,n))))
        threewise=nwise(self.position_list,3)

        for (a, offset, c) in list(threewise):
            # add a exceptions to prevent a via when we don't change directions
            if a[0] == c[0]:
                continue
            if a[1] == c[1]:
                continue
            via_offset = [offset[0] + 0.5*c_height,
                           offset[1] - 0.5*c_width]
            self.obj.add_via(layers=self.layer_stack,
                             offset=via_offset,
                             rotate=90)
            corner_offset = [offset[0] - 0.5*(c_height + self.vert_layer_width),
                             offset[1] + 0.5*(c_width - self.horiz_layer_width)]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号