void nld_d_to_a_proxy::reset() { m_Q.initial(0.0); m_last_state = -1; m_RV.do_reset(); m_is_timestep = m_RV.m_P.net().as_analog().solver()->is_timestep(); m_RV.set(NL_FCONST(1.0) / logic_family().m_R_low, logic_family().m_low_V, 0.0); }
void nld_d_to_a_proxy::reset() { // FIXME: Variable voltage double supply_V = logic_family().fixed_V(); if (supply_V == 0.0) supply_V = 5.0; //m_Q.initial(0.0); m_last_state = -1; m_RV.do_reset(); m_is_timestep = m_RV.m_P.net().solver()->has_timestep_devices(); m_RV.set(NL_FCONST(1.0) / logic_family().R_low(), logic_family().low_V(0.0, supply_V), 0.0); }
void nld_d_to_a_proxy::reset() { // FIXME: Variable voltage double supply_V = logic_family()->fixed_V(); if (supply_V == 0.0) supply_V = 5.0; //m_Q.initial(0.0); m_last_state = -1; m_RV.reset(); m_is_timestep = m_RV.m_P.net().solver()->has_timestep_devices(); m_RV.set_G_V_I(plib::constants<nl_double>::one() / logic_family()->R_low(), logic_family()->low_V(0.0, supply_V), 0.0); }
ATTR_HOT void nld_d_to_a_proxy::update() { const int state = INPLOGIC(m_I); if (state != m_last_state) { m_last_state = state; const nl_double R = state ? logic_family().m_R_high : logic_family().m_R_low; const nl_double V = state ? logic_family().m_high_V : logic_family().m_low_V; // We only need to update the net first if this is a time stepping net if (m_is_timestep) { m_RV.update_dev(); } m_RV.set(NL_FCONST(1.0) / R, V, 0.0); m_RV.m_P.schedule_after(NLTIME_FROM_NS(1)); } }
core_device_t::core_device_t(netlist_state_t &owner, const pstring &name) : object_t(name) , logic_family_t() , netlist_ref(owner) , m_hint_deactivate(false) , m_active_outputs(*this, "m_active_outputs", 1) { if (logic_family() == nullptr) set_logic_family(family_TTL()); }
core_device_t::core_device_t(netlist_t &owner, const pstring &name) : object_t(name) , logic_family_t() , netlist_ref(owner) , m_hint_deactivate(false) #if (NL_PMF_TYPE > NL_PMF_TYPE_VIRTUAL) , m_static_update() #endif { if (logic_family() == nullptr) set_logic_family(family_TTL()); }
core_device_t::core_device_t(core_device_t &owner, const pstring &name) : object_t(owner.name() + "." + name) , logic_family_t() , netlist_ref(owner.state()) , m_hint_deactivate(false) , m_active_outputs(*this, "m_active_outputs", 1) { set_logic_family(owner.logic_family()); if (logic_family() == nullptr) set_logic_family(family_TTL()); state().add_dev(this->name(), pool_owned_ptr<core_device_t>(this, false)); }
core_device_t::core_device_t(core_device_t &owner, const pstring &name) : object_t(owner.name() + "." + name) , logic_family_t() , netlist_ref(owner.netlist()) , m_hint_deactivate(false) #if (NL_PMF_TYPE > NL_PMF_TYPE_VIRTUAL) , m_static_update() #endif { set_logic_family(owner.logic_family()); if (logic_family() == nullptr) set_logic_family(family_TTL()); owner.netlist().m_devices.push_back(plib::owned_ptr<core_device_t>(this, false)); }
ATTR_COLD void core_device_t::init(netlist_t &anetlist, const pstring &name) { if (logic_family() == nullptr) set_logic_family(this->default_logic_family()); init_object(anetlist, name); #if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF) void (core_device_t::* pFunc)() = &core_device_t::update; m_static_update = pFunc; #elif (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF_CONV) void (core_device_t::* pFunc)() = &core_device_t::update; m_static_update = reinterpret_cast<net_update_delegate>((this->*pFunc)); #elif (NL_PMF_TYPE == NL_PMF_TYPE_INTERNAL) m_static_update = pmfp::get_mfp<net_update_delegate>(&core_device_t::update, this); #endif }