mirror of https://github.com/KLayout/klayout.git
WIP, debugging tests
This commit is contained in:
parent
4d67c49b75
commit
1f63aaabf5
|
|
@ -502,8 +502,9 @@ DeviceClassResistor::DeviceClassResistor ()
|
|||
{ "M", "" }, // drop
|
||||
// apply scaling if available
|
||||
{ "R", "(R||$)/M" },
|
||||
{ "L", "L*M" },
|
||||
{ "W", "W" },
|
||||
{ "A", "A*M" },
|
||||
{ "W", "W*M" },
|
||||
{ "P", "P*M" }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ void NetlistSpiceWriterDelegate::write_device (const db::Device &dev) const
|
|||
const db::DeviceClass *dc = dev.device_class ();
|
||||
|
||||
const db::DeviceClass::SpiceProfile &profile = dc->spice_profile (mp_writer->profile ());
|
||||
if (! profile.element.empty ()) {
|
||||
if (! profile.outgoing_parameters.empty ()) {
|
||||
write_device_profile (dev, profile);
|
||||
} else {
|
||||
write_device_default (dev);
|
||||
|
|
@ -113,7 +113,6 @@ void NetlistSpiceWriterDelegate::write_device_profile (const db::Device &dev, co
|
|||
os << profile.element;
|
||||
os << format_name (dev.expanded_name ());
|
||||
os << format_terminals_with_order (dev, profile.terminal_order);
|
||||
os << " ";
|
||||
if (! dev.device_class ()->name ().empty ()) {
|
||||
os << " ";
|
||||
os << format_name (dev.device_class ()->name ());
|
||||
|
|
@ -152,7 +151,7 @@ void NetlistSpiceWriterDelegate::write_device_default (const db::Device &dev) co
|
|||
os << format_name (dev.device_class ()->name ());
|
||||
}
|
||||
|
||||
os << format_params (dev, db::DeviceClassCapacitor::param_id_C);
|
||||
os << format_params (dev, db::DeviceClassCapacitor::param_id_C, true);
|
||||
|
||||
} else if (ind) {
|
||||
|
||||
|
|
@ -165,7 +164,7 @@ void NetlistSpiceWriterDelegate::write_device_default (const db::Device &dev) co
|
|||
os << " ";
|
||||
os << format_name (dev.device_class ()->name ());
|
||||
}
|
||||
os << format_params (dev, db::DeviceClassInductor::param_id_L);
|
||||
os << format_params (dev, db::DeviceClassInductor::param_id_L, true);
|
||||
|
||||
} else if (res || res3) {
|
||||
|
||||
|
|
@ -178,7 +177,7 @@ void NetlistSpiceWriterDelegate::write_device_default (const db::Device &dev) co
|
|||
os << " ";
|
||||
os << format_name (dev.device_class ()->name ());
|
||||
}
|
||||
os << format_params (dev, db::DeviceClassResistor::param_id_R);
|
||||
os << format_params (dev, db::DeviceClassResistor::param_id_R, true);
|
||||
|
||||
} else if (diode) {
|
||||
|
||||
|
|
@ -270,9 +269,12 @@ std::string NetlistSpiceWriterDelegate::format_terminals_with_order (const db::D
|
|||
return os.str ();
|
||||
}
|
||||
|
||||
std::string NetlistSpiceWriterDelegate::format_params (const db::Device &dev, size_t without_id) const
|
||||
std::string NetlistSpiceWriterDelegate::format_params (const db::Device &dev, size_t without_id, bool only_primary) const
|
||||
{
|
||||
bool only_primary = ! m_write_all_parameters;
|
||||
if (m_write_all_parameters) {
|
||||
only_primary = false;
|
||||
}
|
||||
|
||||
std::ostringstream os;
|
||||
|
||||
const std::vector<db::DeviceParameterDefinition> &pd = dev.device_class ()->parameter_definitions ();
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public:
|
|||
std::string format_name (const std::string &s) const;
|
||||
std::string format_terminals (const db::Device &dev, size_t max_terminals = std::numeric_limits<size_t>::max ()) const;
|
||||
std::string format_terminals_with_order (const db::Device &dev, const std::vector<std::string> &terminal_order) const;
|
||||
std::string format_params (const db::Device &dev, size_t without_id = std::numeric_limits<size_t>::max ()) const;
|
||||
std::string format_params (const db::Device &dev, size_t without_id = std::numeric_limits<size_t>::max (), bool only_primary = false) const;
|
||||
|
||||
private:
|
||||
friend class NetlistSpiceWriter;
|
||||
|
|
|
|||
|
|
@ -4673,7 +4673,7 @@ TEST(26_JoinSymmetricNets)
|
|||
nl.combine_devices ();
|
||||
EXPECT_EQ (nl.to_string (),
|
||||
"circuit RESCUBE (A=A,B=B);\n"
|
||||
" device RES $10 (A=A,B=B) (R=833.333333333,L=0,W=0,A=0,P=0);\n"
|
||||
" device RES $10 (A=A,B=B) (R=833.333333333333,L=0,W=0,A=0,P=0);\n"
|
||||
"end;\n"
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,6 +75,39 @@ Box.new(-10, 0, 90, 60).width
|
|||
as "false" but as "true"!
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The "nil" value shortcuts numerical expressions the following way:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
nil + x -> nil
|
||||
x + nil -> x
|
||||
nil + nil -> nil
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The same applies to the other binary operators "*", "/", "-", "&" "|", "<< and ">>".
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The unary operators "-" and "~" deliver "nil" when used with a "nil" argument.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The logical binary operators "||" and "&&" behave this way:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
x || y -> x if x is not "nil" or "false", y otherwise
|
||||
x || nil -> x
|
||||
nil || x -> x
|
||||
nil || nil -> nil
|
||||
x && y -> y if x is not "nil" or "false", x otherwise
|
||||
x && nil -> nil
|
||||
nil && x -> nil
|
||||
nil && nil -> nil
|
||||
</pre>
|
||||
|
||||
<h2>Constants</h2>
|
||||
|
||||
<p>
|
||||
|
|
|
|||
Loading…
Reference in New Issue