summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar couriersud <couriersud@gmx.org>2020-06-28 13:14:16 +0200
committerGravatarGravatar couriersud <couriersud@gmx.org>2020-06-28 13:14:43 +0200
commitab31af569fb543f4b81fe30c3c37f6c957b09c48 (patch) (github)
tree6a93d3b374bbce8c135b1070283d88d5b48de2a1
parent3fcdfa0a9b1783f556abe36c9fb927c25c2170ee (diff)
downloadmame-ab31af569fb543f4b81fe30c3c37f6c957b09c48.tar.bz2
mame-ab31af569fb543f4b81fe30c3c37f6c957b09c48.zip
netlist: include file refactoring.
The purpose of this ongoing exercise is to remove unnecessary dependencies in header files. netlist implementations should only have access to what they need. The same applies to device implementations. Core stuff will be moved to the core subdirectory going forward.
-rw-r--r--src/devices/machine/netlist.cpp17
-rw-r--r--src/devices/machine/netlist.h2
-rw-r--r--src/lib/netlist/devices/nlid_system.h1
-rw-r--r--src/lib/netlist/devices/nlid_truthtable.cpp3
-rw-r--r--src/lib/netlist/nl_base.cpp5
-rw-r--r--src/lib/netlist/nl_base.h78
-rw-r--r--src/lib/netlist/nl_config.h11
-rw-r--r--src/lib/netlist/nl_factory.h3
-rw-r--r--src/lib/netlist/nl_setup.h71
-rw-r--r--src/lib/netlist/nltypes.h93
-rw-r--r--src/lib/netlist/plib/mat_cr.h9
-rw-r--r--src/lib/netlist/plib/palloc.h5
-rw-r--r--src/lib/netlist/plib/pconfig.h11
-rw-r--r--src/lib/netlist/plib/penum.h2
-rw-r--r--src/lib/netlist/plib/pfmtlog.h7
-rw-r--r--src/lib/netlist/plib/pfunction.h1
-rw-r--r--src/lib/netlist/plib/plists.h4
-rwxr-xr-xsrc/lib/netlist/plib/pmatrix2d.h2
-rw-r--r--src/lib/netlist/plib/pmempool.h12
-rw-r--r--src/lib/netlist/plib/ppmf.h1
-rw-r--r--src/lib/netlist/plib/ppreprocessor.cpp1
-rw-r--r--src/lib/netlist/plib/pstate.h4
-rw-r--r--src/lib/netlist/plib/pstream.h9
-rw-r--r--src/lib/netlist/plib/pstring.h26
-rw-r--r--src/lib/netlist/plib/pstrutil.h12
-rw-r--r--src/lib/netlist/plib/ptimed_queue.h3
-rw-r--r--src/lib/netlist/plib/ptypes.h44
-rw-r--r--src/lib/netlist/plib/putil.h20
-rw-r--r--src/lib/netlist/prg/nltool.cpp9
-rwxr-xr-xsrc/lib/netlist/prg/nlwav.cpp2
-rw-r--r--src/lib/netlist/solver/nld_matrix_solver.cpp4
-rw-r--r--src/lib/netlist/solver/nld_matrix_solver.h5
-rw-r--r--src/lib/netlist/solver/nld_matrix_solver_ext.h2
-rw-r--r--src/lib/netlist/solver/nld_ms_direct.h4
-rw-r--r--src/lib/netlist/solver/nld_ms_direct1.h2
-rw-r--r--src/lib/netlist/solver/nld_ms_direct2.h2
-rw-r--r--src/lib/netlist/solver/nld_ms_gcr.h2
-rw-r--r--src/lib/netlist/solver/nld_ms_gmres.h2
-rw-r--r--src/lib/netlist/solver/nld_ms_sm.h2
-rw-r--r--src/lib/netlist/solver/nld_ms_sor.h2
-rw-r--r--src/lib/netlist/solver/nld_ms_sor_mat.h2
-rw-r--r--src/lib/netlist/solver/nld_ms_w.h3
-rw-r--r--src/lib/netlist/solver/nld_solver.cpp12
-rw-r--r--src/lib/netlist/solver/nld_solver.h5
-rw-r--r--src/lib/netlist/tools/nl_convert.cpp1
45 files changed, 260 insertions, 258 deletions
diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp
index 4422481dcd1..2aa5eb0ec60 100644
--- a/src/devices/machine/netlist.cpp
+++ b/src/devices/machine/netlist.cpp
@@ -19,6 +19,9 @@
//#include "netlist/devices/nlid_system.h"
#include "netlist/plib/palloc.h"
+#include "netlist/plib/pmempool.h"
+#include "netlist/plib/pdynlib.h"
+#include "netlist/plib/pstonum.h"
#include "debugger.h"
#include "romload.h"
@@ -116,10 +119,10 @@ protected:
}
}
- netlist::host_arena::unique_ptr<plib::dynlib_base> static_solver_lib() const noexcept override
+ std::unique_ptr<plib::dynlib_base> static_solver_lib() const noexcept override
{
//return plib::make_unique<plib::dynlib_static>(nullptr);
- return plib::make_unique<plib::dynlib_static, netlist::host_arena>(nl_static_solver_syms);
+ return std::make_unique<plib::dynlib_static>(nl_static_solver_syms);
}
private:
@@ -159,9 +162,9 @@ protected:
}
}
- netlist::host_arena::unique_ptr<plib::dynlib_base> static_solver_lib() const noexcept override
+ std::unique_ptr<plib::dynlib_base> static_solver_lib() const noexcept override
{
- return plib::make_unique<plib::dynlib_static, netlist::host_arena>(nullptr);
+ return std::make_unique<plib::dynlib_static>(nullptr);
}
private:
@@ -966,11 +969,11 @@ void netlist_mame_device::common_dev_start(netlist::netlist_state_t *lnetlist) c
}
}
-netlist::host_arena::unique_ptr<netlist::netlist_state_t> netlist_mame_device::base_validity_check(validity_checker &valid) const
+std::unique_ptr<netlist::netlist_state_t> netlist_mame_device::base_validity_check(validity_checker &valid) const
{
try
{
- auto lnetlist = plib::make_unique<netlist::netlist_state_t, netlist::host_arena>("netlist",
+ auto lnetlist = std::make_unique<netlist::netlist_state_t>("netlist",
plib::make_unique<netlist_validate_callbacks_t, netlist::host_arena>());
// enable validation mode
lnetlist->set_extended_validation(true);
@@ -1002,7 +1005,7 @@ netlist::host_arena::unique_ptr<netlist::netlist_state_t> netlist_mame_device::b
{
osd_printf_error("%s\n", err.what());
}
- return netlist::host_arena::unique_ptr<netlist::netlist_state_t>(nullptr);
+ return std::unique_ptr<netlist::netlist_state_t>(nullptr);
}
void netlist_mame_device::device_validity_check(validity_checker &valid) const
diff --git a/src/devices/machine/netlist.h b/src/devices/machine/netlist.h
index 207f168dee8..4486eb729a6 100644
--- a/src/devices/machine/netlist.h
+++ b/src/devices/machine/netlist.h
@@ -111,7 +111,7 @@ protected:
virtual void device_pre_save() override;
virtual void device_clock_changed() override;
- netlist::host_arena::unique_ptr<netlist::netlist_state_t> base_validity_check(validity_checker &valid) const;
+ std::unique_ptr<netlist::netlist_state_t> base_validity_check(validity_checker &valid) const;
attotime m_cur_time;
attotime m_attotime_per_clock;
diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h
index 31a31c62d88..2fea9014e5b 100644
--- a/src/lib/netlist/devices/nlid_system.h
+++ b/src/lib/netlist/devices/nlid_system.h
@@ -11,6 +11,7 @@
#include "netlist/nl_base.h"
#include "netlist/nl_factory.h"
#include "netlist/plib/prandom.h"
+#include "netlist/plib/pstonum.h"
#include "netlist/plib/putil.h"
#include <random>
diff --git a/src/lib/netlist/devices/nlid_truthtable.cpp b/src/lib/netlist/devices/nlid_truthtable.cpp
index 348b37729b1..fed6327f9a8 100644
--- a/src/lib/netlist/devices/nlid_truthtable.cpp
+++ b/src/lib/netlist/devices/nlid_truthtable.cpp
@@ -1,6 +1,9 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
+#include "plib/pstonum.h"
+#include "plib/pstrutil.h"
+
#include "nl_base.h"
#include "nl_factory.h"
#include "nlid_truthtable.h"
diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp
index c57e4f5e1c8..c55931ca9bc 100644
--- a/src/lib/netlist/nl_base.cpp
+++ b/src/lib/netlist/nl_base.cpp
@@ -8,6 +8,7 @@
#include "plib/pfmtlog.h"
#include "plib/pmempool.h"
#include "plib/putil.h"
+#include "plib/pdynlib.h"
#include "devices/nlid_proxy.h"
#include "devices/nlid_system.h"
@@ -25,9 +26,9 @@ namespace netlist
// callbacks_t
// ----------------------------------------------------------------------------------------
- host_arena::unique_ptr<plib::dynlib_base> callbacks_t:: static_solver_lib() const
+ std::unique_ptr<plib::dynlib_base> callbacks_t:: static_solver_lib() const
{
- return plib::make_unique<plib::dynlib_static, host_arena>(nullptr);
+ return std::make_unique<plib::dynlib_static>(nullptr);
}
// ----------------------------------------------------------------------------------------
diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h
index e18c44df9a6..63ae96a6a57 100644
--- a/src/lib/netlist/nl_base.h
+++ b/src/lib/netlist/nl_base.h
@@ -13,17 +13,12 @@
#endif
#include "plib/palloc.h" // owned_ptr
-#include "plib/pdynlib.h"
-#include "plib/pexception.h"
-#include "plib/pfmtlog.h"
#include "plib/pfunction.h"
#include "plib/plists.h"
#include "plib/pmempool.h"
#include "plib/ppmf.h"
-#include "plib/pstate.h"
-#include "plib/pstonum.h"
#include "plib/pstream.h"
-#include "plib/ptime.h"
+#include "plib/pstate.h"
#include "plib/ptimed_queue.h"
#include "plib/ptypes.h"
@@ -90,7 +85,7 @@ class NETLIB_NAME(name) : public delegator_t<base_device_t>
/// #NETLIB_OBJECT for an example.
#define NETLIB_CONSTRUCTOR(cname) \
using this_type = NETLIB_NAME(cname); \
- public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name) \
+ public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name)\
: base_type(owner, name)
/// \brief Used to define the constructor of a netlist device and define a default model.
@@ -203,55 +198,13 @@ class NETLIB_NAME(name) : public delegator_t<base_device_t>
namespace netlist
{
+
/// \brief Delegate type for device notification.
///
using nldelegate = plib::pmfp<void>;
using nldelegate_ts = plib::pmfp<void, nl_fptype>;
using nldelegate_dyn = plib::pmfp<void>;
- // -----------------------------------------------------------------------------
- // forward definitions
- // -----------------------------------------------------------------------------
-
- namespace devices
- {
- class NETLIB_NAME(solver);
- class NETLIB_NAME(mainclock);
- class NETLIB_NAME(base_proxy);
- class NETLIB_NAME(base_d_to_a_proxy);
- class NETLIB_NAME(base_a_to_d_proxy);
- } // namespace devices
-
- namespace solver
- {
- class matrix_solver_t;
- } // namespace solver
-
- class logic_output_t;
- class logic_input_t;
- class analog_net_t;
- class logic_net_t;
- class setup_t;
- class nlparse_t;
- class netlist_t;
- class netlist_state_t;
- class core_device_t;
- class device_t;
-
- template <class CX>
- class delegator_t : public CX
- {
- protected:
- using base_type = delegator_t<CX>;
- using delegated_type = CX;
- using delegated_type::delegated_type;
- };
-
- namespace detail
- {
- class net_t;
- } // namespace detail
-
//============================================================
// Exceptions
//============================================================
@@ -263,7 +216,7 @@ namespace netlist
{
public:
/// \brief Constructor.
- /// Allows a descriptive text to be assed to the exception
+ /// Allows a descriptive text to be passed to the exception
explicit nl_exception(const pstring &text //!< text to be passed
)
@@ -996,8 +949,6 @@ namespace netlist
{
public:
- using list_t = plib::aligned_vector<analog_net_t *>;
-
analog_net_t(netlist_state_t &nl, const pstring &aname, detail::core_terminal_t *railterminal = nullptr);
nl_fptype Q_Analog() const noexcept { return m_cur_Analog; }
@@ -1482,8 +1433,8 @@ namespace netlist
void connect(const detail::core_terminal_t &t1, const detail::core_terminal_t &t2);
protected:
- NETLIB_UPDATEI() { }
- NETLIB_UPDATE_TERMINALSI() { }
+ //NETLIB_UPDATEI() { }
+ //NETLIB_UPDATE_TERMINALSI() { }
private:
};
@@ -1513,11 +1464,11 @@ namespace netlist
~device_t() noexcept override = default;
//nldelegate default_delegate() { return nldelegate(&device_t::update, this); }
- nldelegate default_delegate() { return { &device_t::update, this }; }
+ nldelegate default_delegate() { return { &core_device_t::update, dynamic_cast<core_device_t *>(this) }; }
protected:
- NETLIB_UPDATEI() { }
- NETLIB_UPDATE_TERMINALSI() { }
+ //NETLIB_UPDATEI() { }
+ //NETLIB_UPDATE_TERMINALSI() { }
private:
param_model_t m_model;
@@ -1799,8 +1750,8 @@ namespace netlist
device_arena m_pool; // must be deleted last!
device_arena::unique_ptr<netlist_t> m_netlist;
- host_arena::unique_ptr<plib::dynlib_base> m_lib;
- plib::state_manager_t m_state;
+ std::unique_ptr<plib::dynlib_base> m_lib;
+ plib::state_manager_t m_state;
host_arena::unique_ptr<callbacks_t> m_callbacks;
log_type m_log;
@@ -2205,13 +2156,6 @@ namespace netlist
// logic_input_t
// -----------------------------------------------------------------------------
-#if 0
- template <class D>
- logic_input_t::logic_input_t(D &dev, const pstring &aname)
- : logic_input_t(dev, aname, STATE_INP_ACTIVE, nldelegate(&D :: update, &dev))
- {
- }
-#endif
inline void logic_input_t::inactivate() noexcept
{
if (!is_state(STATE_INP_PASSIVE))
diff --git a/src/lib/netlist/nl_config.h b/src/lib/netlist/nl_config.h
index 81e0c860aa9..813c2923246 100644
--- a/src/lib/netlist/nl_config.h
+++ b/src/lib/netlist/nl_config.h
@@ -44,6 +44,17 @@
#define NL_USE_MEMPOOL (1)
#endif
+/// brief default minimum alignment of mempool_arena
+///
+/// 256 is the best compromise between logic applications like MAME
+/// TTL games (e.g. pong) and analog applications like e.g. kidnikik sound.
+///
+/// Best performance for pong is achieved with a value of 16, but this degrades
+/// kidniki performance by ~10%.
+///
+/// More work is needed here.
+#define NL_MEMPOOL_ALIGN (16)
+
/// \brief Enable queue statistics.
///
/// Queue statistics come at a performance cost. Although
diff --git a/src/lib/netlist/nl_factory.h b/src/lib/netlist/nl_factory.h
index 74cb43f3d40..31d1d0e8068 100644
--- a/src/lib/netlist/nl_factory.h
+++ b/src/lib/netlist/nl_factory.h
@@ -12,6 +12,7 @@
#include "plib/palloc.h"
#include "plib/ptypes.h"
#include "plib/putil.h"
+#include "plib/pmempool.h"
#include <tuple>
#include <utility>
@@ -38,8 +39,6 @@
factory::constructor_ptr_t decl_ ## p_alias = NETLIB_NAME(p_alias ## _c);
namespace netlist {
- class core_device_t;
- class netlist_state_t;
namespace factory {
diff --git a/src/lib/netlist/nl_setup.h b/src/lib/netlist/nl_setup.h
index 6d99f1ca183..38fe06d9b4c 100644
--- a/src/lib/netlist/nl_setup.h
+++ b/src/lib/netlist/nl_setup.h
@@ -13,9 +13,9 @@
#include "plib/ppreprocessor.h"
#include "plib/pstream.h"
#include "plib/pstring.h"
-#include "plib/putil.h"
#include "nl_config.h"
+// FIXME: avoid including factory
#include "nl_factory.h"
#include "nltypes.h"
@@ -134,25 +134,6 @@ void NETLIST_NAME(name)(netlist::nlparse_t &setup) \
namespace netlist
{
- namespace detail {
- class core_terminal_t;
- class net_t;
- } // namespace detail
-
- namespace devices {
- class nld_base_proxy;
- class nld_netlistparams;
- } // namespace devices
-
- class core_device_t;
- class param_t;
- class nlparse_t;
- class setup_t;
- class netlist_state_t;
- class netlist_t;
- class logic_family_desc_t;
- class terminal_t;
-
// -----------------------------------------------------------------------------
// truthtable desc
// -----------------------------------------------------------------------------
@@ -192,32 +173,6 @@ namespace netlist
};
// ----------------------------------------------------------------------------------------
- // Specific netlist psource_t implementations
- // ----------------------------------------------------------------------------------------
-
- class source_netlist_t : public plib::psource_t
- {
- public:
-
- source_netlist_t() = default;
-
- PCOPYASSIGNMOVE(source_netlist_t, delete)
- ~source_netlist_t() noexcept override = default;
-
- virtual bool parse(nlparse_t &setup, const pstring &name);
- };
-
- class source_data_t : public plib::psource_t
- {
- public:
-
- source_data_t() = default;
-
- PCOPYASSIGNMOVE(source_data_t, delete)
- ~source_data_t() noexcept override = default;
- };
-
- // ----------------------------------------------------------------------------------------
// Collection of models
// ----------------------------------------------------------------------------------------
@@ -500,9 +455,31 @@ namespace netlist
};
// ----------------------------------------------------------------------------------------
- // base sources
+ // Specific netlist psource_t implementations
// ----------------------------------------------------------------------------------------
+ class source_netlist_t : public plib::psource_t
+ {
+ public:
+
+ source_netlist_t() = default;
+
+ PCOPYASSIGNMOVE(source_netlist_t, delete)
+ ~source_netlist_t() noexcept override = default;
+
+ virtual bool parse(nlparse_t &setup, const pstring &name);
+ };
+
+ class source_data_t : public plib::psource_t
+ {
+ public:
+
+ source_data_t() = default;
+
+ PCOPYASSIGNMOVE(source_data_t, delete)
+ ~source_data_t() noexcept override = default;
+ };
+
class source_string_t : public source_netlist_t
{
public:
diff --git a/src/lib/netlist/nltypes.h b/src/lib/netlist/nltypes.h
index 98bfbb49a92..b259ae55b76 100644
--- a/src/lib/netlist/nltypes.h
+++ b/src/lib/netlist/nltypes.h
@@ -13,19 +13,94 @@
#define NLTYPES_H_
#include "nl_config.h"
-#include "plib/pchrono.h"
-#include "plib/pdynlib.h"
-#include "plib/pfmtlog.h"
-#include "plib/pmempool.h"
-#include "plib/pstate.h"
+
+//#include "plib/pchrono.h"
+#include "plib/ptypes.h"
#include "plib/pstring.h"
#include "plib/ptime.h"
-#include "plib/putil.h"
-#include <unordered_map>
+#include <memory>
+
+// FIXME: Move to ptypes
+namespace plib
+{
+ // FORWARD declarations
+ template <typename BASEARENA, std::size_t MINALIGN>
+ class mempool_arena;
+
+ struct aligned_arena;
+ class dynlib_base;
+
+ template<class T, bool debug_enabled>
+ class plog_base;
+
+ struct plog_level;
+}
namespace netlist
{
+ // -----------------------------------------------------------------------------
+ // forward definitions
+ // -----------------------------------------------------------------------------
+
+ class logic_output_t;
+ class logic_input_t;
+ class analog_net_t;
+ class logic_net_t;
+ class setup_t;
+ class nlparse_t;
+ class netlist_t;
+ class netlist_state_t;
+ class core_device_t;
+ class device_t;
+ class netlist_state_t;
+ class param_t;
+ class logic_family_desc_t;
+ class terminal_t;
+
+ namespace devices
+ {
+ class nld_solver;
+ class nld_mainclock;
+ class nld_base_proxy;
+ class nld_base_d_to_a_proxy;
+ class nld_base_a_to_d_proxy;
+ class nld_netlistparams;
+ } // namespace devices
+
+ namespace solver
+ {
+ class matrix_solver_t;
+ } // namespace solver
+
+ namespace detail
+ {
+ class core_terminal_t;
+ class net_t;
+ } // namespace detail
+
+ namespace factory
+ {
+ class list_t;
+ class element_t;
+ struct properties;
+ } // namespace factory
+
+ template <class CX>
+ class delegator_t : public CX
+ {
+ protected:
+ using base_type = delegator_t<CX>;
+ using delegated_type = CX;
+ using delegated_type::delegated_type;
+ };
+
+} // namespace netlist
+
+
+namespace netlist
+{
+
/// \brief Constants and const calculations for the library
///
template<typename T>
@@ -79,7 +154,7 @@ namespace netlist
///
using device_arena = std::conditional_t<config::use_mempool::value,
- plib::mempool_arena<plib::aligned_arena>,
+ plib::mempool_arena<plib::aligned_arena, NL_MEMPOOL_ALIGN>,
plib::aligned_arena>;
using host_arena = plib::aligned_arena;
@@ -109,7 +184,7 @@ namespace netlist
/// of a callbacks_t implementation to optionally provide such a collection
/// of symbols.
///
- virtual host_arena::unique_ptr<plib::dynlib_base> static_solver_lib() const;
+ virtual std::unique_ptr<plib::dynlib_base> static_solver_lib() const;
};
using log_type = plib::plog_base<callbacks_t, NL_DEBUG>;
diff --git a/src/lib/netlist/plib/mat_cr.h b/src/lib/netlist/plib/mat_cr.h
index 0f21aff2326..f066d44cd7b 100644
--- a/src/lib/netlist/plib/mat_cr.h
+++ b/src/lib/netlist/plib/mat_cr.h
@@ -249,8 +249,8 @@ namespace plib
A[k] = src.A[k];
}
- index_type * nzbd(index_type row) { return m_nzbd[row]; }
- index_type nzbd_count(index_type row) { return m_nzbd.colcount(row) - 1; }
+ index_type * nzbd(std::size_t row) { return m_nzbd[row]; }
+ std::size_t nzbd_count(std::size_t row) { return m_nzbd.colcount(row) - 1; }
protected:
// FIXME: this should be private
// NOLINTNEXTLINE
@@ -320,14 +320,9 @@ namespace plib
std::size_t pi = base::diag[i];
auto f = reciprocal(base::A[pi++]);
const std::size_t piie = base::row_idx[i+1];
-#if 0
- const auto &nz = base::m_nzbd[i];
- while (auto j = nz[nzbdp++]) // NOLINT(bugprone-infinite-loop)
-#else
const auto *nz = base::m_nzbd[i];
while (auto j = nz[nzbdp++]) // NOLINT(bugprone-infinite-loop)
-#endif
{
// proceed to column i
diff --git a/src/lib/netlist/plib/palloc.h b/src/lib/netlist/plib/palloc.h
index b3ebcbc52e5..a2f4527adb1 100644
--- a/src/lib/netlist/plib/palloc.h
+++ b/src/lib/netlist/plib/palloc.h
@@ -10,8 +10,7 @@
#include "pconfig.h"
#include "pgsl.h"
-#include "pmath.h"
-#include "pstring.h"
+#include "pmath.h" // FIXME: only uses lcm ... move to ptypes.
#include "ptypes.h"
#include <algorithm>
@@ -254,6 +253,8 @@ namespace plib {
//~arena_allocator() noexcept = default;
+ PCOPYASSIGNMOVE(arena_allocator, default)
+
explicit arena_allocator(arena_type & a) noexcept : m_a(a)
{
}
diff --git a/src/lib/netlist/plib/pconfig.h b/src/lib/netlist/plib/pconfig.h
index 99643139de7..65328327d76 100644
--- a/src/lib/netlist/plib/pconfig.h
+++ b/src/lib/netlist/plib/pconfig.h
@@ -74,17 +74,6 @@
#define PALIGNAS_CACHELINE() PALIGNAS(PALIGN_CACHELINE)
#define PALIGNAS_VECTOROPT() PALIGNAS(PALIGN_VECTOROPT)
-/// brief default minimum alignment of mempool_arena
-///
-/// 256 is the best compromise between logic applications like MAME
-/// TTL games (e.g. pong) and analog applications like e.g. kidnikik sound.
-///
-/// Best performance for pong is achieved with a value of 16, but this degrades
-/// kidniki performance by ~10%.
-///
-/// More work is needed here.
-#define PMEMPOOL_ALIGN (256)
-
// FIXME: Breaks mame build on windows mingw due to -Wattribute
// also triggers -Wattribute on ARM
// This is fixed on mingw version 10
diff --git a/src/lib/netlist/plib/penum.h b/src/lib/netlist/plib/penum.h
index f965411d546..55c0669afb5 100644
--- a/src/lib/netlist/plib/penum.h
+++ b/src/lib/netlist/plib/penum.h
@@ -9,8 +9,6 @@
///
#include "pstring.h"
-#include "pstrutil.h"
-#include "putil.h"
namespace plib
{
diff --git a/src/lib/netlist/plib/pfmtlog.h b/src/lib/netlist/plib/pfmtlog.h
index ac2a5e9a747..2c3773b1421 100644
--- a/src/lib/netlist/plib/pfmtlog.h
+++ b/src/lib/netlist/plib/pfmtlog.h
@@ -5,13 +5,12 @@
/// \file pfmtlog.h
///
-#ifndef PFMT_H_
-#define PFMT_H_
+#ifndef PFMTLOG_H_
+#define PFMTLOG_H_
#include "penum.h"
#include "pstring.h"
#include "ptypes.h"
-#include "putil.h"
#include <limits>
#include <locale>
@@ -423,4 +422,4 @@ namespace plib {
template<typename T>
plib::pfmt& operator<<(plib::pfmt &p, T&& val) { return p(std::forward<T>(val)); }
-#endif // PSTRING_H_
+#endif // PFMT_LOG_H_
diff --git a/src/lib/netlist/plib/pfunction.h b/src/lib/netlist/plib/pfunction.h
index 7fcac29aed9..e0b81a25e00 100644
--- a/src/lib/netlist/plib/pfunction.h
+++ b/src/lib/netlist/plib/pfunction.h
@@ -10,7 +10,6 @@
#include "pmath.h"
#include "pstring.h"
-#include "putil.h"
#include <vector>
diff --git a/src/lib/netlist/plib/plists.h b/src/lib/netlist/plib/plists.h
index f23caa18c2c..4430459b616 100644
--- a/src/lib/netlist/plib/plists.h
+++ b/src/lib/netlist/plib/plists.h
@@ -8,9 +8,7 @@
/// \file plists.h
///
-#include "palloc.h"
-#include "pchrono.h"
-#include "pstring.h"
+#include "ptypes.h"
#include <algorithm>
#include <array>
diff --git a/src/lib/netlist/plib/pmatrix2d.h b/src/lib/netlist/plib/pmatrix2d.h
index 0b982b8a034..4591d00b6f6 100755
--- a/src/lib/netlist/plib/pmatrix2d.h
+++ b/src/lib/netlist/plib/pmatrix2d.h
@@ -154,6 +154,8 @@ namespace plib
m_v.resize(N); //FIXME
}
+ PCOPYASSIGNMOVE(pmatrix2d_vrl, default)
+
void resize(size_type N, size_type M)
{
m_N = N;
diff --git a/src/lib/netlist/plib/pmempool.h b/src/lib/netlist/plib/pmempool.h
index d66efe2abdd..60ea24c6641 100644
--- a/src/lib/netlist/plib/pmempool.h
+++ b/src/lib/netlist/plib/pmempool.h
@@ -10,10 +10,10 @@
#include "palloc.h"
#include "pconfig.h"
-#include "pstream.h"
-#include "pstring.h"
+#include "pstream.h" // perrlogger
+//#include "pstring.h"
#include "ptypes.h"
-#include "putil.h"
+//#include "putil.h"
#include <algorithm>
#include <memory>
@@ -27,13 +27,13 @@ namespace plib {
// Memory pool
//============================================================
- template <typename BASEARENA, std::size_t MINALIGN = PMEMPOOL_ALIGN>
- class mempool_arena : public arena_base<mempool_arena<BASEARENA>, false, false>
+ template <typename BASEARENA, std::size_t MINALIGN = PALIGN_MIN_SIZE>
+ class mempool_arena : public arena_base<mempool_arena<BASEARENA, MINALIGN>, false, false>
{
public:
using size_type = typename BASEARENA::size_type;
- using base_type = arena_base<mempool_arena<BASEARENA>, false, false>;
+ using base_type = arena_base<mempool_arena<BASEARENA, MINALIGN>, false, false>;
template <class T>
using base_allocator_type = typename BASEARENA::template allocator_type<T>;
diff --git a/src/lib/netlist/plib/ppmf.h b/src/lib/netlist/plib/ppmf.h
index 39e184eaa5d..75e2e3b184d 100644
--- a/src/lib/netlist/plib/ppmf.h
+++ b/src/lib/netlist/plib/ppmf.h
@@ -34,7 +34,6 @@
#include "pconfig.h"
#include "ptypes.h"
-#include "putil.h"
#include <algorithm>
#include <cstdint> // uintptr_t
diff --git a/src/lib/netlist/plib/ppreprocessor.cpp b/src/lib/netlist/plib/ppreprocessor.cpp
index b563576c6a8..6c4faf88efa 100644
--- a/src/lib/netlist/plib/ppreprocessor.cpp
+++ b/src/lib/netlist/plib/ppreprocessor.cpp
@@ -5,6 +5,7 @@
#include "palloc.h"
#include "pstonum.h"
#include "putil.h"
+#include "pstrutil.h"
namespace plib {
diff --git a/src/lib/netlist/plib/pstate.h b/src/lib/netlist/plib/pstate.h
index d4d98c20785..556bde90d07 100644
--- a/src/lib/netlist/plib/pstate.h
+++ b/src/lib/netlist/plib/pstate.h
@@ -8,7 +8,6 @@
/// \file pstate.h
///
-#include "palloc.h"
#include "pstring.h"
#include "ptypes.h"
@@ -54,7 +53,7 @@ public:
plib::is_floating_point<T>::value);
}
- class callback_t
+ struct callback_t
{
public:
using list_t = std::vector<callback_t *>;
@@ -201,7 +200,6 @@ private:
save_state_ptr( owner, stname, dtype<C>(), 1, &state);
}
-
template<typename C>
std::enable_if_t<!(plib::is_integral<C>::value || std::is_enum<C>::value
|| plib::is_floating_point<C>::value)>
diff --git a/src/lib/netlist/plib/pstream.h b/src/lib/netlist/plib/pstream.h
index dcb2b0652cf..179a4f5ca98 100644
--- a/src/lib/netlist/plib/pstream.h
+++ b/src/lib/netlist/plib/pstream.h
@@ -9,12 +9,10 @@
/// \file pstream.h
///
-#include "palloc.h"
#include "pconfig.h"
-#include "pexception.h"
#include "pfmtlog.h"
#include "pstring.h"
-#include "pstrutil.h"
+#include "pgsl.h"
#include <array>
#include <fstream>
@@ -34,7 +32,6 @@ namespace plib {
{
using ct = typename S::char_type;
static_assert((sizeof(T) % sizeof(ct)) == 0, "istream_read sizeof issue");
- // FIXME: throw on
return is.read(reinterpret_cast<ct *>(data), gsl::narrow<std::streamsize>(len * sizeof(T)));
}
@@ -45,7 +42,6 @@ namespace plib {
{
using ct = typename S::char_type;
static_assert((sizeof(T) % sizeof(ct)) == 0, "ostream_write sizeof issue");
- // FIXME: throw on
return os.write(reinterpret_cast<const ct *>(data), gsl::narrow<std::streamsize>(len * sizeof(T)));
}
@@ -155,7 +151,8 @@ public:
{
// NOLINTNEXTLINE(performance-unnecessary-copy-initialization)
const putf8string conv_utf8(text);
- m_strm->write(conv_utf8.c_str(), static_cast<std::streamsize>(plib::strlen(conv_utf8.c_str())));
+ //m_strm->write(conv_utf8.c_str(), static_cast<std::streamsize>(plib::strlen(conv_utf8.c_str() )));
+ ostream_write(*m_strm, conv_utf8.c_str(), string_info<pstring>::mem_size(conv_utf8));
}
void write(const pstring::value_type c) const
diff --git a/src/lib/netlist/plib/pstring.h b/src/lib/netlist/plib/pstring.h
index 622d8548bd1..44d025b5fb0 100644
--- a/src/lib/netlist/plib/pstring.h
+++ b/src/lib/netlist/plib/pstring.h
@@ -209,10 +209,9 @@ public:
static constexpr const size_type npos = static_cast<size_type>(-1);
// the following are extensions to <string>
-
-private:
// FIXME: remove those
size_type mem_t_size() const noexcept { return m_str.size(); }
+private:
string_type m_str;
};
@@ -254,6 +253,7 @@ struct putf_traits<1, CT>
}
return ret;
}
+
static std::size_t codelen(const mem_t *p) noexcept
{
const auto *p1 = reinterpret_cast<const unsigned char *>(p);
@@ -460,6 +460,28 @@ using putf16string = pstring_t<putf16_traits>;
using putf32string = pstring_t<putf32_traits>;
using pwstring = pstring_t<pwchar_traits>;
+namespace plib
+{
+ template<class T>
+ struct string_info
+ {
+ };
+
+ template<typename T>
+ struct string_info<pstring_t<T>>
+ {
+ using mem_t = typename T::mem_t;
+ static std::size_t mem_size(const pstring_t<T> &s) { return s.mem_t_size(); }
+ };
+
+ template<typename T>
+ struct string_info<std::basic_string<T>>
+ {
+ using mem_t = T;
+ static std::size_t mem_size(const std::string &s) { return s.size(); }
+ };
+} // namespace plib
+
// custom specialization of std::hash can be injected in namespace std
namespace std
{
diff --git a/src/lib/netlist/plib/pstrutil.h b/src/lib/netlist/plib/pstrutil.h
index 2b79935dc3a..46424de618d 100644
--- a/src/lib/netlist/plib/pstrutil.h
+++ b/src/lib/netlist/plib/pstrutil.h
@@ -21,18 +21,6 @@
namespace plib
{
- template<class T>
- struct string_info
- {
- using mem_t = typename T::mem_t;
- };
-
- template<>
- struct string_info<std::string>
- {
- using mem_t = char;
- };
-
template<typename T>
pstring to_string(const T &v)
{
diff --git a/src/lib/netlist/plib/ptimed_queue.h b/src/lib/netlist/plib/ptimed_queue.h
index 2ec158f316e..2de315aa9c6 100644
--- a/src/lib/netlist/plib/ptimed_queue.h
+++ b/src/lib/netlist/plib/ptimed_queue.h
@@ -8,10 +8,9 @@
/// \file ptimed_queue.h
///
-#include "palloc.h"
#include "pchrono.h"
#include "pmulti_threading.h"
-#include "pstring.h"
+#include "ptypes.h"
#include <algorithm>
#include <mutex>
diff --git a/src/lib/netlist/plib/ptypes.h b/src/lib/netlist/plib/ptypes.h
index 7379ed68840..5efac1fbad5 100644
--- a/src/lib/netlist/plib/ptypes.h
+++ b/src/lib/netlist/plib/ptypes.h
@@ -23,19 +23,17 @@
#endif
// noexcept on move operator -> issue with macosx clang
-#define PCOPYASSIGNMOVE(name, def) \
- name(const name &) = def; \
- name(name &&) noexcept = def; \
- name &operator=(const name &) = def; \
- name &operator=(name &&) noexcept = def;
+#define PCOPYASSIGNMOVE(name, def) \
+ PCOPYASSIGN(name, def) \
+ PMOVEASSIGN(name, def)
#define PCOPYASSIGN(name, def) \
- name(const name &) = def; \
- name &operator=(const name &) = def; \
+ name(const name &) = def; \
+ name &operator=(const name &) = def;
#define PMOVEASSIGN(name, def) \
- name(name &&) noexcept = def; \
- name &operator=(name &&) noexcept = def;
+ name(name &&) /*noexcept*/ = def; \
+ name &operator=(name &&) /*noexcept*/ = def;
namespace plib
{
@@ -261,12 +259,34 @@ namespace plib
using type = typename fast_type_for_size<size_for_bits<bits>::value>::type;
};
- //============================================================
- // Avoid unused variable warnings
- //============================================================
+ /// \brief mark arguments as not used for compiler
+ ///
+ /// @tparam Ts unsused parameters
+ ///
template<typename... Ts>
inline void unused_var(Ts&&...) noexcept {} // NOLINT(readability-named-parameter)
+ /// \brief copy type S to type D byte by byte
+ ///
+ /// The purpose of this copy function is to suppress compiler warnings.
+ /// Use at your own risk. This is dangerous.
+ ///
+ /// \param s Source object
+ /// \param d Destination object
+ /// \tparam S Type of source object
+ /// \tparam D Type of destination object
+ template <typename S, typename D>
+ void reinterpret_copy(S &s, D &d)
+ {
+ static_assert(sizeof(D) >= sizeof(S), "size mismatch");
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
+ auto *dp = reinterpret_cast<std::uint8_t *>(&d);
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
+ const auto *sp = reinterpret_cast<std::uint8_t *>(&s);
+ std::copy(sp, sp + sizeof(S), dp);
+ }
+
+
} // namespace plib
//============================================================
diff --git a/src/lib/netlist/plib/putil.h b/src/lib/netlist/plib/putil.h
index dde1918ebaf..4754730e55e 100644
--- a/src/lib/netlist/plib/putil.h
+++ b/src/lib/netlist/plib/putil.h
@@ -249,26 +249,6 @@ namespace plib
list_t m_collection;
};
- /// \brief copy type S to type D byte by byte
- ///
- /// The purpose of this copy function is to suppress compiler warnings.
- /// Use at your own risk. This is dangerous.
- ///
- /// \param s Source object
- /// \param d Destination object
- /// \tparam S Type of source object
- /// \tparam D Type of destination object
- template <typename S, typename D>
- void reinterpret_copy(S &s, D &d)
- {
- static_assert(sizeof(D) >= sizeof(S), "size mismatch");
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
- auto *dp = reinterpret_cast<std::uint8_t *>(&d);
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
- const auto *sp = reinterpret_cast<std::uint8_t *>(&s);
- std::copy(sp, sp + sizeof(S), dp);
- }
-
namespace util
{
pstring basename(const pstring &filename, const pstring &suffix = "");
diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp
index 9bc19779e0b..25b4e6a9307 100644
--- a/src/lib/netlist/prg/nltool.cpp
+++ b/src/lib/netlist/prg/nltool.cpp
@@ -9,6 +9,7 @@
//
// ***************************************************************************
+#include "netlist/plib/pdynlib.h"
#include "netlist/plib/pmain.h"
#include "netlist/devices/net_lib.h"
#include "netlist/nl_errstr.h"
@@ -222,17 +223,17 @@ public:
void vlog(const plib::plog_level &l, const pstring &ls) const noexcept override;
- netlist::host_arena::unique_ptr<plib::dynlib_base> static_solver_lib() const override
+ std::unique_ptr<plib::dynlib_base> static_solver_lib() const override
{
if (m_boostlib == "builtin")
- return plib::make_unique<plib::dynlib_static, netlist::host_arena>(nl_static_solver_syms);
+ return std::make_unique<plib::dynlib_static>(nl_static_solver_syms);
if (m_boostlib == "generic")
- return plib::make_unique<plib::dynlib_static, netlist::host_arena>(nullptr);
+ return std::make_unique<plib::dynlib_static>(nullptr);
if (NL_DISABLE_DYNAMIC_LOAD)
throw netlist::nl_exception("Dynamic library loading not supported due to project security concerns.");
//pstring libpath = plib::util::environment("NL_BOOSTLIB", plib::util::buildpath({".", "nlboost.so"}));
- return plib::make_unique<plib::dynlib, netlist::host_arena>(m_boostlib);
+ return std::make_unique<plib::dynlib>(m_boostlib);
}
private:
diff --git a/src/lib/netlist/prg/nlwav.cpp b/src/lib/netlist/prg/nlwav.cpp
index 9a9b3f08e69..221a91fbe27 100755
--- a/src/lib/netlist/prg/nlwav.cpp
+++ b/src/lib/netlist/prg/nlwav.cpp
@@ -1,10 +1,10 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
#include "netlist/plib/pstring.h"
-//#include "netlist/nl_setup.h"
#include "netlist/plib/pmain.h"
#include "netlist/plib/ppmf.h"
#include "netlist/plib/pstream.h"
+#include "netlist/plib/pstrutil.h"
#include <cstdio>
diff --git a/src/lib/netlist/solver/nld_matrix_solver.cpp b/src/lib/netlist/solver/nld_matrix_solver.cpp
index 87ae2de71d7..6eb4878c9b2 100644
--- a/src/lib/netlist/solver/nld_matrix_solver.cpp
+++ b/src/lib/netlist/solver/nld_matrix_solver.cpp
@@ -37,7 +37,7 @@ namespace solver
// ----------------------------------------------------------------------------------------
matrix_solver_t::matrix_solver_t(netlist_state_t &anetlist, const pstring &name,
- const analog_net_t::list_t &nets,
+ const net_list_t &nets,
const solver_parameters_t *params)
: device_t(anetlist, name)
, m_params(*params)
@@ -67,7 +67,7 @@ namespace solver
return &state().setup().get_connected_terminal(*term)->net();
}
- void matrix_solver_t::setup_base(setup_t &setup, const analog_net_t::list_t &nets)
+ void matrix_solver_t::setup_base(setup_t &setup, const net_list_t &nets)
{
log().debug("New solver setup\n");
std::vector<core_device_t *> step_devices;
diff --git a/src/lib/netlist/solver/nld_matrix_solver.h b/src/lib/netlist/solver/nld_matrix_solver.h
index 3fd0e2fd6d9..55af6a34161 100644
--- a/src/lib/netlist/solver/nld_matrix_solver.h
+++ b/src/lib/netlist/solver/nld_matrix_solver.h
@@ -186,6 +186,7 @@ namespace solver
using list_t = std::vector<matrix_solver_t *>;
using fptype = nl_fptype;
using arena_type = plib::mempool_arena<plib::aligned_arena, PALIGN_VECTOROPT>;
+ using net_list_t = plib::aligned_vector<analog_net_t *>;
// after every call to solve, update inputs must be called.
// this can be done as well as a batch to ease parallel processing.
@@ -266,7 +267,7 @@ namespace solver
protected:
matrix_solver_t(netlist_state_t &anetlist, const pstring &name,
- const analog_net_t::list_t &nets,
+ const net_list_t &nets,
const solver_parameters_t *params);
virtual void vsolve_non_dynamic() = 0;
@@ -289,7 +290,7 @@ namespace solver
private:
// base setup - called from constructor
- void setup_base(setup_t &setup, const analog_net_t::list_t &nets) noexcept(false);
+ void setup_base(setup_t &setup, const net_list_t &nets) noexcept(false);
void sort_terms(matrix_sort_type_e sort);
diff --git a/src/lib/netlist/solver/nld_matrix_solver_ext.h b/src/lib/netlist/solver/nld_matrix_solver_ext.h
index 275ef135c69..7541795c2a1 100644
--- a/src/lib/netlist/solver/nld_matrix_solver_ext.h
+++ b/src/lib/netlist/solver/nld_matrix_solver_ext.h
@@ -25,7 +25,7 @@ namespace solver
using float_type = FT;
matrix_solver_ext_t(netlist_state_t &anetlist, const pstring &name,
- const analog_net_t::list_t &nets,
+ const net_list_t &nets,
const solver_parameters_t *params, const std::size_t size)
: matrix_solver_t(anetlist, name, nets, params)
, m_new_V(size)
diff --git a/src/lib/netlist/solver/nld_ms_direct.h b/src/lib/netlist/solver/nld_ms_direct.h
index b32e4d2172b..8cfb6b65273 100644
--- a/src/lib/netlist/solver/nld_ms_direct.h
+++ b/src/lib/netlist/solver/nld_ms_direct.h
@@ -30,7 +30,7 @@ namespace solver
using float_type = FT;
matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name,
- const analog_net_t::list_t &nets,
+ const matrix_solver_t::net_list_t &nets,
const solver_parameters_t *params, std::size_t size);
void reset() override { matrix_solver_t::reset(); }
@@ -189,7 +189,7 @@ namespace solver
template <typename FT, int SIZE>
matrix_solver_direct_t<FT, SIZE>::matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name,
- const analog_net_t::list_t &nets,
+ const matrix_solver_t::net_list_t &nets,
const solver_parameters_t *params,
std::size_t size)
: matrix_solver_ext_t<FT, SIZE>(anetlist, name, nets, params, size)
diff --git a/src/lib/netlist/solver/nld_ms_direct1.h b/src/lib/netlist/solver/nld_ms_direct1.h
index e33846ad403..c9188a7dc9c 100644
--- a/src/lib/netlist/solver/nld_ms_direct1.h
+++ b/src/lib/netlist/solver/nld_ms_direct1.h
@@ -25,7 +25,7 @@ namespace solver
using base_type = matrix_solver_direct_t<FT, 1>;
matrix_solver_direct1_t(netlist_state_t &anetlist, const pstring &name,
- const analog_net_t::list_t &nets,
+ const matrix_solver_t::net_list_t &nets,
const solver_parameters_t *params)
: matrix_solver_direct_t<FT, 1>(anetlist, name, nets, params, 1)
{}
diff --git a/src/lib/netlist/solver/nld_ms_direct2.h b/src/lib/netlist/solver/nld_ms_direct2.h
index 365c1cac33e..0fb1345e1a6 100644
--- a/src/lib/netlist/solver/nld_ms_direct2.h
+++ b/src/lib/netlist/solver/nld_ms_direct2.h
@@ -29,7 +29,7 @@ namespace solver
using float_type = FT;
matrix_solver_direct2_t(netlist_state_t &anetlist, const pstring &name,
- const analog_net_t::list_t &nets,
+ const matrix_solver_t::net_list_t &nets,
const solver_parameters_t *params)
: matrix_solver_direct_t<FT, 2>(anetlist, name, nets, params, 2)
{}
diff --git a/src/lib/netlist/solver/nld_ms_gcr.h b/src/lib/netlist/solver/nld_ms_gcr.h
index fb5c675dd14..a5ab9f6c283 100644
--- a/src/lib/netlist/solver/nld_ms_gcr.h
+++ b/src/lib/netlist/solver/nld_ms_gcr.h
@@ -36,7 +36,7 @@ namespace solver
using fptype = typename base_type::fptype;
matrix_solver_GCR_t(netlist_state_t &anetlist, const pstring &name,
- const analog_net_t::list_t &nets,
+ const matrix_solver_t::net_list_t &nets,
const solver_parameters_t *params, const std::size_t size)
: matrix_solver_ext_t<FT, SIZE>(anetlist, name, nets, params, size)
, mat(static_cast<typename mat_type::index_type>(size))
diff --git a/src/lib/netlist/solver/nld_ms_gmres.h b/src/lib/netlist/solver/nld_ms_gmres.h
index 837c0bc780e..47d00e7e2ef 100644
--- a/src/lib/netlist/solver/nld_ms_gmres.h
+++ b/src/lib/netlist/solver/nld_ms_gmres.h
@@ -35,7 +35,7 @@ namespace solver
// This is already preconditioning.
matrix_solver_GMRES_t(netlist_state_t &anetlist, const pstring &name,
- analog_net_t::list_t &nets,
+ matrix_solver_t::net_list_t &nets,
const solver_parameters_t *params,
const std::size_t size)
: matrix_solver_direct_t<FT, SIZE>(anetlist, name, nets, params, size)
diff --git a/src/lib/netlist/solver/nld_ms_sm.h b/src/lib/netlist/solver/nld_ms_sm.h
index fd11a32a102..85c4731050e 100644
--- a/src/lib/netlist/solver/nld_ms_sm.h
+++ b/src/lib/netlist/solver/nld_ms_sm.h
@@ -55,7 +55,7 @@ namespace solver
static constexpr const std::size_t storage_N = 100;
matrix_solver_sm_t(netlist_state_t &anetlist, const pstring &name,
- const analog_net_t::list_t &nets,
+ const matrix_solver_t::net_list_t &nets,
const solver_parameters_t *params, const std::size_t size)
: matrix_solver_ext_t<FT, SIZE>(anetlist, name, nets, params, size)
, m_cnt(0)
diff --git a/src/lib/netlist/solver/nld_ms_sor.h b/src/lib/netlist/solver/nld_ms_sor.h
index 6b1a21afd39..a828a1cd715 100644
--- a/src/lib/netlist/solver/nld_ms_sor.h
+++ b/src/lib/netlist/solver/nld_ms_sor.h
@@ -30,7 +30,7 @@ namespace solver
using float_type = FT;
matrix_solver_SOR_t(netlist_state_t &anetlist, const pstring &name,
- analog_net_t::list_t &nets,
+ matrix_solver_t::net_list_t &nets,
const solver_parameters_t *params, const std::size_t size)
: matrix_solver_direct_t<FT, SIZE>(anetlist, name, nets, params, size)
, m_lp_fact(*this, "m_lp_fact", 0)
diff --git a/src/lib/netlist/solver/nld_ms_sor_mat.h b/src/lib/netlist/solver/nld_ms_sor_mat.h
index 2d29d0f01cd..f725213228c 100644
--- a/src/lib/netlist/solver/nld_ms_sor_mat.h
+++ b/src/lib/netlist/solver/nld_ms_sor_mat.h
@@ -30,7 +30,7 @@ namespace solver
using float_type = FT;
matrix_solver_SOR_mat_t(netlist_state_t &anetlist, const pstring &name,
- const analog_net_t::list_t &nets,
+ const matrix_solver_t::net_list_t &nets,
const solver_parameters_t *params, std::size_t size)
: matrix_solver_direct_t<FT, SIZE>(anetlist, name, nets, params, size)
, m_omega(*this, "m_omega", static_cast<float_type>(params->m_gs_sor))
diff --git a/src/lib/netlist/solver/nld_ms_w.h b/src/lib/netlist/solver/nld_ms_w.h
index 598a4b9e516..fde53aac884 100644
--- a/src/lib/netlist/solver/nld_ms_w.h
+++ b/src/lib/netlist/solver/nld_ms_w.h
@@ -61,7 +61,7 @@ namespace solver
static constexpr const std::size_t storage_N = 100;
matrix_solver_w_t(netlist_state_t &anetlist, const pstring &name,
- const analog_net_t::list_t &nets,
+ const matrix_solver_t::net_list_t &nets,
const solver_parameters_t *params, const std::size_t size)
: matrix_solver_ext_t<FT, SIZE>(anetlist, name, nets, params, size)
, m_cnt(0)
@@ -79,7 +79,6 @@ namespace solver
template <typename T>
void LE_compute_x(T & x);
-
template <typename T1, typename T2>
float_ext_type &A(const T1 &r, const T2 &c) { return m_A[r][c]; }
template <typename T1, typename T2>
diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp
index b38616945f9..c3a42f0721f 100644
--- a/src/lib/netlist/solver/nld_solver.cpp
+++ b/src/lib/netlist/solver/nld_solver.cpp
@@ -86,7 +86,7 @@ namespace devices
// FIXME: should be created in device space
template <class C>
NETLIB_NAME(solver)::solver_ptr create_it(netlist_state_t &nl, pstring name,
- analog_net_t::list_t &nets,
+ NETLIB_NAME(solver)::net_list_t &nets,
solver::solver_parameters_t &params, std::size_t size)
{
return plib::make_unique<C, host_arena>(nl, name, nets, &params, size);
@@ -96,7 +96,7 @@ namespace devices
template <typename FT, int SIZE>
NETLIB_NAME(solver)::solver_ptr NETLIB_NAME(solver)::create_solver(std::size_t size,
const pstring &solvername,
- analog_net_t::list_t &nets)
+ NETLIB_NAME(solver)::net_list_t &nets)
{
switch (m_params.m_method())
{
@@ -133,7 +133,7 @@ namespace devices
template <typename FT>
NETLIB_NAME(solver)::solver_ptr NETLIB_NAME(solver)::create_solvers(
const pstring &sname,
- analog_net_t::list_t &nets)
+ net_list_t &nets)
{
std::size_t net_count = nets.size();
switch (net_count)
@@ -200,7 +200,7 @@ namespace devices
auto &n = dynamic_cast<analog_net_t &>(*net);
if (!already_processed(n))
{
- groupspre.emplace_back(analog_net_t::list_t());
+ groupspre.emplace_back(NETLIB_NAME(solver)::net_list_t());
process_net(netlist, n);
}
}
@@ -210,7 +210,7 @@ namespace devices
groups.push_back(g);
}
- std::vector<analog_net_t::list_t> groups;
+ std::vector<NETLIB_NAME(solver)::net_list_t> groups;
private:
@@ -280,7 +280,7 @@ namespace devices
}
}
- std::vector<analog_net_t::list_t> groupspre;
+ std::vector<NETLIB_NAME(solver)::net_list_t> groupspre;
};
void NETLIB_NAME(solver)::post_start()
diff --git a/src/lib/netlist/solver/nld_solver.h b/src/lib/netlist/solver/nld_solver.h
index f1395543524..4ff70d04606 100644
--- a/src/lib/netlist/solver/nld_solver.h
+++ b/src/lib/netlist/solver/nld_solver.h
@@ -49,6 +49,7 @@ namespace devices
//using solver_ptr = device_arena::unique_ptr<solver::matrix_solver_t>;
using solver_ptr = host_arena::unique_ptr<solver::matrix_solver_t>;
+ using net_list_t = solver::matrix_solver_t::net_list_t;
private:
logic_input_t m_fb_step;
@@ -63,11 +64,11 @@ namespace devices
template <typename FT, int SIZE>
solver_ptr create_solver(std::size_t size,
- const pstring &solvername, analog_net_t::list_t &nets);
+ const pstring &solvername, net_list_t &nets);
template <typename FT>
solver_ptr create_solvers(
- const pstring &sname, analog_net_t::list_t &nets);
+ const pstring &sname, net_list_t &nets);
};
} // namespace devices
diff --git a/src/lib/netlist/tools/nl_convert.cpp b/src/lib/netlist/tools/nl_convert.cpp
index ee6a9827eb3..490a275adc2 100644
--- a/src/lib/netlist/tools/nl_convert.cpp
+++ b/src/lib/netlist/tools/nl_convert.cpp
@@ -4,6 +4,7 @@
#include "plib/palloc.h"
#include "plib/pstonum.h"
#include "plib/putil.h"
+#include "plib/pstrutil.h"
#include "nl_convert.h"