The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> Circuit Simulators >> problem in iterative simulation in ocean script
https://designers-guide.org/forum/YaBB.pl?num=1384990420

Message started by Shahriar on Nov 20th, 2013, 3:33pm

Title: problem in iterative simulation in ocean script
Post by Shahriar on Nov 20th, 2013, 3:33pm

Hi,

I'm very new to scripted simulation and I'm trying ocean script. I'm trying  to simulate a ring oscillator to see how frequencies vary with FET width. I'm trying a script without using parametric analysis because I want to understand how to use the loop statements like for, while etc.

This is my code.


Code:
simulator( 'spectre )
design(       "/scratch/mjahan/simulation/ring/spectre/schematic/netlist/netlist")
resultsDir( "/scratch/mjahan/simulation/ring/spectre/schematic" )
modelFile(
   '("/research/isis/users/mjahan/cadence/8RF-IC6/models/allModels.scs" "tt")
   '("/research/isis/users/mjahan/cadence/8RF-IC6/models/design.scs" "")
)

wlist = '( 250n 300n 350n 400n 450n 500n )
analysis('dc ?saveOppoint t  )
analysis('tran ?stop "1u"  ?errpreset "conservative"  )
desVar(        "i" 10u      )
envOption(
     'analysisOrder  list("dc" "tran")
)
saveOption( 'currents "selected" )
saveOption( 'save "selected" )
save( 'v "/out" )
converge( 'ic "/out" "0" )
temp( 27 )
i = 1
while ( (i<7)
     desVar( "w" nthelem(i wlist) )
     run()
     fout = (freq v("/out" ?result "tran-tran") "rising" ?xName "time" ?mode "auto" ?threshold 1.2)
     plot( fout ?expr '( "fout" ) )
     v\ \/out\;\ tran\ \(V\) = v("/out" ?result "tran")
     plot( v\ \/out\;\ tran\ \(V\) ?expr '( "v /out; tran (V)" ) )
     f_final = value( fout 1u )
     printf( "final frequency = %f GHz\n", f_final/1e9 )
     i = i+1
)


It's giving an error saying "too few arguments (at least 2 expected, 1 given)". Could someone please tell me what I'm doing wrong here? Thanks in advance.

Title: Re: problem in iterative simulation in ocean script
Post by Shahriar on Nov 21st, 2013, 10:35am

Never mind. I found out the problem. I put a " " after while. It should "while(..." instead of "while (..."

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.