/scripts/font/

t type='hidden' name='id' value='5155e51bbe24d0cc45a84ddb66138f83ff1810cf'/> MAME - Multiple Arcade Machine Emulator
summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author couriersud <couriersud@users.noreply.github.com>2022-05-29 18:30:25 +0200
committer GitHub <noreply@github.com>2022-05-30 02:30:25 +1000
commit5155e51bbe24d0cc45a84ddb66138f83ff1810cf (patch)
tree80e3f8bcf6b39c8a06e3a6d6ba59c9f45de1449d
parentbfc1c9cd01aeb286357a88259f9bd360ef792348 (diff)
netlist: static solver work and improve code readability (#9841)
- nltool: Added support for building individual static solver files. - Added pre-built documentation files for nltool and nlwav. - plib: Extended typed_version to have patchlevel as well. - plib: Compile more of ppmf.h with nvcc. - create_devinc.py: Add include guards to the generated files. - makefile: Recreate generated files when python code has changed. - Reduced nld_base.h usage in the core. - <oved extern template class declarations to where they belong. - Generally improved code readability and fixed a lot of issues cspell reported.
Diffstat
-rw-r--r--src/devices/machine/netlist.cpp6
-rw-r--r--src/lib/netlist/.gitignore2
-rw-r--r--src/lib/netlist/analog/nld_bjt.cpp56
-rw-r--r--src/lib/netlist/analog/nld_generic_models.h15
-rw-r--r--src/lib/netlist/analog/nld_mosfet.cpp28
-rw-r--r--src/lib/netlist/analog/nld_opamps.cpp28
-rw-r--r--src/lib/netlist/analog/nld_switches.cpp10
-rw-r--r--src/lib/netlist/analog/nlid_fourterm.cpp3
-rw-r--r--src/lib/netlist/analog/nlid_fourterm.h34
-rw-r--r--src/lib/netlist/analog/nlid_twoterm.cpp8
-rw-r--r--src/lib/netlist/analog/nlid_twoterm.h76
-rw-r--r--src/lib/netlist/build/create_devinc.py22
-rw-r--r--src/lib/netlist/build/cspell.json54
-rw-r--r--src/lib/netlist/build/html/nltool.html366
-rw-r--r--src/lib/netlist/build/html/nlwav.html285
-rw-r--r--src/lib/netlist/build/makefile17
-rw-r--r--src/lib/netlist/build/man/nltool.1176
-rw-r--r--src/lib/netlist/build/man/nlwav.1116
-rw-r--r--src/lib/netlist/core/analog.h10
-rw-r--r--src/lib/netlist/core/base_objects.h10
-rw-r--r--src/lib/netlist/core/core_device.h10
-rw-r--r--src/lib/netlist/core/device_macros.h14
-rw-r--r--src/lib/netlist/core/devices.h8
-rw-r--r--src/lib/netlist/core/logic.h4
-rw-r--r--src/lib/netlist/core/netlist_state.h6
-rw-r--r--src/lib/netlist/core/nets.h4
-rw-r--r--src/lib/netlist/core/object_array.h34
-rw-r--r--src/lib/netlist/core/param.h42
-rw-r--r--src/lib/netlist/core/queue.h24
-rw-r--r--src/lib/netlist/core/setup.h4
-rw-r--r--src/lib/netlist/core/state_var.h15
-rw-r--r--src/lib/netlist/devices/nld_4020.cpp54
-rw-r--r--src/lib/netlist/devices/nld_4053.cpp30
-rw-r--r--src/lib/netlist/devices/nld_74123.cpp8
-rw-r--r--src/lib/netlist/devices/nld_74174.cpp32
-rw-r--r--src/lib/netlist/devices/nld_7497.cpp10
-rw-r--r--src/lib/netlist/devices/nld_74ls629.cpp2
-rw-r--r--src/lib/netlist/devices/nld_8277.cpp24
-rw-r--r--src/lib/netlist/devices/nld_9322.cpp32
-rw-r--r--src/lib/netlist/devices/nld_am2847.cpp28
-rw-r--r--src/lib/netlist/devices/nld_log.cpp6
-rw-r--r--src/lib/netlist/devices/nld_mm5837.cpp4
-rw-r--r--src/lib/netlist/devices/nld_ne555.cpp10
-rw-r--r--src/lib/netlist/devices/nld_r2r_dac.cpp6
-rw-r--r--src/lib/netlist/devices/nld_roms.cpp2
-rw-r--r--src/lib/netlist/devices/nld_schmitt.cpp6
-rw-r--r--src/lib/netlist/devices/nld_system.cpp4
-rw-r--r--src/lib/netlist/devices/nlid_proxy.cpp6
-rw-r--r--src/lib/netlist/devices/nlid_proxy.h4
-rw-r--r--src/lib/netlist/devices/nlid_system.h84
-rw-r--r--src/lib/netlist/devices/nlid_truthtable.cpp90
-rw-r--r--src/lib/netlist/devices/nlid_truthtable.h6
-rw-r--r--src/lib/netlist/examples/lostfound.cpp2
-rw-r--r--src/lib/netlist/generated/nld_devinc.h15
-rw-r--r--src/lib/netlist/generated/nlm_modules_lib.cpp2
-rw-r--r--src/lib/netlist/generated/static_solvers.cpp109486
-rw-r--r--src/lib/netlist/nl_base.cpp38
-rw-r--r--src/lib/netlist/nl_base.h63
-rw-r--r--src/lib/netlist/nl_create_mame_solvers.sh4
-rw-r--r--src/lib/netlist/nl_factory.cpp12
-rw-r--r--src/lib/netlist/nl_factory.h18
-rw-r--r--src/lib/netlist/nl_interface.h5
-rw-r--r--src/lib/netlist/nl_parser.cpp33
-rw-r--r--src/lib/netlist/nl_parser.h32
-rw-r--r--src/lib/netlist/nl_setup.cpp104
-rw-r--r--src/lib/netlist/nl_setup.h14
-rw-r--r--src/lib/netlist/nltypes.h13
-rw-r--r--src/lib/netlist/plib/gmres.h52
-rw-r--r--src/lib/netlist/plib/parray.h9
-rw-r--r--src/lib/netlist/plib/pconfig.h12
-rw-r--r--src/lib/netlist/plib/pdynlib.cpp8
-rw-r--r--src/lib/netlist/plib/pdynlib.h119
-rw-r--r--src/lib/netlist/plib/penum.h4
-rw-r--r--src/lib/netlist/plib/pexception.cpp12
-rw-r--r--src/lib/netlist/plib/pexception.h12
-rw-r--r--src/lib/netlist/plib/pfmtlog.h6
-rw-r--r--src/lib/netlist/plib/pfunction.h2
-rw-r--r--src/lib/netlist/plib/pgsl.h5
-rw-r--r--src/lib/netlist/plib/plists.h6
-rw-r--r--src/lib/netlist/plib/pmain.cpp8
-rw-r--r--src/lib/netlist/plib/pmain.h14
-rw-r--r--src/lib/netlist/plib/pmatrix2d.h4
-rw-r--r--src/lib/netlist/plib/pmatrix_cr.h52
-rw-r--r--src/lib/netlist/plib/poptions.cpp12
-rw-r--r--src/lib/netlist/plib/poptions.h46
-rw-r--r--src/lib/netlist/plib/ppmf.h10
-rw-r--r--src/lib/netlist/plib/ppreprocessor.cpp56
-rw-r--r--src/lib/netlist/plib/pstate.h56
-rw-r--r--src/lib/netlist/plib/pstream.h35
-rw-r--r--src/lib/netlist/plib/pstrutil.h5
-rw-r--r--src/lib/netlist/plib/ptests.h2
-rw-r--r--src/lib/netlist/plib/ptimed_queue.h39
-rw-r--r--src/lib/netlist/plib/ptokenizer.cpp54
-rw-r--r--src/lib/netlist/plib/ptokenizer.h111
-rw-r--r--src/lib/netlist/plib/ptypes.h28
-rw-r--r--src/lib/netlist/plib/putil.cpp2
-rw-r--r--src/lib/netlist/plib/putil.h4
-rw-r--r--src/lib/netlist/plib/vector_ops.h2
-rw-r--r--src/lib/netlist/prg/nltool.cpp635
-rw-r--r--src/lib/netlist/prg/nlwav.cpp206
-rw-r--r--src/lib/netlist/solver/nld_matrix_solver.cpp70
-rw-r--r--src/lib/netlist/solver/nld_matrix_solver.h50
-rw-r--r--src/lib/netlist/solver/nld_matrix_solver_ext.h12
-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_direct_lu.h36
-rw-r--r--src/lib/netlist/solver/nld_ms_gcr.h151
-rw-r--r--src/lib/netlist/solver/nld_ms_gmres.h12
-rw-r--r--src/lib/netlist/solver/nld_ms_sm.h22
-rw-r--r--src/lib/netlist/solver/nld_ms_sor.h6
-rw-r--r--src/lib/netlist/solver/nld_ms_sor_mat.h4
-rw-r--r--src/lib/netlist/solver/nld_ms_w.h4
-rw-r--r--src/lib/netlist/solver/nld_solver.cpp60
-rw-r--r--src/lib/netlist/solver/nld_solver.h7
-rw-r--r--src/lib/netlist/tests/test_penum.cpp195
-rw-r--r--src/lib/netlist/tests/test_pmfp.cpp13
-rw-r--r--src/lib/netlist/tests/test_pmfp_multibase.cpp4
-rw-r--r--src/lib/netlist/tools/nl_convert.cpp18
-rw-r--r--src/lib/netlist/tools/nl_convert.h22
-rw-r--r--src/mame/audio/nl_segaspeech.h2
-rw-r--r--src/mame/audio/segaspeech.cpp2
122 files changed, 56293 insertions, 57809 deletions
diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp
index e0023ebb8d4..536d97367b9 100644
--- a/src/devices/machine/netlist.cpp
+++ b/src/devices/machine/netlist.cpp
@@ -68,7 +68,7 @@ DEFINE_DEVICE_TYPE(NETLIST_STREAM_OUTPUT, netlist_mame_stream_output_device, "nl
// Special netlist extension devices ....
// ----------------------------------------------------------------------------------------
-extern const plib::dynlib_static_sym nl_static_solver_syms[];
+extern const plib::static_library::symbol nl_static_solver_syms[];
static netlist::netlist_time_ext nltime_from_attotime(attotime t)
{
@@ -986,7 +986,7 @@ std::unique_ptr<netlist::netlist_state_t> netlist_mame_device::base_validity_che
plib::plog_delegate(&validity_logger::log, &logger));
// enable validation mode
- lnetlist->set_static_solver_lib(std::make_unique<plib::dynlib_static>(nullptr));
+ lnetlist->set_static_solver_lib(std::make_unique<plib::static_library>(nullptr));
common_dev_start(lnetlist.get());
lnetlist->setup().prepare_to_run();
@@ -1034,7 +1034,7 @@ void netlist_mame_device::device_start_common()
{
m_netlist = std::make_unique<netlist_mame_t>(*this, "netlist");
- m_netlist->set_static_solver_lib(std::make_unique<plib::dynlib_static>(nl_static_solver_syms));
+ m_netlist->set_static_solver_lib(std::make_unique<plib::static_library>(nl_static_solver_syms));
if (!machine().options().verbose())
{
diff --git a/src/lib/netlist/.gitignore b/src/lib/netlist/.gitignore
index 75277061721..ec2a4e8336e 100644
--- a/src/lib/netlist/.gitignore
+++ b/src/lib/netlist/.gitignore
@@ -1,5 +1,3 @@
-build/html/*
-build/man/*
build/doxy/*
build/obj/*
buildVS/Release/*
diff --git a/src/lib/netlist/analog/nld_bjt.cpp b/src/lib/netlist/analog/nld_bjt.cpp
index 2ba7240e637..18832d0e4d7 100644
--- a/src/lib/netlist/analog/nld_bjt.cpp
+++ b/src/lib/netlist/analog/nld_bjt.cpp
@@ -178,17 +178,17 @@ namespace analog
{
NETLIB_CONSTRUCTOR(QBJT_switch)
, m_bjt_model(m_model)
- , m_RB(*this, "m_RB", NETLIB_DELEGATE(termhandler))
- , m_RC(*this, "m_RC", NETLIB_DELEGATE(termhandler))
- , m_BC(*this, "m_BC", NETLIB_DELEGATE(termhandler))
+ , m_RB(*this, "m_RB", NETLIB_DELEGATE(terminal_handler))
+ , m_RC(*this, "m_RC", NETLIB_DELEGATE(terminal_handler))
+ , m_BC(*this, "m_BC", NETLIB_DELEGATE(terminal_handler))
, m_gB(nlconst::cgmin())
, m_gC(nlconst::cgmin())
, m_V(nlconst::zero())
, m_state_on(*this, "m_state_on", 0U)
{
- register_subalias("B", m_RB.P());
- register_subalias("E", m_RB.N());
- register_subalias("C", m_RC.P());
+ register_sub_alias("B", m_RB.P());
+ register_sub_alias("E", m_RB.N());
+ register_sub_alias("C", m_RC.P());
connect(m_RB.N(), m_RC.N());
connect(m_RB.P(), m_BC.P());
@@ -196,11 +196,11 @@ namespace analog
}
NETLIB_RESETI();
- NETLIB_HANDLERI(termhandler)
+ NETLIB_HANDLERI(terminal_handler)
{
- auto *solv(m_RB.solver());
- if (solv != nullptr)
- solv->solve_now();
+ auto *solver(m_RB.solver());
+ if (solver != nullptr)
+ solver->solve_now();
else
m_RC.solver()->solve_now();
}
@@ -210,9 +210,9 @@ namespace analog
private:
bjt_model_t m_bjt_model;
- nld_twoterm m_RB;
- nld_twoterm m_RC;
- nld_twoterm m_BC;
+ nld_two_terminal m_RB;
+ nld_two_terminal m_RC;
+ nld_two_terminal m_BC;
nl_fptype m_gB; // base conductance / switch on
nl_fptype m_gC; // collector conductance / switch on
@@ -233,16 +233,16 @@ namespace analog
, m_bjt_model(m_model)
, m_gD_BC(*this, "m_D_BC")
, m_gD_BE(*this, "m_D_BE")
- , m_D_CB(*this, "m_D_CB", NETLIB_DELEGATE(termhandler))
- , m_D_EB(*this, "m_D_EB", NETLIB_DELEGATE(termhandler))
- , m_D_EC(*this, "m_D_EC", NETLIB_DELEGATE(termhandler))
+ , m_D_CB(*this, "m_D_CB", NETLIB_DELEGATE(terminal_handler))
+ , m_D_EB(*this, "m_D_EB", NETLIB_DELEGATE(terminal_handler))
+ , m_D_EC(*this, "m_D_EC", NETLIB_DELEGATE(terminal_handler))
, m_alpha_f(0)
, m_alpha_r(0)
{
- register_subalias("E", m_D_EB.P()); // Cathode
- register_subalias("B", m_D_EB.N()); // Anode
+ register_sub_alias("E", m_D_EB.P()); // Cathode
+ register_sub_alias("B", m_D_EB.N()); // Anode
- register_subalias("C", m_D_CB.P()); // Cathode
+ register_sub_alias("C", m_D_CB.P()); // Cathode
connect(m_D_EB.P(), m_D_EC.P());
connect(m_D_EB.N(), m_D_CB.N());
@@ -250,13 +250,13 @@ namespace analog
if (m_bjt_model.m_CJE > nlconst::zero())
{
- create_and_register_subdevice(*this, "m_CJE", m_CJE);
+ create_and_register_sub_device(*this, "m_CJE", m_CJE);
connect("B", "m_CJE.1");
connect("E", "m_CJE.2");
}
if (m_bjt_model.m_CJC > nlconst::zero())
{
- create_and_register_subdevice(*this, "m_CJC", m_CJC);
+ create_and_register_sub_device(*this, "m_CJC", m_CJC);
connect("B", "m_CJC.1");
connect("C", "m_CJC.2");
}
@@ -266,11 +266,11 @@ namespace analog
protected:
NETLIB_RESETI();
- NETLIB_HANDLERI(termhandler)
+ NETLIB_HANDLERI(terminal_handler)
{
- auto *solv(m_D_EB.solver());
- if (solv != nullptr)
- solv->solve_now();
+ auto *solver(m_D_EB.solver());
+ if (solver != nullptr)
+ solver->solve_now();
else
m_D_CB.solver()->solve_now();
}
@@ -283,9 +283,9 @@ namespace analog
generic_diode<diode_e::BIPOLAR> m_gD_BC;
generic_diode<diode_e::BIPOLAR> m_gD_BE;
- nld_twoterm m_D_CB; // gcc, gce - gcc, gec - gcc, gcc - gce | Ic
- nld_twoterm m_D_EB; // gee, gec - gee, gce - gee, gee - gec | Ie
- nld_twoterm m_D_EC; // 0, -gec, -gcc, 0 | 0
+ nld_two_terminal m_D_CB; // gcc, gce - gcc, gec - gcc, gcc - gce | Ic
+ nld_two_terminal m_D_EB; // gee, gec - gee, gce - gee, gee - gec | Ie
+ nld_two_terminal m_D_EC; // 0, -gec, -gcc, 0 | 0
nl_fptype m_alpha_f;
nl_fptype m_alpha_r;
diff --git a/src/lib/netlist/analog/nld_generic_models.h b/src/lib/netlist/analog/nld_generic_models.h
index 6f58c5369d7..b68b0fb5cee 100644
--- a/src/lib/netlist/analog/nld_generic_models.h
+++ b/src/lib/netlist/analog/nld_generic_models.h
@@ -8,6 +8,7 @@
/// \file nld_generic_models.h
///
+#include "core/state_var.h"
#include "nl_base.h"
//
@@ -73,7 +74,7 @@ namespace netlist::analog
//return -m_h * cap * m_v;
}
- void timestep(nl_fptype cap, nl_fptype v, nl_fptype step) noexcept
+ void time_step(nl_fptype cap, nl_fptype v, nl_fptype step) noexcept
{
m_h = plib::reciprocal(step);
m_c = cap;
@@ -85,7 +86,7 @@ namespace netlist::analog
// no state used
}
- void setparams(nl_fptype gmin) noexcept { m_gmin = gmin; }
+ void set_params(nl_fptype gmin) noexcept { m_gmin = gmin; }
private:
state_var<nl_fptype> m_h;
@@ -113,7 +114,7 @@ namespace netlist::analog
return - G(cap) * m_v;
}
- void timestep([[maybe_unused]] nl_fptype cap, nl_fptype v, nl_fptype step) noexcept
+ void time_step([[maybe_unused]] nl_fptype cap, nl_fptype v, nl_fptype step) noexcept
{
m_h = plib::reciprocal(step);
m_v = v;
@@ -140,7 +141,7 @@ namespace netlist::analog
}
// Returns { G, Ieq }
- std::pair<nl_fptype, nl_fptype> timestep(nl_fptype cap, nl_fptype v, nl_fptype step) const noexcept
+ std::pair<nl_fptype, nl_fptype> time_step(nl_fptype cap, nl_fptype v, nl_fptype step) const noexcept
{
const nl_fptype h(plib::reciprocal(step));
const nl_fptype G(cap * h + m_gmin);
@@ -150,7 +151,7 @@ namespace netlist::analog
{
// this one has no state
}
- void setparams(nl_fptype gmin) noexcept { m_gmin = gmin; }
+ void set_parameters(nl_fptype gmin) noexcept { m_gmin = gmin; }
private:
nl_fptype m_gmin;
};
@@ -170,7 +171,7 @@ namespace netlist::analog
}
// Returns { G, Ieq }
- std::pair<nl_fptype, nl_fptype> timestep(nl_fptype cap, nl_fptype v, nl_fptype step) noexcept
+ std::pair<nl_fptype, nl_fptype> time_step(nl_fptype cap, nl_fptype v, nl_fptype step) noexcept
{
const nl_fptype h(plib::reciprocal(step));
if (m_trn == 0.0)
@@ -193,7 +194,7 @@ namespace netlist::analog
{
// this one has no state
}
- void setparams(nl_fptype gmin) noexcept { m_gmin = gmin; }
+ void set_parameters(nl_fptype gmin) noexcept { m_gmin = gmin; }
private:
nl_fptype m_gmin;
nl_fptype m_vn;
diff --git a/src/lib/netlist/analog/nld_mosfet.cpp b/src/lib/netlist/analog/nld_mosfet.cpp
index 1e976933224..b8d4454d206 100644
--- a/src/lib/netlist/analog/nld_mosfet.cpp
+++ b/src/lib/netlist/analog/nld_mosfet.cpp
@@ -187,9 +187,9 @@ namespace analog
{
public:
NETLIB_CONSTRUCTOR(MOSFET)
- , m_DG(*this, "m_DG", NETLIB_DELEGATE(termhandler))
- , m_SG(*this, "m_SG", NETLIB_DELEGATE(termhandler))
- , m_SD(*this, "m_SD", NETLIB_DELEGATE(termhandler))
+ , m_DG(*this, "m_DG", NETLIB_DELEGATE(terminal_handler))
+ , m_SG(*this, "m_SG", NETLIB_DELEGATE(terminal_handler))
+ , m_SD(*this, "m_SD", NETLIB_DELEGATE(terminal_handler))
, m_D_BD(*this, "m_D_BD")
#if (!BODY_CONNECTED_TO_SOURCE)
, m_D_BS(*this, "m_D_BS")
@@ -213,10 +213,10 @@ namespace analog
, m_Vgd(*this, "m_Vgd", nlconst::zero())
, m_model_acc(m_model)
{
- register_subalias("S", m_SG.P()); // Source
- register_subalias("G", m_SG.N()); // Gate
+ register_sub_alias("S", m_SG.P()); // Source
+ register_sub_alias("G", m_SG.N()); // Gate
- register_subalias("D", m_DG.P()); // Drain
+ register_sub_alias("D", m_DG.P()); // Drain
connect(m_SG.P(), m_SD.P());
connect(m_SG.N(), m_DG.N());
@@ -302,7 +302,7 @@ namespace analog
{
if (m_capacitor_model != 0)
{
- if (ts_type == timestep_type::FORWARD)
+ if (ts_type == time_step_type::FORWARD)
{
//#const nl_nl_fptype Ugd = -m_DG.deltaV() * m_polarity; // Gate - Drain
//#const nl_nl_fptype Ugs = -m_SG.deltaV() * m_polarity; // Gate - Source
@@ -311,9 +311,9 @@ namespace analog
const nl_fptype Ubs = nlconst::zero(); // Bulk - Source == 0 if connected
const nl_fptype Ugb = Ugs - Ubs;
- m_cap_gb.timestep(m_Cgb, Ugb, step);
- m_cap_gs.timestep(m_Cgs, Ugs, step);
- m_cap_gd.timestep(m_Cgd, Ugd, step);
+ m_cap_gb.time_step(m_Cgb, Ugb, step);
+ m_cap_gs.time_step(m_Cgs, Ugs, step);
+ m_cap_gd.time_step(m_Cgd, Ugd, step);
}
else
{
@@ -337,7 +337,7 @@ namespace analog
#endif
}
- NETLIB_HANDLERI(termhandler)
+ NETLIB_HANDLERI(terminal_handler)
{
// only called if connected to a rail net ==> notify the solver to recalculate
auto *solv(m_SG.solver());
@@ -351,9 +351,9 @@ namespace analog
private:
- nld_twoterm m_DG;
- nld_twoterm m_SG;
- nld_twoterm m_SD;
+ nld_two_terminal m_DG;
+ nld_two_terminal m_SG;
+ nld_two_terminal m_SD;
generic_diode<diode_e::MOS> m_D_BD;
#if (!BODY_CONNECTED_TO_SOURCE)
diff --git a/src/lib/netlist/analog/nld_opamps.cpp b/src/lib/netlist/analog/nld_opamps.cpp
index 2b969942ff0..f68088a6619 100644
--- a/src/lib/netlist/analog/nld_opamps.cpp
+++ b/src/lib/netlist/analog/nld_opamps.cpp
@@ -123,9 +123,9 @@ namespace netlist
if (m_type == 1)
{
- register_subalias("PLUS", "G1.IP");
- register_subalias("MINUS", "G1.IN");
- register_subalias("OUT", "G1.OP");
+ register_sub_alias("PLUS", "G1.IP");
+ register_sub_alias("MINUS", "G1.IN");
+ register_sub_alias("OUT", "G1.OP");
connect("G1.ON", "VREF");
connect("RP1.2", "VREF");
@@ -134,13 +134,13 @@ namespace netlist
}
if (m_type == 2 || m_type == 3)
{
- create_and_register_subdevice(*this, "CP1", m_CP);
- create_and_register_subdevice(*this, "EBUF", m_EBUF);
+ create_and_register_sub_device(*this, "CP1", m_CP);
+ create_and_register_sub_device(*this, "EBUF", m_EBUF);
#if TEST_ALT_OUTPUT
- create_and_register_subdevice("RO", m_RO);
+ create_and_register_sub_device("RO", m_RO);
#endif
- register_subalias("PLUS", "G1.IP");
- register_subalias("MINUS", "G1.IN");
+ register_sub_alias("PLUS", "G1.IP");
+ register_sub_alias("MINUS", "G1.IN");
connect("G1.ON", "VREF");
connect("RP1.2", "VREF");
@@ -157,16 +157,16 @@ namespace netlist
{
#if TEST_ALT_OUTPUT
connect("EBUF.OP", "RO.1");
- register_subalias("OUT", "RO.2");
+ register_sub_alias("OUT", "RO.2");
#else
- register_subalias("OUT", "EBUF.OP");
+ register_sub_alias("OUT", "EBUF.OP");
#endif
}
if (m_type == 3)
{
- create_and_register_subdevice(*this, "DN", m_DN, "D(IS=1e-15 N=1)");
- create_and_register_subdevice(*this, "DP", m_DP, "D(IS=1e-15 N=1)");
+ create_and_register_sub_device(*this, "DN", m_DN, "D(IS=1e-15 N=1)");
+ create_and_register_sub_device(*this, "DP", m_DP, "D(IS=1e-15 N=1)");
connect("DP.K", "VH");
connect("VL", "DN.A");
@@ -174,9 +174,9 @@ namespace netlist
connect("DN.K", "RP1.1");
#if TEST_ALT_OUTPUT
connect("EBUF.OP", "RO.1");
- register_subalias("OUT", "RO.2");
+ register_sub_alias("OUT", "RO.2");
#else
- register_subalias("OUT", "EBUF.OP");
+ register_sub_alias("OUT", "EBUF.OP");
#endif
}
diff --git a/src/lib/netlist/analog/nld_switches.cpp b/src/lib/netlist/analog/nld_switches.cpp
index e202a829d66..169d6465969 100644
--- a/src/lib/netlist/analog/nld_switches.cpp
+++ b/src/lib/netlist/analog/nld_switches.cpp
@@ -25,8 +25,8 @@ namespace netlist
, m_R(*this, "R")
, m_POS(*this, "POS", false)
{
- register_subalias("1", m_R.P());
- register_subalias("2", m_R.N());
+ register_sub_alias("1", m_R.P());
+ register_sub_alias("2", m_R.N());
}
NETLIB_RESETI()
@@ -59,10 +59,10 @@ namespace netlist
{
connect(m_R1.N(), m_R2.N());
- register_subalias("1", m_R1.P());
- register_subalias("2", m_R2.P());
+ register_sub_alias("1", m_R1.P());
+ register_sub_alias("2", m_R2.P());
- register_subalias("Q", m_R1.N());
+ register_sub_alias("Q", m_R1.N());
}
NETLIB_RESETI();
diff --git a/src/lib/netlist/analog/nlid_fourterm.cpp b/src/lib/netlist/analog/nlid_fourterm.cpp
index 0f5be50ae20..9e1f185e79c 100644
--- a/src/lib/netlist/analog/nlid_fourterm.cpp
+++ b/src/lib/netlist/analog/nlid_fourterm.cpp
@@ -30,10 +30,11 @@ NETLIB_RESET(VCCS)
m_ON1.set_go_gt(-m_mult, nlconst::zero());
}
-NETLIB_HANDLER(VCCS, termhandler)
+NETLIB_HANDLER(VCCS, terminal_handler)
{
solver::matrix_solver_t *solv = nullptr;
// only called if connected to a rail net ==> notify the solver to recalculate
+ // NOLINTNEXTLINE(bugprone-branch-clone)
if ((solv = m_IP.solver()) != nullptr)
solv->solve_now();
else if ((solv = m_IN.solver()) != nullptr)
diff --git a/src/lib/netlist/analog/nlid_fourterm.h b/src/lib/netlist/analog/nlid_fourterm.h
index 6ba168505c5..9f71964c6d1 100644
--- a/src/lib/netlist/analog/nlid_fourterm.h
+++ b/src/lib/netlist/analog/nlid_fourterm.h
@@ -38,14 +38,14 @@ namespace netlist::analog {
NETLIB_CONSTRUCTOR_EX(VCCS, nl_fptype ri = nlconst::magic(1e9))
, m_G(*this, "G", nlconst::one())
, m_RI(*this, "RI", ri)
- , m_OP(*this, "OP", &m_IP, {&m_ON, &m_IN}, NETLIB_DELEGATE(termhandler))
- , m_ON(*this, "ON", &m_IP, {&m_OP, &m_IN}, NETLIB_DELEGATE(termhandler))
- , m_IP(*this, "IP", &m_IN, {&m_OP, &m_ON}, NETLIB_DELEGATE(termhandler))
- , m_IN(*this, "IN", &m_IP, {&m_OP, &m_ON}, NETLIB_DELEGATE(termhandler))
- , m_OP1(*this, "_OP1", &m_IN, NETLIB_DELEGATE(termhandler))
- , m_ON1(*this, "_ON1", &m_IN, NETLIB_DELEGATE(termhandler))
- //, m_IPx(*this, "_IPx", &m_OP, NETLIB_DELEGATE(termhandler)) // <= this should be NULL and terminal be filtered out prior to solving...
- //, m_INx(*this, "_INx", &m_ON, NETLIB_DELEGATE(termhandler)) // <= this should be NULL and terminal be filtered out prior to solving...
+ , m_OP(*this, "OP", &m_IP, {&m_ON, &m_IN}, NETLIB_DELEGATE(terminal_handler))
+ , m_ON(*this, "ON", &m_IP, {&m_OP, &m_IN}, NETLIB_DELEGATE(terminal_handler))
+ , m_IP(*this, "IP", &m_IN, {&m_OP, &m_ON}, NETLIB_DELEGATE(terminal_handler))
+ , m_IN(*this, "IN", &m_IP, {&m_OP, &m_ON}, NETLIB_DELEGATE(terminal_handler))
+ , m_OP1(*this, "_OP1", &m_IN, NETLIB_DELEGATE(terminal_handler))
+ , m_ON1(*this, "_ON1", &m_IN, NETLIB_DELEGATE(terminal_handler))
+ //, m_IPx(*this, "_IPx", &m_OP, NETLIB_DELEGATE(terminal_handler)) // <= this should be NULL and terminal be filtered out prior to solving...
+ //, m_INx(*this, "_INx", &m_ON, NETLIB_DELEGATE(terminal_handler)) // <= this should be NULL and terminal be filtered out prior to solving...
, m_gfac(nlconst::one())
{
connect(m_OP, m_OP1);
@@ -60,7 +60,7 @@ namespace netlist::analog {
param_fp_t m_RI;
protected:
- NETLIB_HANDLERI(termhandler);
+ NETLIB_HANDLERI(terminal_handler);
NETLIB_UPDATE_PARAMI()
{
NETLIB_NAME(VCCS)::reset();
@@ -187,8 +187,8 @@ namespace netlist::analog {
public:
NETLIB_CONSTRUCTOR(VCVS)
, m_RO(*this, "RO", nlconst::one())
- , m_OP2(*this, "_OP2", &m_ON2, NETLIB_DELEGATE(termhandler))
- , m_ON2(*this, "_ON2", &m_OP2, NETLIB_DELEGATE(termhandler))
+ , m_OP2(*this, "_OP2", &m_ON2, NETLIB_DELEGATE(terminal_handler))
+ , m_ON2(*this, "_ON2", &m_OP2, NETLIB_DELEGATE(terminal_handler))
{
connect(m_OP2, m_OP1);
connect(m_ON2, m_ON1);
@@ -200,9 +200,9 @@ namespace netlist::analog {
private:
//NETLIB_UPDATE_PARAMI();
- NETLIB_HANDLERI(termhandler)
+ NETLIB_HANDLERI(terminal_handler)
{
- NETLIB_NAME(VCCS) :: termhandler();
+ NETLIB_NAME(VCCS) :: terminal_handler();
}
terminal_t m_OP2;
@@ -242,8 +242,8 @@ namespace netlist::analog {
public:
NETLIB_CONSTRUCTOR_PASS(CCVS, nlconst::one())
, m_RO(*this, "RO", nlconst::one())
- , m_OP2(*this, "_OP2", &m_ON2, NETLIB_DELEGATE(termhandler))
- , m_ON2(*this, "_ON2", &m_OP2, NETLIB_DELEGATE(termhandler))
+ , m_OP2(*this, "_OP2", &m_ON2, NETLIB_DELEGATE(terminal_handler))
+ , m_ON2(*this, "_ON2", &m_OP2, NETLIB_DELEGATE(terminal_handler))
{
connect(m_OP2, m_OP1);
connect(m_ON2, m_ON1);
@@ -256,9 +256,9 @@ namespace netlist::analog {
private:
//NETLIB_UPDATE_PARAMI();
- NETLIB_HANDLERI(termhandler)
+ NETLIB_HANDLERI(terminal_handler)
{
- NETLIB_NAME(VCCS) :: termhandler();
+ NETLIB_NAME(VCCS) :: terminal_handler();
}
terminal_t m_OP2;
diff --git a/src/lib/netlist/analog/nlid_twoterm.cpp b/src/lib/netlist/analog/nlid_twoterm.cpp
index 3ba956ae0b2..4bb7ab64059 100644
--- a/src/lib/netlist/analog/nlid_twoterm.cpp
+++ b/src/lib/netlist/analog/nlid_twoterm.cpp
@@ -15,7 +15,7 @@ namespace analog
// nld_twoterm
// ----------------------------------------------------------------------------------------
- solver::matrix_solver_t * NETLIB_NAME(twoterm)::solver() const noexcept
+ solver::matrix_solver_t * NETLIB_NAME(two_terminal)::solver() const noexcept
{
auto *solv(m_P.solver());
if (solv != nullptr)
@@ -24,14 +24,14 @@ namespace analog
}
- void NETLIB_NAME(twoterm)::solve_now() const
+ void NETLIB_NAME(two_terminal)::solve_now() const
{
auto *solv(solver());
if (solv != nullptr)
solv->solve_now();
}
- NETLIB_HANDLER(twoterm, termhandler)
+ NETLIB_HANDLER(two_terminal, terminal_handler)
{
// only called if connected to a rail net ==> notify the solver to recalculate
//printf("%s update\n", this->name().c_str());
@@ -122,7 +122,7 @@ namespace analog
NETLIB_TIMESTEP(L)
{
- if (ts_type == timestep_type::FORWARD)
+ if (ts_type == time_step_type::FORWARD)
{
m_last_I = m_I;
m_last_G = m_G;
diff --git a/src/lib/netlist/analog/nlid_twoterm.h b/src/lib/netlist/analog/nlid_twoterm.h
index 0aa437b227c..52fc8aa08e8 100644
--- a/src/lib/netlist/analog/nlid_twoterm.h
+++ b/src/lib/netlist/analog/nlid_twoterm.h
@@ -48,7 +48,7 @@ namespace netlist::analog
{
// -----------------------------------------------------------------------------
- // nld_twoterm
+ // nld_two_terminal
// -----------------------------------------------------------------------------
template <class C>
@@ -65,16 +65,16 @@ namespace netlist::analog
return d2;
}
- NETLIB_BASE_OBJECT(twoterm)
+ NETLIB_BASE_OBJECT(two_terminal)
{
- NETLIB_CONSTRUCTOR(twoterm)
- , m_P(*this, "1", &m_N, NETLIB_DELEGATE(termhandler))
- , m_N(*this, "2", &m_P, NETLIB_DELEGATE(termhandler))
+ NETLIB_CONSTRUCTOR(two_terminal)
+ , m_P(*this, "1", &m_N, NETLIB_DELEGATE(terminal_handler))
+ , m_N(*this, "2", &m_P, NETLIB_DELEGATE(terminal_handler))
{
}
//#NETLIB_CONSTRUCTOR_EX(twoterm, nldelegate owner_delegate)
template <class C>
- NETLIB_NAME(twoterm)(C &owner, const pstring &name, nldelegate owner_delegate) \
+ NETLIB_NAME(two_terminal)(C &owner, const pstring &name, nl_delegate owner_delegate) \
: base_type(owner, name)
, m_P(owner, name + ".1", &m_N, owner_delegate)
, m_N(owner, name + ".2", &m_P, owner_delegate)
@@ -86,7 +86,7 @@ namespace netlist::analog
public:
- NETLIB_HANDLERI(termhandler);
+ NETLIB_HANDLERI(terminal_handler);
solver::matrix_solver_t *solver() const noexcept;
@@ -181,7 +181,7 @@ namespace netlist::analog
// nld_R
// -----------------------------------------------------------------------------
- NETLIB_OBJECT_DERIVED(R_base, twoterm)
+ NETLIB_OBJECT_DERIVED(R_base, two_terminal)
{
NETLIB_CONSTRUCTOR(R_base)
{
@@ -252,9 +252,9 @@ namespace netlist::analog
, m_DialIsLog(*this, "DIALLOG", false)
, m_Reverse(*this, "REVERSE", false)
{
- register_subalias("1", m_R1.P());
- register_subalias("2", m_R1.N());
- register_subalias("3", m_R2.N());
+ register_sub_alias("1", m_R1.P());
+ register_sub_alias("2", m_R1.N());
+ register_sub_alias("3", m_R2.N());
connect(m_R2.P(), m_R1.N());
@@ -283,8 +283,8 @@ namespace netlist::analog
, m_DialIsLog(*this, "DIALLOG", false)
, m_Reverse(*this, "REVERSE", false)
{
- register_subalias("1", m_R1.P());
- register_subalias("2", m_R1.N());
+ register_sub_alias("1", m_R1.P());
+ register_sub_alias("2", m_R1.N());
}
@@ -305,7 +305,7 @@ namespace netlist::analog
// nld_C
// -----------------------------------------------------------------------------
#if 1
- NETLIB_OBJECT_DERIVED(C, twoterm)
+ NETLIB_OBJECT_DERIVED(C, two_terminal)
{
public:
NETLIB_CONSTRUCTOR(C)
@@ -317,10 +317,10 @@ namespace netlist::analog
NETLIB_IS_TIMESTEP(true)
NETLIB_TIMESTEPI()
{
- if (ts_type == timestep_type::FORWARD)
+ if (ts_type == time_step_type::FORWARD)
{
// G, Ieq
- const auto res(m_cap.timestep(m_C(), deltaV(), step));
+ const auto res(m_cap.time_step(m_C(), deltaV(), step));
const nl_fptype G = res.first;
const nl_fptype I = res.second;
set_mat( G, -G, -I,
@@ -332,7 +332,7 @@ namespace netlist::analog
NETLIB_RESETI()
{
- m_cap.setparams(exec().gmin());
+ m_cap.set_parameters(exec().gmin());
}
/// \brief Set capacitance
@@ -360,10 +360,10 @@ namespace netlist::analog
#else
// Code preserved as a basis for a current/voltage controlled capacitor
- NETLIB_OBJECT_DERIVED(C, twoterm)
+ NETLIB_OBJECT_DERIVED(C, two_terminal)
{
public:
- NETLIB_CONSTRUCTOR_DERIVED(C, twoterm)
+ NETLIB_CONSTRUCTOR_DERIVED(C, two_terminal)
, m_C(*this, "C", nlconst::magic(1e-6))
, m_cap(*this, "m_cap")
{
@@ -372,7 +372,7 @@ namespace netlist::analog
NETLIB_IS_TIMESTEP(true)
NETLIB_TIMESTEPI()
{
- m_cap.timestep(m_C(), deltaV(), step);
+ m_cap.time_step(m_C(), deltaV(), step);
if (m_cap.type() == capacitor_e::CONSTANT_CAPACITY)
{
const nl_fptype I = m_cap.Ieq(m_C(), deltaV());
@@ -394,7 +394,7 @@ namespace netlist::analog
param_fp_t m_C;
NETLIB_RESETI()
{
- m_cap.setparams(exec().gmin());
+ m_cap.set_parameters(exec().gmin());
}
protected:
@@ -411,7 +411,7 @@ namespace netlist::analog
// nld_L
// -----------------------------------------------------------------------------
- NETLIB_OBJECT_DERIVED(L, twoterm)
+ NETLIB_OBJECT_DERIVED(L, two_terminal)
{
public:
NETLIB_CONSTRUCTOR(L)
@@ -503,7 +503,7 @@ namespace netlist::analog
// nld_D
// -----------------------------------------------------------------------------
- NETLIB_OBJECT_DERIVED(D, twoterm)
+ NETLIB_OBJECT_DERIVED(D, two_terminal)
{
public:
NETLIB_CONSTRUCTOR_EX(D, const pstring &model = "D")
@@ -511,8 +511,8 @@ namespace netlist::analog
, m_modacc(m_model)
, m_D(*this, "m_D")
{
- register_subalias("A", P());
- register_subalias("K", N());
+ register_sub_alias("A", P());
+ register_sub_alias("K", N());
}
NETLIB_IS_DYNAMIC(true)
@@ -533,7 +533,7 @@ namespace netlist::analog
// nld_Z - Zener Diode
// -----------------------------------------------------------------------------
- NETLIB_OBJECT_DERIVED(Z, twoterm)
+ NETLIB_OBJECT_DERIVED(Z, two_terminal)
{
public:
NETLIB_CONSTRUCTOR_EX(Z, const pstring &model = "D")
@@ -542,8 +542,8 @@ namespace netlist::analog
, m_D(*this, "m_D")
, m_R(*this, "m_R")
{
- register_subalias("A", P());
- register_subalias("K", N());
+ register_sub_alias("A", P());
+ register_sub_alias("K", N());
}
NETLIB_IS_DYNAMIC(true)
@@ -568,7 +568,7 @@ namespace netlist::analog
// netlist voltage source must have inner resistance
// -----------------------------------------------------------------------------
- NETLIB_OBJECT_DERIVED(VS, twoterm)
+ NETLIB_OBJECT_DERIVED(VS, two_terminal)
{
public:
NETLIB_CONSTRUCTOR(VS)
@@ -579,8 +579,8 @@ namespace netlist::analog
, m_compiled(*this, "m_compiled")
, m_funcparam({nlconst::zero()})
{
- register_subalias("P", P());
- register_subalias("N", N());
+ register_sub_alias("P", P());
+ register_sub_alias("N", N());
if (!m_func().empty())
m_compiled->compile(m_func(), std::vector<pstring>({{pstring("T")}}));
}
@@ -589,7 +589,7 @@ namespace netlist::analog
NETLIB_TIMESTEPI()
{
- if (ts_type == timestep_type::FORWARD)
+ if (ts_type == time_step_type::FORWARD)
{
m_t += step;
m_funcparam[0] = m_t;
@@ -605,7 +605,7 @@ namespace netlist::analog
NETLIB_RESETI()
{
- NETLIB_NAME(twoterm)::reset();
+ NETLIB_NAME(two_terminal)::reset();
this->set_G_V_I(plib::reciprocal(m_R()), m_V(), nlconst::zero());
}
@@ -622,7 +622,7 @@ namespace netlist::analog
// nld_CS - Current source
// -----------------------------------------------------------------------------
- NETLIB_OBJECT_DERIVED(CS, twoterm)
+ NETLIB_OBJECT_DERIVED(CS, two_terminal)
{
public:
NETLIB_CONSTRUCTOR(CS)
@@ -632,8 +632,8 @@ namespace netlist::analog
, m_compiled(*this, "m_compiled")
, m_funcparam({nlconst::zero()})
{
- register_subalias("P", "1");
- register_subalias("N", "2");
+ register_sub_alias("P", "1");
+ register_sub_alias("N", "2");
if (!m_func().empty())
m_compiled->compile(m_func(), std::vector<pstring>({{pstring("T")}}));
}
@@ -641,7 +641,7 @@ namespace netlist::analog
NETLIB_IS_TIMESTEP(!m_func().empty())
NETLIB_TIMESTEPI()
{
- if (ts_type == timestep_type::FORWARD)
+ if (ts_type == time_step_type::FORWARD)
{
m_t += step;
m_funcparam[0] = m_t;
@@ -658,7 +658,7 @@ namespace netlist::analog
NETLIB_RESETI()
{
- NETLIB_NAME(twoterm)::reset();
+ NETLIB_NAME(two_terminal)::reset();
const auto zero(nlconst::zero());
set_mat(zero, zero, -m_I(),
zero, zero, m_I());
diff --git a/src/lib/netlist/build/create_devinc.py b/src/lib/netlist/build/create_devinc.py
index 4d37b5fd393..660759e18d1 100644
--- a/src/lib/netlist/build/create_devinc.py
+++ b/src/lib/netlist/build/create_devinc.py
@@ -87,15 +87,33 @@ def process_file(srcfile):
src.close()
+def file_header():
+ print("// license:BSD-3-Clause")
+ print("// copyright-holders:Couriersud")
+ print("")
+ print("#ifndef NLD_DEVINC_H")
+ print("#define NLD_DEVINC_H")
+ print("")
+ print("#ifndef __PLIB_PREPROCESSOR__\n")
+ print("")
+ print("#include \"../nl_setup.h\"")
+ print("")
+
+def file_footer():
+ print("#endif // __PLIB_PREPROCESSOR__\n")
+ print("#endif // NLD_DEVINC_H\n")
+
if __name__ == '__main__':
if (len(sys.argv) == 0):
print('Usage:')
print(' create_devinc files ...')
sys.exit(0)
- files_sorted = [];
+ files_sorted = []
for argno in range(1, len(sys.argv)):
files_sorted.append(sys.argv[argno])
- files_sorted.sort();
+ files_sorted.sort()
+ file_header()
for entry in files_sorted:
process_file(entry)
+ file_footer()
diff --git a/src/lib/netlist/build/cspell.json b/src/lib/netlist/build/cspell.json
index f7297bd3f04..43e72035b64 100644
--- a/src/lib/netlist/build/cspell.json
+++ b/src/lib/netlist/build/cspell.json
@@ -32,6 +32,7 @@
"opamp",
"opamps",
"pmos",
+ "picosecond",
// Specific project terms
"MAME",
"Couriersud",
@@ -40,8 +41,52 @@
"nltool",
"nlwav",
"nvcc",
+ "lfsr",
+ "gmres",
// FIXME: Remove everything below here again
- "pstring"
+ // Excluded for now ... Still over 1000 in the log
+ "plib", // namespace
+ "pstring",
+ "passert",
+ "putf",
+ "tokstor",
+ "psplit",
+ "gmin",
+ "lastx",
+ "idrn",
+ "preprocessor",
+ "ppreprocessor",
+ "modacc",
+ "Ainv",
+ "anetlist",
+ "netdev",
+ "solv",
+ "sexpr",
+ "pstonum",
+ "pmfp",
+ "pmatrix",
+ "pfmt",
+ "nlname",
+ "nlparse",
+ "nlstate",
+ "nlconst",
+ "nlsetup",
+ "pfmp",
+ "resched",
+ "tokenizer",
+ "ptokenizer",
+ "pexception",
+ "devs",
+ "gonn",
+ "nzbd",
+ "nthcode",
+ "Vcrit",
+ "perrmsg",
+ "pfunction",
+ "tname",
+ "stname",
+ "parray",
+ "nzrd"
],
"languageSettings": [
// This one works with Python
@@ -74,19 +119,20 @@
"ignoreRegExpList": [
"/#include.*/", // Exclude includes, because they are also strings
"/#pragma.*/", // Exclude pragmas, they may include strings
- "/\/\/ NOLINT:.*/", // Exclude clang-tidy instructions
+ "/\/\/ NOLINT\\(.*/", // Exclude clang-tidy instructions
"/\/\/\/ \\\\file.*/", // Doxygen
"/\/\/\/ \\\\addtogroup.*/", // Doxygen
"/`[^`]+`/", // Markup code formatt
"/} \/\/ namespace.*/", // Namespace comments
- "/[A-Z][A-Z][A-Z][^\\s]*/", // Identifiers starting with at least 3 capital letters
// Project specific exclusions start here
"/\/\/ copyright-holders.*/",
"/\/\/- Pinalias:/",
"/\/\/#.*/", // commented source code
"\/\/ Source:.*/", // generated code
"/\\$[A-z0-9][^\\s]*/", // everything starting with a $
- "/[A-z][^\\s]+::[^\\s]+/" // any namespace qualifier
+ // The following should be removed again
+ "/[A-z][^\\s]+::[^\\s]+/", // any namespace qualifier
+ "/[A-Z][A-Z][A-Z][^\\s]*/" // Identifiers starting with at least 3 capital letters
]
}
]
diff --git a/src/lib/netlist/build/html/nltool.html b/src/lib/netlist/build/html/nltool.html
new file mode 100644
index 00000000000..10cf6949e3f
--- /dev/null
+++ b/src/lib/netlist/build/html/nltool.html
@@ -0,0 +1,366 @@
+<!-- Creator : groff version 1.22.3 -->
+<!-- CreationDate: Sat May 14 18:10:42 2022 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; vertical-align: top }
+ pre { margin-top: 0; margin-bottom: 0; vertical-align: top }
+ table { margin-top: 0; margin-bottom: 0; vertical-align: top }
+ h1 { text-align: center }
+</style>
+<title>NLTOOL</title>
+
+</head>
+<body>
+
+<h1 align="center">NLTOOL</h1>
+
+<a href="#NAME">NAME</a><br>
+<a href="#SYNOPSIS">SYNOPSIS</a><br>
+<a href="#DESCRIPTION">DESCRIPTION</a><br>
+<a href="#OPTIONS">OPTIONS</a><br>
+<a href="#EXAMPLES">EXAMPLES</a><br>
+<a href="#AUTHOR">AUTHOR</a><br>
+<a href="#COPYRIGHT">COPYRIGHT</a><br>
+<a href="#SEE ALSO">SEE ALSO</a><br>
+
+<hr>
+
+
+<h2>NAME
+<a name="NAME"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">nltool &minus;
+manual page for nltool (netlist) 0.14</p>
+
+<h2>SYNOPSIS
+<a name="SYNOPSIS"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em"><b>nltool</b>
+[<i>option</i>]... [<i>files</i>]...</p>
+
+<h2>DESCRIPTION
+<a name="DESCRIPTION"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">nltool serves
+as the Swiss Army knife to run, test and convert
+netlists.</p>
+
+<p style="margin-left:11%; margin-top: 1em">Commands may
+accept one or more files depending on the functionality. If
+no file is provided, standard input is used.</p>
+
+<h2>OPTIONS
+<a name="OPTIONS"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em"><b>General
+options:</b></p>
+
+<p style="margin-left:22%;">The following options apply to
+all commands.</p>
+
+<table width="100%" border="0" rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="89%">
+
+
+<p style="margin-top: 1em"><b>&minus;c</b>,
+<b>&minus;&minus;cmd</b>=<i>run</i>|validate|convert|listdevices|listmodels|static|header|docheader|tests</p> </td></tr>
+</table>
+
+
+<p style="margin-left:22%; margin-top: 1em">run|validate|convert|listdevices|listmodels|static|header|docheader|tests</p>
+
+<p><b>&minus;I</b>,
+<b>&minus;&minus;include</b>=<i>Value</i></p> </table>
+
+<p style="margin-left:22%;">Add the directory to the list
+of directories to be searched for header files. This option
+may be specified repeatedly.</p>
+
+<p style="margin-left:11%;"><b>&minus;D</b>,
+<b>&minus;&minus;define</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">predefine value as macro, e.g.
+<b>&minus;Dname</b>=<i>value</i>. If &rsquo;=value&rsquo; is
+omitted predefine it as 1. This option may be specified
+repeatedly.</p>
+
+<p style="margin-left:11%;"><b>&minus;r</b>,
+<b>&minus;&minus;rom</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">where to look for data
+files</p>
+
+<p style="margin-left:11%;"><b>&minus;v</b>,
+<b>&minus;&minus;verbose</b></p>
+
+<p style="margin-left:22%;">be verbose &minus; this
+produces lots of output</p>
+
+<p style="margin-left:11%;"><b>&minus;q</b>,
+<b>&minus;&minus;quiet</b></p>
+
+<p style="margin-left:22%;">be quiet &minus; no
+warnings</p>
+
+
+<p style="margin-left:11%;"><b>&minus;&minus;prepro</b></p>
+
+<p style="margin-left:22%;">output preprocessor output to
+stderr</p>
+
+
+<p style="margin-left:11%;"><b>&minus;&minus;progress</b></p>
+
+<p style="margin-left:22%;">show progress bar on longer
+operations</p>
+
+
+<p style="margin-left:11%;"><b>&minus;&minus;version</b></p>
+
+<p style="margin-left:22%;">display version and exit</p>
+
+<p style="margin-left:11%;"><b>&minus;h</b>,
+<b>&minus;&minus;help</b></p>
+
+<p style="margin-left:22%;">display help and exit</p>
+
+<p style="margin-left:11%; margin-top: 1em"><b>Options for
+run and static commands:</b></p>
+
+<p style="margin-left:22%;">These options apply to run and
+static commands.</p>
+
+<p style="margin-left:11%;"><b>&minus;n</b>,
+<b>&minus;&minus;name</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">the netlist in file specified
+by <b>&minus;f</b> option to run; default is first one</p>
+
+<p style="margin-left:11%; margin-top: 1em"><b>Options for
+static command:</b></p>
+
+<p style="margin-left:22%;">These options apply to static
+command.</p>
+
+<p style="margin-left:11%;"><b>&minus;d</b>,
+<b>&minus;&minus;dir</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">output directory for the
+generated files.</p>
+
+<p style="margin-left:11%;"><b>&minus;o</b>,
+<b>&minus;&minus;output</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">single output file for the
+generated code. Either <b>&minus;&minus;dir</b> or
+<b>&minus;&minus;output</b> can be specificied</p>
+
+
+<p style="margin-left:11%;"><b>&minus;&minus;static_include</b></p>
+
+<p style="margin-left:22%;">write static solvers to
+individual files included by file specified with
+<b>&minus;&minus;output</b>. <b>&minus;&minus;dir</b> must
+be path to &quot;generated/static&quot; path in netlist
+folder.</p>
+
+<p style="margin-left:11%; margin-top: 1em"><b>Options for
+run command:</b></p>
+
+<p style="margin-left:22%;">These options are only used by
+the run command.</p>
+
+<p style="margin-left:11%;"><b>&minus;t</b>,
+<b>&minus;&minus;time_to_run</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">time to run the emulation
+(seconds)</p>
+
+
+<p style="margin-left:11%;"><b>&minus;&minus;boost_lib</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">generic: will use generic
+solvers. builtin: Use optimized solvers compiled in.
+somelib.so: Use library with precompiled solvers.</p>
+
+<p style="margin-left:11%;"><b>&minus;s</b>,
+<b>&minus;&minus;statistics</b></p>
+
+<p style="margin-left:22%;">gather runtime statistics</p>
+
+<p style="margin-left:11%;"><b>&minus;l</b>,
+<b>&minus;&minus;log</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">define terminal to log. This
+option may be specified repeatedly.</p>
+
+<p style="margin-left:11%;"><b>&minus;i</b>,
+<b>&minus;&minus;input</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">input file to process (default
+is none)</p>
+
+
+<p style="margin-left:11%;"><b>&minus;&minus;loadstate</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">load state from file and
+continue from there</p>
+
+
+<p style="margin-left:11%;"><b>&minus;&minus;savestate</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">save state to file at end of
+run</p>
+
+<p style="margin-left:11%;"><b>&minus;&minus;fperr</b></p>
+
+<p style="margin-left:22%;">raise exception on floating
+point errors. This is intended to be used during
+debugging.</p>
+
+<p style="margin-left:11%; margin-top: 1em"><b>Options for
+convert command:</b></p>
+
+<p style="margin-left:22%;">These options are only used by
+the convert command.</p>
+
+<p style="margin-left:11%;"><b>&minus;y</b>,
+<b>&minus;&minus;type</b>=<i>spice</i>|eagle|rinf</p>
+
+<p style="margin-left:22%;">type of file to be converted:
+spice,eagle,rinf</p>
+
+<p style="margin-left:11%; margin-top: 1em"><b>Options for
+validate command:</b></p>
+
+<p style="margin-left:22%;">These options are only used by
+the validate command.</p>
+
+<p style="margin-left:11%; margin-top: 1em"><b>Options for
+header command:</b></p>
+
+<p style="margin-left:22%;">These options are only used by
+the header command.</p>
+
+
+<p style="margin-left:11%;"><b>&minus;&minus;tab&minus;width</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">Tab width for output.</p>
+
+
+<p style="margin-left:11%;"><b>&minus;&minus;line&minus;width</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">Line width for output.</p>
+
+
+<p style="margin-left:11%;"><b>&minus;&minus;pattern</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">Pattern to match against device
+names. If the device name contains pattern, the device will
+be included in the output. Multiple patterns can be
+specified, if none is given, all devices will be output.</p>
+
+<h2>EXAMPLES
+<a name="EXAMPLES"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">nltool &minus;c
+run &minus;t 3.5 &minus;n cap_delay nl_examples/cdelay.c</p>
+
+<p style="margin-left:22%; margin-top: 1em">Run netlist
+&quot;cap_delay&quot; from file nl_examples/cdelay.c for 3.5
+seconds</p>
+
+<p style="margin-left:11%; margin-top: 1em">nltool
+&minus;&minus;cmd=listdevices</p>
+
+<p style="margin-left:22%; margin-top: 1em">List all known
+devices.</p>
+
+<p style="margin-left:11%; margin-top: 1em">nltool
+&minus;&minus;cmd=header &minus;&minus;tab&minus;width=8
+&minus;&minus;line&minus;width=80</p>
+
+<p style="margin-left:22%; margin-top: 1em">Create the
+header file needed for including netlists as code.</p>
+
+<p style="margin-left:11%; margin-top: 1em">nltool
+&minus;&minus;cmd static &minus;&minus;output</p>
+
+
+<p style="margin-left:22%; margin-top: 1em">src/lib/netlist/generated/static_solvers.cpp
+src/mame/audio/nl_*.cpp src/mame/machine/nl_*.cpp</p>
+
+<p style="margin-left:22%; margin-top: 1em">Create static
+solvers for the MAME project using one single source
+file.</p>
+
+<p style="margin-left:11%; margin-top: 1em">nltool
+&minus;&minus;cmd static &minus;&minus;output</p>
+
+
+<p style="margin-left:22%; margin-top: 1em">src/lib/netlist/generated/static_solvers.cpp
+&minus;&minus;dir src/lib/netlist/generated/static
+&minus;&minus;static_include src/mame/audio/nl_*.cpp
+src/mame/machine/nl_*.cpp</p>
+
+<p style="margin-left:22%; margin-top: 1em">Create static
+solvers for the MAME project using a single source file
+which includes generated solvers written to
+&minus;&minus;dir folder.</p>
+
+<p style="margin-left:11%; margin-top: 1em">nltool
+&minus;&minus;cmd tests</p>
+
+<p style="margin-left:22%; margin-top: 1em">Run unit tests.
+In case the unit tests are not linked in, this will do
+nothing.</p>
+
+<h2>AUTHOR
+<a name="AUTHOR"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">Written by
+Couriersud.</p>
+
+<h2>COPYRIGHT
+<a name="COPYRIGHT"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">Copyright
+&copy; 2021 Couriersud License BSD&minus;3&minus;Clause <br>
+This is free software: you are free to change and
+redistribute it. There is NO WARRANTY, to the extent
+permitted by law.</p>
+
+<h2>SEE ALSO
+<a name="SEE ALSO"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">More
+documentation for the <b>nltool</b> program is available in
+doxygen format.</p>
+<hr>
+</body>
+</html>
diff --git a/src/lib/netlist/build/html/nlwav.html b/src/lib/netlist/build/html/nlwav.html
new file mode 100644
index 00000000000..d1e14b1528d
--- /dev/null
+++ b/src/lib/netlist/build/html/nlwav.html
@@ -0,0 +1,285 @@
+<!-- Creator : groff version 1.22.3 -->
+<!-- CreationDate: Sat May 14 18:10:42 2022 -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta name="generator" content="groff -Thtml, see www.gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<meta name="Content-Style" content="text/css">
+<style type="text/css">
+ p { margin-top: 0; margin-bottom: 0; vertical-align: top }
+ pre { margin-top: 0; margin-bottom: 0; vertical-align: top }
+ table { margin-top: 0; margin-bottom: 0; vertical-align: top }
+ h1 { text-align: center }
+</style>
+<title>NLWAV</title>
+
+</head>
+<body>
+
+<h1 align="center">NLWAV</h1>
+
+<a href="#NAME">NAME</a><br>
+<a href="#SYNOPSIS">SYNOPSIS</a><br>
+<a href="#DESCRIPTION">DESCRIPTION</a><br>
+<a href="#OPTIONS">OPTIONS</a><br>
+<a href="#EXAMPLES">EXAMPLES</a><br>
+<a href="#AUTHOR">AUTHOR</a><br>
+<a href="#COPYRIGHT">COPYRIGHT</a><br>
+<a href="#SEE ALSO">SEE ALSO</a><br>
+
+<hr>
+
+
+<h2>NAME
+<a name="NAME"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">nlwav &minus;
+manual page for nlwav (netlist) 0.1</p>
+
+<h2>SYNOPSIS
+<a name="SYNOPSIS"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em"><b>nlwav</b>
+[<i>OPTION</i>] ... [<i>FILE</i>] ...</p>
+
+<h2>DESCRIPTION
+<a name="DESCRIPTION"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">Convert netlist
+log files into wav files.</p>
+
+<h2>OPTIONS
+<a name="OPTIONS"></a>
+</h2>
+
+
+
+<p style="margin-left:11%; margin-top: 1em"><b>&minus;f</b>,
+<b>&minus;&minus;format</b>=<i>wav16s</i>|wav32s|wav32f|vcda|vcdd|tab</p>
+
+<p style="margin-left:22%;">output format. Available
+options are wav16s|wav32s|wav32f|vcda|vcdd|tab.</p>
+
+<table width="100%" border="0" rules="none" frame="void"
+ cellspacing="0" cellpadding="0">
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="9%">
+
+
+<p>wav16s</p></td>
+<td width="2%"></td>
+<td width="60%">
+
+
+<p>: multichannel wav output 16 bit signed</p></td>
+<td width="18%">
+</td></tr>
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="9%">
+
+
+<p>wav32s</p></td>
+<td width="2%"></td>
+<td width="60%">
+
+
+<p>: multichannel wav output 32 bit signed</p></td>
+<td width="18%">
+</td></tr>
+<tr valign="top" align="left">
+<td width="11%"></td>
+<td width="9%">
+
+
+<p>wav32f</p></td>
+<td width="2%"></td>
+<td width="60%">
+
+
+<p>: multichannel wav output 32 bit float</p></td>
+<td width="18%">
+</td></tr>
+</table>
+
+<p style="margin-left:11%;">vcda : analog VCD output</p>
+
+<p style="margin-left:22%;">vcdd : digital VCD output tab :
+sampled output Digital signals are created using the
+<b>&minus;&minus;high</b> and</p>
+
+
+<p style="margin-left:22%; margin-top: 1em"><b>&minus;&minus;low</b>
+options</p>
+
+<p style="margin-left:11%;"><b>&minus;o</b>,
+<b>&minus;&minus;output</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">output file</p>
+
+<p style="margin-left:11%; margin-top: 1em"><b>wav
+options:</b></p>
+
+<p style="margin-left:22%;">These options apply to wav
+output only</p>
+
+<p style="margin-left:11%;"><b>&minus;r</b>,
+<b>&minus;&minus;rate</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">sample rate of output file</p>
+
+<p style="margin-left:11%;"><b>&minus;a</b>,
+<b>&minus;&minus;amp</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">amplification after mean
+correction</p>
+
+
+<p style="margin-left:11%;"><b>&minus;&minus;lowpass</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">lowpass filter frequency.
+Default 20000 Hz.</p>
+
+
+<p style="margin-left:11%;"><b>&minus;&minus;highpass</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">highpass filter frequency.
+Default is 20 Hz.</p>
+
+
+<p style="margin-left:11%;"><b>&minus;&minus;hpboost</b></p>
+
+<p style="margin-left:22%;">enable highpass boost to filter
+out initial click.</p>
+
+<p style="margin-left:11%; margin-top: 1em"><b>vcdd
+options:</b></p>
+
+<p style="margin-left:22%;">These options apply to vcdd
+output only</p>
+
+<p style="margin-left:11%;"><b>&minus;u</b>,
+<b>&minus;&minus;high</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">minimum input for high
+level</p>
+
+<p style="margin-left:11%;"><b>&minus;l</b>,
+<b>&minus;&minus;low</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">maximum input for low level</p>
+
+<p style="margin-left:11%; margin-top: 1em"><b>tab
+options:</b></p>
+
+<p style="margin-left:22%;">These options apply to sampled
+output only</p>
+
+<p style="margin-left:11%;"><b>&minus;s</b>,
+<b>&minus;&minus;start</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">time when sampling starts</p>
+
+<p style="margin-left:11%;"><b>&minus;i</b>,
+<b>&minus;&minus;increment</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">time between samples</p>
+
+<p style="margin-left:11%;"><b>&minus;n</b>,
+<b>&minus;&minus;samples</b>=<i>Value</i></p>
+
+<p style="margin-left:22%;">number of samples</p>
+
+<p style="margin-left:11%; margin-top: 1em"><b>General
+options:</b></p>
+
+<p style="margin-left:22%;">These options always apply</p>
+
+<p style="margin-left:11%;"><b>&minus;v</b>,
+<b>&minus;&minus;verbose</b></p>
+
+<p style="margin-left:22%;">be verbose &minus; this
+produces lots of output</p>
+
+<p style="margin-left:11%;"><b>&minus;q</b>,
+<b>&minus;&minus;quiet</b></p>
+
+<p style="margin-left:22%;">be quiet &minus; no
+warnings</p>
+
+
+<p style="margin-left:11%;"><b>&minus;&minus;version</b></p>
+
+<p style="margin-left:22%;">display version and exit</p>
+
+<p style="margin-left:11%;"><b>&minus;h</b>,
+<b>&minus;&minus;help</b></p>
+
+<p style="margin-left:22%;">display help and exit</p>
+
+<h2>EXAMPLES
+<a name="EXAMPLES"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">./nlwav
+&minus;f vcdd &minus;o x.vcd log_V*</p>
+
+<p style="margin-left:22%; margin-top: 1em">convert all
+files starting with &quot;log_V&quot; into a digital vcd
+file</p>
+
+<p style="margin-left:11%; margin-top: 1em">./nlwav
+&minus;f wav16s &minus;o x.wav log_V*</p>
+
+<p style="margin-left:22%; margin-top: 1em">convert all
+files starting with &quot;log_V&quot; into a multichannel
+wav file (16bit, signed)</p>
+
+<p style="margin-left:11%; margin-top: 1em">./nlwav
+&minus;f tab &minus;o x.tab &minus;s 0.0000005 &minus;i
+0.000001 &minus;n 256 log_BLUE.log</p>
+
+<p style="margin-left:22%; margin-top: 1em">convert file
+log_BLUE.log to sampled output. First sample at 500ns
+followed by 255 samples every micro&minus;second.</p>
+
+<h2>AUTHOR
+<a name="AUTHOR"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">Written by
+Couriersud.</p>
+
+<h2>COPYRIGHT
+<a name="COPYRIGHT"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">Copyright
+&copy; 2021 Couriersud License BSD&minus;3&minus;Clause <br>
+This is free software: you are free to change and
+redistribute it. There is NO WARRANTY, to the extent
+permitted by law.</p>
+
+<h2>SEE ALSO
+<a name="SEE ALSO"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em">More
+documentation for the <b>nlwav</b> program is available in
+doxygen format.</p>
+<hr>
+</body>
+</html>
diff --git a/src/lib/netlist/build/makefile b/src/lib/netlist/build/makefile
index 979df4a16ea..728582dd0e0 100644
--- a/src/lib/netlist/build/makefile
+++ b/src/lib/netlist/build/makefile
@@ -290,7 +290,8 @@ gcc9:
$(MAKE) CC=g++-9 LD=g++-9 CEXTRAFLAGS="-march=native -Wall -pedantic -Wpedantic -fext-numeric-literals -Wsign-compare -Wextra" EXTRALIBS="-lquadmath" OBJ=obj/gcc9
emsdk:
- emmake $(MAKE) CC=emcc LD=emcc CEXTRAFLAGS="-fexceptions" LDEXTRAFLAGS="-fexceptions --emrun" OBJ=obj/emsdk EXESUFFIX=.html
+ emmake $(MAKE) CC=emcc LD=emcc CEXTRAFLAGS="-fexceptions -msimd128" LDEXTRAFLAGS="-s ALLOW_MEMORY_GROWTH=0 -s TOTAL_MEMORY=268435456 -fexceptions -msimd128 --emrun --embed-file ../../../mame/machine/nl_pongf.cpp@nl_pongf.cpp --embed-file ../../../mame/audio/nl_kidniki.cpp@nl_kidniki.cpp" OBJ=obj/emsdk EXESUFFIX=.html
+ # LDFLAGS -s ASSERTIONS=1
clang:
#$(MAKE) CC=clang++-11 LD=clang++-11 OBJ=obj/clang CEXTRAFLAGS="-march=native -msse4.2 -Weverything -Wall -pedantic -Wpedantic -Wunused-private-field -Wno-padded -Wno-unused-template -Wno-missing-variable-declarations -Wno-float-equal -Wconversion -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-format-nonliteral -Wno-exit-time-destructors"
@@ -303,8 +304,8 @@ clang:
-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wformat-nonliteral \
-Wno-exit-time-destructors -Winconsistent-missing-destructor-override \
-Wno-embedded-directive \
- -Wno-undefined-reinterpret-cast \
- -Wunreachable-code -Wno-gnu-alignof-expression \
+ -Wno-undefined-reinterpret-cast -Wno-error=unused-macros \
+ -Wunreachable-code \
-Wmissing-prototypes -Wno-error=deprecated"
clang-libc:
@@ -363,9 +364,9 @@ doc:
./nltool$(EXESUFFIX) -c docheader > ../documentation/devsyn.dox.h
$(DOXYGEN) doxygen.conf
-NLOBJS = $(patsubst $(SRC)%, $(OBJ)%, $(CORESOURCES:.cpp=.o))
cspell:
- cd .. && cspell -c build/cspell.json --no-color --relative $(patsubst $(SRC)/%, %, $(ALLHEADERS) $(ALLSOURCES)) | sed -e "s/ - Unknown/: error: Unknown/g"
+ cd .. && cspell -c build/cspell.json --no-color --locale en-GB --relative $(patsubst $(SRC)/%, %, $(ALLHEADERS) ) | sed -e "s/ - Unknown/: error: Unknown/g"
+ #cd .. && cspell -c build/cspell.json --no-color --locale en-GB --relative $(patsubst $(SRC)/%, %, $(ALLHEADERS) $(ALLSOURCES)) | sed -e "s/ - Unknown/: error: Unknown/g"
#-------------------------------------------------
# depends
@@ -392,15 +393,15 @@ endif
# generated
#-------------------------------------------------
-$(SRC)/generated/lib_entries.hxx: $(DEVSOURCES)
+$(SRC)/generated/lib_entries.hxx: create_lib_entries.py $(DEVSOURCES)
@echo creating $@
$(PYTHON) create_lib_entries.py $^ > $@
-$(SRC)/generated/nld_devinc.h: $(DEVSOURCES)
+$(SRC)/generated/nld_devinc.h: create_devinc.py $(DEVSOURCES)
@echo creating $@
$(PYTHON) create_devinc.py $^ > $@
-$(SRC)/generated/nlm_modules_lib.cpp: $(MODULESOURCES)
+$(SRC)/generated/nlm_modules_lib.cpp: create_modules.py $(MODULESOURCES)
@echo creating $@
$(PYTHON) create_modules.py $^ > $@
diff --git a/src/lib/netlist/build/man/nltool.1 b/src/lib/netlist/build/man/nltool.1
new file mode 100644
index 00000000000..ac1e7006794
--- /dev/null
+++ b/src/lib/netlist/build/man/nltool.1
@@ -0,0 +1,176 @@
+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3.
+.TH NLTOOL "1" "May 2022" "nltool (netlist) 0.14" "User Commands"
+.SH NAME
+nltool \- manual page for nltool (netlist) 0.14
+.SH SYNOPSIS
+.B nltool
+[\fI\,option\/\fR]... [\fI\,files\/\fR]...
+.SH DESCRIPTION
+nltool serves as the Swiss Army knife to run, test and convert netlists.
+.PP
+Commands may accept one or more files depending on the functionality.
+If no file is provided, standard input is used.
+.SH OPTIONS
+.SS "General options:"
+.IP
+The following options apply to all commands.
+.HP
+\fB\-c\fR, \fB\-\-cmd\fR=\fI\,run\/\fR|validate|convert|listdevices|listmodels|static|header|docheader|tests
+.IP
+run|validate|convert|listdevices|listmodels|static|header|docheader|tests
+.TP
+\fB\-I\fR, \fB\-\-include\fR=\fI\,Value\/\fR
+Add the directory to the list of directories to be
+searched for header files. This option may be
+specified repeatedly.
+.TP
+\fB\-D\fR, \fB\-\-define\fR=\fI\,Value\/\fR
+predefine value as macro, e.g. \fB\-Dname\fR=\fI\,value\/\fR. If
+\&'=value' is omitted predefine it as 1. This option
+may be specified repeatedly.
+.TP
+\fB\-r\fR, \fB\-\-rom\fR=\fI\,Value\/\fR
+where to look for data files
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+be verbose \- this produces lots of output
+.TP
+\fB\-q\fR, \fB\-\-quiet\fR
+be quiet \- no warnings
+.TP
+\fB\-\-prepro\fR
+output preprocessor output to stderr
+.TP
+\fB\-\-progress\fR
+show progress bar on longer operations
+.TP
+\fB\-\-version\fR
+display version and exit
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+display help and exit
+.SS "Options for run and static commands:"
+.IP
+These options apply to run and static commands.
+.TP
+\fB\-n\fR, \fB\-\-name\fR=\fI\,Value\/\fR
+the netlist in file specified by \fB\-f\fR option to run;
+default is first one
+.SS "Options for static command:"
+.IP
+These options apply to static command.
+.TP
+\fB\-d\fR, \fB\-\-dir\fR=\fI\,Value\/\fR
+output directory for the generated files.
+.TP
+\fB\-o\fR, \fB\-\-output\fR=\fI\,Value\/\fR
+single output file for the generated code.
+Either \fB\-\-dir\fR or \fB\-\-output\fR can be specificied
+.TP
+\fB\-\-static_include\fR
+write static solvers to individual files included by
+file specified with \fB\-\-output\fR. \fB\-\-dir\fR must be path to
+"generated/static" path in netlist folder.
+.SS "Options for run command:"
+.IP
+These options are only used by the run command.
+.TP
+\fB\-t\fR, \fB\-\-time_to_run\fR=\fI\,Value\/\fR
+time to run the emulation (seconds)
+.TP
+\fB\-\-boost_lib\fR=\fI\,Value\/\fR
+generic: will use generic solvers.
+builtin: Use optimized solvers compiled in.
+somelib.so: Use library with precompiled solvers.
+.TP
+\fB\-s\fR, \fB\-\-statistics\fR
+gather runtime statistics
+.TP
+\fB\-l\fR, \fB\-\-log\fR=\fI\,Value\/\fR
+define terminal to log. This option may be specified
+repeatedly.
+.TP
+\fB\-i\fR, \fB\-\-input\fR=\fI\,Value\/\fR
+input file to process (default is none)
+.TP
+\fB\-\-loadstate\fR=\fI\,Value\/\fR
+load state from file and continue from there
+.TP
+\fB\-\-savestate\fR=\fI\,Value\/\fR
+save state to file at end of run
+.TP
+\fB\-\-fperr\fR
+raise exception on floating point errors. This is
+intended to be used during debugging.
+.SS "Options for convert command:"
+.IP
+These options are only used by the convert command.
+.TP
+\fB\-y\fR, \fB\-\-type\fR=\fI\,spice\/\fR|eagle|rinf
+type of file to be converted: spice,eagle,rinf
+.SS "Options for validate command:"
+.IP
+These options are only used by the validate command.
+.SS "Options for header command:"
+.IP
+These options are only used by the header command.
+.TP
+\fB\-\-tab\-width\fR=\fI\,Value\/\fR
+Tab width for output.
+.TP
+\fB\-\-line\-width\fR=\fI\,Value\/\fR
+Line width for output.
+.TP
+\fB\-\-pattern\fR=\fI\,Value\/\fR
+Pattern to match against device names. If the device
+name contains pattern, the device will be included
+in the output. Multiple patterns can be specified,
+if none is given, all devices will be output.
+.SH EXAMPLES
+nltool \-c run \-t 3.5 \-n cap_delay nl_examples/cdelay.c
+.IP
+Run netlist "cap_delay" from file nl_examples/cdelay.c for 3.5
+seconds
+.PP
+nltool \-\-cmd=listdevices
+.IP
+List all known devices.
+.PP
+nltool \-\-cmd=header \-\-tab\-width=8 \-\-line\-width=80
+.IP
+Create the header file needed for including netlists as code.
+.PP
+nltool \-\-cmd static \-\-output
+.IP
+src/lib/netlist/generated/static_solvers.cpp
+src/mame/audio/nl_*.cpp src/mame/machine/nl_*.cpp
+.IP
+Create static solvers for the MAME project using one single source
+file.
+.PP
+nltool \-\-cmd static \-\-output
+.IP
+src/lib/netlist/generated/static_solvers.cpp \-\-dir
+src/lib/netlist/generated/static \-\-static_include
+src/mame/audio/nl_*.cpp src/mame/machine/nl_*.cpp
+.IP
+Create static solvers for the MAME project using a single source
+file which includes generated solvers written to \-\-dir folder.
+.PP
+nltool \-\-cmd tests
+.IP
+Run unit tests. In case the unit tests are not linked in, this will
+do nothing.
+.SH AUTHOR
+Written by Couriersud.
+.SH COPYRIGHT
+Copyright \(co 2021 Couriersud
+License BSD\-3\-Clause
+.br
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+.SH "SEE ALSO"
+More documentation for the
+.B nltool
+program is available in doxygen format.
+
diff --git a/src/lib/netlist/build/man/nlwav.1 b/src/lib/netlist/build/man/nlwav.1
new file mode 100644
index 00000000000..11c63423809
--- /dev/null
+++ b/src/lib/netlist/build/man/nlwav.1
@@ -0,0 +1,116 @@
+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3.
+.TH NLWAV "1" "May 2022" "nlwav (netlist) 0.1" "User Commands"
+.SH NAME
+nlwav \- manual page for nlwav (netlist) 0.1
+.SH SYNOPSIS
+.B nlwav
+[\fI\,OPTION\/\fR] ... [\fI\,FILE\/\fR] ...
+.SH DESCRIPTION
+Convert netlist log files into wav files.
+.SH OPTIONS
+.TP
+\fB\-f\fR, \fB\-\-format\fR=\fI\,wav16s\/\fR|wav32s|wav32f|vcda|vcdd|tab
+output format. Available options are
+wav16s|wav32s|wav32f|vcda|vcdd|tab.
+.TP
+wav16s
+: multichannel wav output 16 bit signed
+.TP
+wav32s
+: multichannel wav output 32 bit signed
+.TP
+wav32f
+: multichannel wav output 32 bit float
+.TP
+vcda : analog VCD output
+vcdd : digital VCD output
+tab : sampled output
+Digital signals are created using the \fB\-\-high\fR and
+.IP
+\fB\-\-low\fR options
+.TP
+\fB\-o\fR, \fB\-\-output\fR=\fI\,Value\/\fR
+output file
+.SS "wav options:"
+.IP
+These options apply to wav output only
+.TP
+\fB\-r\fR, \fB\-\-rate\fR=\fI\,Value\/\fR
+sample rate of output file
+.TP
+\fB\-a\fR, \fB\-\-amp\fR=\fI\,Value\/\fR
+amplification after mean correction
+.TP
+\fB\-\-lowpass\fR=\fI\,Value\/\fR
+lowpass filter frequency.
+Default 20000 Hz.
+.TP
+\fB\-\-highpass\fR=\fI\,Value\/\fR
+highpass filter frequency.
+Default is 20 Hz.
+.TP
+\fB\-\-hpboost\fR
+enable highpass boost to filter out initial click.
+.SS "vcdd options:"
+.IP
+These options apply to vcdd output only
+.TP
+\fB\-u\fR, \fB\-\-high\fR=\fI\,Value\/\fR
+minimum input for high level
+.TP
+\fB\-l\fR, \fB\-\-low\fR=\fI\,Value\/\fR
+maximum input for low level
+.SS "tab options:"
+.IP
+These options apply to sampled output only
+.TP
+\fB\-s\fR, \fB\-\-start\fR=\fI\,Value\/\fR
+time when sampling starts
+.TP
+\fB\-i\fR, \fB\-\-increment\fR=\fI\,Value\/\fR
+time between samples
+.TP
+\fB\-n\fR, \fB\-\-samples\fR=\fI\,Value\/\fR
+number of samples
+.SS "General options:"
+.IP
+These options always apply
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+be verbose \- this produces lots of output
+.TP
+\fB\-q\fR, \fB\-\-quiet\fR
+be quiet \- no warnings
+.TP
+\fB\-\-version\fR
+display version and exit
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+display help and exit
+.SH EXAMPLES
+\&./nlwav \-f vcdd \-o x.vcd log_V*
+.IP
+convert all files starting with "log_V" into a digital vcd file
+.PP
+\&./nlwav \-f wav16s \-o x.wav log_V*
+.IP
+convert all files starting with "log_V" into a multichannel wav file
+(16bit, signed)
+.PP
+\&./nlwav \-f tab \-o x.tab \-s 0.0000005 \-i 0.000001 \-n 256 log_BLUE.log
+.IP
+convert file log_BLUE.log to sampled output. First sample at 500ns
+followed by 255 samples every micro\-second.
+.SH AUTHOR
+Written by Couriersud.
+.SH COPYRIGHT
+Copyright \(co 2021 Couriersud
+License BSD\-3\-Clause
+.br
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+.SH "SEE ALSO"
+More documentation for the
+.B nlwav
+program is available in doxygen format.
+
diff --git a/src/lib/netlist/core/analog.h b/src/lib/netlist/core/analog.h
index 33e0ec605d2..a003e1c37a5 100644
--- a/src/lib/netlist/core/analog.h
+++ b/src/lib/netlist/core/analog.h
@@ -29,7 +29,7 @@ namespace netlist
public:
analog_t(core_device_t &dev, const pstring &aname, state_e state,
- nldelegate delegate);
+ nl_delegate delegate);
const analog_net_t & net() const noexcept
{
@@ -46,7 +46,7 @@ namespace netlist
/// \brief Base class for terminals.
///
- /// Each \ref nld_twoterm object consists of two terminals. Terminals
+ /// Each \ref nld_two_terminal object consists of two terminals. Terminals
/// are at the core of analog netlists and are connected to \ref net_t
/// objects.
///
@@ -59,10 +59,10 @@ namespace netlist
/// \param dev object owning the terminal
/// \param aname name of this terminal
/// \param other_terminal pointer to the sibling terminal
- terminal_t(core_device_t &dev, const pstring &aname, terminal_t *other_terminal, nldelegate delegate);
+ terminal_t(core_device_t &dev, const pstring &aname, terminal_t *other_terminal, nl_delegate delegate);
terminal_t(core_device_t &dev, const pstring &aname, terminal_t *other_terminal,
- const std::array<terminal_t *, 2> &splitterterms, nldelegate delegate);
+ const std::array<terminal_t *, 2> &splitter_terms, nl_delegate delegate);
/// \brief Returns voltage of connected net
///
@@ -120,7 +120,7 @@ namespace netlist
/// \brief Constructor
analog_input_t(core_device_t &dev, ///< owning device
const pstring &aname, ///< name of terminal
- nldelegate delegate ///< delegate
+ nl_delegate delegate ///< delegate
);
/// \brief returns voltage at terminal.
diff --git a/src/lib/netlist/core/base_objects.h b/src/lib/netlist/core/base_objects.h
index ac392de21e6..20fce1c91ca 100644
--- a/src/lib/netlist/core/base_objects.h
+++ b/src/lib/netlist/core/base_objects.h
@@ -193,7 +193,7 @@ namespace netlist::detail {
/// All terminals are derived from this class.
///
class core_terminal_t : public device_object_t,
- public plib::linkedlist_t<core_terminal_t>::element_t
+ public plib::linked_list_t<core_terminal_t>::element_t
{
public:
/// \brief Number of signal bits
@@ -222,7 +222,7 @@ namespace netlist::detail {
};
core_terminal_t(core_device_t &dev, const pstring &aname,
- state_e state, nldelegate delegate);
+ state_e state, nl_delegate delegate);
virtual ~core_terminal_t() noexcept = default;
PCOPYASSIGNMOVE(core_terminal_t, delete)
@@ -266,11 +266,11 @@ namespace netlist::detail {
#else
void set_copied_input([[maybe_unused]] const netlist_sig_t &val) const noexcept { } // NOLINT: static means more message elsewhere
#endif
- void set_delegate(const nldelegate &delegate) noexcept { m_delegate = delegate; }
- const nldelegate &delegate() const noexcept { return m_delegate; }
+ void set_delegate(const nl_delegate &delegate) noexcept { m_delegate = delegate; }
+ const nl_delegate &delegate() const noexcept { return m_delegate; }
void run_delegate() const noexcept { return m_delegate(); }
private:
- nldelegate m_delegate;
+ nl_delegate m_delegate;
net_t * m_net;
state_var<state_e> m_state;
};
diff --git a/src/lib/netlist/core/core_device.h b/src/lib/netlist/core/core_device.h
index a40a417e414..f7f05427f54 100644
--- a/src/lib/netlist/core/core_device.h
+++ b/src/lib/netlist/core/core_device.h
@@ -85,13 +85,13 @@ namespace netlist
log_type & log();
public:
- virtual void timestep([[maybe_unused]] timestep_type ts_type,
+ virtual void time_step([[maybe_unused]] time_step_type ts_type,
[[maybe_unused]] nl_fptype st) noexcept { }
virtual void update_terminals() noexcept { }
virtual void update_param() noexcept {}
virtual bool is_dynamic() const noexcept { return false; }
- virtual bool is_timestep() const noexcept { return false; }
+ virtual bool is_time_step() const noexcept { return false; }
private:
bool m_hint_deactivate;
@@ -114,13 +114,13 @@ namespace netlist
~base_device_t() noexcept override = default;
template <class O, class C, typename... Args>
- void create_and_register_subdevice(O& owner, const pstring &name, device_arena::unique_ptr<C> &dev, Args&&... args)
+ void create_and_register_sub_device(O& owner, const pstring &name, device_arena::unique_ptr<C> &dev, Args&&... args)
{
dev = state().make_pool_object<C>(owner, name, std::forward<Args>(args)...);
}
- void register_subalias(const pstring &name, const detail::core_terminal_t &term);
- void register_subalias(const pstring &name, const pstring &aliased);
+ void register_sub_alias(const pstring &name, const detail::core_terminal_t &term);
+ void register_sub_alias(const pstring &name, const pstring &aliased);
void connect(const pstring &t1, const pstring &t2);
void connect(const detail::core_terminal_t &t1, const detail::core_terminal_t &t2);
diff --git a/src/lib/netlist/core/device_macros.h b/src/lib/netlist/core/device_macros.h
index 798651ce284..156722bfc65 100644
--- a/src/lib/netlist/core/device_macros.h
+++ b/src/lib/netlist/core/device_macros.h
@@ -12,10 +12,6 @@
// MACROS / New Syntax
//============================================================
-/// \brief Construct a netlist device name
-///
-#define NETLIB_NAME(chip) nld_ ## chip
-
/// \brief Start a netlist device class.
///
/// Used to start defining a netlist device class.
@@ -131,14 +127,14 @@ class NETLIB_NAME(name) : public delegator_t<base_device_t>
/// \endcode
#define NETLIB_IS_TIMESTEP(expr) \
- public: virtual bool is_timestep() const noexcept override { return expr; }
+ public: virtual bool is_time_step() const noexcept override { return expr; }
/// \brief Used to implement the time stepping code.
///
/// Please see \ref NETLIB_IS_TIMESTEP for an example.
#define NETLIB_TIMESTEPI() \
- public: virtual void timestep(timestep_type ts_type, nl_fptype step) noexcept override
+ public: virtual void time_step(time_step_type ts_type, nl_fptype step) noexcept override
/// \brief Used to implement the body of the time stepping code.
///
@@ -149,11 +145,11 @@ class NETLIB_NAME(name) : public delegator_t<base_device_t>
/// \param cname Name of object as given to \ref NETLIB_OBJECT
///
#define NETLIB_TIMESTEP(cname) \
- void NETLIB_NAME(cname) :: timestep(timestep_type ts_type, nl_fptype step) noexcept
+ void NETLIB_NAME(cname) :: time_step(time_step_type ts_type, nl_fptype step) noexcept
-#define NETLIB_DELEGATE(name) nldelegate(&this_type :: name, this)
+#define NETLIB_DELEGATE(name) nl_delegate(&this_type :: name, this)
-#define NETLIB_DELEGATE_NOOP() nldelegate(&core_device_t::handler_noop, static_cast<core_device_t *>(this))
+#define NETLIB_DELEGATE_NOOP() nl_delegate(&core_device_t::handler_noop, static_cast<core_device_t *>(this))
#define NETLIB_UPDATE_TERMINALSI() virtual void update_terminals() noexcept override
#define NETLIB_HANDLERI(name) void name() noexcept
diff --git a/src/lib/netlist/core/devices.h b/src/lib/netlist/core/devices.h
index 451c83b2274..52e33b7d96c 100644
--- a/src/lib/netlist/core/devices.h
+++ b/src/lib/netlist/core/devices.h
@@ -73,7 +73,7 @@ namespace netlist::devices
{
}
- explicit nld_power_pins(device_t &owner, nldelegate delegate)
+ explicit nld_power_pins(device_t &owner, nl_delegate delegate)
: m_VCC(owner, owner.logic_family()->vcc_pin(), delegate)
, m_GND(owner, owner.logic_family()->gnd_pin(), delegate)
{
@@ -90,7 +90,7 @@ namespace netlist::devices
// Some devices like the 74LS629 have two pairs of supply pins.
explicit nld_power_pins(device_t &owner,
const pstring &vcc, const pstring &gnd,
- nldelegate delegate)
+ nl_delegate delegate)
: m_VCC(owner, vcc, delegate)
, m_GND(owner, gnd, delegate)
{
@@ -120,7 +120,7 @@ namespace netlist::devices
NETLIB_CONSTRUCTOR(netlistparams)
, m_use_deactivate(*this, "USE_DEACTIVATE", false)
, m_startup_strategy(*this, "STARTUP_STRATEGY", 0)
- , m_mos_capmodel(*this, "DEFAULT_MOS_CAPMODEL", 2)
+ , m_mos_cap_model(*this, "DEFAULT_MOS_CAPMODEL", 2)
, m_max_link_loops(*this, "MAX_LINK_RESOLVE_LOOPS", 100)
{
}
@@ -129,7 +129,7 @@ namespace netlist::devices
public:
param_logic_t m_use_deactivate;
param_num_t<unsigned> m_startup_strategy;
- param_num_t<unsigned> m_mos_capmodel;
+ param_num_t<unsigned> m_mos_cap_model;
//! How many times do we try to resolve links (connections)
param_num_t<unsigned> m_max_link_loops;
};
diff --git a/src/lib/netlist/core/logic.h b/src/lib/netlist/core/logic.h
index 350acc2995d..fef1f848052 100644
--- a/src/lib/netlist/core/logic.h
+++ b/src/lib/netlist/core/logic.h
@@ -30,7 +30,7 @@ namespace netlist
{
public:
logic_t(device_t &dev, const pstring &aname,
- state_e terminal_state, nldelegate delegate);
+ state_e terminal_state, nl_delegate delegate);
logic_net_t & net() noexcept
{
@@ -50,7 +50,7 @@ namespace netlist
{
public:
logic_input_t(device_t &dev, const pstring &aname,
- nldelegate delegate);
+ nl_delegate delegate);
const netlist_sig_t &operator()() const noexcept
{
diff --git a/src/lib/netlist/core/netlist_state.h b/src/lib/netlist/core/netlist_state.h
index 517dbc36474..5e8ae4567ec 100644
--- a/src/lib/netlist/core/netlist_state.h
+++ b/src/lib/netlist/core/netlist_state.h
@@ -93,7 +93,7 @@ namespace netlist
log_type & log() noexcept { return m_log; }
const log_type &log() const noexcept { return m_log; }
- plib::dynlib_base &static_solver_lib() const noexcept { return *m_lib; }
+ plib::dynamic_library_base &static_solver_lib() const noexcept { return *m_lib; }
/// \brief provide library with static solver implementations.
///
@@ -101,7 +101,7 @@ namespace netlist
/// determined by the specific use case. You can pass such a collection
/// of symbols with this method.
///
- void set_static_solver_lib(std::unique_ptr<plib::dynlib_base> &&lib);
+ void set_static_solver_lib(std::unique_ptr<plib::dynamic_library_base> &&lib);
netlist_t &exec() noexcept { return *m_netlist; }
const netlist_t &exec() const noexcept { return *m_netlist; }
@@ -246,7 +246,7 @@ namespace netlist
device_arena m_pool; // must be deleted last!
device_arena::unique_ptr<netlist_t> m_netlist;
- std::unique_ptr<plib::dynlib_base> m_lib;
+ std::unique_ptr<plib::dynamic_library_base> m_lib;
plib::state_manager_t m_state;
log_type m_log;
diff --git a/src/lib/netlist/core/nets.h b/src/lib/netlist/core/nets.h
index 73b59950966..a121f261a50 100644
--- a/src/lib/netlist/core/nets.h
+++ b/src/lib/netlist/core/nets.h
@@ -134,7 +134,7 @@ namespace netlist
}
constexpr const netlist_time_ext &next_scheduled_time() const noexcept { return m_next_scheduled_time; }
- void set_next_scheduled_time(netlist_time_ext ntime) noexcept { m_next_scheduled_time = ntime; }
+ void set_next_scheduled_time(netlist_time_ext next_time) noexcept { m_next_scheduled_time = next_time; }
bool is_rail_net() const noexcept { return !(m_rail_terminal == nullptr); }
core_terminal_t & rail_terminal() const noexcept { return *m_rail_terminal; }
@@ -258,7 +258,7 @@ namespace netlist
state_var<netlist_sig_t> m_new_Q;
state_var<netlist_sig_t> m_cur_Q;
state_var<queue_status> m_in_queue;
- plib::linkedlist_t<core_terminal_t> m_list_active;
+ plib::linked_list_t<core_terminal_t> m_list_active;
state_var<netlist_time_ext> m_next_scheduled_time;
core_terminal_t * m_rail_terminal;
diff --git a/src/lib/netlist/core/object_array.h b/src/lib/netlist/core/object_array.h
index cab4ab5e429..69528796303 100644
--- a/src/lib/netlist/core/object_array.h
+++ b/src/lib/netlist/core/object_array.h
@@ -45,19 +45,19 @@ namespace netlist
}
template<class D>
- object_array_base_t(D &dev, std::size_t offset, const pstring &fmt, nldelegate delegate)
+ object_array_base_t(D &dev, std::size_t offset, const pstring &fmt, nl_delegate delegate)
{
for (std::size_t i = 0; i<N; i++)
this->emplace_back(dev, formatted(fmt, i+offset), delegate);
}
template<class D>
- object_array_base_t(D &dev, std::size_t offset, std::size_t qmask, const pstring &fmt)
+ object_array_base_t(D &dev, std::size_t offset, std::size_t output_mask, const pstring &fmt)
{
for (std::size_t i = 0; i<N; i++)
{
pstring name(formatted(fmt, i+offset));
- if ((qmask >> i) & 1)
+ if ((output_mask >> i) & 1)
name += "Q";
this->emplace(i, dev, name);
}
@@ -90,8 +90,8 @@ namespace netlist
using base_type::base_type;
template<class D, std::size_t ND>
- object_array_t(D &dev, std::size_t offset, std::size_t qmask,
- const pstring &fmt, std::array<nldelegate, ND> &&delegates)
+ object_array_t(D &dev, std::size_t offset, std::size_t output_mask,
+ const pstring &fmt, std::array<nl_delegate, ND> &&delegates)
{
static_assert(N <= ND, "initializer_list size mismatch");
std::size_t i = 0;
@@ -100,7 +100,7 @@ namespace netlist
if (i < N)
{
pstring name(this->formatted(fmt, i+offset));
- if ((qmask >> i) & 1)
+ if ((output_mask >> i) & 1)
name += "Q";
this->emplace_back(dev, name, e);
}
@@ -219,6 +219,28 @@ namespace netlist
}
};
+ // -----------------------------------------------------------------------------
+ // Externals
+ // -----------------------------------------------------------------------------
+
+ extern template class object_array_t<logic_input_t, 1>;
+ extern template class object_array_t<logic_input_t, 2>;
+ extern template class object_array_t<logic_input_t, 3>;
+ extern template class object_array_t<logic_input_t, 4>;
+ extern template class object_array_t<logic_input_t, 5>;
+ extern template class object_array_t<logic_input_t, 6>;
+ extern template class object_array_t<logic_input_t, 7>;
+ extern template class object_array_t<logic_input_t, 8>;
+
+ extern template class object_array_t<logic_output_t, 1>;
+ extern template class object_array_t<logic_output_t, 2>;
+ extern template class object_array_t<logic_output_t, 3>;
+ extern template class object_array_t<logic_output_t, 4>;
+ extern template class object_array_t<logic_output_t, 5>;
+ extern template class object_array_t<logic_output_t, 6>;
+ extern template class object_array_t<logic_output_t, 7>;
+ extern template class object_array_t<logic_output_t, 8>;
+
} // namespace netlist
diff --git a/src/lib/netlist/core/param.h b/src/lib/netlist/core/param.h
index 445b309c67b..52f086cf6f0 100644
--- a/src/lib/netlist/core/param.h
+++ b/src/lib/netlist/core/param.h
@@ -39,7 +39,7 @@ namespace netlist
POINTER // Special-case which is always initialized at MAME startup time
};
- //deviceless, it's the responsibility of the owner to register!
+ //device-less, it's the responsibility of the owner to register!
param_t(const pstring &name);
param_t(core_device_t &device, const pstring &name);
@@ -49,7 +49,7 @@ namespace netlist
param_type_t param_type() const noexcept(false);
- virtual pstring valstr() const = 0;
+ virtual pstring value_string() const = 0;
protected:
@@ -84,7 +84,7 @@ namespace netlist
void set(const T &param) noexcept { set_and_update_param(m_param, param); }
- pstring valstr() const override
+ pstring value_string() const override
{
return plib::pfmt("{}").e(gsl::narrow<nl_fptype>(m_param));
}
@@ -105,7 +105,7 @@ namespace netlist
operator T() const noexcept { return m_param; }
void set(const T &param) noexcept { set_and_update_param(m_param, param); }
- pstring valstr() const override
+ pstring value_string() const override
{
// returns the numerical value
return plib::pfmt("{}")(static_cast<int>(m_param));
@@ -114,11 +114,6 @@ namespace netlist
T m_param;
};
- // FIXME: these should go as well
- using param_logic_t = param_num_t<bool>;
- using param_int_t = param_num_t<int>;
- using param_fp_t = param_num_t<nl_fptype>;
-
// -----------------------------------------------------------------------------
// pointer parameter
// -----------------------------------------------------------------------------
@@ -131,7 +126,7 @@ namespace netlist
std::uint8_t * operator()() const noexcept { return m_param; }
void set(std::uint8_t *param) noexcept { set_and_update_param(m_param, param); }
- pstring valstr() const override
+ pstring value_string() const override
{
// returns something which errors
return { "PTRERROR" };
@@ -161,7 +156,7 @@ namespace netlist
device().update_param();
}
}
- pstring valstr() const override
+ pstring value_string() const override
{
return *m_param;
}
@@ -315,6 +310,31 @@ namespace netlist
device.state().log().warning(MW_ROM_NOT_FOUND(str()));
}
+ // -----------------------------------------------------------------------------
+ // Externals
+ // -----------------------------------------------------------------------------
+
+ extern template class param_num_t<std::uint8_t>;
+ extern template class param_num_t<std::uint16_t>;
+ extern template class param_num_t<std::uint32_t>;
+ extern template class param_num_t<std::uint64_t>;
+ extern template class param_num_t<std::int8_t>;
+ extern template class param_num_t<std::int16_t>;
+ extern template class param_num_t<std::int32_t>;
+ extern template class param_num_t<std::int64_t>;
+ extern template class param_num_t<float>;
+ extern template class param_num_t<double>;
+ extern template class param_num_t<long double>;
+ extern template class param_num_t<bool>;
+
+ // FIXME: Should not be used as parameters. Fix later.
+ using param_logic_t = param_num_t<bool>;
+ using param_int_t = param_num_t<int>;
+ using param_fp_t = param_num_t<nl_fptype>;
+
+ extern template class param_model_t::value_base_t<float>;
+ extern template class param_model_t::value_base_t<double>;
+ extern template class param_model_t::value_base_t<long double>;
} // namespace netlist
diff --git a/src/lib/netlist/core/queue.h b/src/lib/netlist/core/queue.h
index b4b0c427c83..d8b95ac86e7 100644
--- a/src/lib/netlist/core/queue.h
+++ b/src/lib/netlist/core/queue.h
@@ -18,10 +18,10 @@
#include "../plib/ptimed_queue.h"
#include <array>
+#include <queue>
#include <unordered_map>
#include <utility>
#include <vector>
-#include <queue>
namespace netlist::detail
{
@@ -42,18 +42,18 @@ namespace netlist::detail
template <typename A, typename O, bool TS>
class queue_base :
- public timed_queue<A, plib::pqentry_t<netlist_time_ext, O *>, false>,
+ public timed_queue<A, plib::queue_entry_t<netlist_time_ext, O *>, false>,
public plib::state_manager_t::callback_t
{
public:
- using entry_t = plib::pqentry_t<netlist_time_ext, O *>;
+ using entry_t = plib::queue_entry_t<netlist_time_ext, O *>;
using base_queue = timed_queue<A, entry_t, false>;
using id_delegate = plib::pmfp<std::size_t (const O *)>;
using obj_delegate = plib::pmfp<O * (std::size_t)>;
explicit queue_base(A &arena, std::size_t size, id_delegate get_id, obj_delegate get_obj)
- : timed_queue<A, plib::pqentry_t<netlist_time_ext, O *>, false>(arena, size)
- , m_qsize(0)
+ : timed_queue<A, plib::queue_entry_t<netlist_time_ext, O *>, false>(arena, size)
+ , m_size(0)
, m_times(size)
, m_net_ids(size)
, m_get_id(get_id)
@@ -72,23 +72,23 @@ namespace netlist::detail
void register_state(plib::state_manager_t &manager, const pstring &module) override
{
- manager.save_item(this, m_qsize, module + "." + "qsize");
+ manager.save_item(this, m_size, module + "." + "qsize");
manager.save_item(this, &m_times[0], module + "." + "times", m_times.size());
manager.save_item(this, &m_net_ids[0], module + "." + "names", m_net_ids.size());
}
void on_pre_save([[maybe_unused]] plib::state_manager_t &manager) override
{
- m_qsize = this->size();
- for (std::size_t i = 0; i < m_qsize; i++ )
+ m_size = this->size();
+ for (std::size_t i = 0; i < m_size; i++ )
{
- m_times[i] = this->listptr()[i].exec_time().as_raw();
- m_net_ids[i] = m_get_id(this->listptr()[i].object());
+ m_times[i] = this->list_pointer()[i].exec_time().as_raw();
+ m_net_ids[i] = m_get_id(this->list_pointer()[i].object());
}
}
void on_post_load([[maybe_unused]] plib::state_manager_t &manager) override
{
this->clear();
- for (std::size_t i = 0; i < m_qsize; i++ )
+ for (std::size_t i = 0; i < m_size; i++ )
{
O *n = m_obj_by_id(m_net_ids[i]);
this->template push<false>(entry_t(netlist_time_ext::from_raw(m_times[i]),n));
@@ -96,7 +96,7 @@ namespace netlist::detail
}
private:
- std::size_t m_qsize;
+ std::size_t m_size;
std::vector<netlist_time_ext::internal_type> m_times;
std::vector<std::size_t> m_net_ids;
id_delegate m_get_id;
diff --git a/src/lib/netlist/core/setup.h b/src/lib/netlist/core/setup.h
index 86f298fc333..5171d1428e8 100644
--- a/src/lib/netlist/core/setup.h
+++ b/src/lib/netlist/core/setup.h
@@ -196,7 +196,7 @@ namespace netlist
void resolve_inputs();
pstring resolve_alias(const pstring &name) const;
- void merge_nets(detail::net_t &thisnet, detail::net_t &othernet);
+ void merge_nets(detail::net_t &this_net, detail::net_t &other_net);
void connect_terminals(detail::core_terminal_t &t1, detail::core_terminal_t &t2);
void connect_input_output(detail::core_terminal_t &in, detail::core_terminal_t &out);
@@ -232,7 +232,7 @@ namespace netlist
std::unordered_map<pstring, detail::core_terminal_t *> m_terminals;
// FIXME: Limited to 3 additional terminals
std::unordered_map<const terminal_t *,
- std::array<terminal_t *, 4>> m_connected_terminals;
+ std::array<terminal_t *, 4>> m_connected_terminals;
std::unordered_map<pstring, param_ref_t> m_params;
std::unordered_map<const detail::core_terminal_t *,
devices::nld_base_proxy *> m_proxies;
diff --git a/src/lib/netlist/core/state_var.h b/src/lib/netlist/core/state_var.h
index 253ae832c8a..7791a8604d6 100644
--- a/src/lib/netlist/core/state_var.h
+++ b/src/lib/netlist/core/state_var.h
@@ -175,6 +175,21 @@ namespace netlist
owner.state().save(owner, static_cast<C &>(*this), owner.name(), name);
}
+ // -----------------------------------------------------------------------------
+ // Externals
+ // -----------------------------------------------------------------------------
+
+ extern template struct state_var<std::uint8_t>;
+ extern template struct state_var<std::uint16_t>;
+ extern template struct state_var<std::uint32_t>;
+ extern template struct state_var<std::uint64_t>;
+ extern template struct state_var<std::int8_t>;
+ extern template struct state_var<std::int16_t>;
+ extern template struct state_var<std::int32_t>;
+ extern template struct state_var<std::int64_t>;
+ extern template struct state_var<bool>;
+
+
} // namespace netlist
namespace plib
diff --git a/src/lib/netlist/devices/nld_4020.cpp b/src/lib/netlist/devices/nld_4020.cpp
index f8908652489..9d08b4a8220 100644
--- a/src/lib/netlist/devices/nld_4020.cpp
+++ b/src/lib/netlist/devices/nld_4020.cpp
@@ -113,22 +113,22 @@ namespace netlist::devices {
NETLIB_CONSTRUCTOR_MODEL(CD4020, "CD4XXX")
, m_sub(*this, "A")
{
- register_subalias("IP", "A.IP");
- register_subalias("RESET", "A.RESET");
- register_subalias("Q1", "A.Q1");
- register_subalias("Q4", "A.Q4");
- register_subalias("Q5", "A.Q5");
- register_subalias("Q6", "A.Q6");
- register_subalias("Q7", "A.Q7");
- register_subalias("Q8", "A.Q8");
- register_subalias("Q9", "A.Q9");
- register_subalias("Q10", "A.Q10");
- register_subalias("Q11", "A.Q11");
- register_subalias("Q12", "A.Q12");
- register_subalias("Q13", "A.Q13");
- register_subalias("Q14", "A.Q14");
- register_subalias("VDD", "A.VDD");
- register_subalias("VSS", "A.VSS");
+ register_sub_alias("IP", "A.IP");
+ register_sub_alias("RESET", "A.RESET");
+ register_sub_alias("Q1", "A.Q1");
+ register_sub_alias("Q4", "A.Q4");
+ register_sub_alias("Q5", "A.Q5");
+ register_sub_alias("Q6", "A.Q6");
+ register_sub_alias("Q7", "A.Q7");
+ register_sub_alias("Q8", "A.Q8");
+ register_sub_alias("Q9", "A.Q9");
+ register_sub_alias("Q10", "A.Q10");
+ register_sub_alias("Q11", "A.Q11");
+ register_sub_alias("Q12", "A.Q12");
+ register_sub_alias("Q13", "A.Q13");
+ register_sub_alias("Q14", "A.Q14");
+ register_sub_alias("VDD", "A.VDD");
+ register_sub_alias("VSS", "A.VSS");
}
//NETLIB_RESETI() {}
@@ -142,17 +142,17 @@ namespace netlist::devices {
NETLIB_CONSTRUCTOR_MODEL(CD4024, "CD4XXX")
, m_sub(*this, "A")
{
- register_subalias("IP", "A.IP");
- register_subalias("RESET", "A.RESET");
- register_subalias("Q1", "A.Q1");
- register_subalias("Q2", "A.Q2");
- register_subalias("Q3", "A.Q3");
- register_subalias("Q4", "A.Q4");
- register_subalias("Q5", "A.Q5");
- register_subalias("Q6", "A.Q6");
- register_subalias("Q7", "A.Q7");
- register_subalias("VDD", "A.VDD");
- register_subalias("VSS", "A.VSS");
+ register_sub_alias("IP", "A.IP");
+ register_sub_alias("RESET", "A.RESET");
+ register_sub_alias("Q1", "A.Q1");
+ register_sub_alias("Q2", "A.Q2");
+ register_sub_alias("Q3", "A.Q3");
+ register_sub_alias("Q4", "A.Q4");
+ register_sub_alias("Q5", "A.Q5");
+ register_sub_alias("Q6", "A.Q6");
+ register_sub_alias("Q7", "A.Q7");
+ register_sub_alias("VDD", "A.VDD");
+ register_sub_alias("VSS", "A.VSS");
}
//NETLIB_RESETI() {}
diff --git a/src/lib/netlist/devices/nld_4053.cpp b/src/lib/netlist/devices/nld_4053.cpp
index a0bc9defeb4..c996ed0c2a5 100644
--- a/src/lib/netlist/devices/nld_4053.cpp
+++ b/src/lib/netlist/devices/nld_4053.cpp
@@ -37,16 +37,16 @@ namespace netlist::devices {
, m_inhibit(*this, "INH", NETLIB_DELEGATE(controls))
, m_VEE(*this, "VEE", NETLIB_DELEGATE(controls))
, m_base_r(*this, "BASER", nlconst::magic(270.0))
- , m_lastx(*this, "m_lastx", false)
- , m_lasty(*this, "m_lasty", false)
+ , m_last_x(*this, "m_lastx", false)
+ , m_last_y(*this, "m_lasty", false)
, m_select_state(*this, "m_select_state", false)
, m_inhibit_state(*this, "m_inhibit_state", false)
, m_supply(*this)
{
connect("RX.2", "RY.2");
- register_subalias("X", "RX.1");
- register_subalias("Y", "RY.1");
- register_subalias("XY", "RX.2");
+ register_sub_alias("X", "RX.1");
+ register_sub_alias("Y", "RY.1");
+ register_sub_alias("XY", "RX.2");
}
NETLIB_RESETI()
@@ -57,22 +57,22 @@ namespace netlist::devices {
private:
NETLIB_HANDLERI(controls)
{
- bool newx = false;
- bool newy = false;
+ bool new_x = false;
+ bool new_y = false;
if (!on(m_inhibit, m_inhibit_state))
{
if (!on(m_select, m_select_state))
{
- newx = true;
+ new_x = true;
}
else
{
- newy = true;
+ new_y = true;
}
}
- if (newx != m_lastx || newy != m_lasty)
- update_state(newx, newy);
+ if (new_x != m_last_x || new_y != m_last_y)
+ update_state(new_x, new_y);
}
bool on(analog_input_t &input, bool &state)
@@ -120,8 +120,8 @@ namespace netlist::devices {
m_RY.set_R(RY);
});
}
- m_lastx = newx;
- m_lasty = newy;
+ m_last_x = newx;
+ m_last_y = newy;
}
analog::NETLIB_SUB(R_base) m_RX;
@@ -130,8 +130,8 @@ namespace netlist::devices {
analog_input_t m_inhibit;
analog_input_t m_VEE;
param_fp_t m_base_r;
- state_var<bool> m_lastx;
- state_var<bool> m_lasty;
+ state_var<bool> m_last_x;
+ state_var<bool> m_last_y;
state_var<bool> m_select_state;
state_var<bool> m_inhibit_state;
nld_power_pins m_supply;
diff --git a/src/lib/netlist/devices/nld_74123.cpp b/src/lib/netlist/devices/nld_74123.cpp
index 1d780866f0d..81a5d3f9e0d 100644
--- a/src/lib/netlist/devices/nld_74123.cpp
+++ b/src/lib/netlist/devices/nld_74123.cpp
@@ -117,10 +117,10 @@ namespace netlist::devices {
//, m_power_pins(*this)
{
- register_subalias(pstring(D::gnd()), "RN.2");
- register_subalias(pstring(D::vcc()), "RP.1");
- register_subalias("C", "RN.2");
- register_subalias("RC", "RN.1");
+ register_sub_alias(pstring(D::gnd()), "RN.2");
+ register_sub_alias(pstring(D::vcc()), "RP.1");
+ register_sub_alias("C", "RN.2");
+ register_sub_alias("RC", "RN.1");
connect("_RP_Q", "RP.I");
connect("_RN_Q", "RN.I");
diff --git a/src/lib/netlist/devices/nld_74174.cpp b/src/lib/netlist/devices/nld_74174.cpp
index c44c6cc066a..ed45783f31e 100644
--- a/src/lib/netlist/devices/nld_74174.cpp
+++ b/src/lib/netlist/devices/nld_74174.cpp
@@ -103,46 +103,46 @@ namespace netlist::devices {
, E(*this, "E")
, F(*this, "F")
{
- register_subalias("CLRQ", "A.CLRQ");
+ register_sub_alias("CLRQ", "A.CLRQ");
connect("A.CLRQ", "B.CLRQ");
connect("A.CLRQ", "C.CLRQ");
connect("A.CLRQ", "D.CLRQ");
connect("A.CLRQ", "E.CLRQ");
connect("A.CLRQ", "F.CLRQ");
- register_subalias("CLK", "A.CLK");
+ register_sub_alias("CLK", "A.CLK");
connect("A.CLK", "B.CLK");
connect("A.CLK", "C.CLK");
connect("A.CLK", "D.CLK");
connect("A.CLK", "E.CLK");
connect("A.CLK", "F.CLK");
- register_subalias("D1", "A.D");
- register_subalias("Q1", "A.Q");
+ register_sub_alias("D1", "A.D");
+ register_sub_alias("Q1", "A.Q");
- register_subalias("D2", "B.D");
- register_subalias("Q2", "B.Q");
+ register_sub_alias("D2", "B.D");
+ register_sub_alias("Q2", "B.Q");
- register_subalias("D3", "C.D");
- register_subalias("Q3", "C.Q");
+ register_sub_alias("D3", "C.D");
+ register_sub_alias("Q3", "C.Q");
- register_subalias("D4", "D.D");
- register_subalias("Q4", "D.Q");
+ register_sub_alias("D4", "D.D");
+ register_sub_alias("Q4", "D.Q");
- register_subalias("D5", "E.D");
- register_subalias("Q5", "E.Q");
+ register_sub_alias("D5", "E.D");
+ register_sub_alias("Q5", "E.Q");
- register_subalias("D6", "F.D");
- register_subalias("Q6", "F.Q");
+ register_sub_alias("D6", "F.D");
+ register_sub_alias("Q6", "F.Q");
- register_subalias("GND", "A.GND");
+ register_sub_alias("GND", "A.GND");
connect("A.GND", "B.GND");
connect("A.GND", "C.GND");
connect("A.GND", "D.GND");
connect("A.GND", "E.GND");
connect("A.GND", "F.GND");
- register_subalias("VCC", "A.VCC");
+ register_sub_alias("VCC", "A.VCC");
connect("A.VCC", "B.VCC");
connect("A.VCC", "C.VCC");
connect("A.VCC", "D.VCC");
diff --git a/src/lib/netlist/devices/nld_7497.cpp b/src/lib/netlist/devices/nld_7497.cpp
index 3d9d51101d5..7d80c580d14 100644
--- a/src/lib/netlist/devices/nld_7497.cpp
+++ b/src/lib/netlist/devices/nld_7497.cpp
@@ -61,7 +61,7 @@ namespace netlist::devices {
, m_cnt(*this, "_m_cnt", 0)
, m_rate(*this, "_m_rate", 0)
, m_state(*this, "_m_state", 0)
- , m_lastclock(*this, "_m_lastclock", 0)
+ , m_last_clock(*this, "_m_lastclock", 0)
, m_power_pins(*this)
{
}
@@ -71,7 +71,7 @@ namespace netlist::devices {
{
m_cnt = 0;
m_rate = 0;
- m_lastclock = 0;
+ m_last_clock = 0;
}
NETLIB_HANDLERI(unity)
@@ -89,12 +89,12 @@ namespace netlist::devices {
{
netlist_sig_t clk = m_CLK();
- if (!m_lastclock && clk && !m_ENQ() && !m_CLR())
+ if (!m_last_clock && clk && !m_ENQ() && !m_CLR())
{
m_cnt++;
m_cnt &= 63;
}
- m_lastclock = clk;
+ m_last_clock = clk;
const netlist_sig_t clk_strb = (clk ^ 1) & (m_STRBQ() ^ 1);
@@ -140,7 +140,7 @@ namespace netlist::devices {
state_var_u8 m_cnt;
state_var_u8 m_rate;
state_var_sig m_state;
- state_var_sig m_lastclock;
+ state_var_sig m_last_clock;
nld_power_pins m_power_pins;
void newstate(const netlist_sig_t state)
diff --git a/src/lib/netlist/devices/nld_74ls629.cpp b/src/lib/netlist/devices/nld_74ls629.cpp
index 51b11c7fded..a09d99995a7 100644
--- a/src/lib/netlist/devices/nld_74ls629.cpp
+++ b/src/lib/netlist/devices/nld_74ls629.cpp
@@ -65,7 +65,7 @@ namespace netlist::devices {
struct SN74LS629clk
{
SN74LS629clk(device_t &owner)
- : m_FB(owner, "FB", nldelegate(&SN74LS629clk::fb, this))
+ : m_FB(owner, "FB", nl_delegate(&SN74LS629clk::fb, this))
, m_Y(owner, "Y")
, m_enableq(owner, "m_enableq", 0)
, m_out(owner, "m_out", 0)
diff --git a/src/lib/netlist/devices/nld_8277.cpp b/src/lib/netlist/devices/nld_8277.cpp
index eaebff30eec..424155656f1 100644
--- a/src/lib/netlist/devices/nld_8277.cpp
+++ b/src/lib/netlist/devices/nld_8277.cpp
@@ -84,22 +84,22 @@ namespace netlist::devices {
, m_last_CLKB(*this, "m_last_CLKB", 0)
// FIXME: needs family!
{
- register_subalias("D0A", "A.D0");
- register_subalias("D1A", "A.D1");
- register_subalias("DSA", "A.DS");
- register_subalias("Q7A", "A.Q7");
- register_subalias("Q7QA", "A.Q7Q");
- register_subalias("D0B", "B.D0");
- register_subalias("D1B", "B.D1");
- register_subalias("DSB", "B.DS");
- register_subalias("Q7B", "B.Q7");
- register_subalias("Q7QB", "B.Q7Q");
+ register_sub_alias("D0A", "A.D0");
+ register_sub_alias("D1A", "A.D1");
+ register_sub_alias("DSA", "A.DS");
+ register_sub_alias("Q7A", "A.Q7");
+ register_sub_alias("Q7QA", "A.Q7Q");
+ register_sub_alias("D0B", "B.D0");
+ register_sub_alias("D1B", "B.D1");
+ register_sub_alias("DSB", "B.DS");
+ register_sub_alias("Q7B", "B.Q7");
+ register_sub_alias("Q7QB", "B.Q7Q");
connect("A.VCC", "B.VCC");
connect("A.GND", "B.GND");
- register_subalias("VCC", "A.VCC");
- register_subalias("GND", "A.GND");
+ register_sub_alias("VCC", "A.VCC");
+ register_sub_alias("GND", "A.GND");
}
NETLIB_RESETI()
diff --git a/src/lib/netlist/devices/nld_9322.cpp b/src/lib/netlist/devices/nld_9322.cpp
index 8dee361c8bb..c7ac59be619 100644
--- a/src/lib/netlist/devices/nld_9322.cpp
+++ b/src/lib/netlist/devices/nld_9322.cpp
@@ -64,18 +64,18 @@ namespace netlist::devices {
, m_3(*this, "C")
, m_4(*this, "D")
{
- register_subalias("A1", "A.A");
- register_subalias("B1", "A.B");
- register_subalias("Y1", "A.Y");
- register_subalias("A2", "B.A");
- register_subalias("B2", "B.B");
- register_subalias("Y2", "B.Y");
- register_subalias("A3", "C.A");
- register_subalias("B3", "C.B");
- register_subalias("Y3", "C.Y");
- register_subalias("A4", "D.A");
- register_subalias("B4", "D.B");
- register_subalias("Y4", "D.Y");
+ register_sub_alias("A1", "A.A");
+ register_sub_alias("B1", "A.B");
+ register_sub_alias("Y1", "A.Y");
+ register_sub_alias("A2", "B.A");
+ register_sub_alias("B2", "B.B");
+ register_sub_alias("Y2", "B.Y");
+ register_sub_alias("A3", "C.A");
+ register_sub_alias("B3", "C.B");
+ register_sub_alias("Y3", "C.Y");
+ register_sub_alias("A4", "D.A");
+ register_sub_alias("B4", "D.B");
+ register_sub_alias("Y4", "D.Y");
connect("A.VCC", "B.VCC");
connect("A.VCC", "C.VCC");
@@ -90,10 +90,10 @@ namespace netlist::devices {
connect("A.STROBE", "C.STROBE");
connect("A.STROBE", "D.STROBE");
- register_subalias("SELECT", "A.SELECT");
- register_subalias("STROBE", "A.STROBE");
- register_subalias("GND", "A.GND");
- register_subalias("VCC", "B.VCC");
+ register_sub_alias("SELECT", "A.SELECT");
+ register_sub_alias("STROBE", "A.STROBE");
+ register_sub_alias("GND", "A.GND");
+ register_sub_alias("VCC", "B.VCC");
}
private:
diff --git a/src/lib/netlist/devices/nld_am2847.cpp b/src/lib/netlist/devices/nld_am2847.cpp
index 78627831bf6..ac2edb4f3ff 100644
--- a/src/lib/netlist/devices/nld_am2847.cpp
+++ b/src/lib/netlist/devices/nld_am2847.cpp
@@ -73,18 +73,18 @@ namespace netlist::devices {
, m_last_CP(*this, "m_last_CP", 0)
// FIXME: needs family!
{
- register_subalias("OUTA", "A.OUT");
- register_subalias("OUTB", "B.OUT");
- register_subalias("OUTC", "C.OUT");
- register_subalias("OUTD", "D.OUT");
- register_subalias("INA", "A.IN");
- register_subalias("INB", "B.IN");
- register_subalias("INC", "C.IN");
- register_subalias("IND", "D.IN");
- register_subalias("RCA", "A.RC");
- register_subalias("RCB", "B.RC");
- register_subalias("RCC", "C.RC");
- register_subalias("RCD", "D.RC");
+ register_sub_alias("OUTA", "A.OUT");
+ register_sub_alias("OUTB", "B.OUT");
+ register_sub_alias("OUTC", "C.OUT");
+ register_sub_alias("OUTD", "D.OUT");
+ register_sub_alias("INA", "A.IN");
+ register_sub_alias("INB", "B.IN");
+ register_sub_alias("INC", "C.IN");
+ register_sub_alias("IND", "D.IN");
+ register_sub_alias("RCA", "A.RC");
+ register_sub_alias("RCB", "B.RC");
+ register_sub_alias("RCC", "C.RC");
+ register_sub_alias("RCD", "D.RC");
connect("A.VSS", "B.VSS");
connect("A.VSS", "C.VSS");
@@ -93,8 +93,8 @@ namespace netlist::devices {
connect("A.VDD", "C.VDD");
connect("A.VDD", "D.VDD");
- register_subalias("VSS", "A.VSS");
- register_subalias("VDD", "A.VDD");
+ register_sub_alias("VSS", "A.VSS");
+ register_sub_alias("VDD", "A.VDD");
}
NETLIB_RESETI()
diff --git a/src/lib/netlist/devices/nld_log.cpp b/src/lib/netlist/devices/nld_log.cpp
index 6df57a0eb72..289eb28e67b 100644
--- a/src/lib/netlist/devices/nld_log.cpp
+++ b/src/lib/netlist/devices/nld_log.cpp
@@ -100,7 +100,7 @@ namespace netlist::devices {
for (auto &e : b)
/* use pstring::sprintf, it is a LOT faster */
- m_writer.writeline(plib::pfmt("{1:.9} {2}").e(e.t.as_fp<nl_fptype>()).e(e.v));
+ m_writer.write_line(plib::pfmt("{1:.9} {2}").e(e.t.as_fp<nl_fptype>()).e(e.v));
b.clear();
m_sem_r.release();
m_r++;
@@ -132,9 +132,9 @@ namespace netlist::devices {
NETLIB_OBJECT_DERIVED(logD, log)
{
NETLIB_CONSTRUCTOR(logD)
- , m_I2(*this, "I2", nldelegate(&NETLIB_NAME(logD)::input, this))
+ , m_I2(*this, "I2", nl_delegate(&NETLIB_NAME(logD)::input, this))
{
- m_I.set_delegate(nldelegate(&NETLIB_NAME(logD)::input, this));
+ m_I.set_delegate(nl_delegate(&NETLIB_NAME(logD)::input, this));
}
NETLIB_HANDLERI(input)
diff --git a/src/lib/netlist/devices/nld_mm5837.cpp b/src/lib/netlist/devices/nld_mm5837.cpp
index dfe3aa8b2d5..b1b78208b64 100644
--- a/src/lib/netlist/devices/nld_mm5837.cpp
+++ b/src/lib/netlist/devices/nld_mm5837.cpp
@@ -41,7 +41,7 @@ namespace netlist::devices {
// output
connect("_RV.2", "VDD");
- register_subalias("OUT", "_RV.1");
+ register_sub_alias("OUT", "_RV.1");
}
NETLIB_RESETI()
@@ -94,7 +94,7 @@ namespace netlist::devices {
}
- analog::NETLIB_SUB(twoterm) m_RV;
+ analog::NETLIB_SUB(two_terminal) m_RV;
analog_input_t m_VDD;
analog_input_t m_VGG;
analog_input_t m_VSS;
diff --git a/src/lib/netlist/devices/nld_ne555.cpp b/src/lib/netlist/devices/nld_ne555.cpp
index 1a7e2ecb541..5367ed0648e 100644
--- a/src/lib/netlist/devices/nld_ne555.cpp
+++ b/src/lib/netlist/devices/nld_ne555.cpp
@@ -31,11 +31,11 @@ namespace netlist::devices {
, m_undershoot(*this, "m_undershoot", 0.0)
, m_ovlimit(0.0)
{
- register_subalias("GND", "R3.2"); // Pin 1
- register_subalias("CONT", "R1.2"); // Pin 5
- register_subalias("DISCH", "RDIS.1"); // Pin 7
- register_subalias("VCC", "R1.1"); // Pin 8
- register_subalias("OUT", "ROUT.1"); // Pin 3
+ register_sub_alias("GND", "R3.2"); // Pin 1
+ register_sub_alias("CONT", "R1.2"); // Pin 5
+ register_sub_alias("DISCH", "RDIS.1"); // Pin 7
+ register_sub_alias("VCC", "R1.1"); // Pin 8
+ register_sub_alias("OUT", "ROUT.1"); // Pin 3
connect("R1.2", "R2.1");
connect("R2.2", "R3.1");
diff --git a/src/lib/netlist/devices/nld_r2r_dac.cpp b/src/lib/netlist/devices/nld_r2r_dac.cpp
index f7d49287659..e1607536db6 100644
--- a/src/lib/netlist/devices/nld_r2r_dac.cpp
+++ b/src/lib/netlist/devices/nld_r2r_dac.cpp
@@ -49,7 +49,7 @@
namespace netlist::analog {
- NETLIB_OBJECT_DERIVED(r2r_dac, twoterm)
+ NETLIB_OBJECT_DERIVED(r2r_dac, two_terminal)
{
NETLIB_CONSTRUCTOR(r2r_dac)
, m_VIN(*this, "VIN", nlconst::one())
@@ -57,8 +57,8 @@ namespace netlist::analog {
, m_num(*this, "N", 1)
, m_val(*this, "VAL", 1)
{
- register_subalias("VOUT", P());
- register_subalias("VGND", N());
+ register_sub_alias("VOUT", P());
+ register_sub_alias("VGND", N());
}
NETLIB_UPDATE_PARAMI();
diff --git a/src/lib/netlist/devices/nld_roms.cpp b/src/lib/netlist/devices/nld_roms.cpp
index 46359bf8c52..739039c6c22 100644
--- a/src/lib/netlist/devices/nld_roms.cpp
+++ b/src/lib/netlist/devices/nld_roms.cpp
@@ -169,7 +169,7 @@ namespace netlist::devices {
, m_A(*this, 0, "A{}", NETLIB_DELEGATE(addr))
, m_CEQ(*this, 1,
D::chip_enable_mask::value ^ static_cast<size_t>(0xffff), pstring("CE{}"),
- std::array<nldelegate, 3>{ NETLIB_DELEGATE(ce<0>),
+ std::array<nl_delegate, 3>{ NETLIB_DELEGATE(ce<0>),
NETLIB_DELEGATE(ce<1>),
NETLIB_DELEGATE(ce<2>)})
, m_O(*this, D::data_name_offset::value, "O{}", m_TE())
diff --git a/src/lib/netlist/devices/nld_schmitt.cpp b/src/lib/netlist/devices/nld_schmitt.cpp
index 8c9bf70d9d8..f3d3a1e7a57 100644
--- a/src/lib/netlist/devices/nld_schmitt.cpp
+++ b/src/lib/netlist/devices/nld_schmitt.cpp
@@ -62,7 +62,7 @@ namespace netlist::devices {
, m_modacc(m_stmodel)
, m_last_state(*this, "m_last_var", 1)
{
- register_subalias("Q", "RVO.1");
+ register_sub_alias("Q", "RVO.1");
connect("A", "RVI.1");
// FIXME: need a symbolic reference from connect as well
@@ -110,8 +110,8 @@ namespace netlist::devices {
analog_input_t m_A;
NETLIB_NAME(power_pins) m_supply;
- analog::NETLIB_SUB(twoterm) m_RVI;
- analog::NETLIB_SUB(twoterm) m_RVO;
+ analog::NETLIB_SUB(two_terminal) m_RVI;
+ analog::NETLIB_SUB(two_terminal) m_RVO;
param_model_t m_stmodel;
schmitt_trigger_model_t m_modacc;
state_var<int> m_last_state;
diff --git a/src/lib/netlist/devices/nld_system.cpp b/src/lib/netlist/devices/nld_system.cpp
index c12f818c7ce..0a972928fd2 100644
--- a/src/lib/netlist/devices/nld_system.cpp
+++ b/src/lib/netlist/devices/nld_system.cpp
@@ -89,9 +89,9 @@ namespace netlist::devices {
// continue with optimized clock handlers ....
if ((m_size & (m_size-1)) == 0) // power of 2?
- m_feedback.set_delegate(nldelegate(&NETLIB_NAME(extclock)::clk2_pow2, this));
+ m_feedback.set_delegate(nl_delegate(&NETLIB_NAME(extclock)::clk2_pow2, this));
else
- m_feedback.set_delegate(nldelegate(&NETLIB_NAME(extclock)::clk2, this));
+ m_feedback.set_delegate(nl_delegate(&NETLIB_NAME(extclock)::clk2, this));
}
diff --git a/src/lib/netlist/devices/nlid_proxy.cpp b/src/lib/netlist/devices/nlid_proxy.cpp
index 0b8862b99ea..96ec987df8e 100644
--- a/src/lib/netlist/devices/nlid_proxy.cpp
+++ b/src/lib/netlist/devices/nlid_proxy.cpp
@@ -83,7 +83,7 @@ namespace netlist::devices {
nld_a_to_d_proxy::nld_a_to_d_proxy(netlist_state_t &anetlist, const pstring &name, const logic_input_t *in_proxied)
: nld_base_a_to_d_proxy(anetlist, name, in_proxied)
, m_Q(*this, "Q")
- , m_I(*this, "I", nldelegate(&nld_a_to_d_proxy::input, this))
+ , m_I(*this, "I", nl_delegate(&nld_a_to_d_proxy::input, this))
{
}
@@ -115,12 +115,12 @@ namespace netlist::devices {
nld_d_to_a_proxy::nld_d_to_a_proxy(netlist_state_t &anetlist, const pstring &name, const logic_output_t *out_proxied)
: nld_base_d_to_a_proxy(anetlist, name, out_proxied)
- , m_I(*this, "I", nldelegate(&nld_d_to_a_proxy :: input, this))
+ , m_I(*this, "I", nl_delegate(&nld_d_to_a_proxy :: input, this))
, m_RP(*this, "RP")
, m_RN(*this, "RN")
, m_last_state(*this, "m_last_var", terminal_t::OUT_TRISTATE())
{
- register_subalias("Q", "RN.1");
+ register_sub_alias("Q", "RN.1");
connect(m_RN.N(), *m_tn);
connect(m_RP.P(), *m_tp);
diff --git a/src/lib/netlist/devices/nlid_proxy.h b/src/lib/netlist/devices/nlid_proxy.h
index 89ea6069b0d..aea5b6f11d8 100644
--- a/src/lib/netlist/devices/nlid_proxy.h
+++ b/src/lib/netlist/devices/nlid_proxy.h
@@ -115,8 +115,8 @@ namespace netlist::devices {
static constexpr const nl_fptype G_OFF = nlconst::cgmin();
logic_input_t m_I;
- analog::NETLIB_NAME(twoterm) m_RP;
- analog::NETLIB_NAME(twoterm) m_RN;
+ analog::NETLIB_NAME(two_terminal) m_RP;
+ analog::NETLIB_NAME(two_terminal) m_RN;
state_var<netlist_sig_t> m_last_state;
};
diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h
index 7bed7a245a2..c87bbcfbd9b 100644
--- a/src/lib/netlist/devices/nlid_system.h
+++ b/src/lib/netlist/devices/nlid_system.h
@@ -56,7 +56,7 @@ namespace netlist::devices {
};
// -----------------------------------------------------------------------------
- // varclock
+ // variable clock
// -----------------------------------------------------------------------------
NETLIB_OBJECT(varclock)
@@ -71,17 +71,24 @@ namespace netlist::devices {
{
if (!m_func().empty())
{
- std::vector<pstring> inps;
- inps.emplace_back("T");
+ std::vector<pstring> inputs;
+
+ m_I.reserve(m_N());
+ inputs.reserve(m_N() + 1);
+ m_vals.reserve(m_N() + 1);
+
+ // add time parameter to the front
+ inputs.emplace_back("T");
m_vals.push_back(nlconst::zero());
- for (int i=0; i < m_N(); i++)
+
+ for (std::uint64_t i=0; i < m_N(); i++)
{
- pstring inpname = plib::pfmt("A{1}")(i);
- m_I.push_back(owner.template make_pool_object<analog_input_t>(*this, inpname, NETLIB_DELEGATE(fb)));
- inps.push_back(inpname);
+ pstring input_name = plib::pfmt("A{1}")(i);
+ m_I.push_back(owner.template make_pool_object<analog_input_t>(*this, input_name, NETLIB_DELEGATE(fb)));
+ inputs.push_back(input_name);
m_vals.push_back(nlconst::zero());
}
- m_compiled->compile(m_func(), inps);
+ m_compiled->compile(m_func(), inputs);
}
connect("FB", "Q");
}
@@ -101,7 +108,7 @@ namespace netlist::devices {
}
using pf_type = plib::pfunction<nl_fptype>;
- param_int_t m_N;
+ param_num_t<std::uint64_t> m_N;
param_str_t m_func;
logic_input_t m_feedback;
logic_output_t m_Q;
@@ -242,12 +249,12 @@ namespace netlist::devices {
, m_p_ROUT(*this, "ROUT", nlconst::magic(50.0))
{
- register_subalias("I", "m_RIN.1");
- register_subalias("G", "m_RIN.2");
+ register_sub_alias("I", "m_RIN.1");
+ register_sub_alias("G", "m_RIN.2");
connect("_I", "m_RIN.1");
- register_subalias("_OP", "m_ROUT.1");
- register_subalias("Q", "m_ROUT.2");
+ register_sub_alias("_OP", "m_ROUT.1");
+ register_sub_alias("Q", "m_ROUT.2");
connect("_Q", "m_ROUT.1");
}
@@ -264,8 +271,8 @@ namespace netlist::devices {
m_Q.push(m_I());
}
- analog::NETLIB_NAME(twoterm) m_RIN;
- analog::NETLIB_NAME(twoterm) m_ROUT;
+ analog::NETLIB_NAME(two_terminal) m_RIN;
+ analog::NETLIB_NAME(two_terminal) m_ROUT;
analog_input_t m_I;
analog_output_t m_Q;
@@ -281,21 +288,26 @@ namespace netlist::devices {
{
NETLIB_CONSTRUCTOR(function)
, m_N(*this, "N", 1)
- , m_func(*this, "FUNC", "A0")
+ , m_function(*this, "FUNC", "A0")
, m_thresh(*this, "THRESH", nlconst::zero())
, m_Q(*this, "Q")
, m_compiled(*this, "m_compiled")
, m_last(*this, "m_last")
{
- std::vector<pstring> inps;
- for (int i=0; i < m_N(); i++)
+ std::vector<pstring> inputs;
+
+ m_I.reserve(m_N());
+ inputs.reserve(m_N());
+ m_values.reserve(m_N());
+
+ for (uint64_t i=0; i < m_N(); i++)
{
- pstring inpname = plib::pfmt("A{1}")(i);
- m_I.push_back(owner.template make_pool_object<analog_input_t>(*this, inpname, NETLIB_DELEGATE(inputs)));
- inps.push_back(inpname);
- m_vals.push_back(nlconst::zero());
+ pstring input_name = plib::pfmt("A{1}")(i);
+ m_I.push_back(owner.template make_pool_object<analog_input_t>(*this, input_name, NETLIB_DELEGATE(inputs)));
+ inputs.push_back(input_name);
+ m_values.push_back(nlconst::zero());
}
- m_compiled->compile(m_func(), inps);
+ m_compiled->compile(m_function(), inputs);
}
protected:
@@ -308,9 +320,9 @@ namespace netlist::devices {
{
for (std::size_t i = 0; i < static_cast<unsigned>(m_N()); i++)
{
- m_vals[i] = (*m_I[i])();
+ m_values[i] = (*m_I[i])();
}
- auto result = m_compiled->evaluate(m_vals);
+ auto result = m_compiled->evaluate(m_values);
if (plib::abs(m_last - result) >= m_thresh)
{
m_Q.push(result);
@@ -320,13 +332,13 @@ namespace netlist::devices {
private:
using pf_type = plib::pfunction<nl_fptype>;
- param_int_t m_N;
- param_str_t m_func;
+ param_num_t<std::uint64_t> m_N;
+ param_str_t m_function;
param_fp_t m_thresh;
analog_output_t m_Q;
std::vector<device_arena::unique_ptr<analog_input_t>> m_I;
- pf_type::values_container m_vals;
+ pf_type::values_container m_values;
state_var<pf_type> m_compiled;
state_var<nl_fptype> m_last;
@@ -345,8 +357,8 @@ namespace netlist::devices {
, m_I(*this, "I", NETLIB_DELEGATE(input))
, m_last_state(*this, "m_last_state", 0)
{
- register_subalias("1", "_R.1");
- register_subalias("2", "_R.2");
+ register_sub_alias("1", "_R.1");
+ register_sub_alias("2", "_R.2");
}
NETLIB_RESETI()
@@ -403,9 +415,9 @@ namespace netlist::devices {
, m_power_pins(*this)
{
// connect and register pins
- register_subalias("1", "_R1.1");
- register_subalias("2", "_R1.2");
- register_subalias("3", "_R2.2");
+ register_sub_alias("1", "_R1.1");
+ register_sub_alias("2", "_R1.2");
+ register_sub_alias("3", "_R2.2");
connect("_R1.2", "_R2.1");
}
@@ -550,8 +562,8 @@ namespace netlist::devices {
, m_dis(*this, "m_dis",m_sigma())
{
- register_subalias("1", "m_T.1");
- register_subalias("2", "m_T.2");
+ register_sub_alias("1", "m_T.1");
+ register_sub_alias("2", "m_T.2");
}
private:
@@ -569,7 +581,7 @@ namespace netlist::devices {
m_T.set_G_V_I(plib::reciprocal(m_RI()), nlconst::zero(), nlconst::zero());
}
- analog::NETLIB_SUB(twoterm) m_T;
+ analog::NETLIB_SUB(two_terminal) m_T;
logic_input_t m_I;
param_fp_t m_RI;
param_fp_t m_sigma;
diff --git a/src/lib/netlist/devices/nlid_truthtable.cpp b/src/lib/netlist/devices/nlid_truthtable.cpp
index 5244814aebc..8192222c236 100644
--- a/src/lib/netlist/devices/nlid_truthtable.cpp
+++ b/src/lib/netlist/devices/nlid_truthtable.cpp
@@ -15,7 +15,7 @@
namespace netlist::devices {
template<std::size_t m_NI, std::size_t m_NO>
- class NETLIB_NAME(truthtable_t) : public device_t
+ class NETLIB_NAME(truth_table_t) : public device_t
{
public:
@@ -25,9 +25,9 @@ namespace netlist::devices {
static constexpr const std::size_t m_size = (1 << (m_num_bits));
static constexpr const type_t m_outmask = ((1 << m_NO) - 1);
- struct truthtable_t
+ struct truth_table_t
{
- truthtable_t()
+ truth_table_t()
: m_timing_index{0}
{}
@@ -37,9 +37,9 @@ namespace netlist::devices {
};
template <class C>
- nld_truthtable_t(C &owner, const pstring &name,
+ nld_truth_table_t(C &owner, const pstring &name,
const pstring &model,
- truthtable_t &ttp, const std::vector<pstring> &desc)
+ truth_table_t &ttp, const std::vector<pstring> &desc)
: device_t(owner, name, model)
#if USE_TT_ALTERNATIVE
, m_state(*this, "m_state", 0)
@@ -49,7 +49,7 @@ namespace netlist::devices {
/* FIXME: the family should provide the names of the power-terminals! */
, m_power_pins(*this)
{
- m_activate = activate_delegate(& NETLIB_NAME(truthtable_t) :: incdec_active, this);
+ m_activate = activate_delegate(& NETLIB_NAME(truth_table_t) :: incdec_active, this);
set_hint_deactivate(true);
init(desc);
}
@@ -117,7 +117,7 @@ namespace netlist::devices {
void process() noexcept
{
netlist_time_ext mt(netlist_time_ext::zero());
- type_t nstate(0);
+ type_t new_state(0);
type_t ign(m_ign);
if (doOUT)
@@ -127,16 +127,16 @@ namespace netlist::devices {
if (ign & 1)
I->activate();
for (std::size_t i = 0; i < m_NI; i++)
- nstate |= (m_I[i]() << i);
+ new_state |= (m_I[i]() << i);
#else
- nstate = m_state;
+ new_state = m_state;
for (std::size_t i = 0; ign != 0; ign >>= 1, ++i)
{
if (ign & 1)
{
- nstate &= ~(1 << i);
+ new_state &= ~(1 << i);
m_I[i].activate();
- nstate |= (m_I[i]() << i);
+ new_state |= (m_I[i]() << i);
}
}
#endif
@@ -145,16 +145,16 @@ namespace netlist::devices {
for (std::size_t i = 0; i < m_NI; i++)
{
m_I[i].activate();
- nstate |= (m_I[i]() << i);
+ new_state |= (m_I[i]() << i);
mt = std::max(this->m_I[i].net().next_scheduled_time(), mt);
}
- const type_t outstate(m_ttp.m_out_state[nstate]);
- type_t out(outstate & m_outmask);
+ const type_t output_state(m_ttp.m_out_state[new_state]);
+ type_t out(output_state & m_outmask);
- m_ign = outstate >> m_NO;
+ m_ign = output_state >> m_NO;
- const auto *t(&m_ttp.m_timing_index[nstate * m_NO]);
+ const auto *t(&m_ttp.m_timing_index[new_state * m_NO]);
if (doOUT)
//for (std::size_t i = 0; i < m_NO; ++i)
@@ -172,7 +172,7 @@ namespace netlist::devices {
if (ign & 1)
I->inactivate();
#if USE_TT_ALTERNATIVE
- m_state = nstate;
+ m_state = new_state;
#endif
}
@@ -199,7 +199,7 @@ namespace netlist::devices {
state_var<type_t> m_state;
#endif
state_var<type_t> m_ign;
- const truthtable_t m_ttp;
+ const truth_table_t m_ttp;
/* FIXME: the family should provide the names of the power-terminals! */
nld_power_pins m_power_pins;
};
@@ -332,9 +332,9 @@ namespace netlist::devices {
size_t m_size;
};
- struct truthtable_parser
+ struct truth_table_parser
{
- truthtable_parser(unsigned NO, unsigned NI,
+ truth_table_parser(unsigned NO, unsigned NI,
packed_int outs, uint_least8_t *timing, netlist_time *timing_nt)
: m_NO(NO)
, m_NI(NI)
@@ -349,7 +349,7 @@ namespace netlist::devices {
void parse(const std::vector<pstring> &truthtable);
private:
- void parseline(unsigned cur, std::vector<pstring> list,
+ void parse_line(unsigned cur, std::vector<pstring> list,
tt_bitset state, std::uint_least64_t val, std::vector<uint_least8_t> &timing_index);
tt_bitset calculate_ignored_inputs(tt_bitset state) const;
@@ -370,7 +370,7 @@ namespace netlist::devices {
// ----------------------------------------------------------------------------------------
template<std::size_t m_NI, std::size_t m_NO>
- void NETLIB_NAME(truthtable_t)<m_NI, m_NO>::init(const std::vector<pstring> &desc)
+ void NETLIB_NAME(truth_table_t)<m_NI, m_NO>::init(const std::vector<pstring> &desc)
{
pstring header = desc[0];
@@ -386,7 +386,7 @@ namespace netlist::devices {
for (std::size_t i=0; i < m_NI; i++)
{
inout[i] = plib::trim(inout[i]);
- m_I.emplace_back(*this, inout[i], nldelegate(&NETLIB_NAME(truthtable_t)<m_NI, m_NO> :: inputs, this));
+ m_I.emplace_back(*this, inout[i], nl_delegate(&NETLIB_NAME(truth_table_t)<m_NI, m_NO> :: inputs, this));
}
#else
for (std::size_t i=0; i < m_NI; i++)
@@ -425,22 +425,22 @@ namespace netlist::devices {
// ----------------------------------------------------------------------------------------
template<unsigned m_NI, unsigned m_NO>
- class netlist_factory_truthtable_t : public factory::truthtable_base_element_t
+ class netlist_factory_truth_table_t : public factory::truth_table_base_element_t
{
public:
- netlist_factory_truthtable_t(const pstring &name,
+ netlist_factory_truth_table_t(const pstring &name,
factory::properties &&props)
- : truthtable_base_element_t(name, std::move(props))
+ : truth_table_base_element_t(name, std::move(props))
{ }
device_arena::unique_ptr<core_device_t> make_device(device_arena &pool, netlist_state_t &anetlist, const pstring &name) override
{
- using tt_type = nld_truthtable_t<m_NI, m_NO>;
+ using tt_type = nld_truth_table_t<m_NI, m_NO>;
if (!m_ttbl)
{
- m_ttbl = plib::make_unique<typename nld_truthtable_t<m_NI, m_NO>::truthtable_t>(pool);
- truthtable_parser desc_s(m_NO, m_NI,
+ m_ttbl = plib::make_unique<typename nld_truth_table_t<m_NI, m_NO>::truth_table_t>(pool);
+ truth_table_parser desc_s(m_NO, m_NI,
packed_int(m_ttbl->m_out_state.data(), sizeof(m_ttbl->m_out_state[0]) * 8),
m_ttbl->m_timing_index.data(), m_ttbl->m_timing_nt.data());
@@ -450,10 +450,10 @@ namespace netlist::devices {
return plib::make_unique<tt_type>(pool, anetlist, name, m_family_name, *m_ttbl, m_desc);
}
private:
- device_arena::unique_ptr<typename nld_truthtable_t<m_NI, m_NO>::truthtable_t> m_ttbl;
+ device_arena::unique_ptr<typename nld_truth_table_t<m_NI, m_NO>::truth_table_t> m_ttbl;
};
- tt_bitset truthtable_parser::calculate_ignored_inputs(tt_bitset state) const
+ tt_bitset truth_table_parser::calculate_ignored_inputs(tt_bitset state) const
{
// Determine all inputs which may be ignored ...
tt_bitset ignore = 0;
@@ -515,7 +515,7 @@ namespace netlist::devices {
// parse line
// ----------------------------------------------------------------------------------------
- void truthtable_parser::parseline(unsigned cur, std::vector<pstring> list,
+ void truth_table_parser::parse_line(unsigned cur, std::vector<pstring> list,
tt_bitset state, std::uint_least64_t val, std::vector<uint_least8_t> &timing_index)
{
pstring elem = plib::trim(list[cur]);
@@ -541,28 +541,28 @@ namespace netlist::devices {
nl_assert_always(false, "unknown input value (not 0, 1, or X)");
for (std::uint_least64_t i = start; i <= end; i++)
{
- tt_bitset nstate = state;
+ tt_bitset new_state = state;
if (i==1)
- nstate.set(cur);
+ new_state.set(cur);
if (cur < m_num_bits - 1)
{
- parseline(cur + 1, list, nstate, val, timing_index);
+ parse_line(cur + 1, list, new_state, val, timing_index);
}
else
{
// cutoff previous inputs and outputs for ignore
- if (m_out_state[nstate] != m_out_state.mask() && m_out_state[nstate] != val)
+ if (m_out_state[new_state] != m_out_state.mask() && m_out_state[new_state] != val)
throw nl_exception(plib::pfmt("Error in truth table: State {1:04} already set, {2} != {3}\n")
- .x(nstate.as_uint())(m_out_state[nstate])(val) );
- m_out_state.set(nstate, val);
+ .x(new_state.as_uint())(m_out_state[new_state])(val) );
+ m_out_state.set(new_state, val);
for (std::size_t j=0; j<m_NO; j++)
- m_timing[nstate * m_NO + j] = timing_index[j];
+ m_timing[new_state * m_NO + j] = timing_index[j];
}
}
}
- void truthtable_parser::parse(const std::vector<pstring> &truthtable)
+ void truth_table_parser::parse(const std::vector<pstring> &truthtable)
{
unsigned line = 0;
@@ -613,7 +613,7 @@ namespace netlist::devices {
tindex.push_back(k); //[j] = k;
}
- parseline(0, inout, 0 , val, tindex);
+ parse_line(0, inout, 0 , val, tindex);
if (line < truthtable.size())
ttline = truthtable[line];
else
@@ -658,7 +658,7 @@ namespace netlist::devices {
namespace netlist::factory {
- truthtable_base_element_t::truthtable_base_element_t(const pstring &name,
+ truth_table_base_element_t::truth_table_base_element_t(const pstring &name,
properties &&props)
: factory::element_t(name, std::move(props))
, m_family_name(config::DEFAULT_LOGIC_FAMILY())
@@ -666,7 +666,7 @@ namespace netlist::factory {
}
#define ENTRYY(n, m, s) case (n * 100 + m): \
- { using xtype = devices::netlist_factory_truthtable_t<n, m>; \
+ { using xtype = devices::netlist_factory_truth_table_t<n, m>; \
auto cs=s; \
ret = plib::make_unique<xtype, host_arena>(desc.name, std::move(cs)); } \
break
@@ -676,9 +676,9 @@ namespace netlist::factory {
ENTRYY(n, 7, s); ENTRYY(n, 8, s); ENTRYY(n, 9, s); \
ENTRYY(n, 10, s)
- host_arena::unique_ptr<truthtable_base_element_t> truthtable_create(tt_desc &desc, properties &&props)
+ host_arena::unique_ptr<truth_table_base_element_t> truth_table_create(tt_desc &desc, properties &&props)
{
- host_arena::unique_ptr<truthtable_base_element_t> ret;
+ host_arena::unique_ptr<truth_table_base_element_t> ret;
switch (desc.ni * 100 + desc.no)
{
diff --git a/src/lib/netlist/devices/nlid_truthtable.h b/src/lib/netlist/devices/nlid_truthtable.h
index c889ba2cf48..a7e4d7a327d 100644
--- a/src/lib/netlist/devices/nlid_truthtable.h
+++ b/src/lib/netlist/devices/nlid_truthtable.h
@@ -16,16 +16,16 @@
namespace netlist::factory {
- class truthtable_base_element_t : public factory::element_t
+ class truth_table_base_element_t : public factory::element_t
{
public:
- truthtable_base_element_t(const pstring &name,properties &&props);
+ truth_table_base_element_t(const pstring &name,properties &&props);
std::vector<pstring> m_desc;
pstring m_family_name;
};
- host_arena::unique_ptr<truthtable_base_element_t> truthtable_create(tt_desc &desc,
+ host_arena::unique_ptr<truth_table_base_element_t> truth_table_create(tt_desc &desc,
properties &&props);
} // namespace netlist::factory
diff --git a/src/lib/netlist/examples/lostfound.cpp b/src/lib/netlist/examples/lostfound.cpp
index ef6b5cf1e9e..d7d2a94ac66 100644
--- a/src/lib/netlist/examples/lostfound.cpp
+++ b/src/lib/netlist/examples/lostfound.cpp
@@ -162,7 +162,7 @@ NETLIB_OBJECT(CD4066_GATE_DYNAMIC)
, m_last(*this, "m_last", false)
, m_supply(*this)
{
- register_subalias("CTL", m_DUM1.P());
+ register_sub_alias("CTL", m_DUM1.P());
connect(m_DUM1.P(), m_DUM2.P());
connect(m_DUM1.N(), m_R.P());
diff --git a/src/lib/netlist/generated/nld_devinc.h b/src/lib/netlist/generated/nld_devinc.h
index ffe98877e29..3442ec3ed93 100644
--- a/src/lib/netlist/generated/nld_devinc.h
+++ b/src/lib/netlist/generated/nld_devinc.h
@@ -1,3 +1,14 @@
+// license:BSD-3-Clause
+// copyright-holders:Couriersud
+
+#ifndef NLD_DEVINC_H
+#define NLD_DEVINC_H
+
+#ifndef __PLIB_PREPROCESSOR__
+
+
+#include "../nl_setup.h"
+
// ---------------------------------------------------------------------
// Source: ../analog/nld_bjt.cpp
// ---------------------------------------------------------------------
@@ -1590,3 +1601,7 @@ NETLIST_EXTERNAL(ttl74xx_lib)
#define SOLVER(...) \
NET_REGISTER_DEVEXT(SOLVER, __VA_ARGS__)
+#endif // __PLIB_PREPROCESSOR__
+
+#endif // NLD_DEVINC_H
+
diff --git a/src/lib/netlist/generated/nlm_modules_lib.cpp b/src/lib/netlist/generated/nlm_modules_lib.cpp
index a8a563d8b93..ad8f77a3d8b 100644
--- a/src/lib/netlist/generated/nlm_modules_lib.cpp
+++ b/src/lib/netlist/generated/nlm_modules_lib.cpp
@@ -1,7 +1,7 @@
// license:CC0
// copyright-holders:Couriersud
-// File programmatically created Sun May 22 09:38:02 2022
+// File programmatically created Sun May 22 19:30:34 2022
#include "devices/net_lib.h"
diff --git a/src/lib/netlist/generated/static_solvers.cpp b/src/lib/netlist/generated/static_solvers.cpp
index ce58a075fa7..aab9bedc898 100644
--- a/src/lib/netlist/generated/static_solvers.cpp
+++ b/src/lib/netlist/generated/static_solvers.cpp