• 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
  • mbracht
    mbracht over 6 years ago

    HI Gurup,

    That sound's like one of these infamous rounding issues to me, try

    (printf "%2.20f" p_width)

    ...and you will most likely find that p_with is just close to but not exactly 0.2.

    There is a solution for this problem:

    https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od0000000naf2EAA&pageName=ArticleContent

    Max

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • mbracht
    mbracht over 6 years ago

    HI Gurup,

    That sound's like one of these infamous rounding issues to me, try

    (printf "%2.20f" p_width)

    ...and you will most likely find that p_with is just close to but not exactly 0.2.

    There is a solution for this problem:

    https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od0000000naf2EAA&pageName=ArticleContent

    Max

    • 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