Pin & Label Creation
Pin & Label Creation
cv=geGetEditCellView()
foreach(currentvia via
box=currentvia~>bBox
net=dbMakeNet(cv currentvia~>net~>term~>name)
pin=dbCreatePin(net pinFig)
pin~>term~>direction = "input"
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.
;; 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
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)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 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)
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
)
)
);; 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
))