mirror of https://github.com/KLayout/klayout.git
WIP: added RBA basic tests for device extractors.
This commit is contained in:
parent
a91c3d3a4e
commit
0794290fb5
|
|
@ -389,6 +389,12 @@ template<> struct type_traits<db::NetlistDeviceExtractorBJT3Transistor> : public
|
|||
typedef tl::false_tag has_default_constructor;
|
||||
};
|
||||
|
||||
template<> struct type_traits<db::NetlistDeviceExtractorBJT4Transistor> : public tl::type_traits<void>
|
||||
{
|
||||
typedef tl::false_tag has_copy_constructor;
|
||||
typedef tl::false_tag has_default_constructor;
|
||||
};
|
||||
|
||||
template<> struct type_traits<db::NetlistDeviceExtractorDiode> : public tl::type_traits<void>
|
||||
{
|
||||
typedef tl::false_tag has_copy_constructor;
|
||||
|
|
|
|||
|
|
@ -437,26 +437,15 @@ Class<db::NetlistDeviceExtractorMOS4Transistor> decl_NetlistDeviceExtractorMOS4T
|
|||
"@brief A device extractor for a four-terminal MOS transistor\n"
|
||||
"\n"
|
||||
"This class supplies the generic extractor for a MOS device.\n"
|
||||
"The device is defined by two basic input layers: the diffusion area\n"
|
||||
"(source and drain) and the gate area. It requires a third layer\n"
|
||||
"(poly) to put the gate terminals on and a forth layer to put the bulk\n"
|
||||
"terminal an. The separation between poly\n"
|
||||
"and allows separating the device recognition layer (gate) from the\n"
|
||||
"conductive layer.\n"
|
||||
"It is based on the \\DeviceExtractorMOS3Transistor class with the extension of a bulk terminal "
|
||||
"and corresponding bulk terminal output (annotation) layer.\n"
|
||||
"\n"
|
||||
"The bulk terminal layer can be an empty layer representing the substrate.\n"
|
||||
"The bulk terminal layer ('tB') can be an empty layer representing the substrate.\n"
|
||||
"In this use mode the bulk terminal shapes will be produced on the 'tB' layer. This\n"
|
||||
"layer then needs to be connected to a global net to establish the net connection.\n"
|
||||
"\n"
|
||||
"The device class produced by this extractor is \\DeviceClassMOS4Transistor.\n"
|
||||
"The extractor extracts the six parameters of this class: L, W, AS, AD, PS and PD.\n"
|
||||
"\n"
|
||||
"The device recognition layer names are 'SD' (source/drain), 'G' (gate) and 'W' (well, bulk).\n"
|
||||
"The terminal output layer names are 'tS' (source), 'tG' (gate), 'tD' (drain) and 'tB' (bulk).\n"
|
||||
"\n"
|
||||
"The diffusion area is distributed on the number of gates connecting to\n"
|
||||
"the particular source or drain area.\n"
|
||||
"\n"
|
||||
"The "
|
||||
"This class is a closed one and methods cannot be reimplemented. To reimplement "
|
||||
"specific methods, see \\DeviceExtractor.\n"
|
||||
"\n"
|
||||
|
|
@ -588,18 +577,19 @@ Class<db::NetlistDeviceExtractorCapacitorWithBulk> decl_NetlistDeviceExtractorCa
|
|||
"This class has been introduced in version 0.26."
|
||||
);
|
||||
|
||||
db::NetlistDeviceExtractorBJT3Transistor *make_bjt_extractor (const std::string &name)
|
||||
db::NetlistDeviceExtractorBJT3Transistor *make_bjt3_extractor (const std::string &name)
|
||||
{
|
||||
return new db::NetlistDeviceExtractorBJT3Transistor (name);
|
||||
}
|
||||
|
||||
Class<db::NetlistDeviceExtractorBJT3Transistor> decl_NetlistDeviceExtractorBJT3Transistor (decl_dbNetlistDeviceExtractor, "db", "DeviceExtractorBJT3Transistor",
|
||||
gsi::constructor ("new", &make_bjt_extractor, gsi::arg ("name"),
|
||||
Class<db::NetlistDeviceExtractorBJT3Transistor> decl_dbNetlistDeviceExtractorBJT3Transistor (decl_dbNetlistDeviceExtractor, "db", "DeviceExtractorBJT3Transistor",
|
||||
gsi::constructor ("new", &make_bjt3_extractor, gsi::arg ("name"),
|
||||
"@brief Creates a new device extractor with the given name."
|
||||
),
|
||||
"@brief A device extractor for a bipolar transistor\n"
|
||||
"@brief A device extractor for a bipolar transistor (BJT)\n"
|
||||
"\n"
|
||||
"This class supplies the generic extractor for a bipolar transistor device.\n"
|
||||
"\n"
|
||||
"Extraction of vertical and lateral transistors is supported through a generic geometry model: "
|
||||
"The basic area is the base area. A marker shape must be provided for this area. "
|
||||
"The emitter of the transistor is defined by emitter layer shapes inside the base area. "
|
||||
|
|
@ -622,6 +612,33 @@ Class<db::NetlistDeviceExtractorBJT3Transistor> decl_NetlistDeviceExtractorBJT3T
|
|||
"This class has been introduced in version 0.26."
|
||||
);
|
||||
|
||||
db::NetlistDeviceExtractorBJT4Transistor *make_bjt4_extractor (const std::string &name)
|
||||
{
|
||||
return new db::NetlistDeviceExtractorBJT4Transistor (name);
|
||||
}
|
||||
|
||||
Class<db::NetlistDeviceExtractorBJT4Transistor> decl_NetlistDeviceExtractorBJT4Transistor (decl_dbNetlistDeviceExtractorBJT3Transistor, "db", "DeviceExtractorBJT4Transistor",
|
||||
gsi::constructor ("new", &make_bjt4_extractor, gsi::arg ("name"),
|
||||
"@brief Creates a new device extractor with the given name."
|
||||
),
|
||||
"@brief A device extractor for a four-terminal bipolar transistor (BJT)\n"
|
||||
"\n"
|
||||
"This class supplies the generic extractor for a bipolar transistor device.\n"
|
||||
"It is based on the \\DeviceExtractorBJT3Transistor class with the extension of a substrate terminal "
|
||||
"and corresponding substrate terminal output (annotation) layer.\n"
|
||||
"\n"
|
||||
"The bulk terminal layer ('tS') can be an empty layer representing the wafer substrate.\n"
|
||||
"In this use mode the substrate terminal shapes will be produced on the 'tS' layer. This\n"
|
||||
"layer then needs to be connected to a global net to establish the net connection.\n"
|
||||
"\n"
|
||||
"The device class produced by this extractor is \\DeviceClassBJT4Transistor.\n"
|
||||
"The "
|
||||
"This class is a closed one and methods cannot be reimplemented. To reimplement "
|
||||
"specific methods, see \\DeviceExtractor.\n"
|
||||
"\n"
|
||||
"This class has been introduced in version 0.26."
|
||||
);
|
||||
|
||||
db::NetlistDeviceExtractorDiode *make_diode_extractor (const std::string &name)
|
||||
{
|
||||
return new db::NetlistDeviceExtractorDiode (name);
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ RUBYTEST (dbNetlistCrossReference, "dbNetlistCrossReference.rb")
|
|||
RUBYTEST (dbMatrix, "dbMatrix.rb")
|
||||
RUBYTEST (dbNetlist, "dbNetlist.rb")
|
||||
RUBYTEST (dbNetlistDeviceClasses, "dbNetlistDeviceClasses.rb")
|
||||
RUBYTEST (dbNetlistDeviceExtractors, "dbNetlistDeviceExtractors.rb")
|
||||
RUBYTEST (dbNetlistWriterTests, "dbNetlistWriterTests.rb")
|
||||
RUBYTEST (dbNetlistCompare, "dbNetlistCompare.rb")
|
||||
RUBYTEST (dbPathTest, "dbPathTest.rb")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
# encoding: UTF-8
|
||||
|
||||
# KLayout Layout Viewer
|
||||
# Copyright (C) 2006-2019 Matthias Koefferlein
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
if !$:.member?(File::dirname($0))
|
||||
$:.push(File::dirname($0))
|
||||
end
|
||||
|
||||
load("test_prologue.rb")
|
||||
|
||||
class DBNetlistExtractorTests_TestClass < TestBase
|
||||
|
||||
def test_1_Error
|
||||
|
||||
err = RBA::NetlistDeviceExtractorError::new
|
||||
|
||||
err.message = "MSG"
|
||||
err.cell_name = "Cell"
|
||||
err.category_name = "Cat"
|
||||
err.category_description = "CatDesc"
|
||||
err.geometry = RBA::DPolygon::new(RBA::DBox::new(1, 2, 3, 4))
|
||||
|
||||
assert_equal(err.message, "MSG")
|
||||
assert_equal(err.cell_name, "Cell")
|
||||
assert_equal(err.category_name, "Cat")
|
||||
assert_equal(err.category_description, "CatDesc")
|
||||
assert_equal(err.geometry.to_s, "(1,2;1,4;3,4;3,2)")
|
||||
|
||||
end
|
||||
|
||||
def test_2_Basic
|
||||
|
||||
ex = RBA::DeviceExtractorMOS3Transistor::new
|
||||
assert_equal(ex.class, RBA::DeviceExtractorMOS3Transistor)
|
||||
|
||||
ex = RBA::DeviceExtractorMOS4Transistor::new
|
||||
assert_equal(ex.class, RBA::DeviceExtractorMOS4Transistor)
|
||||
|
||||
ex = RBA::DeviceExtractorBJT3Transistor::new
|
||||
assert_equal(ex.class, RBA::DeviceExtractorBJT3Transistor)
|
||||
|
||||
ex = RBA::DeviceExtractorBJT4Transistor::new
|
||||
assert_equal(ex.class, RBA::DeviceExtractorBJT4Transistor)
|
||||
|
||||
ex = RBA::DeviceExtractorDiode::new
|
||||
assert_equal(ex.class, RBA::DeviceExtractorDiode)
|
||||
|
||||
ex = RBA::DeviceExtractorResistor::new
|
||||
assert_equal(ex.class, RBA::DeviceExtractorResistor)
|
||||
|
||||
ex = RBA::DeviceExtractorResistorWithBulk::new
|
||||
assert_equal(ex.class, RBA::DeviceExtractorResistorWithBulk)
|
||||
|
||||
ex = RBA::DeviceExtractorCapacitor::new
|
||||
assert_equal(ex.class, RBA::DeviceExtractorCapacitor)
|
||||
|
||||
ex = RBA::DeviceExtractorCapacitorWithBulk::new
|
||||
assert_equal(ex.class, RBA::DeviceExtractorCapacitorWithBulk)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
load("test_epilogue.rb")
|
||||
|
||||
Loading…
Reference in New Issue