• 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. if statement ....

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 143
  • Views 16651
  • 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

if statement ....

MarkGr15
MarkGr15 over 10 years ago

Below is my code, and output to a log file.  The problem is that the comma, in both if-else statement, never gets printed.  I added the printing of "First Corner" just to verify that the variable is 0.  If there is another way to skin this cat, I'm open to it, but I might have to share more of my intent for that.

thanks!

Mark

Code:

rdb=axlReadHistoryResDB(ocnxlGetCurrentHistory() ?session ocnxlGetSession())

printf("\n{")
printf("\n \"DATA_TYPE\": \"statistical\",") ;<-- OR functional OR worstcase $$$$$$mg
foreach(point rdb->points()
foreach(corner point->corners()
printf("\n\n %L: {" corner->name)

isFirstCorner=1
printf("\nFirst Corner %L\n" isFirstCorner)
;if(isFirstCorner printf("\nTest .....\n")
;isFirstCorner=0
;if(isFirstCorner printf("\nTest ....\n") printf("\nTest2 ....\n") )

foreach(test corner->tests()
if(isFirstCorner isFirstCorner=0 printf(",") )

printf("\nFirst Corner %L\n" isFirstCorner)

printf("\n\n %L: {" test->name)

isFirstOutput=1

foreach(output test->outputs()
when(output->type=='expr
if(isFirstOutput isFirstOutput=0 printf(",") )

printf("\n \"%s\": %L" output->name output->value)
)
)
printf("\n }")

)
printf("\n }")
)
)
printf("\n }")

------------

Output:  (part of it)

\o "mcmis_T:150": {
\o First Corner 1
\o
\o First Corner 0
\o
\o
\o "_mgraumlich:dg_1uA_mirror_1to8_Sim1:1": {
\o "Idisabled": 7.572342e-11
\o "Rout": 5.061094e+07
\o "IerrorMismatch": -4.725051e-10
\o }
\o }
\o
\o "mcproc_T:150": {
\o First Corner 1
\o
\o First Corner 0
\o
\o
\o "_mgraumlich:dg_1uA_mirror_1to8_Sim1:1": {
\o "Idisabled": 7.292185e-11
\o "Rout": 5.46766e+07
\o "IerrorMismatch": 2.049591e-09
\o }
\o }
\o
\o "mcmis_T:150": {
\o First Corner 1
\o
\o First Corner 0
\o
\o
\o "_mgraumlich:dg_1uA_mirror_1to8_Sim1:1": {
\o "Idisabled": 7.574724e-11
\o "Rout": 5.068103e+07
\o "IerrorMismatch": -1.195872e-10
\o }
\o }
\o
\o "mcproc_T:150": {
\o First Corner 1

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Mark,

    In SKILL, nil is false and anything else is true. So in this case your flag is being toggled between 0 and 1, both of which are considered true, and hence it only ever executes the then branch of the if(). Note that you're using the three-argument version of if() - if(condition thenexpr elseexpr) - I think this is intentional in your case, but if you want to be explicit you can do if(condition then thenexpr1 ... thenexprN else elseexpr1 ... elseexprM).

    So to cure your problem, change the assignments to be isFirstCorner=t or isFirstCorner=nil. That should do the trick. SKILL is not C, and so 0 does not mean false.

    Kind Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • 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