• 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. Any way to format the print statement in spice?

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 125
  • Views 15624
  • 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

Any way to format the print statement in spice?

RK56
RK56 over 8 years ago

Hi,

I'm new to OCEAN/MDL..

I need to print all the voltages and currents in the circuit for further text processing. I don't know the nodes and terminals beforehand.

SPICE syntax .print v(*) i(*) works fine but I want to  format the output as below. 

Node1 voltage1

Node2 voltage2

Term1 current1

Term2 current2

1. Is there any way to format the .print statement in SPICE syntax?

2. Which is the right tool to do this task? OCEAN or MDL or SPICE or any other ?

Thanks

Ramakrishnan

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    I don't think there's a direct way of doing it with .print (or the spectre syntax print statement) (I may be wrong, as I don't use it very often). I did wonder whether you could just use the write= parameter of the dc analysis, but that's not including all the currents - just some of them.

    One way is to run the simulation as usual (assuming that your dc operating point was in an analysis called dcOp) and then in OCEAN:

    openResults("/path/to/results.raw")
    selectResult('dcOp)
    dumpFile=outfile("./report.txt")
    foreach(out outputs(?map nil)
      fprintf(dumpFile "%s %g\n" out getData(out))
    )
    close(dumpFile)

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RK56
    RK56 over 8 years ago
    Thank you Andrew for the information. This definitely gave me an idea on how to swim in OCEAN :-) But I may drop using OCEAN for this particular case since it is not as fast as spice .print statements.

    Few questions here
    1. Why are you passing ?map nil for outputs procedure?
    2. Is the variable namespace of OCEAN and SKILL are shared? Which part of documentation details about this?

    -Ramakrishnan
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Some answers:

    1. The ?map nil was in case your netlist directory has the mapping information related to how the names were mapped from schematic names to netlist names. If you pass ?map nil it will always use the names that appear in the netlist, rather than back-translating them schematic names. In the case of there being no mapping performed, then the only difference you'd potentially see by missing this is that the hierarchy delimiter would be "/" rather than "."
    2. OCEAN is not a separate language - it's just a group of SKILL functions, named that way for convenience (mostly to avoid it looking too scary for analog designers). So the namespace is the same because it's the same language.

    Andrew

    • 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