• 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 to continue SKILL execution by diverting stderr to a...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 13552
  • 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 to continue SKILL execution by diverting stderr to a file?

kumarb
kumarb over 13 years ago
Hi Experts, When a program errors out, it just gets terminated with error message on stderr port. Now I am processing a list and want to print all the error output to a file and continue SKILL execution till end. How this can be possible? Example: procedure(errChk() foreach(elm list(1 “1” list(1) ) printf(“%f” elm) ) printf(“\nProgram execution completed”) ) When I run the program, I want to see “Program execution completed” printed in CIW and errors stored in some file. When I try myport=errport=outfile(“./error.txt”), then also it stops on first error. Thanks in advance for expert guidance. Best regards, Bhupendra
  • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    errset is the key.

    procedure(errChk()
        let((redirectPort)
            redirectPort=outfile("./error.txt")
            when(redirectPort
                let(((errport redirectPort))
                    errset(
                        foreach(elm list(1 "1" list(1) )
                            printf("%f" elm) )
                        t
                    )
                    printf("Program execution completed\n")
                )
                close(redirectPort)
            )
        )
    )

    In this case, I'm wrapping the entire foreach in errset, and so it traps the error (the t as second argument tells it to print the error message still). The errport is redirected to a file - doing it with a let like this takes advantage of SKILL's dynamic scoping, and makes it "safe" because as the program unwinds, errport gets restored.

    If I move the errset to be around the printf, say:

    procedure(errChk()
        let((redirectPort)
            redirectPort=outfile("./error.txt")
            when(redirectPort
                let(((errport redirectPort))
            foreach(elm list(1 "1" list(1) )
                errset(
                            printf("%f" elm)
                t
                )
            )
                    printf("Program execution completed\n")
                )
                close(redirectPort)
            )
        )
    )

    Then error.chk will now have three errors in it.

    Hope that helps!

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kumarb
    kumarb over 13 years ago

     Hi Andrew,

    This works great!

    Thanks a lot.

    Best regards,

    Bhupendra

     

     

    • 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