Sim QA: Test all diode parameters

This commit is contained in:
Mikolaj Wielgus 2022-11-28 08:01:50 +01:00
parent 20ea191f66
commit 26644952a4
2 changed files with 161 additions and 1 deletions

View File

@ -144,3 +144,82 @@
* AKO model, LTspice parameters.
.model D24 ako: D22 D(n=1.1 mfg=KiCad type=Silicon)
* Model with all parameters set (except for a few ones like `level` that are not actually parameters) in the original order.
.model D25 D
*level
+is=000.000E+07
*js
+jsw=100.001E+07
+tnom=200.002E+07
*tref
+rs=300.003E+07
+trs=400.004E+07
*trs1
+trs2=500.005E+07
+n=600.006E+07
+ns=700.007E+07
+tt=800.008E+07
+ttt1=900.009E+07
+ttt2=000.000E+07
+cjo=100.001E+07
*cj0
*cj
+vj=200.002E+07
*pb
+m=300.003E+07
*mj
+tm1=400.004E+07
+tm2=500.005E+07
+cjp=600.006E+07
*cjsw
+php=700.007E+07
+mjsw=800.008E+07
+ikf=900.009E+07
*ik
+ikr=000.000E+07
+nbv=100.001E+07
+area=200.002E+07
+pj=300.003E+07
+tlev=4 ;400.004E+07
+tlevc=5 ;500.005E+07
+eg=600.006E+07
+xti=700.007E+07
+cta=800.008E+07
*ctc
+ctp=900.009E+07
+tpb=000.000E+07
*tvj
+tphp=100.001E+07
+jtun=200.002E+07
+jtunsw=300.003E+07
+ntun=400.004E+07
+xtitun=500.005E+07
+keg=600.006E+07
+kf=700.007E+07
+af=800.008E+07
+fc=900.009E+07
+fcs=000.000E+07
+bv=100.001E+07
+ibv=200.002E+07
*ib
+tcv=300.003E+07
+cond=400.004E+07
+isr=500.005E+07
+nr=600.006E+07
+fv_max=700.007E+07
+bv_max=800.008E+07
+id_max=900.009E+07
+te_max=000.000E+07
+pd_max=100.001E+07
+rth0=200.002E+07
+cth0=300.003E+07
+lm=400.004E+07
+lp=500.005E+07
+wm=600.006E+07
+wp=700.007E+07
+xom=800.008E+07
+xoi=900.009E+07
+xm=000.000E+07
+xp=100.001E+07
*d

View File

@ -219,7 +219,7 @@ BOOST_AUTO_TEST_CASE( Diodes )
const std::vector<SIM_LIBRARY::MODEL> models = m_library->GetModels();
BOOST_CHECK_EQUAL( models.size(), 25 );
BOOST_CHECK_EQUAL( models.size(), 26 );
for( int i = 0; i < models.size(); ++i )
{
@ -347,6 +347,87 @@ BOOST_AUTO_TEST_CASE( Diodes )
BOOST_CHECK_EQUAL( model.FindParam( "eg" )->value->ToString(), "1.1" );
break;
case 25:
BOOST_CHECK( model.GetType() == SIM_MODEL::TYPE::D );
BOOST_CHECK_EQUAL( modelName, "D25" );
//level
BOOST_CHECK_EQUAL( model.FindParam( "is" )->value->ToString(), "0" );
//js
BOOST_CHECK_EQUAL( model.FindParam( "jsw" )->value->ToString(), "1.00001G" );
BOOST_CHECK_EQUAL( model.FindParam( "tnom" )->value->ToString(), "2.00002G" );
//tref
BOOST_CHECK_EQUAL( model.FindParam( "rs" )->value->ToString(), "3.00003G" );
BOOST_CHECK_EQUAL( model.FindParam( "trs" )->value->ToString(), "4.00004G" );
//trs1
BOOST_CHECK_EQUAL( model.FindParam( "trs2" )->value->ToString(), "5.00005G" );
BOOST_CHECK_EQUAL( model.FindParam( "n" )->value->ToString(), "6.00006G" );
BOOST_CHECK_EQUAL( model.FindParam( "ns" )->value->ToString(), "7.00007G" );
BOOST_CHECK_EQUAL( model.FindParam( "tt" )->value->ToString(), "8.00008G" );
BOOST_CHECK_EQUAL( model.FindParam( "ttt1" )->value->ToString(), "9.00009G" );
BOOST_CHECK_EQUAL( model.FindParam( "ttt2" )->value->ToString(), "0" );
BOOST_CHECK_EQUAL( model.FindParam( "cjo" )->value->ToString(), "1.00001G" );
//cj0
//cj
BOOST_CHECK_EQUAL( model.FindParam( "vj" )->value->ToString(), "2.00002G" );
//pb
BOOST_CHECK_EQUAL( model.FindParam( "m_" )->value->ToString(), "3.00003G" );
//mj
BOOST_CHECK_EQUAL( model.FindParam( "tm1" )->value->ToString(), "4.00004G" );
BOOST_CHECK_EQUAL( model.FindParam( "tm2" )->value->ToString(), "5.00005G" );
BOOST_CHECK_EQUAL( model.FindParam( "cjp" )->value->ToString(), "6.00006G" );
//cjsw
BOOST_CHECK_EQUAL( model.FindParam( "php" )->value->ToString(), "7.00007G" );
BOOST_CHECK_EQUAL( model.FindParam( "mjsw" )->value->ToString(), "8.00008G" );
BOOST_CHECK_EQUAL( model.FindParam( "ikf" )->value->ToString(), "9.00009G" );
//ik
BOOST_CHECK_EQUAL( model.FindParam( "ikr" )->value->ToString(), "0" );
BOOST_CHECK_EQUAL( model.FindParam( "nbv" )->value->ToString(), "1.00001G" );
BOOST_CHECK_EQUAL( model.FindParam( "area_" )->value->ToString(), "2.00002G" );
BOOST_CHECK_EQUAL( model.FindParam( "pj_" )->value->ToString(), "3.00003G" );
BOOST_CHECK_EQUAL( model.FindParam( "tlev" )->value->ToString(), "4" ); //"4.00004G" );
BOOST_CHECK_EQUAL( model.FindParam( "tlevc" )->value->ToString(), "5" ); //"5.00005G" );
BOOST_CHECK_EQUAL( model.FindParam( "eg" )->value->ToString(), "6.00006G" );
BOOST_CHECK_EQUAL( model.FindParam( "xti" )->value->ToString(), "7.00007G" );
BOOST_CHECK_EQUAL( model.FindParam( "cta" )->value->ToString(), "8.00008G" );
//ctc
BOOST_CHECK_EQUAL( model.FindParam( "ctp" )->value->ToString(), "9.00009G" );
BOOST_CHECK_EQUAL( model.FindParam( "tpb" )->value->ToString(), "0" );
//tvj
BOOST_CHECK_EQUAL( model.FindParam( "tphp" )->value->ToString(), "1.00001G" );
BOOST_CHECK_EQUAL( model.FindParam( "jtun" )->value->ToString(), "2.00002G" );
BOOST_CHECK_EQUAL( model.FindParam( "jtunsw" )->value->ToString(), "3.00003G" );
BOOST_CHECK_EQUAL( model.FindParam( "ntun" )->value->ToString(), "4.00004G" );
BOOST_CHECK_EQUAL( model.FindParam( "xtitun" )->value->ToString(), "5.00005G" );
BOOST_CHECK_EQUAL( model.FindParam( "keg" )->value->ToString(), "6.00006G" );
BOOST_CHECK_EQUAL( model.FindParam( "kf" )->value->ToString(), "7.00007G" );
BOOST_CHECK_EQUAL( model.FindParam( "af" )->value->ToString(), "8.00008G" );
BOOST_CHECK_EQUAL( model.FindParam( "fc" )->value->ToString(), "9.00009G" );
BOOST_CHECK_EQUAL( model.FindParam( "fcs" )->value->ToString(), "0" );
BOOST_CHECK_EQUAL( model.FindParam( "bv" )->value->ToString(), "1.00001G" );
BOOST_CHECK_EQUAL( model.FindParam( "ibv" )->value->ToString(), "2.00002G" );
//ib
BOOST_CHECK_EQUAL( model.FindParam( "tcv" )->value->ToString(), "3.00003G" );
BOOST_CHECK_EQUAL( model.FindParam( "cond" )->value->ToString(), "4.00004G" );
BOOST_CHECK_EQUAL( model.FindParam( "isr" )->value->ToString(), "5.00005G" );
BOOST_CHECK_EQUAL( model.FindParam( "nr" )->value->ToString(), "6.00006G" );
BOOST_CHECK_EQUAL( model.FindParam( "fv_max" )->value->ToString(), "7.00007G" );
BOOST_CHECK_EQUAL( model.FindParam( "bv_max" )->value->ToString(), "8.00008G" );
BOOST_CHECK_EQUAL( model.FindParam( "id_max" )->value->ToString(), "9.00009G" );
BOOST_CHECK_EQUAL( model.FindParam( "te_max" )->value->ToString(), "0" );
BOOST_CHECK_EQUAL( model.FindParam( "pd_max" )->value->ToString(), "1.00001G" );
BOOST_CHECK_EQUAL( model.FindParam( "rth0" )->value->ToString(), "2.00002G" );
BOOST_CHECK_EQUAL( model.FindParam( "cth0" )->value->ToString(), "3.00003G" );
BOOST_CHECK_EQUAL( model.FindParam( "lm_" )->value->ToString(), "4.00004G" );
BOOST_CHECK_EQUAL( model.FindParam( "lp_" )->value->ToString(), "5.00005G" );
BOOST_CHECK_EQUAL( model.FindParam( "wm_" )->value->ToString(), "6.00006G" );
BOOST_CHECK_EQUAL( model.FindParam( "wp_" )->value->ToString(), "7.00007G" );
BOOST_CHECK_EQUAL( model.FindParam( "xom" )->value->ToString(), "8.00008G" );
BOOST_CHECK_EQUAL( model.FindParam( "xoi" )->value->ToString(), "9.00009G" );
BOOST_CHECK_EQUAL( model.FindParam( "xm" )->value->ToString(), "0" );
BOOST_CHECK_EQUAL( model.FindParam( "xp" )->value->ToString(), "1.00001G" );
//d
break;
default:
BOOST_FAIL( "Unknown parameter index" );
break;