• 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. How to deposit simulation result into a file?

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 143
  • Views 17999
  • 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

How to deposit simulation result into a file?

Alex Liao
Alex Liao over 10 years ago

Hi, I am wondering is there a way to save an output into a file, like a .txt which it is easy to read from.

 

Specifically, in the "Setting outputs" of Virtuoso Analog Design Environment (ADE) I have: 

Name: PhaseMargin

Expression: (phaseMargin((VF("/Vout") / (VF("/Vin+") - VF("/Vin-")))) + 180)

 

After simulation, I got 80 degree displayed.

But is there a way to save this '80' into a .txt file?

I am using SpectreS as the simulator. I think there are some commands to output results.

 

Any answer is appreciated.

Thanks,

Alex


  • Cancel
Parents
  • Alex Liao
    Alex Liao over 10 years ago

    Hi Lawrence,

     I understand what you were saying.

    The spectre standalone command is written in the file runSpectre:

    spectre +escchars +log ../psf/spectre.out -env artist5.1.0 -format psfbin  -raw ../psf -E -cols    80 raw/design

    The  raw/design is the generated spectre netlist which is usually named spectreFinal. It has everything inside, the core netlist (device with paremeters and connections) plus variable assignment and simulation settings. The spectreFinal is the generated netlist from Spectre command (maybe Skill language). Do not worry about it right now.

    The simulation result is in ../psf.

    Q1 here: Is there any way (command style) to extract data and save it (say, the phaseMargin) into a txt fire after executing runSpectre? I tried to use ocnPrint(), but failed. So I think the ocnPrint() can only be executed following a Ocean version simulation which is the design() and run() stuff. 

     

    While the Ocean methodology takes the raw netlist, other variable assignment and simulation settings are written in Ocean format. 

    I have a piece of Ocean script here. I want to have a discussion here. And I think this would provide help to many newcomers who want to study the command way executing simulation.

     

     ocnWaveformTool( 'wavescan )

    simulator( 'spectreS )

    design(  "/users/.../simulation/OP_AMP/spectreS/schematic/netlist/OP_AMP.C")

    resultsDir( "/users/.../simulation/OP_AMP/spectreS/schematic" )

    path( "/home/aaia11/models" )

    analysis('ac ?start "1"  ?stop "1G"  )

    analysis('dc ?oppoint "rawfile"  ?save "allpub"  )

    desVar(   "vd" 600m       )

    desVar(   "l" 2.55u          )

    desVar(   "Ibias" 430.36n            )

    temp( 27 ) 

    includeFile( "/CMC/kits/cmosp18.5.2/models/spectre/icfspectre.init" )

    run()

    selectResult( 'dcOp )

    plot(getData("/Vout") )

    selectResult( 'ac )

    plot(getData("/Vout") )

    Gain = dB20((VF("/Vout") / (VF("/Vin+") - VF("/Vin-"))))

    plot( Gain ?expr '( "Gain" ) )

    PhaseMargin = (phaseMargin((VF("/Vout") / (VF("/Vin+") - VF("/Vin-")))) + 180)

     

    ocnPrint( ?output "./netlist/results.txt" ?numberNotation 'scientific phaseMargin((VF("/Vout") / (VF("/Vin+") - VF("/Vin-")))) + 180) 

     

     

    I did not see any netlist generation statement. The only netslist that displayed is OP_AMP.C. When I opened it, there is only simulator selection information and a statement of 'USE mylib_OP_AMP_schematic'. I did not see any device information. But I did a bit experiment. I found when I use ADE to generate raw netlist a mylib_OP_AMP_schematic.s is shown up. It records all device information. Therefore I attempted to modify the width of a MOSFET to an unreasonable number and "ocean -replay test.ocn". The plotted graph and the saved data changes. So I know the .s file is the one that I want to modify. [we call it device netlist for now]

    Q2: My question is how does the ocean script know the .s file is the device netlist to be used? Is it through the clue that:

     design("/users/.../simulation/OP_AMP/spectreS/schematic/netlist/OP_AMP.C")'  

    The run() command always tries to find the netlist used in 'design()', which is OP_AMP.C in this example and the OP_AMP.C file would find the device netlist which is .s file through 'USE mylib_OP_AMP_schematic', which means the ‘USE XXX’ statement equals to 'include XXX.s.' Am I correct on his name binding and associated reasoning?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Alex Liao
    Alex Liao over 10 years ago

    Hi Lawrence,

     I understand what you were saying.

    The spectre standalone command is written in the file runSpectre:

    spectre +escchars +log ../psf/spectre.out -env artist5.1.0 -format psfbin  -raw ../psf -E -cols    80 raw/design

    The  raw/design is the generated spectre netlist which is usually named spectreFinal. It has everything inside, the core netlist (device with paremeters and connections) plus variable assignment and simulation settings. The spectreFinal is the generated netlist from Spectre command (maybe Skill language). Do not worry about it right now.

    The simulation result is in ../psf.

    Q1 here: Is there any way (command style) to extract data and save it (say, the phaseMargin) into a txt fire after executing runSpectre? I tried to use ocnPrint(), but failed. So I think the ocnPrint() can only be executed following a Ocean version simulation which is the design() and run() stuff. 

     

    While the Ocean methodology takes the raw netlist, other variable assignment and simulation settings are written in Ocean format. 

    I have a piece of Ocean script here. I want to have a discussion here. And I think this would provide help to many newcomers who want to study the command way executing simulation.

     

     ocnWaveformTool( 'wavescan )

    simulator( 'spectreS )

    design(  "/users/.../simulation/OP_AMP/spectreS/schematic/netlist/OP_AMP.C")

    resultsDir( "/users/.../simulation/OP_AMP/spectreS/schematic" )

    path( "/home/aaia11/models" )

    analysis('ac ?start "1"  ?stop "1G"  )

    analysis('dc ?oppoint "rawfile"  ?save "allpub"  )

    desVar(   "vd" 600m       )

    desVar(   "l" 2.55u          )

    desVar(   "Ibias" 430.36n            )

    temp( 27 ) 

    includeFile( "/CMC/kits/cmosp18.5.2/models/spectre/icfspectre.init" )

    run()

    selectResult( 'dcOp )

    plot(getData("/Vout") )

    selectResult( 'ac )

    plot(getData("/Vout") )

    Gain = dB20((VF("/Vout") / (VF("/Vin+") - VF("/Vin-"))))

    plot( Gain ?expr '( "Gain" ) )

    PhaseMargin = (phaseMargin((VF("/Vout") / (VF("/Vin+") - VF("/Vin-")))) + 180)

     

    ocnPrint( ?output "./netlist/results.txt" ?numberNotation 'scientific phaseMargin((VF("/Vout") / (VF("/Vin+") - VF("/Vin-")))) + 180) 

     

     

    I did not see any netlist generation statement. The only netslist that displayed is OP_AMP.C. When I opened it, there is only simulator selection information and a statement of 'USE mylib_OP_AMP_schematic'. I did not see any device information. But I did a bit experiment. I found when I use ADE to generate raw netlist a mylib_OP_AMP_schematic.s is shown up. It records all device information. Therefore I attempted to modify the width of a MOSFET to an unreasonable number and "ocean -replay test.ocn". The plotted graph and the saved data changes. So I know the .s file is the one that I want to modify. [we call it device netlist for now]

    Q2: My question is how does the ocean script know the .s file is the device netlist to be used? Is it through the clue that:

     design("/users/.../simulation/OP_AMP/spectreS/schematic/netlist/OP_AMP.C")'  

    The run() command always tries to find the netlist used in 'design()', which is OP_AMP.C in this example and the OP_AMP.C file would find the device netlist which is .s file through 'USE mylib_OP_AMP_schematic', which means the ‘USE XXX’ statement equals to 'include XXX.s.' Am I correct on his name binding and associated reasoning?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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