diff --git a/src/lib/netlist/analog/nld_bjt.cpp b/src/lib/netlist/analog/nld_bjt.cpp index 6f4a2db86bf..83182847082 100644 --- a/src/lib/netlist/analog/nld_bjt.cpp +++ b/src/lib/netlist/analog/nld_bjt.cpp @@ -137,9 +137,9 @@ public: //NETLIB_RESETI(); NETLIB_UPDATEI(); - inline q_type qtype() const { return m_qtype; } - inline bool is_qtype(q_type atype) const { return m_qtype == atype; } - inline void set_qtype(q_type atype) { m_qtype = atype; } + q_type qtype() const { return m_qtype; } + bool is_qtype(q_type atype) const { return m_qtype == atype; } + void set_qtype(q_type atype) { m_qtype = atype; } protected: bjt_model_t m_model; diff --git a/src/lib/netlist/analog/nlid_twoterm.h b/src/lib/netlist/analog/nlid_twoterm.h index 7778f5f4585..624dd98e558 100644 --- a/src/lib/netlist/analog/nlid_twoterm.h +++ b/src/lib/netlist/analog/nlid_twoterm.h @@ -66,14 +66,14 @@ NETLIB_OBJECT(twoterm) NETLIB_UPDATEI(); public: - /* inline */ void set(const nl_double G, const nl_double V, const nl_double I) + void set(const nl_double G, const nl_double V, const nl_double I) { /* GO, GT, I */ m_P.set( G, G, ( V) * G - I); m_N.set( G, G, ( -V) * G + I); } - /* inline */ nl_double deltaV() const + nl_double deltaV() const { return m_P.net().Q_Analog() - m_N.net().Q_Analog(); } @@ -107,7 +107,7 @@ NETLIB_OBJECT_DERIVED(R_base, twoterm) } public: - inline void set_R(const nl_double R) + void set_R(const nl_double R) { const nl_double G = NL_FCONST(1.0) / R; set_mat( G, -G, 0.0, diff --git a/src/lib/netlist/devices/nld_4020.cpp b/src/lib/netlist/devices/nld_4020.cpp index 7377c27fd0e..b305c16ec7a 100644 --- a/src/lib/netlist/devices/nld_4020.cpp +++ b/src/lib/netlist/devices/nld_4020.cpp @@ -96,7 +96,7 @@ namespace netlist m_sub.m_IP.activate_hl(); } - inline NETLIB_FUNC_VOID(CD4020_sub, update_outputs, (const unsigned cnt)) + NETLIB_FUNC_VOID(CD4020_sub, update_outputs, (const unsigned cnt)) { /* static */ const netlist_time out_delayQn[14] = { NLTIME_FROM_NS(180), NLTIME_FROM_NS(280), diff --git a/src/lib/netlist/devices/nld_7474.cpp b/src/lib/netlist/devices/nld_7474.cpp index dce9b092180..e50faef607b 100644 --- a/src/lib/netlist/devices/nld_7474.cpp +++ b/src/lib/netlist/devices/nld_7474.cpp @@ -41,7 +41,13 @@ namespace netlist private: state_var m_nextD; - inline void newstate(const netlist_sig_t stateQ, const netlist_sig_t stateQQ); + void newstate(const netlist_sig_t stateQ, const netlist_sig_t stateQQ) + { + // 0: High-to-low 40 ns, 1: Low-to-high 25 ns + static constexpr const netlist_time delay[2] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) }; + m_Q.push(stateQ, delay[stateQ]); + m_QQ.push(stateQQ, delay[stateQQ]); + } }; NETLIB_OBJECT(7474_dip) @@ -74,14 +80,6 @@ namespace netlist NETLIB_SUB(7474) m_2; }; - inline void NETLIB_NAME(7474)::newstate(const netlist_sig_t stateQ, const netlist_sig_t stateQQ) - { - // 0: High-to-low 40 ns, 1: Low-to-high 25 ns - static constexpr const netlist_time delay[2] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) }; - m_Q.push(stateQ, delay[stateQ]); - m_QQ.push(stateQQ, delay[stateQQ]); - } - NETLIB_HANDLER(7474, clk) { //if (INP_LH(m_CLK)) diff --git a/src/lib/netlist/devices/nld_7483.cpp b/src/lib/netlist/devices/nld_7483.cpp index 395840b2549..2fbdeb7e52b 100644 --- a/src/lib/netlist/devices/nld_7483.cpp +++ b/src/lib/netlist/devices/nld_7483.cpp @@ -105,7 +105,7 @@ namespace netlist NETLIB_NAME(7483)::update(); } - inline NETLIB_UPDATE(7483) + NETLIB_UPDATE(7483) { uint8_t r = static_cast(m_a + m_b + m_C0()); diff --git a/src/lib/netlist/devices/nld_9310.cpp b/src/lib/netlist/devices/nld_9310.cpp index 27cbdc82dc2..11929741aed 100644 --- a/src/lib/netlist/devices/nld_9310.cpp +++ b/src/lib/netlist/devices/nld_9310.cpp @@ -14,6 +14,7 @@ namespace netlist { namespace devices { + //FIXME: Convert sub devices into NETDEV_DELEGATE logic NETLIB_OBJECT(9310_subABCD) { NETLIB_CONSTRUCTOR(9310_subABCD) diff --git a/src/lib/netlist/devices/nld_9316.cpp b/src/lib/netlist/devices/nld_9316.cpp index 7b1be9aa48d..a557a509aca 100644 --- a/src/lib/netlist/devices/nld_9316.cpp +++ b/src/lib/netlist/devices/nld_9316.cpp @@ -63,8 +63,7 @@ namespace netlist state_var_u8 m_abcd; private: - //inline void update_outputs_all(const unsigned &cnt, const netlist_time &out_delay) noexcept - inline void update_outputs_all(const unsigned &cnt, const netlist_time &out_delay) noexcept + void update_outputs_all(const unsigned &cnt, const netlist_time &out_delay) noexcept { m_Q[0].push((cnt >> 0) & 1, out_delay); m_Q[1].push((cnt >> 1) & 1, out_delay); diff --git a/src/lib/netlist/devices/nld_am2847.cpp b/src/lib/netlist/devices/nld_am2847.cpp index 9aa6c0a795f..6c045cca4ea 100644 --- a/src/lib/netlist/devices/nld_am2847.cpp +++ b/src/lib/netlist/devices/nld_am2847.cpp @@ -116,7 +116,7 @@ namespace netlist /* do nothing */ } - inline NETLIB_FUNC_VOID(Am2847_shifter, shift, (void)) + NETLIB_FUNC_VOID(Am2847_shifter, shift, (void)) { uint32_t out = m_buffer[0] & 1; uint32_t in = (m_RC() ? out : m_IN()); diff --git a/src/lib/netlist/devices/nld_ne555.cpp b/src/lib/netlist/devices/nld_ne555.cpp index d41b9f108c7..cb29f8b3e82 100644 --- a/src/lib/netlist/devices/nld_ne555.cpp +++ b/src/lib/netlist/devices/nld_ne555.cpp @@ -98,8 +98,17 @@ namespace netlist state_var m_last_out; state_var m_ff; - inline nl_double clamp(const nl_double v, const nl_double a, const nl_double b); + nl_double clamp(const nl_double v, const nl_double a, const nl_double b) + { + nl_double ret = v; + nl_double vcc = m_R1.m_P(); + if (ret > vcc - a) + ret = vcc - a; + if (ret < b) + ret = b; + return ret; + } }; NETLIB_OBJECT_DERIVED(NE555_dip, NE555) @@ -117,18 +126,6 @@ namespace netlist } }; - inline nl_double NETLIB_NAME(NE555)::clamp(const nl_double v, const nl_double a, const nl_double b) - { - nl_double ret = v; - nl_double vcc = m_R1.m_P(); - - if (ret > vcc - a) - ret = vcc - a; - if (ret < b) - ret = b; - return ret; - } - NETLIB_RESET(NE555) { m_R1.do_reset(); diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index 83caa98b84e..37d25ada534 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -778,10 +778,10 @@ namespace netlist logic_net_t(netlist_t &nl, const pstring &aname, detail::core_terminal_t *mr = nullptr); virtual ~logic_net_t(); - inline const netlist_sig_t & Q() const NL_NOEXCEPT { return m_cur_Q; } + const netlist_sig_t & Q() const NL_NOEXCEPT { return m_cur_Q; } void initial(const netlist_sig_t val) NL_NOEXCEPT { m_cur_Q = m_new_Q = val; } - inline void set_Q_and_push(const netlist_sig_t newQ, const netlist_time &delay) NL_NOEXCEPT + void set_Q_and_push(const netlist_sig_t newQ, const netlist_time &delay) NL_NOEXCEPT { if (newQ != m_new_Q ) { @@ -789,7 +789,7 @@ namespace netlist push_to_queue(delay); } } - inline void set_Q_and_push_force(const netlist_sig_t newQ, const netlist_time &delay) NL_NOEXCEPT + void set_Q_and_push_force(const netlist_sig_t newQ, const netlist_time &delay) NL_NOEXCEPT { if (newQ != m_new_Q || is_queued()) { @@ -798,7 +798,7 @@ namespace netlist } } - inline void set_Q_time(const netlist_sig_t newQ, const netlist_time &at) NL_NOEXCEPT + void set_Q_time(const netlist_sig_t newQ, const netlist_time &at) NL_NOEXCEPT { if (newQ != m_new_Q) { @@ -1382,7 +1382,7 @@ namespace netlist // ----------------------------------------------------------------------------- template - inline param_rom_t::param_rom_t(device_t &device, const pstring &name) + param_rom_t::param_rom_t(device_t &device, const pstring &name) : param_data_t(device, name) { auto f = stream(); diff --git a/src/lib/netlist/plib/pstate.h b/src/lib/netlist/plib/pstate.h index 9757d6408b7..91534a56663 100644 --- a/src/lib/netlist/plib/pstate.h +++ b/src/lib/netlist/plib/pstate.h @@ -40,7 +40,7 @@ public: template struct datatype_f { - static inline const datatype_t f() + static const datatype_t f() { return datatype_t(sizeof(T), plib::is_integral::value || std::is_enum::value, diff --git a/src/lib/netlist/plib/ptypes.h b/src/lib/netlist/plib/ptypes.h index 0934a86fdf2..d09575fed56 100644 --- a/src/lib/netlist/plib/ptypes.h +++ b/src/lib/netlist/plib/ptypes.h @@ -25,14 +25,14 @@ namespace plib template<> struct is_integral { static constexpr bool value = true; }; template<> struct numeric_limits { - static inline constexpr UINT128 max() + static constexpr UINT128 max() { return ~((UINT128)0); } }; template<> struct numeric_limits { - static inline constexpr INT128 max() + static constexpr INT128 max() { return (~((UINT128)0)) >> 1; } diff --git a/src/lib/netlist/solver/nld_matrix_solver.h b/src/lib/netlist/solver/nld_matrix_solver.h index d60a16499b6..5cbbe59b8d0 100644 --- a/src/lib/netlist/solver/nld_matrix_solver.h +++ b/src/lib/netlist/solver/nld_matrix_solver.h @@ -43,14 +43,14 @@ public: void add(terminal_t *term, int net_other, bool sorted); - inline std::size_t count() const { return m_terms.size(); } + std::size_t count() const { return m_terms.size(); } - inline terminal_t **terms() { return m_terms.data(); } - inline int *connected_net_idx() { return m_connected_net_idx.data(); } - inline nl_double *gt() { return m_gt.data(); } - inline nl_double *go() { return m_go.data(); } - inline nl_double *Idr() { return m_Idr.data(); } - inline nl_double * const *connected_net_V() const { return m_connected_net_V.data(); } + terminal_t **terms() { return m_terms.data(); } + int *connected_net_idx() { return m_connected_net_idx.data(); } + nl_double *gt() { return m_gt.data(); } + nl_double *go() { return m_go.data(); } + nl_double *Idr() { return m_Idr.data(); } + nl_double * const *connected_net_V() const { return m_connected_net_V.data(); } void set_pointers(); @@ -116,8 +116,8 @@ public: const netlist_time solve(); void update_inputs(); - inline bool has_dynamic_devices() const { return m_dynamic_devices.size() > 0; } - inline bool has_timestep_devices() const { return m_step_devices.size() > 0; } + bool has_dynamic_devices() const { return m_dynamic_devices.size() > 0; } + bool has_timestep_devices() const { return m_step_devices.size() > 0; } void update_forced(); void update_after(const netlist_time &after) diff --git a/src/lib/netlist/solver/nld_ms_direct.h b/src/lib/netlist/solver/nld_ms_direct.h index 639d9f4ee18..defa03bc044 100644 --- a/src/lib/netlist/solver/nld_ms_direct.h +++ b/src/lib/netlist/solver/nld_ms_direct.h @@ -240,7 +240,7 @@ unsigned matrix_solver_direct_t::solve_non_dynamic(const bool ne } template -inline unsigned matrix_solver_direct_t::vsolve_non_dynamic(const bool newton_raphson) +unsigned matrix_solver_direct_t::vsolve_non_dynamic(const bool newton_raphson) { build_LE_A(); build_LE_RHS(); diff --git a/src/lib/netlist/solver/nld_ms_direct_lu.h b/src/lib/netlist/solver/nld_ms_direct_lu.h index c379cf8d055..2832fb2d82d 100644 --- a/src/lib/netlist/solver/nld_ms_direct_lu.h +++ b/src/lib/netlist/solver/nld_ms_direct_lu.h @@ -36,9 +36,9 @@ public: virtual void vsetup(analog_net_t::list_t &nets) override; virtual void reset() override { matrix_solver_t::reset(); } - inline unsigned N() const { if (m_N == 0) return m_dim; else return m_N; } + unsigned N() const { if (m_N == 0) return m_dim; else return m_N; } - inline int vsolve_non_dynamic(const bool newton_raphson); + int vsolve_non_dynamic(const bool newton_raphson); protected: virtual void add_term(int net_idx, terminal_t *term) override; @@ -139,7 +139,7 @@ protected: nl_double compute_next_timestep(); template - inline nl_ext_double &A(const T1 r, const T2 c) { return m_A[r][c]; } + nl_ext_double &A(const T1 r, const T2 c) { return m_A[r][c]; } //nl_double m_A[storage_N][((storage_N + 7) / 8) * 8]; nl_double m_RHS[storage_N]; @@ -590,7 +590,7 @@ unsigned matrix_solver_direct_t::solve_non_dynamic(const bool ne } template -inline int matrix_solver_direct_t::vsolve_non_dynamic(const bool newton_raphson) +int matrix_solver_direct_t::vsolve_non_dynamic(const bool newton_raphson) { this->build_LE_A(); this->build_LE_RHS(m_last_RHS); diff --git a/src/lib/netlist/solver/nld_ms_gmres.h b/src/lib/netlist/solver/nld_ms_gmres.h index 323def01d32..92d8a0fd6d9 100644 --- a/src/lib/netlist/solver/nld_ms_gmres.h +++ b/src/lib/netlist/solver/nld_ms_gmres.h @@ -192,7 +192,7 @@ unsigned matrix_solver_GMRES_t::vsolve_non_dynamic(const bool ne } template -inline static void givens_mult( const T c, const T s, T & g0, T & g1 ) +void givens_mult( const T c, const T s, T & g0, T & g1 ) { const T tg0 = c * g0 - s * g1; const T tg1 = s * g0 + c * g1; diff --git a/src/lib/netlist/solver/nld_ms_sm.h b/src/lib/netlist/solver/nld_ms_sm.h index ed95cd2dc03..42d35e9b14c 100644 --- a/src/lib/netlist/solver/nld_ms_sm.h +++ b/src/lib/netlist/solver/nld_ms_sm.h @@ -294,7 +294,7 @@ unsigned matrix_solver_sm_t::solve_non_dynamic(const bool newton } template -inline unsigned matrix_solver_sm_t::vsolve_non_dynamic(const bool newton_raphson) +unsigned matrix_solver_sm_t::vsolve_non_dynamic(const bool newton_raphson) { build_LE_A(); build_LE_RHS(); diff --git a/src/lib/netlist/solver/nld_ms_w.h b/src/lib/netlist/solver/nld_ms_w.h index 0d4e7781eed..4a2710a513d 100644 --- a/src/lib/netlist/solver/nld_ms_w.h +++ b/src/lib/netlist/solver/nld_ms_w.h @@ -80,19 +80,19 @@ protected: template - inline nl_ext_double &A(const T1 &r, const T2 &c) { return m_A[r][c]; } + nl_ext_double &A(const T1 &r, const T2 &c) { return m_A[r][c]; } template - inline nl_ext_double &W(const T1 &r, const T2 &c) { return m_W[r][c]; } + nl_ext_double &W(const T1 &r, const T2 &c) { return m_W[r][c]; } /* access to Ainv for fixed columns over row, there store transposed */ template - inline nl_ext_double &Ainv(const T1 &r, const T2 &c) { return m_Ainv[c][r]; } + nl_ext_double &Ainv(const T1 &r, const T2 &c) { return m_Ainv[c][r]; } template - inline nl_ext_double &RHS(const T1 &r) { return m_RHS[r]; } + nl_ext_double &RHS(const T1 &r) { return m_RHS[r]; } template - inline nl_ext_double &lA(const T1 &r, const T2 &c) { return m_lA[r][c]; } + nl_ext_double &lA(const T1 &r, const T2 &c) { return m_lA[r][c]; } nl_double m_last_RHS[storage_N]; // right hand side - contains currents @@ -361,7 +361,7 @@ unsigned matrix_solver_w_t::solve_non_dynamic(const bool newton_ } template -inline unsigned matrix_solver_w_t::vsolve_non_dynamic(const bool newton_raphson) +unsigned matrix_solver_w_t::vsolve_non_dynamic(const bool newton_raphson) { build_LE_A(); build_LE_RHS(); diff --git a/src/lib/netlist/solver/nld_solver.h b/src/lib/netlist/solver/nld_solver.h index 986d14f401a..6753d675067 100644 --- a/src/lib/netlist/solver/nld_solver.h +++ b/src/lib/netlist/solver/nld_solver.h @@ -68,7 +68,7 @@ NETLIB_OBJECT(solver) void post_start(); void stop(); - inline nl_double gmin() { return m_gmin(); } + nl_double gmin() { return m_gmin(); } void create_solver_code(std::map &mp); diff --git a/src/lib/netlist/solver/vector_base.h b/src/lib/netlist/solver/vector_base.h index 218ae9d81f3..0587269efdf 100644 --- a/src/lib/netlist/solver/vector_base.h +++ b/src/lib/netlist/solver/vector_base.h @@ -37,7 +37,7 @@ private: #endif template -inline static void vec_set (const std::size_t n, const T scalar, T (& RESTRICT v)[N]) +void vec_set (const std::size_t n, const T scalar, T (& RESTRICT v)[N]) { if (n != N) for ( std::size_t i = 0; i < n; i++ ) @@ -48,7 +48,7 @@ inline static void vec_set (const std::size_t n, const T scalar, T (& RESTRICT v } template -inline static T vec_mult (const std::size_t n, const T (& RESTRICT v1)[N], const T (& RESTRICT v2)[N] ) +T vec_mult (const std::size_t n, const T (& RESTRICT v1)[N], const T (& RESTRICT v2)[N] ) { T value = 0.0; if (n != N) @@ -61,7 +61,7 @@ inline static T vec_mult (const std::size_t n, const T (& RESTRICT v1)[N], const } template -inline static T vec_mult2 (const std::size_t n, const T (& RESTRICT v)[N]) +T vec_mult2 (const std::size_t n, const T (& RESTRICT v)[N]) { T value = 0.0; if (n != N) @@ -74,7 +74,7 @@ inline static T vec_mult2 (const std::size_t n, const T (& RESTRICT v)[N]) } template -inline static void vec_mult_scalar (const std::size_t n, const T (& RESTRICT v)[N], const T & scalar, T (& RESTRICT result)[N]) +void vec_mult_scalar (const std::size_t n, const T (& RESTRICT v)[N], const T & scalar, T (& RESTRICT result)[N]) { if (n != N) for ( std::size_t i = 0; i < n; i++ ) @@ -85,7 +85,7 @@ inline static void vec_mult_scalar (const std::size_t n, const T (& RESTRICT v)[ } template -inline static void vec_add_mult_scalar (const std::size_t n, const T (& RESTRICT v)[N], const T scalar, T (& RESTRICT result)[N]) +void vec_add_mult_scalar (const std::size_t n, const T (& RESTRICT v)[N], const T scalar, T (& RESTRICT result)[N]) { if (n != N) for ( std::size_t i = 0; i < n; i++ ) @@ -96,20 +96,21 @@ inline static void vec_add_mult_scalar (const std::size_t n, const T (& RESTRICT } template -inline static void vec_add_mult_scalar_p(const std::size_t & n, const T * RESTRICT v, const T scalar, T * RESTRICT result) +void vec_add_mult_scalar_p(const std::size_t & n, const T * RESTRICT v, const T scalar, T * RESTRICT result) { for ( std::size_t i = 0; i < n; i++ ) result[i] += scalar * v[i]; } -inline static void vec_add_ip(const std::size_t n, const double * RESTRICT v, double * RESTRICT result) +template +void vec_add_ip(const std::size_t n, const T * RESTRICT v, T * RESTRICT result) { for ( std::size_t i = 0; i < n; i++ ) result[i] += v[i]; } template -inline void vec_sub(const std::size_t n, const T (& RESTRICT v1)[N], const T (& RESTRICT v2)[N], T (& RESTRICT result)[N]) +void vec_sub(const std::size_t n, const T (& RESTRICT v1)[N], const T (& RESTRICT v2)[N], T (& RESTRICT result)[N]) { if (n != N) for ( std::size_t i = 0; i < n; i++ ) @@ -120,7 +121,7 @@ inline void vec_sub(const std::size_t n, const T (& RESTRICT v1)[N], const T (& } template -inline void vec_scale(const std::size_t n, T (& RESTRICT v)[N], const T scalar) +void vec_scale(const std::size_t n, T (& RESTRICT v)[N], const T scalar) { if (n != N) for ( std::size_t i = 0; i < n; i++ ) @@ -130,9 +131,10 @@ inline void vec_scale(const std::size_t n, T (& RESTRICT v)[N], const T scalar) v[i] = scalar * v[i]; } -inline double vec_maxabs(const std::size_t n, const double * RESTRICT v) +template +T vec_maxabs(const std::size_t n, const T * RESTRICT v) { - double ret = 0.0; + T ret = 0.0; for ( std::size_t i = 0; i < n; i++ ) ret = std::max(ret, std::abs(v[i]));