DRC:moving cell origin to a point (let's say 0,0)

Hi Experts,

I would like to filter some layers and then apply some kind of transform or move the lower-left of the bbox to 0,0. using DRC script. with GUI it is quite easy using Move selection to 0, 0 with Reposition selection by using as "Left" as reference point.

Thanks & Regards
Rambir

Comments

  • Hello Rambir,
    The DRC engine use Ruby so you could use a transformation. I attach 2 functions here (but it's in python) so you need to translate. At least you see how you could change the origin.
    Best Regards,
    Andy

    def adjustOrigin(layoutB,topcell):
           """
           adjust cell origin lower left corner
           """
           bbox= topcell.bbox()
           trans = db.Trans(db.Point((-bbox.left), (-bbox.bottom)))
          #all instances 
          for inst in layoutB.top_cell().each_inst():
               layoutB.top_cell().transform(inst,trans)
    
          # all shapes
           for li in layoutB.layer_indices():
             for shape in layoutB.top_cell().each_shape(li):
               layoutB.top_cell().shapes(li).transform(shape,trans)
           layoutB.update()
           return(layoutB)
    
    def adjustOriginCenter(layoutB,topcell):
           """
           adjust cell origin centerpoint
           """
           bbox= topcell.bbox()
           trans = db.Trans.new(-bbox.center())
           for inst in layoutB.top_cell().each_inst():
               layoutB.top_cell().transform(inst,trans)
    
           for li in layoutB.layer_indices():
             for shape in layoutB.top_cell().each_shape(li):
               layoutB.top_cell().shapes(li).transform(shape,trans)
           layoutB.update()
           return(layoutB)
    
  • @andyL thanks for sharing this!

    Matthias

  • Thank you Andy.. works wonders

Sign In or Register to comment.