;================================================================================ ; Robert Johnstone ; Simon Fraser University ; ; Copyright 2000,2001,2002 Robert W. Johnstone ;-------------------------------------------------------------------------------- ; 2002/02/21 ; -modified code to use poly and anchor variables, layers no longer hard coded ; -created spring_box_2 ; 2000/11/29 ; -creation date if( (!boundp( 'admLibraryName )) then warn( "Setting the destination library to default value of ADM" ) admLibraryName = "ADM" ) pcDefinePCell( list( ddGetObj(admLibraryName) "spring_box_2" "layout" ) ; end of list for first argument ( ( width 100.0 ) ( boxes 5 ) ( include_anchor t ) ( include_poly0 "boolean" nil ) ) ; end of parameter list prog( ; declare variables ( pcTechFile rodObj p0p_enclosure p_minSpacing p_minWidth p_nomWidth pa_enclosure a_nomWidth poly anchor y w2 ) ; set layers poly = "POLY2" anchor = "ANCHOR2" ; load tech file rules pcTechFile = techGetTechFile( pcCellView ) p0p_enclosure = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY0" poly ) if( (p0p_enclosure==nil) then warn(strcat( "minEnclosure rule for POLY0->" poly " not set") ) ) p_minSpacing = techGetSpacingRule( pcTechFile "minSpacing" poly ) if( (p_minSpacing==nil) then warn(strcat("minSpacing rule for " poly " not set") ) ) p_minWidth = techGetSpacingRule( pcTechFile "minWidth" poly ) if( (p_minWidth==nil) then warn(strcat("minWidth rule for " poly " not set") ) ) p_nomWidth = techGetSpacingRule( pcTechFile "nomWidth" poly ) if( (p_nomWidth==nil) then warn(strcat("nomWidth rule for " poly " not set") ) ) pa_enclosure = techGetOrderedSpacingRule( pcTechFile "minEnclosure" poly anchor ) if( (pa_enclosure==nil) then warn(strcat("minEnclosure rule for " poly "->" anchor " not set") ) ) a_nomWidth = techGetSpacingRule( pcTechFile "nomWidth" anchor ) if( (a_nomWidth==nil) then warn(strcat("nomWidth rule for " anchor " not set") ) ) ; check parameters boxes = if( (boxes<1) 1 boxes ) ; create first connection point dbCreateRect( pcCellView "TMP" list( -p_minWidth*0.5:-p_minWidth p_minWidth*0.5:0 ) ) dbCreateRect( pcCellView poly list( -p_minWidth*0.5:0 p_minWidth*0.5:p_minSpacing ) ) ; create boxes for( lp 0 boxes-1 y = lp * 2 * ( p_minWidth + p_minSpacing ) + p_minWidth dbCreateRect( pcCellView poly list( -width*0.5:y width*0.5:y+p_minWidth ) ) y = y + p_minWidth dbCreateRect( pcCellView poly list( -width*0.5:y -width*0.5+p_nomWidth:y+p_minSpacing ) ) dbCreateRect( pcCellView poly list( width*0.5:y width*0.5-p_nomWidth:y+p_minSpacing ) ) y = y + p_minSpacing dbCreateRect( pcCellView poly list( -width*0.5:y width*0.5:y+p_minWidth ) ) y = y + p_minWidth dbCreateRect( pcCellView poly list( -p_minWidth*0.5:y p_minWidth*0.5:y+p_minSpacing ) ) ) ; include POLY0 ground plane? if( (include_poly0==t) then dbCreateRect( pcCellView "POLY0" list( -width*0.5-p0p_enclosure:-p0p_enclosure width*0.5+p0p_enclosure:boxes*2*(p_minSpacing+p_minWidth)+p_minSpacing+p0p_enclosure) ) ) ; include anchor? y = boxes * 2 * ( p_minWidth + p_minSpacing ) + p_minWidth if( (include_anchor==t) then w2 = a_nomWidth + 2 * pa_enclosure dbCreateRect( pcCellView poly list( -w2*0.5:y w2*0.5:y+w2 ) ) dbCreateRect( pcCellView anchor list( -a_nomWidth*0.5:y+pa_enclosure a_nomWidth*0.5:y+pa_enclosure+a_nomWidth ) ) if( (include_poly0==t) then dbCreateRect( pcCellView "POLY0" list( -w2*0.5-p0p_enclosure:y-p0p_enclosure w2*0.5+p0p_enclosure:y+w2+p0p_enclosure)) ) else dbCreateRect( pcCellView "TMP" list( -p_minWidth*0.5:y p_minWidth*0.5:y+p_minWidth ) ) ) ; create stretch handles rodObj = rodGetObj( "" pcCellView ) rodAssignHandleToParameter( ?parameter "width" ?rodObj rodObj ?handleName list( "centerLeft" "centerRight" ) ?displayName "width" ?stretchDir "x" ?userFunction lambda( (SPCInfo) SPCInfo->paramVal + 2*SPCInfo->increment ) ) rodAssignHandleToParameter( ?parameter "boxes" ?rodObj rodObj ?handleName "upperCenter" ?displayName "boxes" ?stretchDir "y" ?updateIncrement 2*(p_minSpacing + p_minWidth) ?userFunction lambda( (SPCInfo) SPCInfo->paramVal + round(SPCInfo->increment/SPCInfo->userData) ) ?userData 2 * (p_minWidth + p_minSpacing) ) ; Create the instNamePrefix property dbReplaceProp( pcCellView "instNamePrefix" "string" "spring" ) ; set version string dbReplaceProp( pcCellView "version" "string" "1.0.1" ) ; body SKILL code returns value t return(t) ) ; end of body-of-SKILL-code prog ) ; ; end of pcDefinePCell