• 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. Reading Error messages from CIW

Stats

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

Reading Error messages from CIW

FranzD
FranzD over 2 years ago

HI,

I recently used CCFcaptureWarnings() to capture the warnings of a called procedure. I found it here: https://community.cadence.com/cadence_technology_forums/f/custom-ic-skill/38856/reading-warning-messages-from-ciw-using-skill

It works fine and captures all warnings. I now wanted to know if I can capture also the error messages like this? 

Thanks

Franz

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago

    Hi Franz,

    BTW, there's also (since IC6.1.8/ICADVM18.1 ISR1) a built-in function called muffleWarnings which suppresses warnings:

    muffleWarnings(
       expressionsThatProduceWarnings()
    )

    You can then get the warnings using getMuffleWarnings() afterwards.

    For errors, normally this would trigger an error and the program would stop. You can catch these with:

    errset(singleExpression)

    For example:

    errset(1/0)

    This will suppress the error and return anyway - it returns a list of the result - returns nil if there was an error, otherwise a list of whatever the result of the expression would have been. You can get the error displayed by passing:

    errset(1/0 t)

    but the error is still caught.

    The error itself is in errset.errset.

    If you are trying to suppress error messages from caught errors (maybe that's what you're asking?), then you could rewrite CCFcaptureWarnings to CCFcaptureErrors by changing the inner part to:

            let(((report tempPort))
              ,@body
            )

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • FranzD
    FranzD over 2 years ago in reply to Andrew Beckett

    Hi Andrew,

    thanks for the reply. Actually I want to write some skill code to verify the callbacks of the CDF parameters. For this case I want to catch warnings and errors but still run my code. So I dont want to suppress the errors and warnings rather then check if there are any and if so save them. For the warnings I did:

    ciwMessage = CCFcaptureWarnings(re = CCSinvokeObjCdfCallbacks(...))

    After that I check the value of re. If it is nil then I store the ciwMessage in a log file. But I saw that this only captures the warnings but there are also some errors which are not stored in ciwMessage, but printed on the ciw. I would like to catch them to. The best solution for me would be to also check if I have errors and/or warnings to log which type of problem occured. Do you have any suggestions for this? 

    Thanks

    Franz

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to FranzD

    Hi Franz,

    CCSinvokeObjCdfCallbacks already catches the errors (it uses errset inside) but doesn't suppress the error messages (intentionally). So in that case you could do either:

    ciwErrors = CCFcaptureErrors(muffleWarnings(re = CCSinvokeObjCdfCallbacks(...)))
    ciwWarnings = getMuffleWarnings()

    (note in this case, ciwWarnings ends up being a list). Or you could continue to use CCFcaptureWarnings:

    ciwErrors = CCFcaptureErrors(
      ciwWarnings = CCFcaptureWarnings(re = CCSinvokeObjCdfCallbacks(...))
    )

    Here's the full CCFcaptureErrors making the changes I suggested earlier:

    defmacro(CCFcaptureErrors (@rest body)
      `let(((tempPort outstring()))
        unwindProtect(
          ;------------------------------------------------------------------
          ; main clause - using dynamic scoping, redirect woport to tempPort
          ; and then invoke the forms passed in as the argument to the
          ; macro
          ;------------------------------------------------------------------
          {
            let(((errport tempPort))
              ,@body
            )
            ;----------------------------------------------------------------
            ; return value is the data written to the string port
            ;----------------------------------------------------------------
            getOutstring(tempPort)
          }
          ;------------------------------------------------------------------
          ; always execute the close even if there was an error in
          ; the code above
          ;------------------------------------------------------------------
          close(tempPort)
        )
      )
    )

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • FranzD
    FranzD over 2 years ago in reply to Andrew Beckett

    Hi Andrew,

    that helps me a lot! Thank you very much! At last I have a more general question: For the warnings you used woport and for the erros the report. Is there also some general port for the output to the ciw? So that I could use the marco with a different port to get all the information that is printed to the ciw regardless if its warnings, errors or just prints?

    Regards

    Franz

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AurelBuche
    AurelBuche over 2 years ago in reply to FranzD

    Hi Franz

    Yes, you have poport, woport and errport that respectively prints info, warning and error messages to the CIW

    If you set an outstring port instead of all of them, you can temporarily catch all messages 

    Cheers,

    Aurélien

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • FranzD
    FranzD over 2 years ago in reply to AurelBuche

    Hi Aurélien,

    Can you make this a little more clear for me? Lets say I have a function and I want to catch all info, warning and error of it, how would I realize this?

    Thank you!

    Franz

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to FranzD

    allOut=CCFcaptureTheLot(...)

    will do this - using this code:

    defmacro(CCFcaptureTheLot (@rest body)
      `let(((tempPort outstring()))
        unwindProtect(
          ;------------------------------------------------------------------
          ; main clause - using dynamic scoping, redirect woport to tempPort
          ; and then invoke the forms passed in as the argument to the
          ; macro
          ;------------------------------------------------------------------
          {
            let(((woport tempPort) (poport tempPort) (errport tempPort))
              ,@body
              ; next two lines are to force final warning to be flushed
              warn("")
              getWarn()
            )
            ;----------------------------------------------------------------
            ; return value is the data written to the string port
            ;----------------------------------------------------------------
            getOutstring(tempPort)
          }
          ;------------------------------------------------------------------
          ; always execute the close even if there was an error in
          ; the code above
          ;------------------------------------------------------------------
          close(tempPort)
        )
      )
    )

    If you notice the inner let line is setting woport, poport and errport to tempPort temporarily.

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to FranzD
    FranzD said:
    that helps me a lot! Thank you very much!

    Franz,

    I should also point out that editing a post after you had replied with just the above doesn't send out another notifier. So it ends up being rather likely that I won't see it (since I don't check the link every time).

    Luckily in this case the further conversation meant I spotted the request.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • FranzD
    FranzD over 2 years ago in reply to Andrew Beckett

    Ok thanks for the note and thanks for the help to both of you!

    • 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