diff --git a/src/db/db/dbNetlistDeviceClasses.cc b/src/db/db/dbNetlistDeviceClasses.cc index d0eac99a7..57c9bd1f1 100644 --- a/src/db/db/dbNetlistDeviceClasses.cc +++ b/src/db/db/dbNetlistDeviceClasses.cc @@ -501,10 +501,10 @@ DeviceClassResistor::DeviceClassResistor () sp.incoming_parameters = { { "M", "" }, // drop // apply scaling if available - { "R", "(R||$)/(M||1.0)" }, - { "A", "A*(M||1.0)" }, - { "W", "W*(M||1.0)" }, - { "P", "P*(M||1.0)" } + { "R", "(R||$)/M" }, + { "A", "A*M" }, + { "W", "W*M" }, + { "P", "P*M" } }; set_spice_profile (std::string ("*"), sp); @@ -560,9 +560,9 @@ DeviceClassCapacitor::DeviceClassCapacitor () sp.incoming_parameters = { { "M", "" }, // drop // apply scaling if available - { "C", "(C||$)*(M||1.0)" }, - { "A", "A*(M||1.0)" }, - { "P", "P*(M||1.0)" } + { "C", "(C||$)*M" }, + { "A", "A*M" }, + { "P", "P*M" } }; set_spice_profile (std::string ("*"), sp); @@ -614,7 +614,7 @@ DeviceClassInductor::DeviceClassInductor () sp.incoming_parameters = { { "M", "" }, // drop // apply scaling if available - { "L", "(L||$)/(M||1.0)" } + { "L", "(L||$)/M" } }; set_spice_profile (std::string ("*"), sp); @@ -649,8 +649,8 @@ DeviceClassDiode::DeviceClassDiode () sp.incoming_parameters = { { "M", "" }, // drop // apply scaling if available - { "A", "A*(M||1.0)" }, - { "P", "P*(M||1.0)" } + { "A", "A*M" }, + { "P", "P*M" } }; set_spice_profile (std::string ("*"), sp); @@ -697,11 +697,11 @@ DeviceClassMOS3Transistor::DeviceClassMOS3Transistor () { "M", "" }, // drop // apply scaling if available { "L", "_" }, - { "W", "W*(M||1.0)" }, - { "AS", "AS*(M||1.0)" }, - { "PS", "PS*(M||1.0)" }, - { "AD", "AD*(M||1.0)" }, - { "PD", "PD*(M||1.0)" } + { "W", "W*M" }, + { "AS", "AS*M" }, + { "PS", "PS*M" }, + { "AD", "AD*M" }, + { "PD", "PD*M" } }; set_spice_profile (std::string ("*"), sp); @@ -1001,12 +1001,12 @@ DeviceClassBJT3Transistor::DeviceClassBJT3Transistor () { "M", "" }, // drop // apply scaling if available { "NE", "_" }, - { "AE", "AE*(M||1.0)" }, - { "PE", "PE*(M||1.0)" }, - { "AB", "AB*(M||1.0)" }, - { "PB", "PB*(M||1.0)" }, - { "AC", "AC*(M||1.0)" }, - { "PC", "PC*(M||1.0)" } + { "AE", "AE*M" }, + { "PE", "PE*M" }, + { "AB", "AB*M" }, + { "PB", "PB*M" }, + { "AC", "AC*M" }, + { "PC", "PC*M" } }; set_spice_profile (std::string ("*"), sp); diff --git a/src/db/db/dbNetlistSpiceReaderDelegate.cc b/src/db/db/dbNetlistSpiceReaderDelegate.cc index 9b8139527..9164432f8 100644 --- a/src/db/db/dbNetlistSpiceReaderDelegate.cc +++ b/src/db/db/dbNetlistSpiceReaderDelegate.cc @@ -594,6 +594,12 @@ bool NetlistSpiceReaderDelegate::element (db::Circuit *circuit, const std::strin } } + for (auto d = dict.begin (); d != dict.end (); ++d) { + if (! d->first.empty () && d->first.front () != '*' && all_params.find (d->first) == all_params.end ()) { + all_params.insert (std::make_pair (d->first, (const db::DeviceParameterDefinition *) 0)); + } + } + for (auto p = all_params.begin (); p != all_params.end (); ++p) { std::map::const_iterator id; diff --git a/src/db/unit_tests/dbNetlistReaderTests.cc b/src/db/unit_tests/dbNetlistReaderTests.cc index e1dccba7f..9b4018848 100644 --- a/src/db/unit_tests/dbNetlistReaderTests.cc +++ b/src/db/unit_tests/dbNetlistReaderTests.cc @@ -1077,7 +1077,7 @@ TEST(28_SpiceProfiles3) EXPECT_EQ (nl.to_string (), "circuit TOP ();\n" " device NMOS '1' (S=N3,G=N2,D=N1,B=N1) (L=0.25,W=3,AS=0,AD=0,PS=0,PD=0,X=200);\n" - " device PMOS '2' (S=N3,G=N2,D=N5,B=N5) (L=0.25,W=4,AS=0,AD=0,PS=0,PD=0,Y=HELLO!);\n" + " device PMOS '2' (S=N3,G=N2,D=N5,B=N5) (L=0.25,W=4,AS=0,AD=0,PS=0,PD=0,X=42,Y=HELLO!);\n" "end;\n" ); }