38 model->SetParamValue(
"pwl", aPwlValue );
45 return model->SpiceGenerator().ItemLine( item );
55 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
"0 0 1 1 2 0" );
57 BOOST_CHECK( out.find(
"PWL(" ) != std::string::npos );
58 BOOST_CHECK( out.find(
"0 0 1 1 2 0" ) != std::string::npos );
65 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
"0 0 1u 0 2u 1" );
67 BOOST_CHECK( out.find(
"1u" ) != std::string::npos );
68 BOOST_CHECK( out.find(
"2u" ) != std::string::npos );
69 BOOST_CHECK( out.find(
"PWL( )" ) == std::string::npos );
75 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
"0 0 1m 1 2m 0" );
77 BOOST_CHECK( out.find(
"1m" ) != std::string::npos );
78 BOOST_CHECK( out.find(
"PWL( )" ) == std::string::npos );
85 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
"0 0 1M 1" );
87 BOOST_CHECK( out.find(
"1Meg" ) != std::string::npos );
94 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
"0 0 {t_start} 1" );
96 BOOST_CHECK( out.find(
"{t_start}" ) != std::string::npos );
97 BOOST_CHECK( out.find(
"PWL( )" ) == std::string::npos );
103 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
104 "0 0 {t_rise} 1u {t_fall} 0" );
106 BOOST_CHECK( out.find(
"{t_rise}" ) != std::string::npos );
107 BOOST_CHECK( out.find(
"{t_fall}" ) != std::string::npos );
108 BOOST_CHECK( out.find(
"1u" ) != std::string::npos );
114 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::I_PWL,
115 "0 0 1u 500m {t_end} 1" );
117 BOOST_CHECK( out.find(
"1u" ) != std::string::npos );
118 BOOST_CHECK( out.find(
"500m" ) != std::string::npos );
119 BOOST_CHECK( out.find(
"{t_end}" ) != std::string::npos );
126 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
127 "0 0 {t_start + 1u} 1" );
129 BOOST_CHECK( out.find(
"{t_start + 1u}" ) != std::string::npos );
130 BOOST_CHECK( out.find(
"PWL( )" ) == std::string::npos );
136 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
137 "0 0 {max( {t_a}, {t_b} )} 1" );
139 BOOST_CHECK( out.find(
"{max( {t_a}, {t_b} )}" ) != std::string::npos );
147 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
148 "0 0 {t_start + 1M} 1" );
150 BOOST_CHECK( out.find(
"1Meg" ) != std::string::npos );
151 BOOST_CHECK( out.find(
"1M}" ) == std::string::npos );
159 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
160 "0 0 {t_start + 1u * scale} 1" );
162 BOOST_CHECK( out.find(
"{t_start + 1u * scale}" ) != std::string::npos );
169 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
170 "0 0 {1Meg + t_start} 1" );
172 BOOST_CHECK( out.find(
"{1Meg + t_start}" ) != std::string::npos );
static std::unique_ptr< SIM_MODEL > Create(TYPE aType, std::span< const wxString > aPins, REPORTER &aReporter)
std::string GeneratePwlItemLine(SIM_MODEL::TYPE aType, const std::string &aPwlValue) const
A wrapper for reporting to a wxString object.
std::vector< std::string > pinNetNames
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
IbisParser parser & reporter
BOOST_TEST_INFO("Two-port Series .op current = "<< iDevice)
BOOST_AUTO_TEST_CASE(PwlPlainNumbers)