I have several problems on Monte Carlo Analysis using OCEAN. Hope somebody can give me a hand. I really appreciate it.
The first problem is how to specify a seed when doing Monte Carlo analysis. I tried the command monteCarlo( ?seed "2" ?numIters "3" ...) and the Monte Carlo analysis ran successfully. But I am not sure whether it is right, because in the OCEAN reference, the monteCarlo() command do not have an argument like ?seed "2". By the way, what should be taken into consideration when choosing the value of the seed? Can I choose it arbitrarily?
The second problem is how to select and process the result of certain run of a Monte Carlo analysis. For example, after a Monte Carlo analysis is done, I get some files, such as ac.ac , mc1-001_ac.ac , mc1-002_ac.ac , mc1-003_ac.ac and so on. How can I select the result of certain run? Say, the result of the first iteration. I tried the command selectResult( 'ac ) , and then plot() , but three curves were plotted corresponding to the three iterations of Monte Carlo analysis. Then I tried the command selectResult( "ac-ac" ) , and then plot() , only the result of the nominal run before the Monte Carlo analysis was plotted.
The third problem is that can I run an analysis using the input.scs. If the answer is yes, how can I do it? It seems that the input.scs is similar to the .sp file in Hspice. So I guess it can be used to run an analysis. However, I tried the command spectre input.scs ,and it ran successfully. But no result was plotted or saved. Even the psf file was not created.
First of all, you really should not need to set the seed for monte carlo. It has a default seed, intended to give you the same results if you run the same circuit multiple times. It can be set in IC61X easily - in IC5141 if you desperately want to set it you'd have to use:
envSetVal("asimenv.monte" "seedValue" 'string "232") ; the default is "1".
I think you probably need to do this before the simulator() statement in your OCEAN script.
To get to the results of a particular iteration, you can do:
value(v("/out" ?result 'ac) 'iteration 2)
For example. This is assuming that you've turned on the option to save family data (because otherwise it doesn't keep all the waveforms). You must use the "aliased" name of the analysis output (e.g. "ac" rather than "ac-ac") otherwise you will indeed get the nominal results. There's coverage of this in the documentation - you typically need to type:
and compare with
The results browser in IC5141 used to show the unaliased names - but for monte carlo you need to use the aliase names to get the result with variation. In IC615 (from ISR3 onwards), the results browser now shows the aliased name, which is better.
You can run spectre from the command line - using "spectre input.scs". It will produce the output database, but by default will call it "input.raw" (i.e. whatever the input file name is, with the suffix removed, and ".raw" added instead). You can alter that by doing (say):
spectre -raw ../psf input.scs
to tell it to put the results elsewhere.
In reply to Andrew Beckett:
It really works, Andrew. Thank you so much for help me a lot. I really appreciate it.