;================================================================================ ; Robert Johnstone ; Simon Fraser University ; ; Copyright 2000,2002 Robert W. Johnstone ;-------------------------------------------------------------------------------- ; 2002/08/07 ; - When margins are included, the pcell now writes MARGIN along the four ; edges ; 2002/06/03 ; - modified code because interafce to dbCreateRoundRect changed ; 2000/10/01 ; - created unless( boundp( 'admLibraryName ) warn( "Setting the destination library to default value of ADM" ) admLibraryName = "ADM" ) pcDefinePCell( list( ddGetObj(admLibraryName) "frame" "layout" ) ; end of list for first argument ( ( width 10000.0 ) ( height 10000.0 ) ( margin 250.0 ) ( include_pads t ) ( pad_count 48 ) ( pad_size 100.0 ) ( pad_chamfer 0.0 ) ) ; end of parameter list prog( ; declare variables ( pcTechFile p0p1_enclosure p1a1_enclosure p1p2_enclosure p2m_enclosure p2v_enclosure v_nomWidth m_nomWidth w h x y big_e tmp ) ; load tech file rules pcTechFile = techGetTechFile( pcCellView ) p0p1_enclosure = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY0" "POLY1" ) unless(p0p1_enclosure warn("minEnclosure rule for POLY0->POLY1 not set") ) p1a1_enclosure = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY1" "ANCHOR1" ) unless(p1a1_enclosure warn("minEnclosure rule for POLY1->ANCHOR1 not set") ) p1p2_enclosure = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY1" "POLY2" ) unless(p1p2_enclosure warn("minEnclosure rule for POLY1->POLY2 not set") ) p2m_enclosure = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY2" "METAL" ) unless(p2m_enclosure warn("minEnclosure rule for POLY2->METAL not set") ) p2v_enclosure = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY2" "P1P2VIA" ) unless(p2v_enclosure warn("minEnclosure rule for POLY2->P1P2VIA not set") ) v_nomWidth = techGetSpacingRule( pcTechFile "nomWidth" "P1P2VIA" ) unless(v_nomWidth warn("nomWidth rule for P1P2VIA not set") ) m_nomWidth = techGetSpacingRule( pcTechFile "nomWidth" "METAL" ) unless(m_nomWidth warn("nomWidth rule for METAL not set") ) ; check parameters margin = if( (margin<0) 0 margin ) width = if( (width<2*margin) 2*margin width ) height = if( (height<2*margin) 2*margin height ) tmp = pad_count - floor( pad_count / 4 ) * 4 pad_count = pad_count + if( (tmp > 0) 4-tmp 0 ) pad_size = if( (pad_size0) then w = w - margin h = h - margin dbCreateRect( pcCellView "TMP" list( -w:-h w:h ) ) dbCreateLabel( pcCellView "TMP" 0:-h-margin*0.5 "MARGIN" "centerCenter" "R0" "stick" margin*0.5 ) dbCreateLabel( pcCellView "TMP" 0:h+margin*0.5 "MARGIN" "centerCenter" "R0" "stick" margin*0.5 ) dbCreateLabel( pcCellView "TMP" -w-margin*0.5:0 "MARGIN" "centerCenter" "R90" "stick" margin*0.5 ) dbCreateLabel( pcCellView "TMP" w+margin*0.5:0 "MARGIN" "centerCenter" "R90" "stick" margin*0.5 ) ) ; add pads if( (include_pads==t) then x = width*0.5 - margin - big_e - pad_size * 0.5 tmp = height - 2*margin - 3*pad_size - 2*big_e for( lp 1 pad_count/4 y = (lp - 0.5 - pad_count/8) * tmp / pad_count * 4 w = pad_size*0.5 dbCreateRoundRect( pcCellView "METAL" list( x-w:y-w x+w:y+w ) pad_chamfer ) dbCreateRoundRect( pcCellView "METAL" list( -x-w:y-w -x+w:y+w ) pad_chamfer ) w = w + p2m_enclosure dbCreateRoundRect( pcCellView "POLY2" list( x-w:y-w x+w:y+w ) pad_chamfer ) dbCreateRoundRect( pcCellView "POLY2" list( -x-w:y-w -x+w:y+w ) pad_chamfer ) w = w - p2v_enclosure dbCreateRoundRect( pcCellView "P1P2VIA" list( x-w:y-w x+w:y+w ) pad_chamfer ) dbCreateRoundRect( pcCellView "P1P2VIA" list( -x-w:y-w -x+w:y+w ) pad_chamfer ) w = w + p2v_enclosure + p1p2_enclosure dbCreateRoundRect( pcCellView "POLY1" list( x-w:y-w x+w:y+w ) pad_chamfer ) dbCreateRoundRect( pcCellView "POLY1" list( -x-w:y-w -x+w:y+w ) pad_chamfer ) w = w - p1a1_enclosure dbCreateRoundRect( pcCellView "ANCHOR1" list( x-w:y-w x+w:y+w ) pad_chamfer ) dbCreateRoundRect( pcCellView "ANCHOR1" list( -x-w:y-w -x+w:y+w ) pad_chamfer ) w = w + p1a1_enclosure + p0p1_enclosure dbCreateRoundRect( pcCellView "POLY0" list( x-w:y-w x+w:y+w ) pad_chamfer ) dbCreateRoundRect( pcCellView "POLY0" list( -x-w:y-w -x+w:y+w ) pad_chamfer ) ) y = height*0.5 - margin - big_e - pad_size * 0.5 tmp = width - 2*margin - 3*pad_size - 2*big_e for( lp 1 pad_count/4 x = (lp - 0.5 - pad_count/8) * tmp / pad_count * 4 w = pad_size*0.5 dbCreateRoundRect( pcCellView "METAL" list( x-w:y-w x+w:y+w ) pad_chamfer ) dbCreateRoundRect( pcCellView "METAL" list( x-w:-y-w x+w:-y+w ) pad_chamfer ) w = w + p2m_enclosure dbCreateRoundRect( pcCellView "POLY2" list( x-w:y-w x+w:y+w ) pad_chamfer ) dbCreateRoundRect( pcCellView "POLY2" list( x-w:-y-w x+w:-y+w ) pad_chamfer ) w = w - p2v_enclosure dbCreateRoundRect( pcCellView "P1P2VIA" list( x-w:y-w x+w:y+w ) pad_chamfer ) dbCreateRoundRect( pcCellView "P1P2VIA" list( x-w:-y-w x+w:-y+w ) pad_chamfer ) w = w + p2v_enclosure + p1p2_enclosure dbCreateRoundRect( pcCellView "POLY1" list( x-w:y-w x+w:y+w ) pad_chamfer ) dbCreateRoundRect( pcCellView "POLY1" list( x-w:-y-w x+w:-y+w ) pad_chamfer ) w = w - p1a1_enclosure dbCreateRoundRect( pcCellView "ANCHOR1" list( x-w:y-w x+w:y+w ) pad_chamfer ) dbCreateRoundRect( pcCellView "ANCHOR1" list( x-w:-y-w x+w:-y+w ) pad_chamfer ) w = w + p1a1_enclosure + p0p1_enclosure dbCreateRoundRect( pcCellView "POLY0" list( x-w:y-w x+w:y+w ) pad_chamfer ) dbCreateRoundRect( pcCellView "POLY0" list( x-w:-y-w x+w:-y+w ) pad_chamfer ) ) ) ; Create the instNamePrefix property dbReplaceProp( pcCellView "instNamePrefix" "string" "frame" ) ; set version string dbReplaceProp( pcCellView "version" "string" "1.4.1" ) ; body SKILL code returns value t return(t) ) ; end of body-of-SKILL-code prog ) ; ; end of pcDefinePCell