Andrew Beckett's program to write waveforms to an ASCII file

Discussion in 'Cadence' started by Cliff Curry, Jan 17, 2004.

  1. Cliff Curry

    Cliff Curry Guest

    This program by Andrew Beckett <>
    is very useful.

    Make a file with this text in it... named "waveout.il"
    At the CIW prompt, type load("waveout.il")
    Then, to create a file of your waveform data, at the CIW prompt,
    type abWriteOutputASCII("filename").

    Thank you very much Andrew!

    Cliff Curry


    /***************************************************************
    * *
    * (abWriteOutputsASCII fileName *
    * [?numberNotation 'engineering] *
    * [?precision 15] *
    * [?width 20] *
    * [?numSpaces 0] *
    * ) *
    * *
    * Write the outputs in the current ADE window outputs section *
    * into a file. The precision and number notation can *
    * be controlled. *
    * *
    ***************************************************************/

    (procedure
    (abWriteOutputsASCII fileName @key
    (numberNotation 'engineering)
    (precision 15)
    (width 20)
    (numSpaces 0)
    )
    (let (session waves)
    (setq session (asiGetCurrentSession))
    ; Get the ADE outputs, and convert to a list of
    ; waveforms. I'm assuming that the current simulation
    ; results are already selected (i.e. either the run
    ; just completed, or Results->Select was used.
    (setq waves
    (foreach mapcar output (asiGetOutputList session)
    (if (getq output signal)
    ; if it is a signal, return the VT of it.
    (VT (getq output signal))
    ; otherwise it's an expression, so evaluate it
    (eval (getq output expression))
    )
    ))
    ; call ocnPrint to output the waveforms, having
    ; added on the arguments to control the formatting.
    (apply 'ocnPrint
    (append
    (list ?output fileName ?numberNotation numberNotation
    ?precision precision ?width width ?numSpaces numSpaces)
    waves
    )) ; apply
    ) ; let
    ) ; procedure
     
    Cliff Curry, Jan 17, 2004
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.