# Inductor Monte Carlo Simulation in Cadence-Spectre

Status
Not open for further replies.

#### Ian.Y.Jin

##### Newbie level 6
Dear All,

I'm currently doing an inductor Monte Carlo simulation in Cadence-Spectre (Cadence version: 5.10.41_USR5.90.69; Spectre version: 6.2.0.420). My objective is to see how the inductance and Q-factor (differential-driven) changes over process variations.

I set up a few expressions to convert 2-port S-parameters to 1-port differential equivalent as follows:

monteExpr( "S11" "sp(1 1 ?result 'sp)" )
monteExpr( "S12" "sp(1 2 ?result 'sp)" )
monteExpr( "S21" "sp(2 1 ?result 'sp)" )
monteExpr( "S22" "sp(2 2 ?result 'sp)" )
monteExpr( "Sdm" "0.5*(S11-S12-S21+S22)" )

The plots of first four expressions are working fine all the time, and I can see the effect of process variations. But the "Sdm" expression gives problem, sometimes it gives only one curve, and sometimes (without anything changed), it even gives error message as follows:
*Error* Evaluating expression ((0.5 * ((S11 - S12 - S21) + S22))).
*Error* ("eval" 13 t nil ("*Error* eval: unbound variable" S11))

I don't know what's going wrong. Does this problem ring any bell for you? Thanks.

Best Regards,
Y. Jin

#### oermens

s11, s12, s21, s22 have no meaning to spectre, you must use aaSP(m n) where m,n can take value 1 or 2

armSetCalcMemory( "Sdiff" "(aaSP(1 1)-aaSP(1 2)-aaSP(2 1)+aaSP(2 2))/2" )
armSetCalcMemory( "Zdiff" "2*50*(1+(aaSP(1 1)-aaSP(1 2)-aaSP(2 1)+aaSP(2 2))/2)/
(1-(aaSP(1 1)-aaSP(1 2)-aaSP(2 1)+aaSP(2 2))/2)" )
armSetCalcMemory( "Rdiff" "real(2*50*(1+(aaSP(1 1)-aaSP(1 2)-aaSP(2 1)+aaSP(2 2)
)/2)/(1-(aaSP(1 1)-aaSP(1 2)-aaSP(2 1)+aaSP(2 2))/2))" )
armSetCalcMemory( "Xdiff" "imag(2*50*(1+(aaSP(1 1)-aaSP(1 2)-aaSP(2 1)+aaSP(2 2)
)/2)/(1-(aaSP(1 1)-aaSP(1 2)-aaSP(2 1)+aaSP(2 2))/2))" )
armSetCalcMemory( "Ldiff" "imag(2*50*(1+(aaSP(1 1)-aaSP(1 2)-aaSP(2 1)+aaSP(2 2)
)/2)/(1-(aaSP(1 1)-aaSP(1 2)-aaSP(2 1)+aaSP(2 2))/2))/(2*pi*xval(aaSP(1 1)))" )
armSetCalcMemory( "Qdiff" "imag(2*50*(1+(aaSP(1 1)-aaSP(1 2)-aaSP(2 1)+aaSP(2 2)
)/2)/(1-(aaSP(1 1)-aaSP(1 2)-aaSP(2 1)+aaSP(2 2))/2))/real(2*50*(1+(aaSP(1 1)-aa
SP(1 2)-aaSP(2 1)+aaSP(2 2))/2)/(1-(aaSP(1 1)-aaSP(1 2)-aaSP(2 1)+aaSP(2 2))/2))
" )

in order: differential sparameter, differential impedance, differential resistance, differential reactance, differential inductance, differential quality factor. even if you define a variable in calculator, if you just type the variable name (ex, Sdiff) into calculator expression it will give error. you have to select the variable from the list of user defined variables in calculator, then in the expression you will see the full equation that the variable represents. very stupid i know, but it is the way calculator works.

#### Ian.Y.Jin

##### Newbie level 6
Thanks a lot, oermens!

I try to load the variables into AWD calculator at CIW command line,
but the list was empty when I checked "var" button in the calculator.
I guess I may miss something from your tips.

Best Regards,
Y. Jin

#### oermens

Try to save it as text file then in AWD calculator go to Memories->Load and select the text file. Then go to Memories->Select to get the equation you're looking for.

Can you try running a single iteration of sp, then doing results->direct plot->main form and select 'add to outputs' before plotting s11/12/21/22, then run monte carlo? But for Sdiff you would still need to write out the equation manually.

#### Ian.Y.Jin

##### Newbie level 6
oermens said:
Try to save it as text file then in AWD calculator go to Memories->Load and select the text file. Then go to Memories->Select to get the equation you're looking for.
Thanks, oermens. It works perfectly for both single iteration and Monte Carlo simulation! In my version of AWD calculator, the exact menu for " Memories->Select" is "Recall" though.

In case some people need to know the detail, after recalling the variable from calculator memory, at the Analog Statistical Analysis window, go to "Get Expressions" and the desired expression will show up as a candidate for "Expression/Signal". Give it a name, and ready to go.
Can you try running a single iteration of sp, then doing results->direct plot->main form and select 'add to outputs' before plotting s11/12/21/22, then run monte carlo? But for Sdiff you would still need to write out the equation manually.
Yes, I can add "s11/12/21/22" to outputs, and plot them from "direct plot->main form" after Monte Carlo simulations.