Sim QA: Add tests for AKO and LTspice diodes
This commit is contained in:
parent
7378aaae9d
commit
c4fc9c1b16
|
@ -135,3 +135,12 @@
|
|||
|
||||
* No newline at the end of file.
|
||||
.model D21_Usual D(BV=1.1U CJ=2.2M IBV=3.3 JS=4.4K MJ=5.5MEG N=6.6G)
|
||||
|
||||
* Base for AKO model.
|
||||
.model D22 D(is=11.1n n=2.2 rs=33.3m ikf=99.9 xti=3 eg=1.1)
|
||||
|
||||
* AKO model.
|
||||
.model D23 ako: D22 D(ikf=111.1 eg=2.2 m=.3)
|
||||
|
||||
* AKO model, LTspice parameters.
|
||||
.model D24 ako: D22 D(n=1.1 mfg=KiCad type=Silicon)
|
||||
|
|
|
@ -133,7 +133,7 @@ BOOST_AUTO_TEST_CASE( Diodes )
|
|||
|
||||
const std::vector<SIM_LIBRARY::MODEL> models = m_library->GetModels();
|
||||
|
||||
BOOST_CHECK_EQUAL( models.size(), 22 );
|
||||
BOOST_CHECK_EQUAL( models.size(), 25 );
|
||||
|
||||
for( int i = 0; i < models.size(); ++i )
|
||||
{
|
||||
|
@ -142,6 +142,7 @@ BOOST_AUTO_TEST_CASE( Diodes )
|
|||
switch( i )
|
||||
{
|
||||
case 0:
|
||||
BOOST_CHECK( model.GetType() == SIM_MODEL::TYPE::D );
|
||||
BOOST_CHECK_EQUAL( modelName, "1N4148" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "bv" )->value->ToString(), "100" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "cjo" )->value->ToString(), "4p" );
|
||||
|
@ -155,6 +156,7 @@ BOOST_AUTO_TEST_CASE( Diodes )
|
|||
break;
|
||||
|
||||
case 1:
|
||||
BOOST_CHECK( model.GetType() == SIM_MODEL::TYPE::D );
|
||||
BOOST_CHECK_EQUAL( modelName, "D1" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "is" )->value->ToString(), "1.23n" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "n" )->value->ToString(), "1.23" );
|
||||
|
@ -179,6 +181,7 @@ BOOST_AUTO_TEST_CASE( Diodes )
|
|||
break;
|
||||
|
||||
case 4:
|
||||
BOOST_CHECK( model.GetType() == SIM_MODEL::TYPE::D );
|
||||
BOOST_CHECK_EQUAL( modelName, "D4" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "is" )->value->ToString(), "100f" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "rs" )->value->ToString(), "2" );
|
||||
|
@ -208,6 +211,7 @@ BOOST_AUTO_TEST_CASE( Diodes )
|
|||
break;
|
||||
|
||||
case 18:
|
||||
BOOST_CHECK( model.GetType() == SIM_MODEL::TYPE::D );
|
||||
BOOST_CHECK_EQUAL( modelName, "D<>/?:\\|[]!@#$%^&-_18" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "n" )->value->ToString(), "-1.1" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "m_" )->value->ToString(), "2.2" );
|
||||
|
@ -223,8 +227,43 @@ BOOST_AUTO_TEST_CASE( Diodes )
|
|||
CompareToUsualDiodeModel( model, modelName, i );
|
||||
break;
|
||||
|
||||
case 22:
|
||||
BOOST_CHECK( model.GetType() == SIM_MODEL::TYPE::D );
|
||||
BOOST_CHECK_EQUAL( modelName, "D22" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "is" )->value->ToString(), "11.1n" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "n" )->value->ToString(), "2.2" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "rs" )->value->ToString(), "33.3m" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "ikf" )->value->ToString(), "99.9" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "xti" )->value->ToString(), "3" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "eg" )->value->ToString(), "1.1" );
|
||||
break;
|
||||
|
||||
case 23:
|
||||
BOOST_CHECK( model.GetType() == SIM_MODEL::TYPE::D );
|
||||
BOOST_CHECK_EQUAL( modelName, "D23" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "is" )->value->ToString(), "11.1n" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "n" )->value->ToString(), "2.2" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "rs" )->value->ToString(), "33.3m" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "ikf" )->value->ToString(), "111.1" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "xti" )->value->ToString(), "3" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "eg" )->value->ToString(), "2.2" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "m_" )->value->ToString(), "300m" );
|
||||
break;
|
||||
|
||||
case 24:
|
||||
BOOST_CHECK( model.GetType() == SIM_MODEL::TYPE::D );
|
||||
BOOST_CHECK_EQUAL( modelName, "D24" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "is" )->value->ToString(), "11.1n" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "n" )->value->ToString(), "1.1" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "rs" )->value->ToString(), "33.3m" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "ikf" )->value->ToString(), "99.9" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "xti" )->value->ToString(), "3" );
|
||||
BOOST_CHECK_EQUAL( model.FindParam( "eg" )->value->ToString(), "1.1" );
|
||||
break;
|
||||
|
||||
default:
|
||||
BOOST_FAIL( "Unknown parameter index" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue