diff options
Diffstat (limited to 'src/lib/netlist/nl_base.h')
-rw-r--r-- | src/lib/netlist/nl_base.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index 4e2c84794dc..0891e81c6b4 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -691,7 +691,7 @@ namespace netlist virtual ~net_t() noexcept = default; - void reset() noexcept; + virtual void reset() noexcept; void toggle_new_Q() noexcept { m_new_Q = (m_cur_Q ^ 1); } @@ -952,6 +952,8 @@ namespace netlist analog_net_t(netlist_state_t &nl, const pstring &aname, detail::core_terminal_t *railterminal = nullptr); + void reset() noexcept override; + nl_fptype Q_Analog() const noexcept { return m_cur_Analog; } void set_Q_Analog(nl_fptype v) noexcept { m_cur_Analog = v; } // used by solver code ... @@ -1744,8 +1746,14 @@ namespace netlist /// void print_stats(stats_info &si) const; + /// \brief call reset on all netlist components + /// void reset(); + /// \brief prior to running free no longer needed resources + /// + void free_setup_resources(); + private: device_arena m_pool; // must be deleted last! @@ -1785,10 +1793,7 @@ namespace netlist m_inc = netlist_time::from_fp(plib::reciprocal(m_freq()*nlconst::two())); } - NETLIB_RESETI() - { - m_Q.net().set_next_scheduled_time(netlist_time_ext::zero()); - } + NETLIB_RESETI(); NETLIB_UPDATE_PARAMI() { @@ -2147,6 +2152,14 @@ namespace netlist analog_input_t m_GND; }; + namespace devices + { + inline NETLIB_RESET(mainclock) + { + m_Q.net().set_next_scheduled_time(exec().time()); + } + } // namespace devices + // ----------------------------------------------------------------------------- // Hot section // |