• 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. Pin width change

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 143
  • Views 15370
  • 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

Pin width change

Gurup
Gurup over 6 years ago

Hi, 

 I am writing a code to change the pin width cyclically, and be lwo is my code

sel_pin=css()

if(sel_pin ~>objType == "rect" && sel_pin~>children != nil then

p_width=caadr(sel_path~>bBox)-caar(sel_path~>bBox)

cond(
(p_width<0.2   p_width=0.5)
(p_width<=0.2 && p_width<0.6 p_width=0.6)
(p_width>=0.6 && p_width<1 p_width=1)
(p_width>=1 && p_width<2 p_width=2)
(p_width>=2 p_width=.2)
);end cond

pin_width=p_width
crd1=car(sel_pin~>bBox)
crd2=list(car(crd1)+pin_width cadr(crd1)+pin_width)
sel_pin~>bBox=list(crd1 crd2)
sel_pin~>children~>xy=list(car(crd1)+(pin_width/2.0) cadr(crd1)+(pin_width/2.0))
sel_pin~>children~>height=(pin_width/2)

);end if

When I exucte the code for pin width 0.2, then the Cond statement not changing the p_width to 0.6.

Its taking p_width<0.2 is true when pin width is 0.2.

Please correct me if any thing is wrong

  • Cancel
Parents
  • Gurup
    Gurup over 6 years ago

    And in  different coordinate the p_width is changing .. and in some coordinate its struck one value

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to Gurup

    One way to deal with these floating point rounding errors (which have been covered many times in these forums and elsewhere for numerous programming languages - this is not an issue unique to SKILL) is to introduce an error term (epsilon) in the comparisons. In this case I set it to a small number (e.g. one tenth of your probably database unit - often people have a DBU of 1nm, so I set it to 0.1nm). Then make the comparison including this term:

    epsilon=1e-4 ; assuming you have a DBUperUU of 0.001 this would be a tenth of the resolution (could be tighter still)
    cond(
      (p_width<0.2-epsilon p_width=0.5)
      (p_width>=0.2-epsilon && p_width<0.6-epsilon p_width=0.6)
      (p_width>=0.6-epsilon && p_width<1-epsilon p_width=1)
      (p_width>=1-epsilon && p_width<2-epsilon p_width=2)
      (p_width>=2-epsilon p_width=.2)
    );end cond

    By the way, your second branch in the cond statement had (I believe) the comparison the wrong way around (it had <= rather than >=)

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Gurup
    Gurup over 6 years ago in reply to Andrew Beckett

    Thank you very much mbracht and Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Gurup
    Gurup over 6 years ago in reply to Andrew Beckett

    Thank you very much mbracht and Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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