• 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. How reduce amount of zeros past comma, after using callback...

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 142
  • Views 5229
  • 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

How reduce amount of zeros past comma, after using callback procedure.

TiNat
TiNat over 13 years ago

 Hello. I design my own library of elements and attach to each element file with callback
procedure. In my process grid resolution is 0.05 mkm. And in procedure I check if the geometrical
sizes lies in grid and transform them if not,  using the following code:

l_temp = round(1e+6*evalstring(cdfgData->l->value)*100)-fix(round(1e+6*evalstring(cdfgData->l->value)*100)/10)*10

if(l_temp<5.0 then addsegml = 0.0 else addsegml = 5.0)

cdfgData->l->value = sprintf(ll,"%.2g" fix(round(1e+6*evalstring(cdfgData->l->value)*100)/10)*10+addsegml)/(100*1e+6))

i.e. the length 0.367u will be transfotm to 0.35u.

But I have following problem:
when I enter the length less than 100u, there are no problems, but when I enter length more than 100u
the result transformed to 100.00000u. Such amount of zeros is not pleasant. I assume that I need enter some environment varable in .cdsenv or .cdsinit, but I don't know what. Who can help me, how I can avoid such problem.
 

Regards.

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    You might want to use aelSuffixNotation() instead of using sprintf. So for example:

    value=100u

    aelSuffixNotation(value 6) => "100u"

    The 6 is to say that there should be 6 significant digits - it is to stop 100.01u rounding if there's a default of 4 significant digits. You can choose how many you want.

    I'd also recommend using cdfParseFloatString() instead of evalstring. If somebody has unwittingly entered "exit" as the value of the length of the transistor, you wouldn't want your callback causing virtuoso to exit!

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    You might want to use aelSuffixNotation() instead of using sprintf. So for example:

    value=100u

    aelSuffixNotation(value 6) => "100u"

    The 6 is to say that there should be 6 significant digits - it is to stop 100.01u rounding if there's a default of 4 significant digits. You can choose how many you want.

    I'd also recommend using cdfParseFloatString() instead of evalstring. If somebody has unwittingly entered "exit" as the value of the length of the transistor, you wouldn't want your callback causing virtuoso to exit!

    Regards,

    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