• 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. Append data to file

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 15691
  • 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

Append data to file

gs748
gs748 over 10 years ago

Hello,

I am invoking a Perl program test.pl in Skill script and I am trying to append data to a file by using following print statements in skill and perl. Print statements from the perl.pl are not written to "out" file.

Can you please help me to determine where I am wrong with the below syntax. Thank you!

out = outfile("./out")
poport = out
printf("PASS\n")
printf("FAIL\n")
system("perl test.pl >> out")

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    This is a slightly dubious approach - better to do:

    out=outfile("./out")
    fprintf(out "PASS\n")
    fprintf(out "FAIL\n")
    close(out)
    system("perl test.pl >> out")

    I wouldn't go setting poport to out unless there is a really good reason - you have to do that very carefully to avoid breaking things. Secondly, having two processes writing to the file at the same time is not a good idea - because SKILL would think it knows where the end of the file is and when it ultimately closes the file, it would have truncated it at that point. Thirdly you'd probably need to drain() the port before you tried writing to it - but even then I doubt that would work.

    Note that if you're going to want to do the above repeatedly and append to the same file, you can pass "a" as the second argument to outfile to tell it to append to the file rather than overwrite.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • gs748
    gs748 over 10 years ago
    Hi Andrew, Passing "a" as the second argument to outfile did the trick. Thanks for additional info, I will keep a note of poport! Thanks.
    • 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