summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--nl_examples/2N6027.cpp2
-rw-r--r--src/lib/netlist/analog/nld_bjt.cpp59
-rw-r--r--src/lib/netlist/macro/nlm_base.cpp4
-rw-r--r--src/lib/netlist/plib/palloc.h6
4 files changed, 55 insertions, 16 deletions
diff --git a/nl_examples/2N6027.cpp b/nl_examples/2N6027.cpp
index 47903706cb2..8b414317087 100644
--- a/nl_examples/2N6027.cpp
+++ b/nl_examples/2N6027.cpp
@@ -76,7 +76,7 @@ NETLIST_START(PUT_2N6027)
* FIXME: Needs to be removed when added to the
* transistor EB model.
*/
-#if 1
+#if 0
CAP(CJE1, CAP_N(1))
CAP(CJE2, CAP_N(1))
diff --git a/src/lib/netlist/analog/nld_bjt.cpp b/src/lib/netlist/analog/nld_bjt.cpp
index 0f50a9103fb..c2cfbd9faca 100644
--- a/src/lib/netlist/analog/nld_bjt.cpp
+++ b/src/lib/netlist/analog/nld_bjt.cpp
@@ -73,7 +73,7 @@ private:
* | | RBM | minimum base resistance at high currents | | RB | 10 | * |
* | | RE | emitter resistance | | 0 | 1 | * |
* | | RC | collector resistance | | 0 | 10 | * |
- * | | CJE | B-E zero-bias depletion capacitance | F | 0 | 2pF | * |
+ * | Y | CJE | B-E zero-bias depletion capacitance | F | 0 | 2pF | * |
* | | VJE | B-E built-in potential | V | 0.75 | 0.6 | |
* | | MJE | B-E junction exponential factor | - | 0.33 | 0.33 | |
* | | TF | ideal forward transit time | sec | 0 | 0.1ns | |
@@ -81,7 +81,7 @@ private:
* | | VTF | voltage describing VBC dependence of TF | V | infinite | | |
* | | ITF | high-current parameter for effect on TF | A | 0 | | * |
* | | PTF | excess phase at freq=1.0/(TF*2PI) Hz | deg | 0 | | |
- * | | CJC | B-C zero-bias depletion capacitance | F | 0 | 2pF | * |
+ * | Y | CJC | B-C zero-bias depletion capacitance | F | 0 | 2pF | * |
* | | VJC | B-C built-in potential | V | 0.75 | 0.5 | |
* | | MJC | B-C junction exponential factor | - | 0.33 | 0.5 | |
* | | XCJC | fraction of B-C depletion capacitance connected to internal base node | - | 1 | | |
@@ -95,25 +95,31 @@ private:
* | | KF | flicker-noise coefficient | - | 0 | | |
* | | AF | flicker-noise exponent | - | 1 | | |
* | | FC | coefficient for forward-bias depletion capacitance formula | - | 0.5 | | |
- * | | TNOM | Parameter measurement temperature | C | 27 | 50 | | */
+ * | | TNOM | Parameter measurement temperature | C | 27 | 50 | |
+ * */
class bjt_model_t : public param_model_t
{
public:
bjt_model_t(device_t &device, const pstring &name, const pstring &val)
: param_model_t(device, name, val)
- , m_IS(*this, "IS")
- , m_BF(*this, "BF")
- , m_NF(*this, "NF")
- , m_BR(*this, "BR")
- , m_NR(*this, "NR")
+ , m_IS (*this, "IS")
+ , m_BF (*this, "BF")
+ , m_NF (*this, "NF")
+ , m_BR (*this, "BR")
+ , m_NR (*this, "NR")
+ , m_CJE(*this, "CJE")
+ , m_CJC(*this, "CJC")
{}
- value_t m_IS; //!< transport saturation current
- value_t m_BF; //!< ideal maximum forward beta
- value_t m_NF; //!< forward current emission coefficient
- value_t m_BR; //!< ideal maximum reverse beta
- value_t m_NR; //!< reverse current emission coefficient
+ value_t m_IS; //!< transport saturation current
+ value_t m_BF; //!< ideal maximum forward beta
+ value_t m_NF; //!< forward current emission coefficient
+ value_t m_BR; //!< ideal maximum reverse beta
+ value_t m_NR; //!< reverse current emission coefficient
+ value_t m_CJE; //!< B-E zero-bias depletion capacitance
+ value_t m_CJC; //!< B-C zero-bias depletion capacitance
+
};
// Have a common start for transistors
@@ -250,6 +256,19 @@ public:
connect(m_D_EB.m_P, m_D_EC.m_P);
connect(m_D_EB.m_N, m_D_CB.m_N);
connect(m_D_CB.m_P, m_D_EC.m_N);
+
+ if (m_model.m_CJE > 0.0)
+ {
+ register_sub("m_CJE", m_CJE);
+ connect("B", "m_CJE.1");
+ connect("E", "m_CJE.2");
+ }
+ if (m_model.m_CJC > 0.0)
+ {
+ register_sub("m_CJC", m_CJC);
+ connect("B", "m_CJC.1");
+ connect("C", "m_CJC.2");
+ }
}
protected:
@@ -270,6 +289,9 @@ private:
nl_double m_alpha_f;
nl_double m_alpha_r;
+ NETLIB_SUBXX(analog, C) m_CJE;
+ NETLIB_SUBXX(analog, C) m_CJC;
+
};
@@ -376,6 +398,17 @@ NETLIB_UPDATE(QBJT_EB)
NETLIB_RESET(QBJT_EB)
{
NETLIB_NAME(Q)::reset();
+ if (m_CJE)
+ {
+ m_CJE->reset();
+ m_CJE->m_C.setTo(m_model.m_CJE);
+ }
+ if (m_CJC)
+ {
+ m_CJC->reset();
+ m_CJC->m_C.setTo(m_model.m_CJC);
+ }
+
}
NETLIB_UPDATE_TERMINALS(QBJT_EB)
diff --git a/src/lib/netlist/macro/nlm_base.cpp b/src/lib/netlist/macro/nlm_base.cpp
index 86f5a2f941c..6d4d3c252b4 100644
--- a/src/lib/netlist/macro/nlm_base.cpp
+++ b/src/lib/netlist/macro/nlm_base.cpp
@@ -32,8 +32,8 @@ NETLIST_END()
* ---------------------------------------------------------------------------*/
static NETLIST_START(bjt_models)
- NET_MODEL("NPN _(IS=1e-15 BF=100 NF=1 BR=1 NR=1)")
- NET_MODEL("PNP _(IS=1e-15 BF=100 NF=1 BR=1 NR=1)")
+ NET_MODEL("NPN _(IS=1e-15 BF=100 NF=1 BR=1 NR=1 CJE=0 CJC=0)")
+ NET_MODEL("PNP _(IS=1e-15 BF=100 NF=1 BR=1 NR=1 CJE=0 CJC=0)")
NET_MODEL("2SA1015 PNP(Is=295.1E-18 Xti=3 Eg=1.11 Vaf=100 Bf=110 Xtb=1.5 Br=10.45 Rc=15 Cjc=66.2p Mjc=1.054 Vjc=.75 Fc=.5 Cje=5p Mje=.3333 Vje=.75 Tr=10n Tf=1.661n VCEO=45V ICrating=150M MFG=Toshiba)")
NET_MODEL("2SC1815 NPN(Is=2.04f Xti=3 Eg=1.11 Vaf=6 Bf=400 Ikf=20m Xtb=1.5 Br=3.377 Rc=1 Cjc=1p Mjc=.3333 Vjc=.75 Fc=.5 Cje=25p Mje=.3333 Vje=.75 Tr=450n Tf=20n Itf=0 Vtf=0 Xtf=0 VCEO=45V ICrating=150M MFG=Toshiba)")
diff --git a/src/lib/netlist/plib/palloc.h b/src/lib/netlist/plib/palloc.h
index 830ce3ec525..d0e69ed13ec 100644
--- a/src/lib/netlist/plib/palloc.h
+++ b/src/lib/netlist/plib/palloc.h
@@ -147,6 +147,12 @@ namespace plib {
m_is_owned = false;
m_ptr = nullptr;
}
+
+ /**
+ * \brief Return @c true if the stored pointer is not null.
+ */
+ explicit operator bool() const noexcept { return m_ptr != nullptr; }
+
pointer release()
{
pointer tmp = m_ptr;