0% found this document useful (0 votes)
42 views7 pages

Pin & Label Creation

This document contains procedures for filling vias in a layout. The RGfillVias procedure takes a cell view and optional dontFill layers as input. It gets the selected shapes, iterates through metal layers, and uses temporary layers to create masks for shaping filling vias between the metal layers. The RGshapeFillVias procedure takes a fill shape, via specification, and grid as input. It creates a mask for the fill shape and then repeatedly inserts rectangular via shapes within the mask area according to the via specification parameters. The RGgetLayerShapes procedure gets all shapes for a given layer and purpose in a cell view and applies optional filtering, processing, or deletion of the shapes.

Uploaded by

Anand Acahri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views7 pages

Pin & Label Creation

This document contains procedures for filling vias in a layout. The RGfillVias procedure takes a cell view and optional dontFill layers as input. It gets the selected shapes, iterates through metal layers, and uses temporary layers to create masks for shaping filling vias between the metal layers. The RGshapeFillVias procedure takes a fill shape, via specification, and grid as input. It creates a mask for the fill shape and then repeatedly inserts rectangular via shapes within the mask area according to the via specification parameters. The RGgetLayerShapes procedure gets all shapes for a given layer and purpose in a cell view and applies optional filtering, processing, or deletion of the shapes.

Uploaded by

Anand Acahri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 7

procedure(hello()

cv=geGetEditCellView()

via=setof(f cv~>vias f~>objType == "stdVia")

foreach(currentvia via

if(currentvia~>viaHeader~>viaDefName == "M5_M4" then

if(currentvia~>net~>term~>name == "vccint" || currentvia~>net~>term~>name == "gnd" || currentvia~


then

box=currentvia~>bBox

pinFig=dbCreateRect(cv '("M14" "pin") box)

net=dbMakeNet(cv currentvia~>net~>term~>name)

pin=dbCreatePin(net pinFig)

pin~>term~>direction = "input"

lable=dbCreateLabel(cv '("M14" "pin") centerBox(box) currentvia~>net~>term~>name "centerCenter"


"R0" "roman" 0.01)

leAttachFig(lable pin~>fig)

dbAddFigToNet(pin~>fig net)))))
Have fun. This makes a whole lot of contacts. Masks the contact sets by
the top and bottom layers of the vias undersized by the via clearance.
Then screen the remaining shapes to make sure they are all still full
size. This was even tied to a bindkey.

Make sure you get the via properties correct.

;; RGfillVias() - fill areas below selected metals with vias

;; Contains
;; RGfillVias( ?cv - cellView, defaults togeGetEditCellView()
;; ?dontFill - layerPurposePair, defaults to NIL
;; )
;; does via fill below the selected set in the current cell (cv)
;; RGshapeFillVias( cv fillShape viaSpec ?grid 0.005)
;; does via fill guided by the fillShape of the specified via
;; RGgetLayerShapes( cv layer purpose ?applyToShape func
;; ?applyToShapes func ?delete t)
;; general operator/iterator on shapes

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RGfillVias
procedure( RGfillVias(@key cv dontFill )
let( (selectedShapes viaLayers viaProps
top bot via maskShape
;; layer definitions
(poly '("POLY1" "drawing"))
(m1 '("METAL1" "drawing"))
(m2 '("METAL2" "drawing"))
(m3 '("METAL3" "drawing"))
(m4 '("METAL4" "drawing"))
(m5 '("METAL5" "drawing"))
(m6 '("METAL6" "drawing"))
;; via definitions with properties
(contactprops '(nil layer ("CONT" "drawing")
size 0.22 space 0.25
over 0.1 res 0.02 ))
(via12props '(nil layer ("VIA12" "drawing")
size 0.26 space 0.26
over 0.06 res 0.02 ))
(via23props '(nil layer ("VIA23" "drawing")
size 0.26 space 0.26
over 0.06 res 0.02 ))
(via34props '(nil layer ("VIA34" "drawing")
size 0.26 space 0.26
over 0.06 res 0.02 ))
(via45props '(nil layer ("VIA45" "drawing")
size 0.26 space 0.26
over 0.06 res 0.02 ))
(via56props '(nil layer ("VIA56" "drawing")
size 0.36 space 0.35
over 0.51 res 0.02 ))
;; temporary layers
(tly1pp '("y0" "drawing")) ;; must not be
;; clobbered by RGshapeFillVias
(tly2pp '("y1" "drawing")) ;; ok to be
;; clobbered
) ;; END let

if( !cv then cv = geGetEditCellView())


if( !cv then
printf("ERROR: RGfillVias, can't find cell view\n")
else ;; good to end

selectedShapes = geGetSelectedSet()
if( !selectedShapes then
printf("ERROR: RGfillVias, no selected shapes, select
shapes to via down from\n")
else ;; good to end

;; Finish Datatables
;; source layers in order
viaLayers = list(poly m1 m2 m3 m4 m5 m6)
;; via layers in matching order, contact is below m1
viaProps = list(nil contactprops via12props
via23props via34props via45props via56props)

foreach( shape selectedShapes


for(lidx 1 length(viaLayers)-1
top = nth(lidx viaLayers)
;; check to see if top of a via layer lpp
if( and( car(shape->lpp) == car(top)
cadr( shape->lpp) == cadr(top)) then
printf("Vias down from layer %L in area %L\n"
shape->lpp shape->bBox)
;; shape is on top of via layer
bot = nth(lidx-1 viaLayers)
maskShape = dbCopyFig(shape cv)
maskShape->lpp = tly1pp ;; mask1 is tly1pp
leLayerAnd(cv tly1pp bot tly2pp)
;;tly2pp = shape && bottomLayer
dbDeleteObject(maskShape) ;; clear tly1pp
if(dontFill then
leLayerAndNot(cv tly2pp dontFill
tly1pp) ;; tly1pp = mask &! dontfill
else
leLayerAnd(cv tly2pp tly2pp tly1pp)
)
RGgetLayerShapes( cv car(tly2pp) cadr(tly2pp) ?delete t)

;; do fill of all shapes on tly1pp


via = nth(lidx viaProps)
RGgetLayerShapes( cv car(tly1pp) cadr(tly1pp)
?applyToShape
lambda( (shape)
RGshapeFillVias(cv shape via)
)
)
;; cleanup
RGgetLayerShapes( cv car(tly1pp) cadr(tly1pp) ?delete t)
) ;; END if
);; END for lidx
) ;; END foreach shape
)) ;; END tests
)) ;; END let procedure RGfillVias

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RGshapeFillVias
procedure( RGshapeFillVias(cv fillShape viaspec @key
(grid 0.005))
let( (sx1 sy1 sx2 sy2 xl
;; temporary layers
maskShape
(tly1pp '("y1" "drawing"))
(tly2pp '("y2" "drawing"))
(tly3pp '("y3" "drawing"))
(epsilon 0.1) ;; normalized rounding offset
)
;; vias
;; clear temporary layers
RGgetLayerShapes(cv car(tly1pp) cadr(tly1pp)
?delete t)
RGgetLayerShapes(cv car(tly2pp) cadr(tly2pp)
?delete t)
RGgetLayerShapes(cv car(tly3pp) cadr(tly3pp)
?delete t)

;; start with original shape and size of shape


maskShape = dbCopyFig(fillShape cv)
maskShape->lpp = tly2pp
sx1 = caar(maskShape->bBox)
sy1 = cadar(maskShape->bBox)
sx2 = caadr(maskShape->bBox)
sy2 = cadadr(maskShape->bBox)
;; tly1 is masking shape for via coverage
if( viaspec->over then
;; shrink fill area by viaspec->over
leLayerSize(cv tly2pp -viaspec->over tly1pp)
sx1 = sx1 + viaspec->over
sx2 = sx2 - viaspec->over
sy1 = sy1 + viaspec->over
sy2 = sy2 - viaspec->over
else
leLayerSize(cv tly2pp 0 tly1pp)
)
dbDeleteObject(maskShape)

;; now fill entier bBox area with via shapes in tly2pp


while( sy1<sy2
xl = sx1
while( xl<sx2
dbCreateRect(cv tly2pp list(list(xl sy1)
list(xl+viaspec->size sy1+viaspec->size)))
xl = xl+viaspec->size+viaspec->space
)
sy1 = sy1+viaspec->size+viaspec->space
)

;; apply mask to tly3pp


leLayerAnd(cv tly1pp tly2pp tly3pp)

;; delete clipped shapes


RGgetLayerShapes(cv car(tly3pp) cadr(tly3pp)
?applyToShape
lambda( (shape) ;; rectangle of size viaspec->size
if( or( shape->objType != "rect"

fix((caadr(shape->bBox)-caar(shape->bBox))/grid+epsilon)
!= fix(viaspec->size/grid+epsilon)

fix((cadadr(shape->bBox)-cadar(shape->bBox))/grid+epsilon)

!= fix(viaspec->size/grid+epsilon)
) then
dbDeleteObject(shape)
)
) ;; END lambda
)

;; move good shapes to contact layer


;;printf("INFO: vias to layer %s %s\n",car(viaspec->layer)
cadr(viaspec->layer))
leLayerAnd(cv tly1pp tly3pp viaspec->layer)
;; clear temporary layers
RGgetLayerShapes(cv car(tly1pp) cadr(tly1pp)
?delete t)
RGgetLayerShapes(cv car(tly2pp) cadr(tly2pp)
?delete t)
RGgetLayerShapes(cv car(tly3pp) cadr(tly3pp)
?delete t)

)
);; END RGshapeFillVias

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
RGgetLayerShapes
(procedure RGgetLayerShapes( cv layer purpose
@key (delete nil) (applyToShape nil)
(applyToShapes nil))
(let (shapes)
foreach( lpp cv~>layerPurposePairs
if( and( lpp~>layerName==layer
lpp~>purpose==purpose) then
shapes=lpp~>shapes
))

if( length(shapes) != 0 then


if( applyToShapes then ;; applyToShapes
apply(applyToShapes list(shapes))
)
if( applyToShape then ;; applyToShape
foreach( shape shapes
apply(applyToShape list(shape)))
)
if( delete then ;; delete
foreach( shape shapes
dbDeleteObject( shape ))
)
)
shapes
)
) ;; END procedure RGgetLayerShapes

You might also like