I uses a scripts to analyze phase noise of a VCO at different control voltage. I found some data points are significantly different from ADE produced. Then I saved script in ADE and load the script in ocean. The phase noise calculated with ocean script is -80. But at ADE, it is -100. Anyone can tell me how to solve this problem? Thanks! The save script is attached as below. The frequency calculated are consisten, but phase noise are different from ocean script.
ocnWaveformTool( 'wavescan )fp=outfile(sprintf(nil "%s/tmp.csv" resultPATH) "a")fprintf(fp "vc ts cf wc freq amp vcom phasenoise\n")simulator( 'spectre )design( "/users/dtgong/simulation/testLCVCO/spectre/schematic/netlist/netlist")resultsDir( "/users/dtgong/simulation/testLCVCO/spectre/schematic" )modelFile( '("/home/dtgong/peregrine/PSC_Release_3.8.1/Rel_3.8.1/gc/models/psa/spectre/modellib.scs" "Nominal"))analysis('tran ?stop "200n" ?errpreset "conservative" )analysis('pnoise ?sweeptype "relative" ?relharmnum "1" ?start "10K" ?stop "100M" ?maxsideband "7" ?p "/vp0" ?n "/vn0" ?oprobe "" ?iprobe "" ?refsideband "" ?ppv "" )analysis('pss ?fund "5.0G" ?harms "7" ?errpreset "conservative" ?tstab "500n" ?p "/vp0" ?n "/vn0" ?ppv "" )desVar( "wc" 30u )desVar( "wb" 10u )desVar( "cf" 220p )desVar( "r" 10 )desVar( "global_use_preLPE" 1 )desVar( "vc" 1.1 )desVar( "cl" 60f )envOption( 'autoDisplay nil )save( 'i "/I0/I0/R0/MINUS" "/I0/I0/L0/PLUS" "/I0/I0/L1/PLUS" )converge( 'ic "/vn0" "0.01" )temp( 27 ) run()selectResult( 'tran );plot(getData("/vp0") getData("/vn0") getData("/I0/vb") getData("/I0/I0/R0/MINUS") getData("/I0/I0/L0/PLUS") getData("/I0/I0/L1/PLUS") getData("/I0/I0/vtail") )freq = frequency(clip((VT("/vp0") - VT("/vn0")) 1e-08 4e-08));plot( freq ?expr '( "freq" ) )Phase\ Noise\;\ dBc\/Hz\,\ Relative\ Harmonic\ \=\ 1 = phaseNoise(1 "pss_fd" ?result "pnoise");plot( Phase\ Noise\;\ dBc\/Hz\,\ Relative\ Harmonic\ \=\ 1 ?expr '( "Phase Noise; dBc/Hz, Relative Harmonic = 1" ) )ph_1M = value(phaseNoise(1 "pss_fd" ?result "pnoise") 1000000.0);plot( ph_1M ?expr '( "ph_1M" ) );freq0 = (freq (VT("/vp0") - VT("/vn0")) "rising" ?xName "time" ?mode "auto" ?threshold 0.0 ?histoDisplay nil ?noOfHistoBins nil);plot( freq0 ?expr '( "freq0" ) )fprintf(fp "%.3fGHz %f\n" freq*1e-9 ph_1M)close(fp)
Thanks a lot,
Given that in both cases a netlist for spectre is assembled and simulated, I would take the "input.scs" in the netlist directory as simulated in ADE - copy it elsewhere - and then do the same for the OCEAN script - and do a "diff" between the two to see what differences there are. There is bound to be some difference (otherwise the results would be the same) - maybe that will pinpoint the reason and it will become clear if there's something missing (or different) in the OCEAN script.
In reply to Andrew Beckett:
I moved input.scs to a temporary directory. Then I ran simulation at ADE by press button "netlist and run", the phase noise at 1 MHz offset is -98.6. There is no input.scs in netlist direction created after the simulation. Then I ran the same job at OCEAN, the phase noise at 1MHz offset is -77 and input.scs is created, which is same as the one I moved to temporary directory. Any more comments on that?
I am still confused.
Thanks a lot,
In reply to datao:
Make sure you're not running OCEAN and ADE at the same time. Quite likely the ADE run was using spectre's interactive mode - so you had the previous netlist still in spectre's memory.
So to be sure, start ADE from scratch and run the simulation; copy the input.scs. Close ADE and then run your OCEAN script - and then compare the input.scs in both cases.
Check also the spectre.out from both runs - are you using the same versions?
I quite ADE and run OCEAN script, I still get the phase noise at -77. Then I remove input.scs and start ADE. This time the phase noise from ADE is -77! But if I re-run the job in ADE by press button "netlist and run", it is -98.6. The third time run is also -98.6. Now, I at least partially reproduce the results at ADE. But which number is correct?
How to check their version, OCEAN and ADE?
Thanks a lot,
When you hit the run button the second time, spectre will be re-running from what is in memory. It's possible that you have multiple operating points and your circuit is converging on a different solution after the first run.
In order to find out the spectre version - this will appear at the top of the spectre output log, and also "spectre -W" will tell you from the UNIX command line - but I'd check the log file.
You can also try setting "rebuildmatrix=yes" on the Simulator->Options->Analog form (if it's not on the form, type it in the additional parameters field). That said, if there is more than one operating point, maybe you need to investigate that. Perhaps you can check if the PSS simulation is finding the same oscillation frequency the first and second time you run it in ADE? It should tell you at the end of the PSS simulation what the final oscillation frequency is (and you can get this on the direct plot form too) - maybe it's converged on a different solution for the oscillation frequency?
I checked the logFile, the spectre version is 220.127.116.116. In the spectre.out, I do not find the fundemental frequency change in pss analysis. When the option "rebuildmatrix=yes" is checked, I simulated 4 times with ADE, the phase noise is not change, always -77.
If I set "rebuildmatrix=no", then the first simulation get -77, the second simulation I get -98.6. Since frequency does not change, which number is more reasonable?