;================================================================================ ; Robert Johnstone ; Simon Fraser University ; ; Copyright 2000,2001,2002 Robert W. Johnstone ;-------------------------------------------------------------------------------- ; 2002/05/30 ; - update function parameters to make them easier to use ; 2001/05/21 ; - created these routines procedure( techGetMumpsPinSize( pcTechFile pin_size ) let( ; declare variables ( p1p2_enclosure p2v_enclosure p2m_enclosure v_minWidth m_minWidth tmp ) ; get technology parameters p1p2_enclosure = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY1" "POLY2" ) unless( p1p2_enclosure warn("minEnclosure rule for POLY1->POLY2 not set") ) p2v_enclosure = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY2" "P1P2VIA" ) unless( p2v_enclosure warn("minEnclosure rule for POLY2->P1P2VIA not set") ) p2m_enclosure = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY2" "METAL" ) unless( p2m_enclosure warn("minEnclosure rule for POLY2->METAL not set") ) v_minWidth = techGetSpacingRule( pcTechFile "minWidth" "P1P2VIA" ) unless( v_minWidth warn("minWidth rule for P1P2VIA not set") ) m_minWidth = techGetSpacingRule( pcTechFile "minWidth" "METAL" ) unless( m_minWidth warn("minWidth rule for METAL not set") ) ; modify pin size tmp = m_minWidth + p2m_enclosure*2 + p1p2_enclosure*2 pin_size = if( (pin_sizeANCHOR1 not set") ) e_p2 = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY1" "POLY2" ) unless( e_p2 warn("minEnclosure rule for POLY1->POLY2 not set") ) e_v = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY2" "P1P2VIA" ) unless( e_v warn("minEnclosure rule for POLY2->P1P2VIA not set") ) e_m = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY2" "METAL" ) unless( e_m warn("minEnclosure rule for POLY2->METAL not set") ) ; get x and y position x = xCoord( pt ) y = yCoord( pt ) ; create figures w = width * 0.5 pcShape = dbCreateRoundRect( pcCellView "POLY1" list( x-w:y-w x+w:y+w ) c ) when( pcNet dbCreatePin( pcNet pcShape ) ) w = width * 0.5 - e_a1 dbCreateRoundRect( pcCellView "ANCHOR1" list( x-w:y-w x+w:y+w ) c ) w = width * 0.5 - e_p2 pcShape = dbCreateRoundRect( pcCellView "POLY2" list( x-w:y-w x+w:y+w ) c ) when( pcNet dbCreatePin( pcNet pcShape ) ) w = width * 0.5 - e_p2 - e_v dbCreateRoundRect( pcCellView "P1P2VIA" list( x-w:y-w x+w:y+w ) c ) w = width * 0.5 - e_p2 - e_m pcShape = dbCreateRoundRect( pcCellView "METAL" list( x-w:y-w x+w:y+w ) c ) pcPin = when( pcNet dbCreatePin( pcNet pcShape ) ) ; create text display when( pcNet pcText = dbCreateTextDisplay( pcPin~>term pcPin~>term "TMP" t x:y "centerCenter" "R0" "stick" width*0.5 t nil t nil t "name" nil) pcText~>parent = pcShape ) ;return pin pcPin )) procedure( dbCreateMumpsRect( pcCellView pcNet bBox ) let( ; declare variables ( pcTechFile pcShape pcPin pcText e_a1 e_p2 e_v e_m x1 y1 x2 y2 ) ; get tech file pcTechFile = techGetTechFile( pcCellView ) e_a1 = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY1" "ANCHOR1" ) unless( e_a1 warn("minEnclosure rule for POLY1->ANCHOR1 not set") ) e_p2 = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY1" "POLY2" ) unless( e_p2 warn("minEnclosure rule for POLY1->POLY2 not set") ) e_v = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY2" "P1P2VIA" ) unless( e_v warn("minEnclosure rule for POLY2->P1P2VIA not set") ) e_m = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY2" "METAL" ) unless( e_m warn("minEnclosure rule for POLY2->METAL not set") ) ; get coordinates x1 = xCoord( lowerLeft( bBox ) ) y1 = yCoord( lowerLeft( bBox ) ) x2 = xCoord( upperRight( bBox ) ) y2 = yCoord( upperRight( bBox ) ) ; create figures pcShape = dbCreateRect( pcCellView "POLY1" list( x1:y1 x2:y2 ) ) when( pcNet dbCreatePin( pcNet pcShape ) ) x1 = x1 + e_a1 x2 = x2 - e_a1 y1 = y1 + e_a1 y2 = y2 - e_a1 dbCreateRect( pcCellView "ANCHOR1" list( x1:y1 x2:y2 ) ) x1 = x1 + e_p2 - e_a1 x2 = x2 - e_p2 + e_a1 y1 = y1 + e_p2 - e_a1 y2 = y2 - e_p2 + e_a1 pcShape = dbCreateRect( pcCellView "POLY2" list( x1:y1 x2:y2 ) ) when( pcNet dbCreatePin( pcNet pcShape ) ) x1 = x1 + e_v x2 = x2 - e_v y1 = y1 + e_v y2 = y2 - e_v dbCreateRect( pcCellView "P1P2VIA" list( x1:y1 x2:y2 ) ) x1 = x1 + e_m - e_v x2 = x2 - e_m + e_v y1 = y1 + e_m - e_v y2 = y2 - e_m + e_v pcShape = dbCreateRect( pcCellView "METAL" list( x1:y1 x2:y2 ) ) pcPin = when( pcNet dbCreatePin( pcNet pcShape ) ) ; create text display when( pcNet x1 = xCoord( lowerLeft( bBox ) ) y1 = yCoord( lowerLeft( bBox ) ) x2 = xCoord( upperRight( bBox ) ) y2 = yCoord( upperRight( bBox ) ) pcText = dbCreateTextDisplay( pcPin~>term pcPin~>term "TMP" t (x1+x2)*0.5:(y1+y2)*0.5 "centerCenter" "R0" "stick" min(abs(x2-x1),abs(y2-y1))*0.5 t nil t nil t "name" nil) pcText~>parent = pcShape ) ;return pin pcPin )) procedure( dbCreateMumpsRoundRect( pcCellView pcNet bBox c ) let( ; declare variables ( pcTechFile pcShape pcPin pcText e_a1 e_p2 e_v e_m x1 y1 x2 y2 ) ; get tech file pcTechFile = techGetTechFile( pcCellView ) e_a1 = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY1" "ANCHOR1" ) unless( e_a1 warn("minEnclosure rule for POLY1->ANCHOR1 not set") ) e_p2 = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY1" "POLY2" ) unless( e_p2 warn("minEnclosure rule for POLY1->POLY2 not set") ) e_v = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY2" "P1P2VIA" ) unless( e_v warn("minEnclosure rule for POLY2->P1P2VIA not set") ) e_m = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY2" "METAL" ) unless( e_m warn("minEnclosure rule for POLY2->METAL not set") ) ; get coordinates x1 = xCoord( lowerLeft( bBox ) ) y1 = yCoord( lowerLeft( bBox ) ) x2 = xCoord( upperRight( bBox ) ) y2 = yCoord( upperRight( bBox ) ) ; create figures pcShape = dbCreateRoundRect( pcCellView "POLY1" list( x1:y1 x2:y2 ) c ) when( pcNet dbCreatePin( pcNet pcShape ) ) x1 = x1 + e_a1 x2 = x2 - e_a1 y1 = y1 + e_a1 y2 = y2 - e_a1 dbCreateRoundRect( pcCellView "ANCHOR1" list( x1:y1 x2:y2 ) c ) x1 = x1 + e_p2 - e_a1 x2 = x2 - e_p2 + e_a1 y1 = y1 + e_p2 - e_a1 y2 = y2 - e_p2 + e_a1 pcShape = dbCreateRoundRect( pcCellView "POLY2" list( x1:y1 x2:y2 ) c ) when( pcNet dbCreatePin( pcNet pcShape ) ) x1 = x1 + e_v x2 = x2 - e_v y1 = y1 + e_v y2 = y2 - e_v dbCreateRoundRect( pcCellView "P1P2VIA" list( x1:y1 x2:y2 ) c ) x1 = x1 + e_m - e_v x2 = x2 - e_m + e_v y1 = y1 + e_m - e_v y2 = y2 - e_m + e_v pcShape = dbCreateRoundRect( pcCellView "METAL" list( x1:y1 x2:y2 ) c ) pcPin = when( pcNet dbCreatePin( pcNet pcShape ) ) ; create text display when( pcNet x1 = xCoord( lowerLeft( bBox ) ) y1 = yCoord( lowerLeft( bBox ) ) x2 = xCoord( upperRight( bBox ) ) y2 = yCoord( upperRight( bBox ) ) pcText = dbCreateTextDisplay( pcPin~>term pcPin~>term "TMP" t (x1+x2)*0.5:(y1+y2)*0.5 "centerCenter" "R0" "stick" min(abs(x2-x1),abs(y2-y1))*0.5 t nil t nil t "name" nil) pcText~>parent = pcShape ) ;return pin pcPin )) procedure( dbCreateMumpsPath( pcCellView pcNet pts width ) let( ; declare variables ( pcTechFile pcShape pcPin pcText e_a1 e_p2 e_v e_m x1 x2 y1 y2 tmp pts2 ) ; get tech file pcTechFile = techGetTechFile( pcCellView ) e_a1 = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY1" "ANCHOR1" ) unless( e_a1 warn("minEnclosure rule for POLY1->ANCHOR1 not set") ) e_p2 = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY1" "POLY2" ) unless( e_p2 warn("minEnclosure rule for POLY1->POLY2 not set") ) e_v = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY2" "P1P2VIA" ) unless( e_v warn("minEnclosure rule for POLY2->P1P2VIA not set") ) e_m = techGetOrderedSpacingRule( pcTechFile "minEnclosure" "POLY2" "METAL" ) unless( e_m warn("minEnclosure rule for POLY2->METAL not set") ) ; create figures pcShape = dbCreatePath( pcCellView "POLY1" pts width ) when( pcNet dbCreatePin( pcNet pcShape ) ) x1 = xCoord( nthelem( 1 pts ) ) y1 = yCoord( nthelem( 1 pts ) ) x2 = xCoord( nthelem( 2 pts ) ) y2 = yCoord( nthelem( 2 pts ) ) tmp = sqrt( (x1-x2)**2 + (y1-y2)**2 ) x1 = x1 + (x2-x1)*e_a1/tmp y1 = y1 + (y2-y1)*e_a1/tmp pts2 = cons( x1:y1 cdr(pts) ) x1 = xCoord( nthelem( length(pts)-1 pts ) ) y1 = yCoord( nthelem( length(pts)-1 pts ) ) x2 = xCoord( nthelem( length(pts) pts ) ) y2 = yCoord( nthelem( length(pts) pts ) ) tmp = sqrt( (x1-x2)**2 + (y1-y2)**2 ) x2 = x2 - (x2-x1)*e_a1/tmp y2 = y2 - (y2-y1)*e_a1/tmp pts2 = cons( x2:y2 cdr(reverse(pts2)) ) dbCreatePath( pcCellView "ANCHOR1" pts2 width-e_a1*2 ) x1 = xCoord( nthelem( 1 pts ) ) y1 = yCoord( nthelem( 1 pts ) ) x2 = xCoord( nthelem( 2 pts ) ) y2 = yCoord( nthelem( 2 pts ) ) tmp = sqrt( (x1-x2)**2 + (y1-y2)**2 ) x1 = x1 + (x2-x1)*e_p2/tmp y1 = y1 + (y2-y1)*e_p2/tmp pts2 = cons( x1:y1 cdr(pts) ) x1 = xCoord( nthelem( length(pts)-1 pts ) ) y1 = yCoord( nthelem( length(pts)-1 pts ) ) x2 = xCoord( nthelem( length(pts) pts ) ) y2 = yCoord( nthelem( length(pts) pts ) ) tmp = sqrt( (x1-x2)**2 + (y1-y2)**2 ) x2 = x2 - (x2-x1)*e_p2/tmp y2 = y2 - (y2-y1)*e_p2/tmp pts2 = cons( x2:y2 cdr(reverse(pts2)) ) pcShape = dbCreatePath( pcCellView "POLY2" pts2 width-e_p2*2) when( pcNet dbCreatePin( pcNet pcShape ) ) x1 = xCoord( nthelem( 1 pts ) ) y1 = yCoord( nthelem( 1 pts ) ) x2 = xCoord( nthelem( 2 pts ) ) y2 = yCoord( nthelem( 2 pts ) ) tmp = sqrt( (x1-x2)**2 + (y1-y2)**2 ) x1 = x1 + (x2-x1)*(e_p2+e_v)/tmp y1 = y1 + (y2-y1)*(e_p2+e_v)/tmp pts2 = cons( x1:y1 cdr(pts) ) x1 = xCoord( nthelem( length(pts)-1 pts ) ) y1 = yCoord( nthelem( length(pts)-1 pts ) ) x2 = xCoord( nthelem( length(pts) pts ) ) y2 = yCoord( nthelem( length(pts) pts ) ) tmp = sqrt( (x1-x2)**2 + (y1-y2)**2 ) x2 = x2 - (x2-x1)*(e_p2+e_v)/tmp y2 = y2 - (y2-y1)*(e_p2+e_v)/tmp pts2 = cons( x2:y2 cdr(reverse(pts2)) ) dbCreatePath( pcCellView "P1P2VIA" pts2 width-e_p2*2-e_v*2 ) x1 = xCoord( nthelem( 1 pts ) ) y1 = yCoord( nthelem( 1 pts ) ) x2 = xCoord( nthelem( 2 pts ) ) y2 = yCoord( nthelem( 2 pts ) ) tmp = sqrt( (x1-x2)**2 + (y1-y2)**2 ) x1 = x1 + (x2-x1)*(e_p2+e_m)/tmp y1 = y1 + (y2-y1)*(e_p2+e_m)/tmp pts2 = cons( x1:y1 cdr(pts) ) x1 = xCoord( nthelem( length(pts)-1 pts ) ) y1 = yCoord( nthelem( length(pts)-1 pts ) ) x2 = xCoord( nthelem( length(pts) pts ) ) y2 = yCoord( nthelem( length(pts) pts ) ) tmp = sqrt( (x1-x2)**2 + (y1-y2)**2 ) x2 = x2 - (x2-x1)*(e_p2+e_m)/tmp y2 = y2 - (y2-y1)*(e_p2+e_m)/tmp pts2 = cons( x2:y2 cdr(reverse(pts2)) ) pcShape = dbCreatePath( pcCellView "METAL" pts2 width-e_p2*2-e_m*2 ) pcPin = when( pcNet dbCreatePin( pcNet pcShape ) ) ; create text display when( pcNet tmp = ceiling( length(pts) / 2 ) x1 = xCoord( nthelem( tmp pts ) ) y1 = yCoord( nthelem( tmp pts ) ) x2 = xCoord( nthelem( tmp+1 pts ) ) y2 = yCoord( nthelem( tmp+1 pts ) ) pcText = dbCreateTextDisplay( pcPin~>term pcPin~>term "TMP" t (x1+x2)*0.5:(y1+y2)*0.5 "centerCenter" "R0" "stick" width*0.5 t nil t nil t "name" nil) pcText~>parent = pcShape ) ;return pin pcPin ))