• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. scaling pin spacing - ideas on imposing a minimum between...

Stats

  • Locked Locked
  • Replies 0
  • Subscribers 143
  • Views 885
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

scaling pin spacing - ideas on imposing a minimum between pins

aicdesigner
aicdesigner over 4 years ago

I find it handy to space pins out and blow up their names (so that all pin names are visible when schematic is "fit" ) as the schematic gets bigger.

The opposite function which brings pins closer together can be handy when working with symbols.

As you can see, the increasing-spacing function works ok. If anyone has ideas on how to enforce a minimum (of 2x snapSpacing) spacing from nearest neighbour, I'd be very grateful if you could share). The existing code obviously doesn't do that..

; smartIncPinSpace( "+" ) ; or "-"

procedure( smartIncPinSpace( space )
let( ( direction unitsep obj count snapSpacing newx min_x min_y sum_sq_x sum_sq_y sum_x sum_y
x y x_p y_p x_table y_table var_x var_y aligned_x aligned_y k_scale k_x k_y
newy firstx firsty firstxy lastxy add)
snapSpacing = envGetVal("schematic" "symSnapSpacing")
; when we do the actual scaling, we'll work in units of snapSpacing
if("+" == space then
k_scale = 1.2
else
k_scale = 0.8
)


; build up hashtables of the pin coordinates - on for x, one for y and values are the counts
x_table = makeTable( "" 0 ) ; arguments are "print name" and default value
y_table = makeTable( "" 0 )
min_x = nil
count = 0
sum_sq_x = 0
sum_sq_y = 0
sum_x = 0
sum_y = 0
aligned_x = 0
aligned_y = 0

foreach( obj geGetSelSet()
if( obj~>pin
then
x = xCoord( obj~>xy )
y = yCoord( obj~>xy )
if( ! min_x
then
min_x = x
min_y = y
else
min_x = min( min_x x )
min_y = min( min_y y )
x_table[ x ]++
y_table[ y ]++
)
sum_sq_x += x*x
sum_sq_y += y*y
sum_x += x
sum_y += y
count++
else
geDeselectObject( obj )
)
)

foreach( key x_table
if( x_table[key] > 1
aligned_x++
)
)
foreach( key y_table
if( y_table[key] > 1
aligned_y++
)
)
if( aligned_x == aligned_y
then
; look at spreads
var_x = ( sum_sq_x - sum_x*sum_x ) / count
var_y = ( sum_sq_y - sum_x*sum_y ) / count
else
var_x = 0
var_y = 0 ; just so this doesn't intefere with anything
)

if( ( aligned_x > aligned_y || var_x < var_y )
then
; means you increase y spacings
k_y = k_scale
k_x = 0
else
; increase x spacings
k_y = 0
k_x = k_scale
) ; might be a way to compact this if into something more elegant

foreach( obj geGetSelSet()
x = xCoord( obj~>xy ) - min_x
y = yCoord( obj~>xy ) - min_y
if( k_y > 0 && y > 0
then
y_p = snapSpacing * round( k_y * y/snapSpacing )
if( k_y > 1 && y_p == y
y_p += snapSpacing
)
if( k_y < 1 && y_p == y
y_p = max( 2*snapSpacing, y_p-snapSpacing)
)
obj~>xy = list( x + min_x, y_p + min_y)
else
if( k_x > 0 && x > 0
then
x_p = snapSpacing * round( k_x * x/snapSpacing )
if( k_x > 1 && x_p == x
x_p += snapSpacing
)
if( k_x < 1 && x_p == x
x_p = max( 2*snapSpacing, x_p-snapSpacing)
)
obj~>xy = list( x_p + min_x, y + min_y)

)
)

) ; foreach


); let
); procedure

  • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information