• 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. is it possible to disable printf output (ie stdout) of a...

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 142
  • Views 3132
  • 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

is it possible to disable printf output (ie stdout) of a called function/procedure

ebecheto
ebecheto over 13 years ago

 It is rather a general question than a 'Custom IC' question, but the context is about :

foreach(mapcar c cdfGetInstCDF(css())~>parameters evalstring(c->callback||"" ))

such evaluation of callback functions output a lot of blabla

Reff = Rbar * s
Reff = Rbar
Reff = Rbar / m

... n-times.

Is it possible to wrap-up a function that would  disable printf. Something like

mute(printf("Do not echo that!"))

??

Or I don't know, a function that redirect sdtout temporary :

disableStdout()

 printf("Do not echo that!")

enableStdout()

 ??

Thanks for any help. That would be a nice X-mas gift to me.

Regards

 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    Merry Christmas!

    Two solutions (one I just wrote, and one from some time ago):

     

    /* abMute.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Dec 22, 2011 
    Modified   
    By         
    
    A macro to mute the output from printf() calls etc.
    
    abMute(printf("test this\n"))
    
    will produce nothing.
    
    Relies on SKILL's dynamic scoping, so will not work in SKILL++
    unless you do:
    
    inSkill(abMute(printf("test this\n")))
    
    ***************************************************
    
    SCCS Info: @(#) abMute.il 12/22/11.11:03:17 1.1
    
    */
    
    (defmacro abMute (@rest body)
      `(progn
         (unless (openportp (getqq abMute nullport))
           (putpropqq abMute (outfile "/dev/null") nullport))
         (let ((poport (getqq abMute nullport)))
           ,@body
           )
         )
      )

     

     And the second (put this in a file with a .ils suffix, since it is SKILL++ code):

     

    /* abRedirectOutput.ils
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Aug 12, 1998 
    Modified   
    By         
    
    Call using abRedirectOutput(t) or abRedirectOutput(nil)
    to turn printing to CIW on or off.
    
    Note, this is SKILL++, so requires file to end in .ils
    
    ***************************************************
    
    SCCS Info: @(#) abRedirectOutput.ils 11/20/08.15:26:24 1.2
    
    */
    
    /* going to define abRedirectOutput */
    (define abRedirectOutput nil)
    
    /* private variable containing port to /dev/null */
    (let (nullport)
    
    (procedure (redirect on)
      (if on
          (progn
           (unless nullport
                   (setq nullport (outfile "/dev/null")))
           (setq poport nullport)
           )
          (progn
           (setq poport (inSkill stdout))
           (close nullport)
           (setq nullport nil)
           )
          )
      on)
    
    /* export it */
    (setq abRedirectOutput redirect)
    )
      

     

    • 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