示例#1
0
 generic_capacitor_variable(core_device_t dev, string name)
 {
     m_h    = new state_var <nl_fptype>(dev, name + ".m_h", nlconst.zero());
     m_c    = new state_var <nl_fptype>(dev, name + ".m_c", nlconst.zero());
     m_v    = new state_var <nl_fptype>(dev, name + ".m_v", nlconst.zero());
     m_gmin = nlconst.zero();
 }
示例#2
0
 //NETLIB_CONSTRUCTOR_EX(twoterm, nldelegate owner_delegate)
 //template <class C>
 //NETLIB_NAME(twoterm)(C &owner, const pstring &name, nldelegate owner_delegate) \
 //        : base_type(owner, name)
 public nld_twoterm(core_device_t owner, string name, nldelegate owner_delegate)
     : base(owner, name)
 {
     m_P = new terminal_t(owner, name + ".1", owner_delegate); //, &m_N, owner_delegate);
     m_N = new terminal_t(owner, name + ".2", owner_delegate); //, &m_P, owner_delegate);
     m_P.terminal_t_after_ctor(m_N);
     m_N.terminal_t_after_ctor(m_P);
 }
示例#3
0
 //template<>
 public static core_device_t bselect(bool b, netlist_base_t d1, core_device_t d2)
 {
     if (b)
     {
         throw new nl_exception("bselect with netlist and b==true");
     }
     return(d2);
 }
示例#4
0
 //template<>
 public static core_device_t bselect(bool b, netlist_state_t d1, core_device_t d2)
 {
     //plib::unused_var(d1);
     if (b)
     {
         throw new nl_exception("bselect with netlist and b==true");
     }
     return(d2);
 }
示例#5
0
        public generic_diode(diode_e TYPE_, core_device_t dev, string name)
        {
            TYPE = TYPE_;

            m_Vd    = new state_var <nl_fptype>(dev, name + ".m_Vd", nlconst.diode_start_voltage());
            m_Id    = new state_var <nl_fptype>(dev, name + ".m_Id", nlconst.zero());
            m_G     = new state_var <nl_fptype>(dev, name + ".m_G", nlconst.cgminalt());
            m_Vt    = nlconst.zero();
            m_Vmin  = nlconst.zero(); // not used in MOS model
            m_Is    = nlconst.zero();
            m_logIs = nlconst.zero();
            m_gmin  = nlconst.cgminalt();
            m_VtInv = nlconst.zero();
            m_Vcrit = nlconst.zero();


            set_param(
                nlconst.np_Is()
                , nlconst.one()
                , nlconst.cgminalt()
                , nlconst.T0());
            //m_name = name;
        }
示例#6
0
 protected core_terminal_t(core_device_t dev, string aname, state_e state, nldelegate delegate_)
     : base(dev, dev.name() + "." + aname)
 {
示例#7
0
 /// \brief Constructor.
 ///
 /// \param dev  pointer to device owning the object.
 /// \param name string holding the name of the device
 protected device_object_t(core_device_t dev, string aname)
     : base(aname)
 {
     m_device = dev;
 }
示例#8
0
        public generic_capacitor_const(core_device_t dev, string name)
        {
            m_gmin = nlconst.zero();

            //plib::unused_var(dev, name);
        }
示例#9
0
            //template <class C>
            //inline core_device_t &bselect(bool b, C &d1, core_device_t &d2)
            //{
            //    core_device_t *h = dynamic_cast<core_device_t *>(&d1);
            //    return b ? *h : d2;
            //}
            public static core_device_t bselect(bool b, object d1, core_device_t d2)
            {
                var h = (d1 is core_device_t) ? (core_device_t)d1 : null;

                return(b ? h : d2);
            }
示例#10
0
            analog_net_t m_proxied_net; // only for proxy nets in analog input logic


            public proxied_analog_output_t(core_device_t dev, string aname)
                : base(dev, aname)
            {
                m_proxied_net = null;
            }