• 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. RF Design
  3. Ocean scripting: design parameters as output for parametric...

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 63
  • Views 14493
  • 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

Ocean scripting: design parameters as output for parametric analysis of phase noise

Aksh
Aksh over 4 years ago

Hi,

I am not able to find a solution to get the outputs for phase noise in an oscillator at different frequencies along with the input parameters. 

I am varying 7 parameters with specific values in each run of phase noise for an oscillator circuit using the parametric analysis method.

At each specific set of 7 parameters, I am plotting the phase noise vs frequency graph ranging from 10Hz to 1M Hz.

I want to have the output preferably in .out/csv/.m format (so that I can easily import them to Matlab)

The output contains an array of phase noise values for a particular set of design parameters at a given frequency, all the values of design parameters (in separate rows/columns) used for that particular run. This whole set varies with different frequencies.

My current ocean script looks like this, I am not able to figure out how to achieve the objective.

simulator( 'spectre )
design( "/home/chordia.2/simulation/oscillator/spectre/schematic/netlist/netlist")
resultsDir( "/home/chordia.2/simulation/oscillator/spectre/schematic" )
modelFile(
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/mm180_bjt_v121.lib.scs" "tt_bip")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/mm180_mimcap_v101.lib.scs" "mimcaps_typ")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/mm180_reg18bpw_v123.lib.scs" "tt")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/mm180_reg33bpw_v123.lib.scs" "tt")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/mm180_res_v141.lib.scs" "res_typ")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/mm180_lvt18_v113.lib.scs" "tt")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/mm180_lvt33_v113.lib.scs" "tt")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/mm180_reg18_v124.lib.scs" "tt")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/mm180_reg33_v114.lib.scs" "tt")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/mm180_zvt18_v121.lib.scs" "tt")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/mm180_zvt33_v113.lib.scs" "tt")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/core_rf_v2d4.lib.scs" "tt")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/io_rf_v2d3.lib.scs" "tt")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/l_slcr20k_rf_v2d3.lib.scs" "typ")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/mimcapm_rf_v2d3.lib.scs" "typ")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/pad_rf_v2d3.lib.scs" "typ")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/rnhr_rf_v2d4.lib.scs" "typ")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/rnnpo_rf_v2d4.lib.scs" "typ")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/rnppo_rf_v2d4.lib.scs" "typ")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/vardiop_rf_v2d3.lib.scs" "typ")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/varmis_18_rf_v2d3.lib.scs" "typ")
'("/home/UMC_PDK/G-9FD-MIXED_MODE_RFCMOS18-1.8V_3.3V-1P6M-MMC_UM180FDKMFC00000OA-FDK-Ver.A02_PB/UM180FDKMFC00000OA_A02_DESIGNKIT/UM180FDKMFC00000OA_A02_PB/UMC_18_CMOS/../Models/Spectre/mm180_diode_v113.mdl.scs" "")
)
analysis('pnoise ?relharmnum "" ?start "10" ?stop "1M"
?p "/net13" ?n "/net4" ?oprobe "" ?noisetype "timeaverage"
?noiseout list("usb") ?noisetypeUI "" ?ppv "" )
analysis('pss ?engine "Harmonic Balance" ?flexbalance "yes" ?oversamplefactor ""
?fund "2.4G" ?harms "5" ?errpreset "conservative" ?tstab "600n"
?oscana t ?p "/net13" ?n "/net4" ?oscic "lin"
?oscmethod "" ?step "" ?write "" ?writefinal ""
?swapfile "" ?checkpss "" ?ppv "" ?backtracking "" )
desVar( "C" 1e-12 )
desVar( "L" 4.35e-9 )
desVar( "NL" 4.56e-06 )
desVar( "NR" 4.56e-06 )
desVar( "NT" 4.56e-06 )
desVar( "PL" 4.56e-06 )
desVar( "PR" 4.56e-06 )
envOption(
'analysisOrder list("pss" "pnoise")
)
temp( 27 )
paramAnalysis("NL" ?values '(4.839e-06 4.839e-06 4.839e-06 4.839e-06 4.839e-06 4.839e-06 4.839e-06 4.2786e-06 ) ?sweepType 'paramset
paramAnalysis("NR" ?values '(4.8293e-06 4.8293e-06 4.8293e-06 4.8293e-06 4.8293e-06 4.8293e-06 4.2926e-06 4.8293e-06 ) ?sweepType 'paramset
paramAnalysis("NT" ?values '(4.8258e-06 4.8258e-06 4.8258e-06 4.8258e-06 4.8258e-06 4.2794e-06 4.8258e-06 4.8258e-06 ) ?sweepType 'paramset
paramAnalysis("PL" ?values '(4.2742e-06 4.2742e-06 4.2742e-06 4.2742e-06 4.8416e-06 4.2742e-06 4.2742e-06 4.2742e-06 ) ?sweepType 'paramset
paramAnalysis("PR" ?values '(4.8365e-06 4.8365e-06 4.8365e-06 4.2799e-06 4.8365e-06 4.8365e-06 4.8365e-06 4.8365e-06 ) ?sweepType 'paramset
paramAnalysis("L" ?values '(4.6432e-09 4.6432e-09 4.1827e-09 4.6432e-09 4.6432e-09 4.6432e-09 4.6432e-09 4.6432e-09 ) ?sweepType 'paramset
paramAnalysis("C" ?values '(9.4464e-13 1.058e-12 9.4464e-13 9.4464e-13 9.4464e-13 9.4464e-13 9.4464e-13 9.4464e-13 ) ?sweepType 'paramset
)))))))
out=outfile("./scripting_test_output.out","w")
paramRun()
phase\ noise = rfOutputNoise("dBc/Hz" ?result "pnoise")
plot( phase\ noise ?expr '( "phase noise" ) )

  • Cancel
  • ShawnLogan
    ShawnLogan over 4 years ago

    Dear Aksh,

    First, as you probably know, the param() analysis is part of the ADE-L tool which is no longer supported by Cadence. In addition, the job submission process associated with a param analysis is far less efficient than that with the currently supported tools Explorer and Assembler. Hence, I would consider switching your analysis to use Explorer (analogous to the former ADE-L) or Assembler (analogous to ADE-XL).

    Second, having written that, I did study the relevant portion of your ocean script and included it below.


    out=outfile("./scripting_test_output.out","w")
    paramRun()
    phase\ noise = rfOutputNoise("dBc/Hz" ?result "pnoise")
    plot( phase\ noise ?expr '( "phase noise" ) )

    Your script does not produce any files - it just opens a file pointer to file "scripting_test_output.out" from my review of your code. Am I overlooking a section of your code?
    To access a specific waveform following a param() sweep, you need to specify the specific sweep value of the waveform for which you are interested. I do not see that in your code. I usually determine the sweep values for a parameter I am sweeping and then, using the set of sweep values as a list, access the waveforms for each sweep value and print them to a text file. This is done using the ocean functions famGetSweepValues() and famValue(). For example, to access a specific waveform for a single parameter sweep:

    waveform_i = famValue(waveform (nth i famGetSweepValues(waveform)))

    You can then write the data to a text file using the fprintf() command or, alternatively, ocnPrint().

    I hope this helps Aksh.

    Shawn

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Aksh
    Aksh over 4 years ago in reply to ShawnLogan

    Hi Shawn,

    Thanks for taking this up.

    Sure, I will try the explorer and assembler tools. But for the meantime, and to speed the things up, I feel that parametric analysis seems more than sufficient for me.

    Besides, I think the ocean scripting might cost very few changes to shift to these methods. Therefore at first, it seems feasible to build the basic logic for saving the output in the desired fashion.

    and Yes, you are right. The original ocean script file did not contain the line:

    out=outfile("./scripting_test_output.out","w")

    and only had

    paramRun()
    phase\ noise = rfOutputNoise("dBc/Hz" ?result "pnoise")
    plot( phase\ noise ?expr '( "phase noise" ) )

    While unsuccessfully trying to write the code for output generation, I forgot it there and was included in the post.

    And the original script does not generate any outputs. I used to generate them manually using calculator and now want to automate as the experiments are getting tedious.

    I will also try the sweep method, but I have a question. Will sweeping the parameters (even at specific values) won't produce much more experiments than parametric sweeping?

    Because sweeping parameters essentially finds the output for every combination among the different parameters and their different values. (eg. 3 parameters varying at 3 levels makes total combinations for sweeping to 27, but I need only 3 outputs)

    And now talking about the objective:

    This is the output: Output_csv file, I used to generate manually.

    What I need is to have the values of parameters (here given in the first column as a whole) in separate columns.

    Each row includes all the parameter values for that particular run in separate columns and all the phase noise values at the range of frequencies (as it is in the output file). But I am not able to think about the logic needed for this.

    I hope this provides more clarity regarding the objective. 

    Let me know if I missed something again.

    Thank You

    Aksh

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 4 years ago in reply to Aksh

    Dear Aksh,

    Aksh said:


    and Yes, you are right. The original ocean script file did not contain the line:

    out=outfile("./scripting_test_output.out","w")


    You did include that line in your post. I may have confused you - sorry. I was only indicating that your code dreated a pointer to the file but did not attempt to write anything to the file pointer.

    Aksh said:


    I will also try the sweep method, but I have a question. Will sweeping the parameters (even at specific values) won't produce much more experiments than parametric sweeping?

    Because sweeping parameters essentially finds the output for every combination among the different parameters and their different values. (eg. 3 parameters varying at 3 levels makes total combinations for sweeping to 27, but I need only 3 outputs)

    The second sweep is only to access the specific waveforms you are interested in from the set of parametric simulation results. The set of parametric analyses will produce a set of waves entitled a single family of waveforms. To print data from one of more the specific analysese, you need to access that specific wavefrom from the family of waveforms. From your description, you only want a very small subset of the parametric results - which makes me wonder why you are using a set of parametric analyses which includes all combinations. Hence, your access set of sweeps only accesses a small number of the family wavefrom. I hope this is clear.

    Aksh said:


    What I need is to have the values of parameters (here given in the first column as a whole) in separate columns.

    Each row includes all the parameter values for that particular run in separate columns and all the phase noise values at the range of frequencies (as it is in the output file). But I am not able to think about the logic needed for this.

    You can create an array of simulation results and format the text file from that array. Alternatively, print out the data in a format that is produced by your waveform access sweep and re-format it in UNIX/Linux using a shell script with a few awk/sed statements.

    I hope I understood your questions and concerns! As a side note, I am not convinced, however, that continuing to use the parametric analyses will save you time in the long run. Often it is necessary to iterate a design many times.

    Shawn

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Aksh
    Aksh over 4 years ago in reply to ShawnLogan

    Dear Shawn,

    I tried using ADE Explorer and sweeping the parameters at specific values (but it did not happen what I wanted). I think it might take some time to get a hang of it.


    One can always do the post-processing and format the text files, but it adds an extra layer of complexity and time.

    Could you suggest how can I access a specific waveform family of output waveforms ( suggest the methods/functions/commands)?.

    Indexing them one by one and printing them to the output file. The ocean script should give an idea of what the families would be.

    Thanks for clearing out the confusion.

    Aksh

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 4 years ago in reply to Aksh

    Dear Aksh,

    Unknown said:
    This is done using the ocean functions famGetSweepValues() and famValue(). For example, to access a specific waveform for a single parameter sweep:

    waveform_i = famValue(waveform (nth i famGetSweepValues(waveform)))

    You can then write the data to a text file using the fprintf() command or, alternatively, ocnPrint().

    Did you see this in my prior post?

    Shawn

    • 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