• 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 Design
  3. SKILL: Print voltage to a text file in ADE XL over corn...

Stats

  • Replies 7
  • Subscribers 125
  • Views 16561
  • Members are here 0

SKILL: Print voltage to a text file in ADE XL over corners

Anonymous
Anonymous over 8 years ago

Hello,

I have a simple SKILL script that I load and run in the CIW window after an ADE-L simulation finishes to output a sampled waveform to a text file for Matlab post processing.  A simplified example follows:

writePort = outfile("f1.txt")

for( i 0 Num_pts-1

   tx = i*t_clk

   this_t = t_start + tx

   v1 = value(VT("/v1node") this_t)

   fprintf(writePort "%10.6g " v1)

)

fprintf(writePort "\n")

The problem is when I try this after running a corner sweep in ADE-XL I get "srrWave:0x51f13e70" type of data.  I assume the voltage is now a structured array, with multiple waveforms (one per corner), and I need to use a function to access each corner data waveform separately.  What is the easiest way to do this?

I have played with ocnPrint() which does indeed work.  However, it also outputs column data with corner information spread throughout the numerical data in the file.  This makes the file bigger and requires more text processing (e.g., slower) in Matlab.  I was wondering if there was another solution closer in nature to my original script.

Many thanks in advance for any tips!

Kind regards,

Chris

  • Cancel
  • Sign in to reply
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Hi Chris,

    A much simpler solution would be to use the Spectre Toolbox for Matlab (run <MMSIMinstRoot>/bin/cdnshelp and search for "matlab toolbox"). This would allow  you to use the cds_srr function directly within Matlab to read the PSF data directly (at the root of the PSF results for the entire ADE XL run) and avoid any text processing at all. You'll then get Matlab multi-dimensional data indexed by the sweep variables.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Anonymous
    Anonymous over 8 years ago
    Hi Andrew,

    Thanks for your quick response. That's a great idea. However, I'm running Matlab locally on my PC and neither it nor our Cadence installation seem to show it being installed. For the moment I think I'd like to find the next best alternative, as I suspect getting this installed and running can become a bit of a headache. :)
    Do you know how I could simply replace my "fprintf()" statement with a function that would split it into multiple waveforms, one per corner?

    Thanks again,
    Chris
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Hi Chris,

    You could look at abDumpWaveforms or abDumpFamily in the code in this post or abDumpWaveformsToVCSV in the code in this post. One potential problem with abDumpWaveforms is that the x-axis of all the time-domain waveforms may not be consistent (unless maybe you used the strobeperiod option to ensure they are regularly spaced time steps in the output); I think that will make it a bit more challenging for abDumpWaveformsToVCSV although it can handle it OK if my memory is OK (I think each curve ends up with a separate x-axis in the CSV file). The abDumpFamily writes each family member into a separate file (if my memory is correct) so that might be an option too. Anyway, a few to try out - I referenced these in an earlier post asking about using Matlab on Windows when the result data is on UNIX.

    Kind Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Anonymous
    Anonymous over 8 years ago
    Hi Andrew,

    Thanks for the examples. I'll give them a close look and see what works best for me.
    Again, I appreciate your time!

    Regards,
    Chris
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Anonymous
    Anonymous over 8 years ago
    Hi Andrew,

    May I ask 2 additional questions? This can help my debugging.
    (1) Could you send the skill code for LinRg and LogRg that is used in abDumpSampledWaveform()?
    (2) What does it actually mean when I see "srrWave:0x51f13e70" type of data? What am I doing wrong?

    Thanks!
    Regards,
    Chris
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Chris,

    linRg and logRg are available within Virtuoso (they have a lowercase l at the beginning, not an uppercase L), so you don't need the SKILL code.

    If you are seeing srrWave:... objects, then that means the result is a waveform (or a family of waveforms). Essentially there are objects in Virtuoso that can be used to represent waveform data that typically contain an x and y vector, with various attributes to include axis names and units. They can also represent family data - so that's where you have one or more sweep variables on top of the simple waveform data - so they represent a collection of curves.

    I'm not sure where you're seeing these srrWave objects?

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Anonymous
    Anonymous over 8 years ago
    Hi Andrew,

    Ahh, thanks for the clarification.
    While I was trying to use functions like drGetElem() and drGetWaveformXVec() I kept getting these srrWave objects instead of the numerical data I was hoping for. So your explanation makes sense.

    Regards,
    Chris
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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