26#include <boost/algorithm/string/predicate.hpp>
43 for( MODEL_TYPE type : MODEL_TYPE_ITERATOR() )
45 BOOST_TEST_CONTEXT(
"Model name: " << ModelInfo( type ).
name )
47 const std::vector<SIM_MODEL::PARAM::INFO> modelParams = ModelInfo( type ).modelParams;
48 const std::vector<SIM_MODEL::PARAM::INFO> instanceParams = ModelInfo( type ).instanceParams;
52 BOOST_TEST_CONTEXT(
"Model param name: " << modelParam.name )
55 BOOST_CHECK( std::none_of( modelParams.begin(), modelParams.end(),
56 [&modelParam](
const auto& aOtherModelParam )
58 return modelParam.id != aOtherModelParam.id
59 && modelParam.name == aOtherModelParam.name;
64 BOOST_CHECK( std::none_of( instanceParams.begin(), instanceParams.end(),
65 [&modelParam](
const auto& aInstanceParam )
67 return modelParam.name == aInstanceParam.name;
70 if( boost::ends_with( modelParam.name,
"_" ) )
76 BOOST_CHECK( std::any_of( instanceParams.begin(), instanceParams.end(),
77 [&modelParam](
const auto& aInstanceParam )
79 return modelParam.name.substr( 0, modelParam.name.length() - 1 )
80 == aInstanceParam.name;
89 BOOST_TEST_CONTEXT(
"Instance param name: " << instanceParam.name )
91 BOOST_CHECK( std::none_of( instanceParams.begin(), instanceParams.end(),
92 [&instanceParam](
const auto& aOtherInstanceParam )
94 return instanceParam.id != aOtherInstanceParam.id
95 && instanceParam.dir != SIM_MODEL::PARAM::DIR_OUT
96 && aOtherInstanceParam.dir != SIM_MODEL::PARAM::DIR_OUT
97 && instanceParam.name == aOtherInstanceParam.name;
111 for( MODEL_TYPE type : MODEL_TYPE_ITERATOR() )
113 const std::vector<SIM_MODEL::PARAM::INFO> modelParams = ModelInfo( type ).modelParams;
114 const std::vector<SIM_MODEL::PARAM::INFO> instanceParams = ModelInfo( type ).instanceParams;
118 case MODEL_TYPE::NONE:
119 case MODEL_TYPE::_ENUM_END:
167 case MODEL_TYPE::DIODE:
168 BOOST_CHECK_EQUAL( modelParams.size(), 76 );
169 BOOST_CHECK_EQUAL( instanceParams.size(), 30 );
172 case MODEL_TYPE::BJT:
173 BOOST_CHECK_EQUAL( modelParams.size(), 152 );
174 BOOST_CHECK_EQUAL( instanceParams.size(), 53 );
177 case MODEL_TYPE::VBIC:
178 BOOST_CHECK_EQUAL( modelParams.size(), 117 );
179 BOOST_CHECK_EQUAL( instanceParams.size(), 45 );
182 case MODEL_TYPE::HICUM2:
183 BOOST_CHECK_EQUAL( modelParams.size(), 149 );
184 BOOST_CHECK_EQUAL( instanceParams.size(), 61 );
187 case MODEL_TYPE::JFET:
188 BOOST_CHECK_EQUAL( modelParams.size(), 34 );
189 BOOST_CHECK_EQUAL( instanceParams.size(), 28 );
192 case MODEL_TYPE::JFET2:
193 BOOST_CHECK_EQUAL( modelParams.size(), 46 );
194 BOOST_CHECK_EQUAL( instanceParams.size(), 30 );
197 case MODEL_TYPE::MES:
198 BOOST_CHECK_EQUAL( modelParams.size(), 22 );
199 BOOST_CHECK_EQUAL( instanceParams.size(), 25 );
202 case MODEL_TYPE::MESA:
203 BOOST_CHECK_EQUAL( modelParams.size(), 71 );
204 BOOST_CHECK_EQUAL( instanceParams.size(), 30 );
207 case MODEL_TYPE::HFET1:
208 BOOST_CHECK_EQUAL( modelParams.size(), 68 );
209 BOOST_CHECK_EQUAL( instanceParams.size(), 28 );
212 case MODEL_TYPE::HFET2:
213 BOOST_CHECK_EQUAL( modelParams.size(), 40 );
214 BOOST_CHECK_EQUAL( instanceParams.size(), 28 );
217 case MODEL_TYPE::VDMOS:
218 BOOST_CHECK_EQUAL( modelParams.size(), 69 );
219 BOOST_CHECK_EQUAL( instanceParams.size(), 36 );
222 case MODEL_TYPE::MOS1:
223 BOOST_CHECK_EQUAL( modelParams.size(), 35 );
224 BOOST_CHECK_EQUAL( instanceParams.size(), 76 );
227 case MODEL_TYPE::MOS2:
228 BOOST_CHECK_EQUAL( modelParams.size(), 42 );
229 BOOST_CHECK_EQUAL( instanceParams.size(), 76 );
232 case MODEL_TYPE::MOS3:
233 BOOST_CHECK_EQUAL( modelParams.size(), 48 );
234 BOOST_CHECK_EQUAL( instanceParams.size(), 81 );
237 case MODEL_TYPE::BSIM1:
238 BOOST_CHECK_EQUAL( modelParams.size(), 81 );
239 BOOST_CHECK_EQUAL( instanceParams.size(), 14 );
242 case MODEL_TYPE::BSIM2:
243 BOOST_CHECK_EQUAL( modelParams.size(), 137 );
244 BOOST_CHECK_EQUAL( instanceParams.size(), 14 );
247 case MODEL_TYPE::MOS6:
248 BOOST_CHECK_EQUAL( modelParams.size(), 42 );
249 BOOST_CHECK_EQUAL( instanceParams.size(), 78 );
252 case MODEL_TYPE::BSIM3:
253 BOOST_CHECK_EQUAL( modelParams.size(), 429 );
254 BOOST_CHECK_EQUAL( instanceParams.size(), 46 );
257 case MODEL_TYPE::MOS9:
258 BOOST_CHECK_EQUAL( modelParams.size(), 48 );
259 BOOST_CHECK_EQUAL( instanceParams.size(), 81 );
262 case MODEL_TYPE::B4SOI:
263 BOOST_CHECK_EQUAL( modelParams.size(), 915 );
264 BOOST_CHECK_EQUAL( instanceParams.size(), 74 );
267 case MODEL_TYPE::BSIM4:
268 BOOST_CHECK_EQUAL( modelParams.size(), 892 );
269 BOOST_CHECK_EQUAL( instanceParams.size(), 84 );
272 case MODEL_TYPE::B3SOIFD:
273 BOOST_CHECK_EQUAL( modelParams.size(), 393 );
274 BOOST_CHECK_EQUAL( instanceParams.size(), 27 );
277 case MODEL_TYPE::B3SOIDD:
278 BOOST_CHECK_EQUAL( modelParams.size(), 393 );
279 BOOST_CHECK_EQUAL( instanceParams.size(), 27 );
282 case MODEL_TYPE::B3SOIPD:
283 BOOST_CHECK_EQUAL( modelParams.size(), 470 );
284 BOOST_CHECK_EQUAL( instanceParams.size(), 36 );
287 case MODEL_TYPE::HISIM2:
288 BOOST_CHECK_EQUAL( modelParams.size(), 486 );
289 BOOST_CHECK_EQUAL( instanceParams.size(), 59 );
292 case MODEL_TYPE::HISIMHV1:
293 BOOST_CHECK_EQUAL( modelParams.size(), 610 );
294 BOOST_CHECK_EQUAL( instanceParams.size(), 72 );
297 case MODEL_TYPE::HISIMHV2:
298 BOOST_CHECK_EQUAL( modelParams.size(), 730 );
299 BOOST_CHECK_EQUAL( instanceParams.size(), 74 );
303 BOOST_FAIL( wxString::Format(
304 "Unhandled type: %d "
305 "(if you created a new type you need to handle it in this switch "
TEST_SIM_MODEL_NGSPICE_FIXTURE()
@ NONE
No connection to this item.
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(ParamDuplicates)