summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/analog/nlid_fourterm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/netlist/analog/nlid_fourterm.h')
-rw-r--r--src/lib/netlist/analog/nlid_fourterm.h60
1 files changed, 27 insertions, 33 deletions
diff --git a/src/lib/netlist/analog/nlid_fourterm.h b/src/lib/netlist/analog/nlid_fourterm.h
index 641fc72427b..5ca6a747116 100644
--- a/src/lib/netlist/analog/nlid_fourterm.h
+++ b/src/lib/netlist/analog/nlid_fourterm.h
@@ -8,7 +8,8 @@
#ifndef NLID_FOURTERM_H_
#define NLID_FOURTERM_H_
-#include "../nl_base.h"
+#include "netlist/nl_base.h"
+#include "plib/putil.h"
namespace netlist {
namespace analog {
@@ -40,39 +41,32 @@ namespace netlist {
NETLIB_CONSTRUCTOR(VCCS)
, m_G(*this, "G", 1.0)
, m_RI(*this, "RI", 1e9)
- , m_OP(*this, "OP")
- , m_ON(*this, "ON")
- , m_IP(*this, "IP")
- , m_IN(*this, "IN")
- , m_OP1(*this, "_OP1")
- , m_ON1(*this, "_ON1")
+ , m_OP(*this, "OP", &m_IP)
+ , m_ON(*this, "ON", &m_IP)
+ , m_IP(*this, "IP", &m_IN) // <= this should be NULL and terminal be filtered out prior to solving...
+ , m_IN(*this, "IN", &m_IP) // <= this should be NULL and terminal be filtered out prior to solving...
+ , m_OP1(*this, "_OP1", &m_IN)
+ , m_ON1(*this, "_ON1", &m_IN)
, m_gfac(1.0)
{
- m_IP.m_otherterm = &m_IN; // <= this should be NULL and terminal be filtered out prior to solving...
- m_IN.m_otherterm = &m_IP; // <= this should be NULL and terminal be filtered out prior to solving...
-
- m_OP.m_otherterm = &m_IP;
- m_OP1.m_otherterm = &m_IN;
-
- m_ON.m_otherterm = &m_IP;
- m_ON1.m_otherterm = &m_IN;
-
connect(m_OP, m_OP1);
connect(m_ON, m_ON1);
- m_gfac = NL_FCONST(1.0);
+ m_gfac = plib::constants<nl_double>::one();
}
+ NETLIB_RESETI();
+
param_double_t m_G;
param_double_t m_RI;
protected:
- NETLIB_RESETI();
NETLIB_UPDATEI();
NETLIB_UPDATE_PARAMI()
{
NETLIB_NAME(VCCS)::reset();
}
+
terminal_t m_OP;
terminal_t m_ON;
@@ -98,14 +92,14 @@ namespace netlist {
NETLIB_IS_DYNAMIC(true)
- param_double_t m_cur_limit; /* current limit */
-
protected:
- NETLIB_UPDATEI();
+ //NETLIB_UPDATEI();
NETLIB_RESETI();
NETLIB_UPDATE_PARAMI();
NETLIB_UPDATE_TERMINALSI();
+ private:
+ param_double_t m_cur_limit; /* current limit */
nl_double m_vi;
};
@@ -137,12 +131,13 @@ namespace netlist {
public:
NETLIB_CONSTRUCTOR_DERIVED(CCCS, VCCS)
{
- m_gfac = NL_FCONST(1.0) / m_RI();
+ m_gfac = plib::constants<nl_double>::one() / m_RI();
}
- protected:
- NETLIB_UPDATEI();
NETLIB_RESETI();
+
+ protected:
+ //NETLIB_UPDATEI();
NETLIB_UPDATE_PARAMI();
};
@@ -180,29 +175,28 @@ namespace netlist {
public:
NETLIB_CONSTRUCTOR_DERIVED(VCVS, VCCS)
, m_RO(*this, "RO", 1.0)
- , m_OP2(*this, "_OP2")
- , m_ON2(*this, "_ON2")
+ , m_OP2(*this, "_OP2", &m_ON2)
+ , m_ON2(*this, "_ON2", &m_OP2)
{
- m_OP2.m_otherterm = &m_ON2;
- m_ON2.m_otherterm = &m_OP2;
-
connect(m_OP2, m_OP1);
connect(m_ON2, m_ON1);
}
+ NETLIB_RESETI();
+
param_double_t m_RO;
- protected:
+ private:
//NETLIB_UPDATEI();
- NETLIB_RESETI();
//NETLIB_UPDATE_PARAMI();
terminal_t m_OP2;
terminal_t m_ON2;
+
};
- }
-}
+ } // namespace analog
+} // namespace netlist
#endif /* NLD_FOURTERM_H_ */