• 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. Redirect poport to variable

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 14409
  • 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

Redirect poport to variable

liorscotland
liorscotland over 6 years ago

Hello all.

One can direct the poport into a file, if needed.

However, can one redirect this into a variable, directly?

Thanks,

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago

    Hi Lior,

    How about this?

    /* abPoportToString
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Mar 07, 2019 
    Modified   
    By         
    
    A macro to capture any output to poport (e.g. standard output) from
    the code within the body of the call into a string (which is returned)
    
    For example:
    
    data=abPoportToString(
        ; code inside just writes to poport
        foreach(file sort(getDirFiles("/bin") 'alphalessp)
          printf("%s\n" file)
        )
      )
    
    This will have all the file names in the directory /bin in a string
    with newline between each file name, as produced by the printf.
    
    So you could then do: printf("%s" data) and see the same text.
    
    ***************************************************
    
    SCCS Info: @(#) abPoportToString.il 03/07/19.17:04:14 1.1
    
    */
    
    (defmacro abPoportToString (@rest body)
      `(let ((_outputStringPort (outstring)))
         (unwindProtect
           (dynamicLet ((poport _outputStringPort))
                       ,@body
                       (getOutstring _outputStringPort)
                       )
           (close _outputStringPort)
           )
         )
      )
    

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • liorscotland
    liorscotland over 6 years ago in reply to Andrew Beckett

    Hi Andrew. I'll give it a try..

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

    Hi Andrew. Works as expected. 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