The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> Circuit Simulators >> Inductor Monte Carlo Simulation in Cadence-Spectre
https://designers-guide.org/forum/YaBB.pl?num=1241271061

Message started by Ian on May 2nd, 2009, 6:31am

Title: Inductor Monte Carlo Simulation in Cadence-Spectre
Post by Ian on May 2nd, 2009, 6:31am

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 (probably 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 ring any bell for you? Thanks.


Best Regards,
Ian

Title: Re: Inductor Monte Carlo Simulation in Cadence-Spectre
Post by pancho_hideboo on May 2nd, 2009, 6:46am


Ian wrote on May 2nd, 2009, 6:31am:
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)" )
Are these Ocean Scripts ?

I think
 monteExpr( "Sdm" "0.5*(S11-S12-S21+S22)" )
has to be
 monteExpr( "Sdm" "0.5*(sp(1 1 ?result 'sp)-sp(1 2 ?result 'sp)-sp(2 1 ?result 'sp)+sp(2 2 ?result 'sp))" ),
although I don't know Cadence Spectre.

http://www.designers-guide.org/Forum/YaBB.pl?num=1205240723/9#9



Title: Re: Inductor Monte Carlo Simulation in Cadence-Spectre
Post by Ian on May 2nd, 2009, 7:01am


pancho_hideboo wrote on May 2nd, 2009, 6:46am:
I think
 monteExpr( "Sdm" "0.5*(S11-S12-S21+S22)" )
has to be
 monteExpr( "Sdm" "0.5*(sp(1 1 ?result 'sp)-sp(1 2 ?result 'sp)-sp(2 1 ?result 'sp)+sp(2 2 ?result 'sp))" ),
although I don't know Cadence Spectre.


I actually tried the alternative expression for "Sdm" you've mentioned, and it didn't work either.

Title: Re: Inductor Monte Carlo Simulation in Cadence-Spectre
Post by pancho_hideboo on May 2nd, 2009, 7:08am

It is very natural that monteExpr( "Sdm" "0.5*(S11-S12-S21+S22)" ) doesn't work because you don't define S11,S12,S21 and S22.
Again see http://www.designers-guide.org/Forum/YaBB.pl?num=1205240723/9#9


Ian wrote on May 2nd, 2009, 7:01am:
I actually tried the alternative expression for "Sdm" you've mentioned, and it didn't work either.
I don't think it doesn't work.
Show me error messages showed in CIW when you use following.
 monteExpr( "Sdm" "0.5*(sp(1 1 ?result 'sp)-sp(1 2 ?result 'sp)-sp(2 1 ?result 'sp)+sp(2 2 ?result 'sp))" )

Or try the following.
 monteExpr( "Sdm" "0.5*(getData("s11" ?result 'sp)-getData("s12" ?result 'sp)-getData("s21" ?result 'sp)+getData("s22" ?result 'sp))" )


Quote:
monteExpr
monteExpr( t_monteExprName s_expression ) => t/nil
[Description]
Sets up the Monte Carlo scalar expressions that are used to create the histogram file.
[Arguments]
t_monteExprName
  Name of the expression.
s_expression Expression.
  Value Returned
  t Returned if successful.
  nil Returned otherwise.
[Example]
monteExpr( "bw" ’bandwidth( v(\"net7\") 3 \"low\") )

Title: Re: Inductor Monte Carlo Simulation in Cadence-Spectre
Post by oermens on May 2nd, 2009, 4:54pm

I replied this topic on another forum, but will post here for anyone who is interested:

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

try loading these variables into your ADE calculator:

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. for example you can not type in calculator 0.5*Z0*(1+Sdiff)/(1-Sdiff) to get differential impedance. very stupid i know, but it is the way calculator works.

Title: Re: Inductor Monte Carlo Simulation in Cadence-Spectre
Post by pancho_hideboo on May 2nd, 2009, 6:54pm


oermens wrote on May 2nd, 2009, 4:54pm:
s11, s12, s21, s22 have no meaning to spectre
No. It is wrong.

Cadence Spectre save S-parameters as s11, s12, s21, s22 in PSF data.
But you can't use s11, s12, s21, s22 directly in expression.
Again see http://www.designers-guide.org/Forum/YaBB.pl?num=1205240723/9#9


Title: Re: Inductor Monte Carlo Simulation in Cadence-Spectre
Post by oermens on May 2nd, 2009, 8:29pm


pancho_hideboo wrote on May 2nd, 2009, 6:54pm:
Cadence Spectre save S-parameters as s11, s12, s21, s22 in PSF data.
But you can't use s11, s12, s21, s22 directly in expression.
Again see http://www.designers-guide.org/Forum/YaBB.pl?num=1205240723/9#9


ahh i see. because in calculator you can find s11, s12, etc as available functions but when you select them the expression editor will enter aaSP(1 1), aaSP(1 2), etc. i always find it annoying that you can define variables but not refer to them explicitly in expression editor.

Title: Re: Inductor Monte Carlo Simulation in Cadence-Spectre
Post by pancho_hideboo on May 2nd, 2009, 9:40pm


oermens wrote on May 2nd, 2009, 8:29pm:
ahh i see. because in calculator you can find s11, s12, etc as available functions
but when you select them the expression editor will enter aaSP(1 1), aaSP(1 2), etc.

Some calculator functions such as aaSP(), VF(), VT(), etc. are valid only in calculator.
They are not available in Ocean Scripts.

I don't use such functions which are available only in calculator.

A starter of the following were also using a function, VT() which is valid only in calculator.
http://www.designers-guide.org/Forum/YaBB.pl?num=1209239943

Title: Re: Inductor Monte Carlo Simulation in Cadence-Spectre
Post by Ian on May 6th, 2009, 12:52pm

Thanks again, oermans!

As for a single iteration of SP simulation using Ocean stript, the following functions just work fine:

S11=sp(1 1 ?result 'sp)
S12=sp(1 2 ?result 'sp)
S21=sp(2 1 ?result 'sp)
S22=sp(2 2 ?result 'sp)

Sdm=0.5*(S11-S12-S21+S22)
Zdm=100*(1+Sdm)/(1-Sdm)
Xdm=imag(Zdm)
rdm=real(Zdm)
Qd = imag(Zdm)/real(Zdm)

BTW, aaSP() and VF() can be accessible in the script. Compared to SP(), aaSP() takes more processing time in my observation.




Title: Re: Inductor Monte Carlo Simulation in Cadence-Spectre
Post by pancho_hideboo on May 6th, 2009, 5:08pm


Ian wrote on May 6th, 2009, 12:52pm:
BTW, aaSP() and VF() can be accessible in the script.

According to "Skill_Finder", it seems that "VF()" and "VT()" work in OCEAN Script.
But I can't find "aaSP()" in "Skill_Finder".

"sp()" is a standard Ocean function.

Anyway "getData()" is most generic.

Title: Re: Inductor Monte Carlo Simulation in Cadence-Spectre
Post by Andrew Beckett on May 29th, 2009, 1:37am

Ian,


Quote:
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)" )


I believe in some versions it does automatically create SKILL variables with the same name as the monteExpr name. But if you're using too old an IC version, this won't work. A workaround is to do this:


Code:
monteExpr( "S11" "s11=sp(1 1 ?result 'sp)" )
monteExpr( "S12" "s12=sp(1 2 ?result 'sp)" )
monteExpr( "S21" "s21=sp(2 1 ?result 'sp)" )
monteExpr( "S22" "s22=sp(2 2 ?result 'sp)" )
monteExpr( "Sdm" "0.5*(s11-s12-s21+s22)" )


I changed the variables to lower case to avoid clashing with auto-generated variables if you end up using a more recent IC version.

Note, I didn't test this - but I think it should work.

Best Regards,

Andrew.

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