mirror of
https://github.com/KLayout/klayout.git
synced 2026-08-29 01:14:35 +02:00
Updated doc, reverted netlist writer to write all parameters - it will only write primary parameters for R, L and C
This commit is contained in:
@@ -117,7 +117,7 @@ void NetlistSpiceWriterDelegate::write_device (const db::Device &dev) const
|
||||
os << " ";
|
||||
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) {
|
||||
|
||||
@@ -130,7 +130,7 @@ void NetlistSpiceWriterDelegate::write_device (const db::Device &dev) const
|
||||
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) {
|
||||
|
||||
@@ -143,7 +143,7 @@ void NetlistSpiceWriterDelegate::write_device (const db::Device &dev) const
|
||||
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) {
|
||||
|
||||
@@ -212,13 +212,13 @@ std::string NetlistSpiceWriterDelegate::format_terminals (const db::Device &dev,
|
||||
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
|
||||
{
|
||||
std::ostringstream os;
|
||||
|
||||
const std::vector<db::DeviceParameterDefinition> &pd = dev.device_class ()->parameter_definitions ();
|
||||
for (std::vector<db::DeviceParameterDefinition>::const_iterator i = pd.begin (); i != pd.end (); ++i) {
|
||||
if (i->id () != without_id) {
|
||||
if (i->id () != without_id && (! only_primary || i->is_primary ())) {
|
||||
double sis = i->si_scaling ();
|
||||
os << " " << i->name () << "=";
|
||||
// for compatibility
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
void emit_comment (const std::string &comment) const;
|
||||
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_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;
|
||||
|
||||
@@ -107,6 +107,7 @@ See <a href="/about/drc_ref_layer.xml#drc">Layer#drc</a>, <a href="#bbox_height"
|
||||
<p>Usage:</p>
|
||||
<ul>
|
||||
<li><tt>bjt3(name)</tt></li>
|
||||
<li><tt>bjt3(name, class)</tt></li>
|
||||
</ul>
|
||||
<p>
|
||||
Use this class with <a href="#extract_devices">extract_devices</a> to specify extraction of a
|
||||
@@ -120,6 +121,7 @@ about this extractor.
|
||||
<p>Usage:</p>
|
||||
<ul>
|
||||
<li><tt>bjt4(name)</tt></li>
|
||||
<li><tt>bjt4(name, class)</tt></li>
|
||||
</ul>
|
||||
<p>
|
||||
Use this class with <a href="#extract_devices">extract_devices</a> to specify extraction of a
|
||||
@@ -143,6 +145,7 @@ This function creates a box object. The arguments are the same than for the
|
||||
<p>Usage:</p>
|
||||
<ul>
|
||||
<li><tt>capacitor(name, area_cap)</tt></li>
|
||||
<li><tt>capacitor(name, area_cap, class)</tt></li>
|
||||
</ul>
|
||||
<p>
|
||||
Use this class with <a href="#extract_devices">extract_devices</a> to specify extraction of a capacitor.
|
||||
@@ -156,6 +159,7 @@ about this extractor.
|
||||
<p>Usage:</p>
|
||||
<ul>
|
||||
<li><tt>capacitor_with_bulk(name, area_cap)</tt></li>
|
||||
<li><tt>capacitor_with_bulk(name, area_cap, class)</tt></li>
|
||||
</ul>
|
||||
<p>
|
||||
Use this class with <a href="#extract_devices">extract_devices</a> to specify extraction of a capacitor
|
||||
@@ -442,6 +446,7 @@ See <a href="/about/drc_ref_netter.xml#device_scaling">Netter#device_scaling</a>
|
||||
<p>Usage:</p>
|
||||
<ul>
|
||||
<li><tt>diode(name)</tt></li>
|
||||
<li><tt>diode(name, class)</tt></li>
|
||||
</ul>
|
||||
<p>
|
||||
Use this class with <a href="#extract_devices">extract_devices</a> to specify extraction of a
|
||||
@@ -455,6 +460,7 @@ about this extractor.
|
||||
<p>Usage:</p>
|
||||
<ul>
|
||||
<li><tt>dmos3(name)</tt></li>
|
||||
<li><tt>dmos3(name, class)</tt></li>
|
||||
</ul>
|
||||
<p>
|
||||
Use this class with <a href="#extract_devices">extract_devices</a> to specify extraction of a
|
||||
@@ -470,6 +476,7 @@ about this extractor (strict mode applies for 'dmos3').
|
||||
<p>Usage:</p>
|
||||
<ul>
|
||||
<li><tt>dmos4(name)</tt></li>
|
||||
<li><tt>dmos4(name, class)</tt></li>
|
||||
</ul>
|
||||
<p>
|
||||
Use this class with <a href="#extract_devices">extract_devices</a> to specify extraction of a
|
||||
@@ -1054,6 +1061,7 @@ argument, "middle" represents the bounding box center marker generator on primar
|
||||
<p>Usage:</p>
|
||||
<ul>
|
||||
<li><tt>mos3(name)</tt></li>
|
||||
<li><tt>mos3(name, class)</tt></li>
|
||||
</ul>
|
||||
<p>
|
||||
Use this class with <a href="#extract_devices">extract_devices</a> to specify extraction of a
|
||||
@@ -1067,6 +1075,7 @@ about this extractor (non-strict mode applies for 'mos3').
|
||||
<p>Usage:</p>
|
||||
<ul>
|
||||
<li><tt>mos4(name)</tt></li>
|
||||
<li><tt>mos4(name, class)</tt></li>
|
||||
</ul>
|
||||
<p>
|
||||
Use this class with <a href="#extract_devices">extract_devices</a> to specify extraction of a
|
||||
@@ -1402,6 +1411,7 @@ version of the L2N DB format will be used.
|
||||
<p>Usage:</p>
|
||||
<ul>
|
||||
<li><tt>resistor(name, sheet_rho)</tt></li>
|
||||
<li><tt>resistor(name, sheet_rho, class)</tt></li>
|
||||
</ul>
|
||||
<p>
|
||||
Use this class with <a href="#extract_devices">extract_devices</a> to specify extraction of a resistor.
|
||||
@@ -1417,6 +1427,7 @@ about this extractor.
|
||||
<p>Usage:</p>
|
||||
<ul>
|
||||
<li><tt>resistor_with_bulk(name, sheet_rho)</tt></li>
|
||||
<li><tt>resistor_with_bulk(name, sheet_rho, class)</tt></li>
|
||||
</ul>
|
||||
<p>
|
||||
Use this class with <a href="#extract_devices">extract_devices</a> to specify extraction of a resistor
|
||||
@@ -1922,6 +1933,7 @@ shape.
|
||||
<p>Usage:</p>
|
||||
<ul>
|
||||
<li><tt>write_spice([ use_net_names [, with_comments ] ])</tt></li>
|
||||
<li><tt>write_spice(writer_delegate [, use_net_names [, with_comments ] ])</tt></li>
|
||||
</ul>
|
||||
<p>
|
||||
Use this option in <a href="#target_netlist">target_netlist</a> for the format parameter to
|
||||
@@ -1929,5 +1941,8 @@ specify SPICE format.
|
||||
"use_net_names" and "with_comments" are boolean parameters indicating
|
||||
whether to use named nets (numbers if false) and whether to add
|
||||
information comments such as instance coordinates or pin names.
|
||||
</p><p>
|
||||
"writer_delegate" allows using a <a href="#NetlistSpiceWriterDelegate">NetlistSpiceWriterDelegate</a> object to
|
||||
control the actual writing.
|
||||
</p>
|
||||
</doc>
|
||||
|
||||
@@ -3334,7 +3334,7 @@ The tile size must be specified with the "tile_size" option:
|
||||
</p><p>
|
||||
<pre>
|
||||
# reports areas where layer 1/0 density is below 10% on 20x20 um tiles
|
||||
low_density = input(1, 0).density(0.0 .. 0.1, tile_size(20.um))
|
||||
low_density = input(1, 0).with_density(0.0 .. 0.1, tile_size(20.um))
|
||||
</pre>
|
||||
</p><p>
|
||||
Anisotropic tiles can be specified by giving two values, like "tile_size(10.um, 20.um)".
|
||||
@@ -3348,7 +3348,7 @@ in increments of the tile step:
|
||||
<pre>
|
||||
# reports areas where layer 1/0 density is below 10% on 30x30 um tiles
|
||||
# with a tile step of 20x20 um:
|
||||
low_density = input(1, 0).density(0.0 .. 0.1, tile_size(30.um), tile_step(20.um))
|
||||
low_density = input(1, 0).with_density(0.0 .. 0.1, tile_size(30.um), tile_step(20.um))
|
||||
</pre>
|
||||
</p><p>
|
||||
For "tile_step", anisotropic values can be given as well by using two values: the first for the
|
||||
@@ -3366,7 +3366,7 @@ drawn boundary layer. To specify a separate, additional layer included in the bo
|
||||
# reports density of layer 1/0 below 10% on 20x20 um tiles. The layout's boundary is taken from
|
||||
# layer 0/0:
|
||||
cell_frame = input(0, 0)
|
||||
low_density = input(1, 0).density(0.0 .. 0.1, tile_size(20.um), tile_boundary(cell_frame))
|
||||
low_density = input(1, 0).with_density(0.0 .. 0.1, tile_size(20.um), tile_boundary(cell_frame))
|
||||
</pre>
|
||||
</p><p>
|
||||
Note that the layer given in "tile_boundary" adds to the input layer for computing the bounding box.
|
||||
@@ -3378,7 +3378,7 @@ direction. With the "tile_origin" option this allows full control over the area
|
||||
<pre>
|
||||
# reports density of layer 1/0 below 10% on 20x20 um tiles in the region 0,0 .. 2000,3000
|
||||
# (100 and 150 tiles of 20 um each are used in horizontal and vertical direction):
|
||||
low_density = input(1, 0).density(0.0 .. 0.1, tile_size(20.um), tile_origin(0.0, 0.0), tile_count(100, 150))
|
||||
low_density = input(1, 0).with_density(0.0 .. 0.1, tile_size(20.um), tile_origin(0.0, 0.0), tile_count(100, 150))
|
||||
</pre>
|
||||
</p><p>
|
||||
The "padding mode" indicates how the area outside the layout's bounding box is considered.
|
||||
@@ -3392,7 +3392,7 @@ There are two modes:
|
||||
Example:
|
||||
</p><p>
|
||||
<pre>
|
||||
low_density = input(1, 0).density(0.0 .. 0.1, tile_size(20.um), padding_ignore)
|
||||
low_density = input(1, 0).with_density(0.0 .. 0.1, tile_size(20.um), padding_ignore)
|
||||
</pre>
|
||||
</p><p>
|
||||
The complementary version of "with_density" is <a href="#without_density">without_density</a>.
|
||||
|
||||
@@ -386,6 +386,9 @@ gate = nactive & poly # gate area
|
||||
|
||||
extract_devices(mos4("NMOS4"), { :SD => nsd, :G => gate, :P => poly, :W => bulk })
|
||||
</pre>
|
||||
</p><p>
|
||||
The return value of this method will be the device class of the devices
|
||||
generated in the extraction step (see <a href="#DeviceClass">DeviceClass</a>).
|
||||
</p>
|
||||
<a name="l2n_data"/><h2>"l2n_data" - Gets the internal <class_doc href="LayoutToNetlist">LayoutToNetlist</class_doc> object</h2>
|
||||
<keyword name="l2n_data"/>
|
||||
|
||||
Reference in New Issue
Block a user