The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design >> RF Design >> Monte Carlo Simulation and Swept PSS for IIP2
https://designers-guide.org/forum/YaBB.pl?num=1140581758

Message started by schehrazi on Feb 21st, 2006, 8:15pm

Title: Monte Carlo Simulation and Swept PSS for IIP2
Post by schehrazi on Feb 21st, 2006, 8:15pm

Hi,

I tried to run a Monte Carlo simulation to measure the IIP2 of a mixer in presence of device mismatch. For this, I have to run a swept PSS simulation with PAC. Monte Carlo simulation runs, however, it seems to overwrite the data which is saved in each run during the next run. I mean for example run #2 overwrites the saved data in run #1. The reason that I suspect this is 1) the output histogram does not make sense because the mean is not what I expect and the standard deviation is zero 2) count of the files starting with "mc" in the result directory is exactly equal to the count of the nominal swept PSS.

In order to make sure the Monte Carlo simulation runs correctly and my models are right, I did two test simulations on two current mirror MOSFETs. When the two transistors are prefectly matched, the differential DC and AC currents are zero. AC current was generated by exciting the gates of the MOSFETs with an AC voltage [simple PSS was used to simulate this].

Now when I run Monte Carlo with DC and simple PSS, The results make perfect sense. Also I see the files related to all runs in the run directory. However, swept PSS has the above mentioned problem.

Has anybody seen this before?
I am using icfb Ver. 5.0.33

Thank you.

Title: Re: Monte Carlo Simulation and Swept PSS for IIP2
Post by Andrew Beckett on Feb 21st, 2006, 10:00pm

In order to get the histogram, you do not need to have kept all the individual run data (although you can do this by turning on the "save family waveforms" (or whatever the button is called) on the main monte carlo form).

The most likely problem is that you've got the expression for the scalar wrong - perhaps it's referring to a specific results directory, or using the wrong name for the results. The best approach is generally to use the direct plot form, and then hit the "add to outputs" button - this should generate the correct expression.

Often the issue is with the ?results argument in any data access expression. You need to make sure this is referring to the alias name for the results - if you do a single run and then do:


Code:
results()


in the CIW, and compare this (one to one) with:


Code:
results(?noAlias t)


You want to be using the name from results() not results(?noAlias t) as the argument to your ?results keyword argument in the expressions.

Perhaps you can post the expression you're using here - and I can take a look to see if I can spot anything wrong with it?

There were some issues with swept PSS and monte carlo, but these were fixed back in 4.4.5/4.4.6 if my memory is correct.

Best Regards,

Andrew.

Title: Re: Monte Carlo Simulation and Swept PSS for IIP2
Post by schehrazi on Feb 21st, 2006, 11:40pm

Hi,

I appreciate your reply and your help.

These are the results of runing the commands that you suggested plus my expression.

results()
("dcOpInfo-info" output "element-info" "sweeppss_pss_fd-sweep" "dcOp-dc"
   dcOpInfo pac instance "modelParameter-info" "sweeppss_pss_td-sweep"
   variables pss_td designParamVals dcOp "outputParameter-info"
   model "designParamVals-info" "sweeppss_pac-sweep" pss_fd
)


results(?noAlias t)
("dcOpInfo-info" "mc1_outputParameter-montecarlo" "element-info" "sweeppss_pss_fd-sweep" "dcOp-dc"
   "mc1_dcOpInfo-montecarlo" "mc1_pac-montecarlo" "mc1_element-montecarlo" "modelParameter-info" "sweeppss_pss_td-sweep"
   "variables" "mc1_pss_td-montecarlo" "mc1_designParamVals-montecarlo" "mc1_dcOp-montecarlo" "outputParameter-info"
   "mc1_modelParameter-montecarlo" "designParamVals-info" "sweeppss_pac-sweep" "mc1_pss_fd-montecarlo"
)


MY EXPRESSION:

ipn(dB20(harmonic((v "/sss" ?result "sweeppss_pac-sweep" ?resultsDir "/space2/nobackup/chehrazi/simulation/MOSMismatch/spectre/schematic") -1)) dB20(harmonic((v "/sss" ?result "sweeppss_pac-sweep" ?resultsDir "/space2/nobackup/chehrazi/simulation/MOSMismatch/spectre/schematic") 0)) 2 1 -40 -40)





Title: Re: Monte Carlo Simulation and Swept PSS for IIP2
Post by Andrew Beckett on Feb 22nd, 2006, 7:47am

Try getting rid of the ?resultsDir argument pair altogether, and change ?result to ?result "pac". I think the "sweeppss_pac-sweep" will get the nominal run results.

i.e. something like


Code:
ipn(dB20(harmonic((v "/sss" ?result "pac") -1)) dB20(harmonic((v "/sss" ?result "pac") 0)) 2 1 -40 -40)


Regards,

Andrew.

Title: Re: Monte Carlo Simulation and Swept PSS for IIP2
Post by schehrazi on Feb 23rd, 2006, 9:19am

Thank you so much Andrew, it seems to be working.


Title: Re: Monte Carlo Simulation and Swept PSS for IIP2
Post by Andrew Beckett on Feb 23rd, 2006, 10:22am

For the benefit of anyone else reading this thread, you might be thinking that getting the right expression is a bit like magic. Well, the best solution is to use the Direct Plot for to build the expressions - because this uses the correct aliased names for the analyses, and doesn't point to a specific result set. The issue tends to come about when people construct their own expressions using the results browser - because that tends to end up pointing to a specific result set. If you're not careful, you'll end up picking up the nominal run - and so the distribution will have zero deviation (not surprising!). So if you're really going to do it with the results browser, you need to use the results() and results(?noAlias t) trick I mentioned above. It's often a good idea to do this with a simple run, rather than a monte-carlo run, to minimise the confusion.

I do have an enhancement request in to ask for a means of getting the right expression from the results browser (i.e. using the aliased name, and not specifying the results directory) - so hopefully we'll get that one day, which will make generating the right expression easier for results browser users.

Anyway, glad the specific issue was solved in this case!

Best Regards,

Andrew.

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