mirror of https://github.com/KLayout/klayout.git
WIP: added NE parameter for BJT3/4, AE and NE are primary parameters now.
This commit is contained in:
parent
6f6b9e898b
commit
9647c94c68
|
|
@ -483,6 +483,7 @@ DB_PUBLIC size_t DeviceClassBJT3Transistor::param_id_AB = 2;
|
|||
DB_PUBLIC size_t DeviceClassBJT3Transistor::param_id_PB = 3;
|
||||
DB_PUBLIC size_t DeviceClassBJT3Transistor::param_id_AC = 4;
|
||||
DB_PUBLIC size_t DeviceClassBJT3Transistor::param_id_PC = 5;
|
||||
DB_PUBLIC size_t DeviceClassBJT3Transistor::param_id_NE = 6;
|
||||
|
||||
DB_PUBLIC size_t DeviceClassBJT3Transistor::terminal_id_C = 0;
|
||||
DB_PUBLIC size_t DeviceClassBJT3Transistor::terminal_id_B = 1;
|
||||
|
|
@ -494,12 +495,14 @@ DeviceClassBJT3Transistor::DeviceClassBJT3Transistor ()
|
|||
add_terminal_definition (db::DeviceTerminalDefinition ("B", "Base"));
|
||||
add_terminal_definition (db::DeviceTerminalDefinition ("E", "Emitter"));
|
||||
|
||||
add_parameter_definition (db::DeviceParameterDefinition ("AE", "Emitter area (square micrometer)", 0.0, false));
|
||||
// NOTE: the emitter area and the emitter count are the primary parameters
|
||||
add_parameter_definition (db::DeviceParameterDefinition ("AE", "Emitter area (square micrometer)", 0.0, true));
|
||||
add_parameter_definition (db::DeviceParameterDefinition ("PE", "Emitter perimeter (micrometer)", 0.0, false));
|
||||
add_parameter_definition (db::DeviceParameterDefinition ("AB", "Base area (square micrometer)", 0.0, false));
|
||||
add_parameter_definition (db::DeviceParameterDefinition ("PB", "Base perimeter (micrometer)", 0.0, false));
|
||||
add_parameter_definition (db::DeviceParameterDefinition ("AC", "Collector area (square micrometer)", 0.0, false));
|
||||
add_parameter_definition (db::DeviceParameterDefinition ("PC", "Collector perimeter (micrometer)", 0.0, false));
|
||||
add_parameter_definition (db::DeviceParameterDefinition ("NE", "Emitter count", 1.0, true));
|
||||
}
|
||||
|
||||
bool DeviceClassBJT3Transistor::combine_devices (Device *a, Device *b) const
|
||||
|
|
@ -529,7 +532,7 @@ bool DeviceClassBJT3Transistor::combine_devices (Device *a, Device *b) const
|
|||
|
||||
void DeviceClassBJT3Transistor::combine_parameters (Device *a, Device *b) const
|
||||
{
|
||||
for (size_t i = 0; i < 6; ++i) {
|
||||
for (size_t i = 0; i < 7; ++i) {
|
||||
a->set_parameter_value (i, a->parameter_value (i) + b->parameter_value (i));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -293,6 +293,7 @@ public:
|
|||
static size_t param_id_PB;
|
||||
static size_t param_id_AC;
|
||||
static size_t param_id_PC;
|
||||
static size_t param_id_NE;
|
||||
|
||||
static size_t terminal_id_C;
|
||||
static size_t terminal_id_B;
|
||||
|
|
|
|||
|
|
@ -492,6 +492,8 @@ void NetlistDeviceExtractorBJT3Transistor::extract_devices (const std::vector<db
|
|||
|
||||
device->set_trans (db::DCplxTrans ((pe->box ().center () - db::Point ()) * dbu ()));
|
||||
|
||||
device->set_parameter_value (db::DeviceClassBJT3Transistor::param_id_NE, 1.0);
|
||||
|
||||
device->set_parameter_value (db::DeviceClassBJT3Transistor::param_id_AE, dbu () * dbu () * pe->area ());
|
||||
device->set_parameter_value (db::DeviceClassBJT3Transistor::param_id_PE, dbu () * pe->perimeter ());
|
||||
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ void NetlistSpiceWriterDelegate::write_device (const db::Device &dev) const
|
|||
os << " PE=" << tl::sprintf ("%.12gU", dev.parameter_value (db::DeviceClassBJT3Transistor::param_id_PE));
|
||||
os << " PB=" << tl::sprintf ("%.12gU", dev.parameter_value (db::DeviceClassBJT3Transistor::param_id_PB));
|
||||
os << " PC=" << tl::sprintf ("%.12gU", dev.parameter_value (db::DeviceClassBJT3Transistor::param_id_PC));
|
||||
os << " NE=" << tl::sprintf ("%.0f", dev.parameter_value (db::DeviceClassBJT3Transistor::param_id_NE));
|
||||
|
||||
} else {
|
||||
|
||||
|
|
|
|||
|
|
@ -183,6 +183,9 @@ Class<db::DeviceClassBJT3Transistor> decl_dbDeviceClassBJT3Transistor (decl_dbDe
|
|||
) +
|
||||
gsi::constant ("PARAM_PC", db::DeviceClassBJT3Transistor::param_id_PC,
|
||||
"@brief A constant giving the parameter ID for parameter PC (collector perimeter)"
|
||||
) +
|
||||
gsi::constant ("PARAM_NE", db::DeviceClassBJT3Transistor::param_id_NE,
|
||||
"@brief A constant giving the parameter ID for parameter NE (emitter count)"
|
||||
),
|
||||
"@brief A device class for a bipolar transistor.\n"
|
||||
"This class describes a bipolar transistor. Bipolar transistors have tree terminals: the collector (C), the base (B) and the emitter (E).\n"
|
||||
|
|
@ -190,6 +193,8 @@ Class<db::DeviceClassBJT3Transistor> decl_dbDeviceClassBJT3Transistor (decl_dbDe
|
|||
"\n"
|
||||
"The parameters are AE, AB and AC for the emitter, base and collector areas in square micrometers and "
|
||||
"PE, PB and PC for the emitter, base and collector perimeters in micrometers.\n"
|
||||
"In addition, the emitter count (NE) is given. The emitter count is 1 always for a transistor extracted initially. "
|
||||
"Upon combination of devices, the emitter counts are added, thus forming multi-emitter devices.\n"
|
||||
"\n"
|
||||
"This class has been introduced in version 0.26."
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2043,6 +2043,7 @@ TEST(39_ParallelBJT3Transistors)
|
|||
d2->set_parameter_value (db::DeviceClassBJT3Transistor::param_id_PB, 14.0);
|
||||
d2->set_parameter_value (db::DeviceClassBJT3Transistor::param_id_AC, 5.0);
|
||||
d2->set_parameter_value (db::DeviceClassBJT3Transistor::param_id_PC, 15.0);
|
||||
d2->set_parameter_value (db::DeviceClassBJT3Transistor::param_id_NE, 4.0);
|
||||
|
||||
db::Circuit *circuit = new db::Circuit ();
|
||||
nl.add_circuit (circuit);
|
||||
|
|
@ -2074,8 +2075,8 @@ TEST(39_ParallelBJT3Transistors)
|
|||
|
||||
EXPECT_EQ (nl.to_string (),
|
||||
"circuit '' (A=n1,B=n2,C=n3);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3) (AE=2,PE=12,AB=3,PB=13,AC=4,PC=14);\n"
|
||||
" device '' d2 (C=n1,B=n2,E=n2) (AE=3,PE=13,AB=4,PB=14,AC=5,PC=15);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3) (AE=2,PE=12,AB=3,PB=13,AC=4,PC=14,NE=1);\n"
|
||||
" device '' d2 (C=n1,B=n2,E=n2) (AE=3,PE=13,AB=4,PB=14,AC=5,PC=15,NE=4);\n"
|
||||
"end;\n"
|
||||
);
|
||||
|
||||
|
|
@ -2084,8 +2085,8 @@ TEST(39_ParallelBJT3Transistors)
|
|||
// no combination as emitters are connected differently
|
||||
EXPECT_EQ (nl.to_string (),
|
||||
"circuit '' (A=n1,B=n2,C=n3);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3) (AE=2,PE=12,AB=3,PB=13,AC=4,PC=14);\n"
|
||||
" device '' d2 (C=n1,B=n2,E=n2) (AE=3,PE=13,AB=4,PB=14,AC=5,PC=15);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3) (AE=2,PE=12,AB=3,PB=13,AC=4,PC=14,NE=1);\n"
|
||||
" device '' d2 (C=n1,B=n2,E=n2) (AE=3,PE=13,AB=4,PB=14,AC=5,PC=15,NE=4);\n"
|
||||
"end;\n"
|
||||
);
|
||||
|
||||
|
|
@ -2093,8 +2094,8 @@ TEST(39_ParallelBJT3Transistors)
|
|||
|
||||
EXPECT_EQ (nl.to_string (),
|
||||
"circuit '' (A=n1,B=n2,C=n3);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3) (AE=2,PE=12,AB=3,PB=13,AC=4,PC=14);\n"
|
||||
" device '' d2 (C=n1,B=n2,E=n3) (AE=3,PE=13,AB=4,PB=14,AC=5,PC=15);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3) (AE=2,PE=12,AB=3,PB=13,AC=4,PC=14,NE=1);\n"
|
||||
" device '' d2 (C=n1,B=n2,E=n3) (AE=3,PE=13,AB=4,PB=14,AC=5,PC=15,NE=4);\n"
|
||||
"end;\n"
|
||||
);
|
||||
|
||||
|
|
@ -2102,7 +2103,7 @@ TEST(39_ParallelBJT3Transistors)
|
|||
|
||||
EXPECT_EQ (nl.to_string (),
|
||||
"circuit '' (A=n1,B=n2,C=n3);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3) (AE=5,PE=25,AB=7,PB=27,AC=9,PC=29);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3) (AE=5,PE=25,AB=7,PB=27,AC=9,PC=29,NE=5);\n"
|
||||
"end;\n"
|
||||
);
|
||||
}
|
||||
|
|
@ -2121,6 +2122,7 @@ TEST(40_ParallelBJT4Transistors)
|
|||
d1->set_parameter_value (db::DeviceClassBJT4Transistor::param_id_PB, 13.0);
|
||||
d1->set_parameter_value (db::DeviceClassBJT4Transistor::param_id_AC, 4.0);
|
||||
d1->set_parameter_value (db::DeviceClassBJT4Transistor::param_id_PC, 14.0);
|
||||
d1->set_parameter_value (db::DeviceClassBJT4Transistor::param_id_NE, 2.0);
|
||||
db::Device *d2 = new db::Device (cls, "d2");
|
||||
d2->set_parameter_value (db::DeviceClassBJT4Transistor::param_id_AE, 3.0);
|
||||
d2->set_parameter_value (db::DeviceClassBJT4Transistor::param_id_PE, 13.0);
|
||||
|
|
@ -2128,6 +2130,7 @@ TEST(40_ParallelBJT4Transistors)
|
|||
d2->set_parameter_value (db::DeviceClassBJT4Transistor::param_id_PB, 14.0);
|
||||
d2->set_parameter_value (db::DeviceClassBJT4Transistor::param_id_AC, 5.0);
|
||||
d2->set_parameter_value (db::DeviceClassBJT4Transistor::param_id_PC, 15.0);
|
||||
d2->set_parameter_value (db::DeviceClassBJT4Transistor::param_id_NE, 3.0);
|
||||
|
||||
db::Circuit *circuit = new db::Circuit ();
|
||||
nl.add_circuit (circuit);
|
||||
|
|
@ -2166,8 +2169,8 @@ TEST(40_ParallelBJT4Transistors)
|
|||
|
||||
EXPECT_EQ (nl.to_string (),
|
||||
"circuit '' (A=n1,B=n2,C=n3,D=n4);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3,S=n4) (AE=2,PE=12,AB=3,PB=13,AC=4,PC=14);\n"
|
||||
" device '' d2 (C=n1,B=n2,E=n2,S=n4) (AE=3,PE=13,AB=4,PB=14,AC=5,PC=15);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3,S=n4) (AE=2,PE=12,AB=3,PB=13,AC=4,PC=14,NE=2);\n"
|
||||
" device '' d2 (C=n1,B=n2,E=n2,S=n4) (AE=3,PE=13,AB=4,PB=14,AC=5,PC=15,NE=3);\n"
|
||||
"end;\n"
|
||||
);
|
||||
|
||||
|
|
@ -2176,8 +2179,8 @@ TEST(40_ParallelBJT4Transistors)
|
|||
// no combination as emitters are connected differently
|
||||
EXPECT_EQ (nl.to_string (),
|
||||
"circuit '' (A=n1,B=n2,C=n3,D=n4);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3,S=n4) (AE=2,PE=12,AB=3,PB=13,AC=4,PC=14);\n"
|
||||
" device '' d2 (C=n1,B=n2,E=n2,S=n4) (AE=3,PE=13,AB=4,PB=14,AC=5,PC=15);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3,S=n4) (AE=2,PE=12,AB=3,PB=13,AC=4,PC=14,NE=2);\n"
|
||||
" device '' d2 (C=n1,B=n2,E=n2,S=n4) (AE=3,PE=13,AB=4,PB=14,AC=5,PC=15,NE=3);\n"
|
||||
"end;\n"
|
||||
);
|
||||
|
||||
|
|
@ -2185,8 +2188,8 @@ TEST(40_ParallelBJT4Transistors)
|
|||
|
||||
EXPECT_EQ (nl.to_string (),
|
||||
"circuit '' (A=n1,B=n2,C=n3,D=n4);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3,S=n4) (AE=2,PE=12,AB=3,PB=13,AC=4,PC=14);\n"
|
||||
" device '' d2 (C=n1,B=n2,E=n3,S=n4) (AE=3,PE=13,AB=4,PB=14,AC=5,PC=15);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3,S=n4) (AE=2,PE=12,AB=3,PB=13,AC=4,PC=14,NE=2);\n"
|
||||
" device '' d2 (C=n1,B=n2,E=n3,S=n4) (AE=3,PE=13,AB=4,PB=14,AC=5,PC=15,NE=3);\n"
|
||||
"end;\n"
|
||||
);
|
||||
|
||||
|
|
@ -2194,7 +2197,7 @@ TEST(40_ParallelBJT4Transistors)
|
|||
|
||||
EXPECT_EQ (nl.to_string (),
|
||||
"circuit '' (A=n1,B=n2,C=n3,D=n4);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3,S=n4) (AE=5,PE=25,AB=7,PB=27,AC=9,PC=29);\n"
|
||||
" device '' d1 (C=n1,B=n2,E=n3,S=n4) (AE=5,PE=25,AB=7,PB=27,AC=9,PC=29,NE=5);\n"
|
||||
"end;\n"
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1581,8 +1581,8 @@ TEST(6_BJT3TransistorExtraction)
|
|||
" device PMOS $2 (S=VDD,G=$4,D=OUT,B=VDD) (L=0.4,W=2.3,AS=1.38,AD=1.38,PS=5.8,PD=5.8);\n"
|
||||
" device PMOS $3 (S=VDD,G=IN,D=$3,B=VDD) (L=0.4,W=2.3,AS=1.38,AD=1.38,PS=5.8,PD=5.8);\n"
|
||||
" device NMOS $4 (S=VSS,G=$4,D=OUT,B=BULK) (L=0.4,W=4.6,AS=2.185,AD=2.185,PS=8.8,PD=8.8);\n"
|
||||
" device PNP $6 (C=BULK,B=$3,E=$3) (AE=3.06,PE=7);\n"
|
||||
" device PNP $7 (C=BULK,B=$3,E=$4) (AE=6.12,PE=14);\n"
|
||||
" device PNP $6 (C=BULK,B=$3,E=$3) (AE=3.06,PE=7,AB=25.2,PB=21.2,AC=25.2,PC=21.2,NE=1);\n"
|
||||
" device PNP $7 (C=BULK,B=$3,E=$4) (AE=6.12,PE=14,AB=50.4,PB=42.4,AC=50.4,PC=42.4,NE=2);\n"
|
||||
" device NMOS $9 (S=VSS,G=IN,D=$3,B=BULK) (L=0.4,W=3.1,AS=1.86,AD=1.86,PS=7.4,PD=7.4);\n"
|
||||
"end;\n"
|
||||
);
|
||||
|
|
|
|||
|
|
@ -787,7 +787,9 @@ std::string device_string (const db::Device *device)
|
|||
s += formatted_value (device->parameter_value (p->id ()));
|
||||
}
|
||||
}
|
||||
s += "]";
|
||||
if (! first) {
|
||||
s += "]";
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
* net 3 n3
|
||||
* net 4 n4
|
||||
* device instance $1 r0 *1 0,0 B3CLS
|
||||
Q$1 3 4 1 B3CLS AE=0.25P AB=1.2P AC=1P PE=0.18U PB=0.75U PC=0.6U
|
||||
Q$1 3 4 1 B3CLS AE=0.25P AB=1.2P AC=1P PE=0.18U PB=0.75U PC=0.6U NE=1
|
||||
* device instance $2 r0 *1 0,0 B3CLS
|
||||
Q$2 2 4 3 B3CLS AE=1.2P AB=1.4P AC=1.5P PE=2.5U PB=2.8U PC=3U
|
||||
Q$2 2 4 3 B3CLS AE=1.2P AB=1.4P AC=1.5P PE=2.5U PB=2.8U PC=3U NE=1
|
||||
.ENDS C1
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
* net 4 n4
|
||||
* net 5 n5
|
||||
* device instance $1 r0 *1 0,0 B4CLS
|
||||
Q$1 3 4 1 5 B4CLS AE=0.25P AB=1.2P AC=1P PE=0.18U PB=0.75U PC=0.6U
|
||||
Q$1 3 4 1 5 B4CLS AE=0.25P AB=1.2P AC=1P PE=0.18U PB=0.75U PC=0.6U NE=1
|
||||
* device instance $2 r0 *1 0,0 B4CLS
|
||||
Q$2 2 4 3 5 B4CLS AE=1.2P AB=1.4P AC=1.5P PE=2.5U PB=2.8U PC=3U
|
||||
Q$2 2 4 3 5 B4CLS AE=1.2P AB=1.4P AC=1.5P PE=2.5U PB=2.8U PC=3U NE=1
|
||||
.ENDS C1
|
||||
|
|
|
|||
Loading…
Reference in New Issue