• 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. writing into file using skill

Stats

  • Locked Locked
  • Replies 12
  • Subscribers 144
  • Views 19900
  • 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

writing into file using skill

RAGHU2634
RAGHU2634 over 6 years ago

Hi ,

I want  to  write manual data into a new/existing  file based on condition met in program. Is there any available command or script to do this ?

Thanks,

Raghu

  • Cancel
  • Adam Kubacak
    Adam Kubacak over 6 years ago

    Raghu,

    targetFile = outfile(targetFileName "a")  ;"a"-append, "w"-overwrite
    fprintf(targetFile "%s" stringVariable)  ;or different variable type configuration
    close(targetFile)

    See the help for complete description of these functions.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RAGHU2634
    RAGHU2634 over 6 years ago in reply to Adam Kubacak

    Hi Adam,

    Thanks for the response .

    I gone through the above functions.

    I tried the below exactly

    stopM=outfile("./stopM1" "w")

    fprintf(stopM "%s"  stopLayers)

    The command executed without errors but it written nothing into file. Please let mw know where I am making mistake

    Thanks,

    Rgahu

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RK56
    RK56 over 6 years ago in reply to RAGHU2634

    Hi,

    You have to close the file port. Try,

    close(stopM)

    -Ramakrishnan

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • mbracht
    mbracht over 6 years ago in reply to RK56

    alternatively - if you want to see the file's content before closing the file descriptor - you might as well flush the buffer:

    (drain stopM)

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Adam Kubacak
    Adam Kubacak over 6 years ago in reply to RAGHU2634

    Raghu,

    there should be no error. I don't know what type of data are contained in your "stopLayers".

    It's probably a list, so then you have to you "%L" formatting. Look up fprintf function in Cadence help.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • RAGHU2634
    RAGHU2634 over 6 years ago in reply to mbracht

    thanks

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • RAGHU2634
    RAGHU2634 over 6 years ago in reply to Adam Kubacak

    i was not closing the port so i was not seeing it

    thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RAGHU2634
    RAGHU2634 over 6 years ago in reply to RAGHU2634

    Hi Adam,

    In extension to the above question ,

    I have a list A which has individual elements & also lists inside lists . Can we make this list A as flatten one so that it has only elements & no lists inside .Please let me know how to handle this ?

    Thanks,

    Raghu

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Adam Kubacak
    Adam Kubacak over 6 years ago in reply to RAGHU2634

    Hello Raghu,
    try to search Cadence site better...
    Such a task is well described for instance here: Using mapcan for list flattening

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Adam Kubacak
    Adam Kubacak over 6 years ago in reply to RAGHU2634

    Hello Raghu,

    try to search Cadence site better...

    Such a task is well described for instance here: List flattening

    • Cancel
    • Vote Up +1 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