R
Richard Griffith
Guest
Aby wrote:
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
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Have fun. This makes a whole lot of contacts. Masks the contact sets byHi everyone,
I am trying to write some SKILL code for generating a custom power
grid. After dumping the metal rails at different layers, I am now
trying to create vias that would connect rails on different metal
layers. Is there any function in SKILL that would compute the overlap
region between the metal rails at different layers and automatically
insert vias?
Would appreciate any comments.
saby.
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
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----