;================================================================================ ; Robert Johnstone ; Simon Fraser University ; ; Copyright 2000,2002 Robert W. Johnstone ;-------------------------------------------------------------------------------- ; 2002/10/25 ; - updated calls to dbCreateRoundRect to matched new parameter list ; 2000/08/14 ; - created unless( boundp( 'admLibraryName ) warn( "Setting the destination library to default value of ADM" ) admLibraryName = "ADM" ) pcDefinePCell( list( ddGetObj(admLibraryName) "staple" "layout" ) ; end of list for first argument ( ( width 12.0 ) ( space 6.0 ) ( chamfer 0.0 ) ( include_poly0 "boolean" nil ) ) ; end of parameter list prog( ( pcTechFile rodObj p0p2_enclosure a2_nomSpacing a2_nomWidth p2_nomWidth p2a2_enclosure w_a w_1 w_2 sp tmpx tmpy ) ; load tech file rules pcTechFile = techGetTechFile( pcCellView ) p0p2_enclosure = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY0" "POLY2" ) unless( p0p2_enclosure warn("minEnclosure rule for POLY0->POLY2 not set") ) a2_nomSpacing = techGetSpacingRule( pcTechFile "nomSpacing" "ANCHOR2" ) unless( a2_nomSpacing warn("nomSpacing rule for ANCHOR2 not set") ) a2_nomWidth = techGetSpacingRule( pcTechFile "nomWidth" "ANCHOR2" ) unless( a2_nomWidth warn("nomWidth rule for ANCHOR2 not set") ) p2_nomWidth = techGetSpacingRule( pcTechFile "nomWidth" "POLY2" ) unless( p2_nomWidth warn("nomWidth rule for POLY2 not set") ) p2a2_enclosure = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY2" "ANCHOR2" ) unless( p2a2_enclosure warn("minEnclosure rule for POLY2->ANCHOR2 not set") ) ; check parameters width = if( (widthwidth-2*p2a2_enclosure) a2_nomWidth width-2*p2a2_enclosure ) w_2 = if( (a2_nomWidth+2*p2a2_enclosure>width) a2_nomWidth+2*p2a2_enclosure width ) space = if( (spaceparamVal - 2*SPCInfo->increment ) ) rodObj = rodCreateRect( ?layer "ANCHOR2" ?bBox list( -w_a:sp w_a:sp+a2_nomWidth ) ) rodAssignHandleToParameter( ?parameter "space" ?rodObj rodObj ?handleName "lowerCenter" ?displayName "space" ?stretchDir "y" ?userFunction lambda( (SPCInfo) SPCInfo->paramVal - 2*SPCInfo->increment ) ) ; create poly2 overlayer if( (w_2-chamfer*0.5>w_1 && sp-p2a2_enclosure>0) then dbCreateRoundRect( pcCellView "POLY2" list( -w_2:-sp-a2_nomWidth-p2a2_enclosure w_2:-sp+p2a2_enclosure ) chamfer ) dbCreateRoundRect( pcCellView "POLY2" list( -w_2:sp-p2a2_enclosure w_2:sp+a2_nomWidth+p2a2_enclosure ) chamfer ) rodObj = rodCreateRect( ?layer "POLY2" ?bBox list( -w_1:-sp+p2a2_enclosure w_1:sp-p2a2_enclosure ) ) else w_1 = if( (w_2>w_1) w_2 w_1 ) tmpy = sp + a2_nomWidth + p2a2_enclosure rodObj = rodCreateRoundRect( "POLY2" chamfer -w_1 -tmpy w_1 tmpy ) ) rodAssignHandleToParameter( ?parameter "width" ?rodObj rodObj ?handleName list( "centerLeft" "centerRight" ) ?displayName "width" ?stretchDir "x" ?userFunction lambda( (SPCInfo) SPCInfo->paramVal + 2*SPCInfo->increment ) ) ; create poly0 enclosure if( (include_poly0==t) then tmpx = w_1 + p0p2_enclosure if( (w_2>w_1 && sp-p2a2_enclosure*2>0) then tmpx = w_1 + p0p2_enclosure tmpy = sp - p2a2_enclosure - p0p2_enclosure dbCreateRect( pcCellView "POLY0" list( -tmpx:-tmpy tmpx:tmpy ) ) tmpx = w_2 + p0p2_enclosure tmpy = sp - p2a2_enclosure - p0p2_enclosure dbCreateRoundRect( pcCellView "POLY0" list( -tmp:-sp-a2_nomWidth-p2a2_enclosure-p0p2_enclosure tmpx:-tmpy ) chamfer ) dbCreateRoundRect( pcCellView "POLY0" list( -tmpx:tmpy tmpx:sp+a2_nomWidth+p2a2_enclosure+p0p2_enclosure ) chamfer ) else tmpx = w_2 + p0p2_enclosure tmpy = sp + a2_nomWidth + p2a2_enclosure + p0p2_enclosure dbCreateRoundRect( pcCellView "POLY0" list( -tmpx:-tmpy tmpx:tmpy ) chamfer ) ) ) ; Create the instNamePrefix property dbReplaceProp( pcCellView "instNamePrefix" "string" "staple" ) ; set version string dbReplaceProp( pcCellView "version" "string" "1.4.1" ) ; body SKILL code returns value t return(t) ) )