From 7079d0f5fece7ba0d29849058b5e86925b52849a Mon Sep 17 00:00:00 2001 From: couriersud Date: Thu, 10 Jan 2019 02:07:14 +0100 Subject: Move information where it belongs ... into the drivers. (nw) --- src/lib/netlist/devices/nld_system.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/lib/netlist/devices/nld_system.cpp') diff --git a/src/lib/netlist/devices/nld_system.cpp b/src/lib/netlist/devices/nld_system.cpp index eabc4b4fbff..fa3726340a0 100644 --- a/src/lib/netlist/devices/nld_system.cpp +++ b/src/lib/netlist/devices/nld_system.cpp @@ -141,17 +141,17 @@ namespace netlist } - NETLIB_DEVICE_IMPL(dummy_input) - NETLIB_DEVICE_IMPL(frontier) - NETLIB_DEVICE_IMPL(function) - NETLIB_DEVICE_IMPL(logic_input) - NETLIB_DEVICE_IMPL(analog_input) - NETLIB_DEVICE_IMPL(clock) - NETLIB_DEVICE_IMPL(extclock) - NETLIB_DEVICE_IMPL(res_sw) - NETLIB_DEVICE_IMPL(mainclock) - NETLIB_DEVICE_IMPL(gnd) - NETLIB_DEVICE_IMPL(netlistparams) + NETLIB_DEVICE_IMPL_DEPRECATED(dummy_input) + NETLIB_DEVICE_IMPL_DEPRECATED(frontier) + NETLIB_DEVICE_IMPL_DEPRECATED(function) + NETLIB_DEVICE_IMPL_DEPRECATED(logic_input) + NETLIB_DEVICE_IMPL_DEPRECATED(analog_input) + NETLIB_DEVICE_IMPL_DEPRECATED(clock) + NETLIB_DEVICE_IMPL_DEPRECATED(extclock) + NETLIB_DEVICE_IMPL_DEPRECATED(res_sw) + NETLIB_DEVICE_IMPL_DEPRECATED(mainclock) + NETLIB_DEVICE_IMPL_DEPRECATED(gnd) + NETLIB_DEVICE_IMPL_DEPRECATED(netlistparams) } //namespace devices } // namespace netlist -- cgit v1.2.3-70-g09d2 From b4ba8dc55210a81b03ee0b45bcd36478cfc66dd4 Mon Sep 17 00:00:00 2001 From: couriersud Date: Fri, 1 Feb 2019 02:07:30 +0100 Subject: netlist: code maintenance and fixing kidniki ... (nw) to run at acceptable speed again. --- src/devices/machine/netlist.cpp | 12 ++-- src/devices/machine/netlist.h | 2 +- src/lib/netlist/analog/nld_switches.cpp | 29 +++++++--- src/lib/netlist/analog/nlid_fourterm.cpp | 10 ---- src/lib/netlist/analog/nlid_fourterm.h | 4 +- src/lib/netlist/analog/nlid_twoterm.cpp | 85 ++++------------------------ src/lib/netlist/analog/nlid_twoterm.h | 52 +++++++++++++---- src/lib/netlist/devices/nld_7475.cpp | 2 +- src/lib/netlist/devices/nld_74ls629.cpp | 5 +- src/lib/netlist/devices/nld_r2r_dac.cpp | 2 +- src/lib/netlist/devices/nld_system.cpp | 37 ------------ src/lib/netlist/devices/nlid_proxy.cpp | 5 -- src/lib/netlist/devices/nlid_system.h | 16 +++--- src/lib/netlist/devices/nlid_truthtable.cpp | 9 --- src/lib/netlist/nl_base.cpp | 23 +++----- src/lib/netlist/nl_base.h | 22 +++---- src/lib/netlist/nl_factory.cpp | 4 -- src/lib/netlist/plib/gmres.h | 1 - src/lib/netlist/plib/palloc.cpp | 3 +- src/lib/netlist/plib/pfunction.cpp | 1 - src/lib/netlist/plib/pstate.cpp | 1 - src/lib/netlist/plib/pstream.cpp | 1 - src/lib/netlist/plib/putil.cpp | 4 +- src/lib/netlist/prg/nltool.cpp | 4 -- src/lib/netlist/solver/nld_matrix_solver.cpp | 18 +++--- src/lib/netlist/solver/nld_matrix_solver.h | 4 +- src/lib/netlist/solver/nld_ms_sor_mat.h | 2 - src/lib/netlist/solver/nld_solver.cpp | 9 +-- src/lib/netlist/tools/nl_convert.cpp | 1 - src/mame/audio/nl_kidniki.cpp | 6 +- 30 files changed, 137 insertions(+), 237 deletions(-) (limited to 'src/lib/netlist/devices/nld_system.cpp') diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp index 9f588368f8e..6795dcb9d6a 100644 --- a/src/devices/machine/netlist.cpp +++ b/src/devices/machine/netlist.cpp @@ -144,7 +144,7 @@ public: // avoid calls due to noise if (std::fabs(cur - m_last) > 1e-6) { - m_cpu_device->update_icount(); + m_cpu_device->update_icount(exec().time()); m_callback(cur, m_cpu_device->local_time()); m_cpu_device->check_mame_abort_slice(); m_last = cur; @@ -192,7 +192,7 @@ public: // avoid calls due to noise if (cur != m_last) { - m_cpu_device->update_icount(); + m_cpu_device->update_icount(exec().time()); m_callback(cur, m_cpu_device->local_time()); m_cpu_device->check_mame_abort_slice(); m_last = cur; @@ -933,9 +933,9 @@ ATTR_COLD void netlist_mame_device::device_pre_save() netlist().run_state_manager().pre_save(); } -void netlist_mame_device::update_icount() +void netlist_mame_device::update_icount(netlist::netlist_time time) { - const netlist::netlist_time newt(netlist().time()); + const netlist::netlist_time newt(time); const netlist::netlist_time delta(newt - m_old + m_rem); const uint64_t d = delta / m_div; m_old = newt; @@ -1061,13 +1061,13 @@ ATTR_HOT void netlist_mame_cpu_device::execute_run() m_genPC &= 255; debugger_instruction_hook(m_genPC); netlist().process_queue(m_div); - update_icount(); + update_icount(netlist().time()); } } else { netlist().process_queue(m_div * m_icount); - update_icount(); + update_icount(netlist().time()); } } diff --git a/src/devices/machine/netlist.h b/src/devices/machine/netlist.h index 68723c0d982..d79e9e298c2 100644 --- a/src/devices/machine/netlist.h +++ b/src/devices/machine/netlist.h @@ -110,7 +110,7 @@ public: ATTR_HOT inline netlist_mame_t &netlist() { return *m_netlist; } ATTR_HOT inline const netlist::netlist_time last_time_update() { return m_old; } - ATTR_HOT void update_icount(); + ATTR_HOT void update_icount(netlist::netlist_time time); ATTR_HOT void check_mame_abort_slice(); static void register_memregion_source(netlist::setup_t &setup, const char *name); diff --git a/src/lib/netlist/analog/nld_switches.cpp b/src/lib/netlist/analog/nld_switches.cpp index 042b61ce7e7..1ecfae06f9d 100644 --- a/src/lib/netlist/analog/nld_switches.cpp +++ b/src/lib/netlist/analog/nld_switches.cpp @@ -49,6 +49,11 @@ namespace netlist NETLIB_UPDATE(switch1) { + } + + NETLIB_UPDATE_PARAM(switch1) + { + m_R.solve_now(); if (!m_POS()) { m_R.set_R(R_OFF); @@ -58,12 +63,6 @@ namespace netlist m_R.set_R(R_ON); } - m_R.update_dev(); - } - - NETLIB_UPDATE_PARAM(switch1) - { - update(); } // ---------------------------------------------------------------------------------------- @@ -113,13 +112,25 @@ namespace netlist m_R2.set_R(R_ON); } - m_R1.update_dev(); - m_R2.update_dev(); + //m_R1.update_dev(time); + //m_R2.update_dev(time); } NETLIB_UPDATE_PARAM(switch2) { - update(); + if (!m_POS()) + { + m_R1.set_R(R_ON); + m_R2.set_R(R_OFF); + } + else + { + m_R1.set_R(R_OFF); + m_R2.set_R(R_ON); + } + + m_R1.solve_now(); + m_R2.solve_now(); } } //namespace analog diff --git a/src/lib/netlist/analog/nlid_fourterm.cpp b/src/lib/netlist/analog/nlid_fourterm.cpp index aa2723fe8e1..89784812fbe 100644 --- a/src/lib/netlist/analog/nlid_fourterm.cpp +++ b/src/lib/netlist/analog/nlid_fourterm.cpp @@ -63,11 +63,6 @@ NETLIB_UPDATE_PARAM(LVCCS) NETLIB_NAME(VCCS)::update_param(); } -NETLIB_UPDATE(LVCCS) -{ - NETLIB_NAME(VCCS)::update(); -} - NETLIB_UPDATE_TERMINALS(LVCCS) { const nl_double m_mult = m_G() * m_gfac; // 1.0 ==> 1V ==> 1A @@ -105,11 +100,6 @@ NETLIB_UPDATE_PARAM(CCCS) NETLIB_NAME(VCCS)::update_param(); } -NETLIB_UPDATE(CCCS) -{ - NETLIB_NAME(VCCS)::update(); -} - // ---------------------------------------------------------------------------------------- // nld_VCVS // ---------------------------------------------------------------------------------------- diff --git a/src/lib/netlist/analog/nlid_fourterm.h b/src/lib/netlist/analog/nlid_fourterm.h index 641fc72427b..a0984221cae 100644 --- a/src/lib/netlist/analog/nlid_fourterm.h +++ b/src/lib/netlist/analog/nlid_fourterm.h @@ -101,7 +101,7 @@ namespace netlist { param_double_t m_cur_limit; /* current limit */ protected: - NETLIB_UPDATEI(); + //NETLIB_UPDATEI(); NETLIB_RESETI(); NETLIB_UPDATE_PARAMI(); NETLIB_UPDATE_TERMINALSI(); @@ -141,7 +141,7 @@ namespace netlist { } protected: - NETLIB_UPDATEI(); + //NETLIB_UPDATEI(); NETLIB_RESETI(); NETLIB_UPDATE_PARAMI(); }; diff --git a/src/lib/netlist/analog/nlid_twoterm.cpp b/src/lib/netlist/analog/nlid_twoterm.cpp index 0f6fc3688c2..3b57279ffca 100644 --- a/src/lib/netlist/analog/nlid_twoterm.cpp +++ b/src/lib/netlist/analog/nlid_twoterm.cpp @@ -83,9 +83,8 @@ void generic_diode::update_diode(const nl_double nVd) // nld_twoterm // ---------------------------------------------------------------------------------------- -NETLIB_UPDATE(twoterm) +void NETLIB_NAME(twoterm)::solve_now() { - /* only called if connected to a rail net ==> notify the solver to recalculate */ /* we only need to call the non-rail terminal */ if (m_P.has_net() && !m_P.net().isRailNet()) m_P.solve_now(); @@ -93,6 +92,13 @@ NETLIB_UPDATE(twoterm) m_N.solve_now(); } + +NETLIB_UPDATE(twoterm) +{ + /* only called if connected to a rail net ==> notify the solver to recalculate */ + solve_now(); +} + // ---------------------------------------------------------------------------------------- // nld_R_base // ---------------------------------------------------------------------------------------- @@ -103,18 +109,13 @@ NETLIB_RESET(R_base) set_R(1.0 / exec().gmin()); } -NETLIB_UPDATE(R_base) -{ - NETLIB_NAME(twoterm)::update(); -} - // ---------------------------------------------------------------------------------------- // nld_R // ---------------------------------------------------------------------------------------- NETLIB_UPDATE_PARAM(R) { - update_dev(); + solve_now(); set_R(std::max(m_R(), exec().gmin())); } @@ -140,8 +141,8 @@ NETLIB_RESET(POT) NETLIB_UPDATE_PARAM(POT) { - m_R1.update_dev(); - m_R2.update_dev(); + m_R1.solve_now(); + m_R2.solve_now(); nl_double v = m_Dial(); if (m_DialIsLog()) @@ -170,7 +171,7 @@ NETLIB_RESET(POT2) NETLIB_UPDATE_PARAM(POT2) { - m_R1.update_dev(); + m_R1.solve_now(); nl_double v = m_Dial(); @@ -197,11 +198,6 @@ NETLIB_UPDATE_PARAM(C) m_GParallel = exec().gmin(); } -NETLIB_UPDATE(C) -{ - NETLIB_NAME(twoterm)::update(); -} - NETLIB_TIMESTEP(C) { /* Gpar should support convergence */ @@ -230,11 +226,6 @@ NETLIB_UPDATE_PARAM(L) { } -NETLIB_UPDATE(L) -{ - NETLIB_NAME(twoterm)::update(); -} - NETLIB_TIMESTEP(L) { /* Gpar should support convergence */ @@ -266,11 +257,6 @@ NETLIB_UPDATE_PARAM(D) m_D.set_param(Is, n, exec().gmin()); } -NETLIB_UPDATE(D) -{ - NETLIB_NAME(twoterm)::update(); -} - NETLIB_UPDATE_TERMINALS(D) { m_D.update_diode(deltaV()); @@ -281,53 +267,6 @@ NETLIB_UPDATE_TERMINALS(D) //set(m_D.G(), 0.0, m_D.Ieq()); } -// ---------------------------------------------------------------------------------------- -// nld_VS -// ---------------------------------------------------------------------------------------- - -NETLIB_RESET(VS) -{ - NETLIB_NAME(twoterm)::reset(); - this->set(1.0 / m_R(), m_V(), 0.0); -} - -NETLIB_UPDATE(VS) -{ - NETLIB_NAME(twoterm)::update(); -} - -NETLIB_TIMESTEP(VS) -{ - this->set(1.0 / m_R(), - m_compiled.evaluate(std::vector({exec().time().as_double()})), - 0.0); -} - -// ---------------------------------------------------------------------------------------- -// nld_CS -// ---------------------------------------------------------------------------------------- - -NETLIB_RESET(CS) -{ - NETLIB_NAME(twoterm)::reset(); - const nl_double I = m_I(); - - set_mat(0.0, 0.0, -I, - 0.0, 0.0, I); - //this->set(0.0, 0.0, m_I()); -} - -NETLIB_UPDATE(CS) -{ - NETLIB_NAME(twoterm)::update(); -} - -NETLIB_TIMESTEP(CS) -{ - const double I = m_compiled.evaluate(std::vector({exec().time().as_double()})); - set_mat(0.0, 0.0, -I, - 0.0, 0.0, I); -} } //namespace analog diff --git a/src/lib/netlist/analog/nlid_twoterm.h b/src/lib/netlist/analog/nlid_twoterm.h index cb856763176..ad59246643d 100644 --- a/src/lib/netlist/analog/nlid_twoterm.h +++ b/src/lib/netlist/analog/nlid_twoterm.h @@ -81,6 +81,8 @@ NETLIB_OBJECT(twoterm) NETLIB_UPDATEI(); public: + void solve_now(); + void set(const nl_double G, const nl_double V, const nl_double I) { /* GO, GT, I */ @@ -125,7 +127,7 @@ public: protected: NETLIB_RESETI(); - NETLIB_UPDATEI(); + //NETLIB_UPDATEI(); }; @@ -233,7 +235,7 @@ public: protected: NETLIB_RESETI(); - NETLIB_UPDATEI(); + //NETLIB_UPDATEI(); NETLIB_UPDATE_PARAMI(); private: @@ -265,7 +267,7 @@ public: protected: NETLIB_RESETI(); - NETLIB_UPDATEI(); + //NETLIB_UPDATEI(); NETLIB_UPDATE_PARAMI(); private: @@ -381,7 +383,7 @@ public: protected: NETLIB_RESETI(); - NETLIB_UPDATEI(); + //NETLIB_UPDATEI(); NETLIB_UPDATE_PARAMI(); generic_diode m_D; @@ -398,6 +400,7 @@ NETLIB_OBJECT_DERIVED(VS, twoterm) { public: NETLIB_CONSTRUCTOR_DERIVED(VS, twoterm) + , m_t(*this, "m_t", 0.0) , m_R(*this, "R", 0.1) , m_V(*this, "V", 0.0) , m_func(*this,"FUNC", "") @@ -410,12 +413,26 @@ public: } NETLIB_IS_TIMESTEP(m_func() != "") - NETLIB_TIMESTEPI(); + + NETLIB_TIMESTEPI() + { + m_t += step; + this->set(1.0 / m_R(), + m_compiled.evaluate(std::vector({m_t})), + 0.0); + } protected: - NETLIB_UPDATEI(); - NETLIB_RESETI(); + // NETLIB_UPDATEI() { NETLIB_NAME(twoterm)::update(time); } + + NETLIB_RESETI() + { + NETLIB_NAME(twoterm)::reset(); + this->set(1.0 / m_R(), m_V(), 0.0); + } +private: + state_var m_t; param_double_t m_R; param_double_t m_V; param_str_t m_func; @@ -430,6 +447,7 @@ NETLIB_OBJECT_DERIVED(CS, twoterm) { public: NETLIB_CONSTRUCTOR_DERIVED(CS, twoterm) + , m_t(*this, "m_t", 0.0) , m_I(*this, "I", 1.0) , m_func(*this,"FUNC", "") , m_compiled(this->name() + ".FUNCC", this, this->state().run_state_manager()) @@ -441,12 +459,26 @@ public: } NETLIB_IS_TIMESTEP(m_func() != "") - NETLIB_TIMESTEPI(); + NETLIB_TIMESTEPI() + { + m_t += step; + const double I = m_compiled.evaluate(std::vector({m_t})); + set_mat(0.0, 0.0, -I, + 0.0, 0.0, I); + } + protected: - NETLIB_UPDATEI(); - NETLIB_RESETI(); + //NETLIB_UPDATEI() { NETLIB_NAME(twoterm)::update(time); } + NETLIB_RESETI() + { + NETLIB_NAME(twoterm)::reset(); + set_mat(0.0, 0.0, -m_I(), + 0.0, 0.0, m_I()); + } +private: + state_var m_t; param_double_t m_I; param_str_t m_func; plib::pfunction m_compiled; diff --git a/src/lib/netlist/devices/nld_7475.cpp b/src/lib/netlist/devices/nld_7475.cpp index 544cd84e73c..06e3c588081 100644 --- a/src/lib/netlist/devices/nld_7475.cpp +++ b/src/lib/netlist/devices/nld_7475.cpp @@ -101,7 +101,7 @@ namespace netlist { unsigned start_q = m_last_Q; - NETLIB_PARENT_UPDATE(7477); + NETLIB_NAME(7477)::update(); for (std::size_t i=0; i<4; i++) { diff --git a/src/lib/netlist/devices/nld_74ls629.cpp b/src/lib/netlist/devices/nld_74ls629.cpp index e25a1d21d88..b08654c5e40 100644 --- a/src/lib/netlist/devices/nld_74ls629.cpp +++ b/src/lib/netlist/devices/nld_74ls629.cpp @@ -104,7 +104,10 @@ namespace netlist } NETLIB_UPDATEI(); - NETLIB_UPDATE_PARAMI() { update_dev(); } + NETLIB_UPDATE_PARAMI() + { + /* update param may be called from anywhere, update_dev(time) is not a good idea */ + } public: NETLIB_SUB(SN74LS629clk) m_clock; diff --git a/src/lib/netlist/devices/nld_r2r_dac.cpp b/src/lib/netlist/devices/nld_r2r_dac.cpp index 4c29389d491..3a0ec2aea80 100644 --- a/src/lib/netlist/devices/nld_r2r_dac.cpp +++ b/src/lib/netlist/devices/nld_r2r_dac.cpp @@ -39,7 +39,7 @@ namespace netlist NETLIB_UPDATE_PARAM(r2r_dac) { - update_dev(); + solve_now(); double V = m_VIN() / static_cast(1 << m_num()) * static_cast(m_val()); diff --git a/src/lib/netlist/devices/nld_system.cpp b/src/lib/netlist/devices/nld_system.cpp index fa3726340a0..864362de783 100644 --- a/src/lib/netlist/devices/nld_system.cpp +++ b/src/lib/netlist/devices/nld_system.cpp @@ -51,43 +51,6 @@ namespace netlist m_cnt = 0; } - // ---------------------------------------------------------------------------------------- - // logic_input - // ---------------------------------------------------------------------------------------- - - NETLIB_RESET(logic_input) - { - m_Q.initial(0); - } - - NETLIB_UPDATE(logic_input) - { - m_Q.push(m_IN() & 1, netlist_time::from_nsec(1)); - } - - NETLIB_UPDATE_PARAM(logic_input) - { - } - - // ---------------------------------------------------------------------------------------- - // analog_input - // ---------------------------------------------------------------------------------------- - - NETLIB_RESET(analog_input) - { - m_Q.initial(0.0); - } - - NETLIB_UPDATE(analog_input) - { - m_Q.push(m_IN()); - } - - NETLIB_UPDATE_PARAM(analog_input) - { - } - - // ----------------------------------------------------------------------------- // nld_res_sw // ----------------------------------------------------------------------------- diff --git a/src/lib/netlist/devices/nlid_proxy.cpp b/src/lib/netlist/devices/nlid_proxy.cpp index d4163a74c42..24396bb54d7 100644 --- a/src/lib/netlist/devices/nlid_proxy.cpp +++ b/src/lib/netlist/devices/nlid_proxy.cpp @@ -126,11 +126,6 @@ namespace netlist log().warning(MW_1_NO_POWER_TERMINALS_ON_DEVICE_1, out_proxied->device().name()); else log().verbose("D/A Proxy: Found power terminals on device {1}", out_proxied->device().name()); -#if (0) - printf("%s %s\n", out_proxied->name().c_str(), out_proxied->device().name().c_str()); - auto x = netlist().setup().find_terminal(out_proxied->name(), detail::device_object_t::terminal_type::OUTPUT, false); - if (x) printf("==> %s\n", x->name().c_str()); -#endif } diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h index 498ce657818..3d878646549 100644 --- a/src/lib/netlist/devices/nlid_system.h +++ b/src/lib/netlist/devices/nlid_system.h @@ -187,11 +187,9 @@ namespace netlist set_logic_family(setup().family_from_model(m_FAMILY())); } - NETLIB_UPDATE_AFTER_PARAM_CHANGE() - - NETLIB_UPDATEI(); - NETLIB_RESETI(); - NETLIB_UPDATE_PARAMI(); + NETLIB_UPDATEI() { } + NETLIB_RESETI() { m_Q.initial(0); } + NETLIB_UPDATE_PARAMI() { m_Q.push(m_IN() & 1, netlist_time::from_nsec(1)); } protected: logic_output_t m_Q; @@ -207,11 +205,11 @@ namespace netlist , m_IN(*this, "IN", 0.0) { } - NETLIB_UPDATE_AFTER_PARAM_CHANGE() - NETLIB_UPDATEI(); - NETLIB_RESETI(); - NETLIB_UPDATE_PARAMI(); + NETLIB_UPDATEI() { } + NETLIB_RESETI() { m_Q.initial(0.0); } + NETLIB_UPDATE_PARAMI() { m_Q.push(m_IN()); } + protected: analog_output_t m_Q; param_double_t m_IN; diff --git a/src/lib/netlist/devices/nlid_truthtable.cpp b/src/lib/netlist/devices/nlid_truthtable.cpp index 4cebc8c1b4c..2377071c4e2 100644 --- a/src/lib/netlist/devices/nlid_truthtable.cpp +++ b/src/lib/netlist/devices/nlid_truthtable.cpp @@ -209,15 +209,6 @@ namespace netlist } m_ign = 0; - -#if 0 - printf("%s\n", name().c_str()); - for (int j=0; j < m_size; j++) - printf("%05x %04x %04x %04x\n", j, m_ttp->m_out_state[j] & ((1 << m_NO)-1), - m_ttp->m_out_state[j] >> m_NO, m_ttp->m_timing[j * m_NO + 0]); - for (int k=0; m_ttp->m_timing_nt[k] != netlist_time::zero(); k++) - printf("%d %f\n", k, m_ttp->m_timing_nt[k].as_double() * 1000000.0); -#endif } // ---------------------------------------------------------------------------------------- diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index bd4c8d77b41..f878be1e48a 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -168,7 +168,7 @@ void detail::queue_t::on_pre_save() { state().log().debug("on_pre_save\n"); m_qsize = this->size(); - state().log().debug("current time {1} qsize {2}\n", exec().time().as_double(), m_qsize); + state().log().debug("qsize {1}\n", m_qsize); for (std::size_t i = 0; i < m_qsize; i++ ) { m_times[i] = this->listptr()[i].m_exec_time.as_raw(); @@ -180,7 +180,7 @@ void detail::queue_t::on_pre_save() void detail::queue_t::on_post_load() { this->clear(); - state().log().debug("current time {1} qsize {2}\n", exec().time().as_double(), m_qsize); + state().log().debug("qsize {1}\n", m_qsize); for (std::size_t i = 0; i < m_qsize; i++ ) { detail::net_t *n = state().nets()[m_net_ids[i]].get(); @@ -352,14 +352,20 @@ void netlist_state_t::reset() std::unordered_map m; // Reset all nets once ! + log().verbose("Call reset on all nets:"); for (auto & n : nets()) n->reset(); // Reset all devices once ! + log().verbose("Call reset on all devices:"); for (auto & dev : m_devices) dev->do_reset(); // Make sure everything depending on parameters is set + // Currently analog input and logic input also + // push their outputs to queue. + + log().verbose("Call update_param on all devices:"); for (auto & dev : m_devices) dev->update_param(); @@ -391,17 +397,6 @@ void netlist_state_t::reset() if (!plib::container::contains(d, dev)) d.push_back(dev); } - log().verbose("Call update on devices which need parameter update:"); - for (auto & dev : m_devices) - if (dev->needs_update_after_param_change()) - { - if (!plib::container::contains(d, dev.get())) - { - d.push_back(dev.get()); - log().verbose("\t ...{1}", dev->name()); - dev->update_dev(); - } - } log().verbose("Devices not yet updated:"); for (auto &dev : m_devices) if (!plib::container::contains(d, dev.get())) @@ -1061,8 +1056,6 @@ param_t::param_type_t param_t::param_type() const void param_t::update_param() { device().update_param(); - if (device().needs_update_after_param_change()) - device().update_dev(); } pstring param_t::get_initial(const device_t &dev, bool *found) diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index 4029ba2f99b..69e7ede2b80 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -123,9 +123,6 @@ class NETLIB_NAME(name) : public device_t #define NETLIB_TIMESTEPI() \ public: virtual void timestep(const nl_double step) override -#define NETLIB_UPDATE_AFTER_PARAM_CHANGE() \ - public: virtual bool needs_update_after_param_change() const override { return true; } - #define NETLIB_FAMILY(family) , m_famsetter(*this, family) #define NETLIB_DELEGATE(chip, name) nldelegate(&NETLIB_NAME(chip) :: name, this) @@ -141,18 +138,15 @@ class NETLIB_NAME(name) : public device_t #define NETLIB_SUB(chip) nld_ ## chip #define NETLIB_SUBXX(ns, chip) std::unique_ptr< ns :: nld_ ## chip > -#define NETLIB_HANDLER(chip, name) void NETLIB_NAME(chip) :: name(void) NL_NOEXCEPT +#define NETLIB_HANDLER(chip, name) void NETLIB_NAME(chip) :: name() NL_NOEXCEPT #define NETLIB_UPDATE(chip) NETLIB_HANDLER(chip, update) -// FIXME: NETLIB_PARENT_UPDATE should disappear -#define NETLIB_PARENT_UPDATE(chip) NETLIB_NAME(chip) :: update() - #define NETLIB_RESET(chip) void NETLIB_NAME(chip) :: reset(void) -#define NETLIB_UPDATE_PARAM(chip) void NETLIB_NAME(chip) :: update_param(void) +#define NETLIB_UPDATE_PARAM(chip) void NETLIB_NAME(chip) :: update_param() #define NETLIB_FUNC_VOID(chip, name, params) void NETLIB_NAME(chip) :: name params -#define NETLIB_UPDATE_TERMINALS(chip) void NETLIB_NAME(chip) :: update_terminals(void) +#define NETLIB_UPDATE_TERMINALS(chip) void NETLIB_NAME(chip) :: update_terminals() //============================================================ // Asserts @@ -727,19 +721,19 @@ namespace netlist void toggle_new_Q() noexcept { m_new_Q = (m_cur_Q ^ 1); } - void toggle_and_push_to_queue(const netlist_time delay) NL_NOEXCEPT + void toggle_and_push_to_queue(netlist_time delay) NL_NOEXCEPT { toggle_new_Q(); push_to_queue(delay); } - void push_to_queue(const netlist_time delay) NL_NOEXCEPT; + void push_to_queue(netlist_time delay) NL_NOEXCEPT; bool is_queued() const noexcept { return m_in_queue == QS_QUEUED; } void update_devs() NL_NOEXCEPT; const netlist_time time() const noexcept { return m_time; } - void set_time(const netlist_time ntime) noexcept { m_time = ntime; } + void set_time(netlist_time ntime) noexcept { m_time = ntime; } bool isRailNet() const noexcept { return !(m_railterminal == nullptr); } core_terminal_t & railterminal() const noexcept { return *m_railterminal; } @@ -979,7 +973,7 @@ namespace netlist virtual ~param_str_t(); const pstring &operator()() const NL_NOEXCEPT { return Value(); } - void setTo(const pstring ¶m) NL_NOEXCEPT + void setTo(netlist_time time, const pstring ¶m) NL_NOEXCEPT { if (m_param != param) { @@ -1086,6 +1080,7 @@ namespace netlist virtual ~core_device_t(); + // FIXME: useless trampoline void update_dev() NL_NOEXCEPT { do_update(); @@ -1139,7 +1134,6 @@ namespace netlist virtual void update_param() {} virtual bool is_dynamic() const { return false; } virtual bool is_timestep() const { return false; } - virtual bool needs_update_after_param_change() const { return false; } private: bool m_hint_deactivate; diff --git a/src/lib/netlist/nl_factory.cpp b/src/lib/netlist/nl_factory.cpp index 973b1b7814f..998f1a5870b 100644 --- a/src/lib/netlist/nl_factory.cpp +++ b/src/lib/netlist/nl_factory.cpp @@ -67,11 +67,7 @@ void list_t::register_device(std::unique_ptr &&factory) { for (auto & e : *this) if (e->name() == factory->name()) - { - // FIXME: throws pure virtual exception - printf("%s\n", e->name().c_str()); m_setup.log().fatal(MF_1_FACTORY_ALREADY_CONTAINS_1, factory->name()); - } push_back(std::move(factory)); } diff --git a/src/lib/netlist/plib/gmres.h b/src/lib/netlist/plib/gmres.h index 7a24de8e03f..edda011dc19 100644 --- a/src/lib/netlist/plib/gmres.h +++ b/src/lib/netlist/plib/gmres.h @@ -213,7 +213,6 @@ namespace plib const float_type rho_to_accuracy = std::sqrt(vec_mult2(n, Ax)) / accuracy; rho_delta = accuracy * rho_to_accuracy; - //printf("%e %e\n", rho_delta, accuracy * std::sqrt(static_cast(n))); } else rho_delta = accuracy * std::sqrt(static_cast(n)); diff --git a/src/lib/netlist/plib/palloc.cpp b/src/lib/netlist/plib/palloc.cpp index fa87c1cf94f..80fd2098a66 100644 --- a/src/lib/netlist/plib/palloc.cpp +++ b/src/lib/netlist/plib/palloc.cpp @@ -8,6 +8,7 @@ #include "pconfig.h" #include "palloc.h" #include "pfmtlog.h" +#include "pexception.h" #include @@ -91,7 +92,7 @@ void mempool::free(void *ptr) auto i = reinterpret_cast(p - mininfosize()); block *b = i->m_block; if (b->m_num_alloc == 0) - fprintf(stderr, "Argh .. double free\n"); + plib::pexception("mempool::free - double free was called\n"); else { //b->m_free = m_min_alloc; diff --git a/src/lib/netlist/plib/pfunction.cpp b/src/lib/netlist/plib/pfunction.cpp index f08fa2c60ea..3a1ef9d841b 100644 --- a/src/lib/netlist/plib/pfunction.cpp +++ b/src/lib/netlist/plib/pfunction.cpp @@ -117,7 +117,6 @@ void pfunction::compile_infix(const std::vector &inputs, const pstring std::stack opstk; std::vector postfix; - //printf("dbg: %s\n", expr.c_str()); for (unsigned i = 0; i < sexpr.size(); i++) { pstring &s = sexpr[i]; diff --git a/src/lib/netlist/plib/pstate.cpp b/src/lib/netlist/plib/pstate.cpp index 043033ed1ea..3cab5dec127 100644 --- a/src/lib/netlist/plib/pstate.cpp +++ b/src/lib/netlist/plib/pstate.cpp @@ -59,7 +59,6 @@ void state_manager_t::post_load() template<> void state_manager_t::save_item(const void *owner, callback_t &state, const pstring &stname) { - //save_state_ptr(stname, DT_CUSTOM, 0, 1, &state); callback_t *state_p = &state; auto p = plib::make_unique(stname, owner, state_p); m_custom.push_back(std::move(p)); diff --git a/src/lib/netlist/plib/pstream.cpp b/src/lib/netlist/plib/pstream.cpp index 9c99438811c..a204bdcfe33 100644 --- a/src/lib/netlist/plib/pstream.cpp +++ b/src/lib/netlist/plib/pstream.cpp @@ -169,7 +169,6 @@ void pofilestream::vwrite(const value_type *buf, const pos_type n) std::size_t r = fwrite(buf, 1, n, static_cast(m_file)); if (r < n) { - //printf("%ld %ld %s\n", r, n, strerror(errno)); if (ferror(static_cast(m_file))) throw file_write_e(m_filename); } diff --git a/src/lib/netlist/plib/putil.cpp b/src/lib/netlist/plib/putil.cpp index 92e0e6b3ab1..19f66ba6cbb 100644 --- a/src/lib/netlist/plib/putil.cpp +++ b/src/lib/netlist/plib/putil.cpp @@ -33,10 +33,10 @@ namespace plib const pstring environment(const pstring &var, const pstring &default_val) { - if (getenv(var.c_str()) == nullptr) + if (std::getenv(var.c_str()) == nullptr) return default_val; else - return pstring(getenv(var.c_str())); + return pstring(std::getenv(var.c_str())); } } diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index 1a82df36dcc..f77a5966b0e 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -693,10 +693,6 @@ int tool_app_t::execute() plib::fpsignalenabler::global_enable(true); plib::fpsignalenabler sigen(plib::FP_ALL & ~plib::FP_INEXACT & ~plib::FP_UNDERFLOW); - //perr("{}", "WARNING: This is Work In Progress! - It may fail anytime\n"); - //perr("Update dispatching using method {}\n", pmf_verbose[NL_PMF_TYPE]); - //printf("test2 %f\n", std::exp(-14362.38064713)); - if (opt_help()) { pout(usage()); diff --git a/src/lib/netlist/solver/nld_matrix_solver.cpp b/src/lib/netlist/solver/nld_matrix_solver.cpp index 2c530b219cc..30e47c9ba72 100644 --- a/src/lib/netlist/solver/nld_matrix_solver.cpp +++ b/src/lib/netlist/solver/nld_matrix_solver.cpp @@ -429,7 +429,7 @@ void matrix_solver_t::reset() void matrix_solver_t::update() NL_NOEXCEPT { - const netlist_time new_timestep = solve(); + const netlist_time new_timestep = solve(exec().time()); update_inputs(); if (m_params.m_dynamic_ts && has_timestep_devices() && new_timestep > netlist_time::zero()) @@ -438,9 +438,15 @@ void matrix_solver_t::update() NL_NOEXCEPT } } +/* update_forced is called from within param_update + * + * this should only occur outside of execution and thus + * using time should be safe. + * + */ void matrix_solver_t::update_forced() { - const netlist_time new_timestep = solve(); + const netlist_time new_timestep = solve(exec().time()); plib::unused_var(new_timestep); update_inputs(); @@ -458,7 +464,7 @@ void matrix_solver_t::step(const netlist_time &delta) m_step_devices[k]->timestep(dd); } -void matrix_solver_t::solve_base() +void matrix_solver_t::solve_base(netlist_time time) { ++m_stat_vsolver_calls; if (has_dynamic_devices()) @@ -487,9 +493,8 @@ void matrix_solver_t::solve_base() } } -const netlist_time matrix_solver_t::solve() +const netlist_time matrix_solver_t::solve(netlist_time now) { - const netlist_time now = exec().time(); const netlist_time delta = now - m_last_step; // We are already up to date. Avoid oscillations. @@ -500,7 +505,7 @@ const netlist_time matrix_solver_t::solve() /* update all terminals for new time step */ m_last_step = now; step(delta); - solve_base(); + solve_base(now); const netlist_time next_time_step = compute_next_timestep(delta.as_double()); return next_time_step; @@ -614,7 +619,6 @@ netlist_time matrix_solver_t::compute_next_timestep(const double cur_ts) const nl_double DD_n = (n->Q_Analog() - t->m_last_V); const nl_double hn = cur_ts; - //printf("%f %f %f %f\n", DD_n, t->m_DD_n_m_1, hn, t->m_h_n_m_1); nl_double DD2 = (DD_n / hn - t->m_DD_n_m_1 / t->m_h_n_m_1) / (hn + t->m_h_n_m_1); nl_double new_net_timestep; diff --git a/src/lib/netlist/solver/nld_matrix_solver.h b/src/lib/netlist/solver/nld_matrix_solver.h index cd785db9cba..2f4e692ed6f 100644 --- a/src/lib/netlist/solver/nld_matrix_solver.h +++ b/src/lib/netlist/solver/nld_matrix_solver.h @@ -143,12 +143,12 @@ public: vsetup(nets); } - void solve_base(); + void solve_base(netlist_time time); /* after every call to solve, update inputs must be called. * this can be done as well as a batch to ease parallel processing. */ - const netlist_time solve(); + const netlist_time solve(netlist_time now); void update_inputs(); bool has_dynamic_devices() const { return m_dynamic_devices.size() > 0; } diff --git a/src/lib/netlist/solver/nld_ms_sor_mat.h b/src/lib/netlist/solver/nld_ms_sor_mat.h index 1892ed472f5..a64d6a9659a 100644 --- a/src/lib/netlist/solver/nld_ms_sor_mat.h +++ b/src/lib/netlist/solver/nld_ms_sor_mat.h @@ -161,11 +161,9 @@ unsigned matrix_solver_SOR_mat_t::vsolve_non_dynamic(const bool newton lambda1 = akk; #endif } - //printf("lambda: %f %f\n", lambda, 2.0 / (1.0 + 2 * sqrt(lambda)) ); //ws = 2.0 / (2.0 - lambdaN - lambda1); m_omega = 2.0 / (2.0 - lambda1); - //printf("%f %f %f\n", m_omega, lambda1, lambdaN); } #endif diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp index a7c2f1fc196..ac7f9155feb 100644 --- a/src/lib/netlist/solver/nld_solver.cpp +++ b/src/lib/netlist/solver/nld_solver.cpp @@ -93,9 +93,10 @@ NETLIB_UPDATE(solver) if (m_params.m_dynamic_ts) return; + netlist_time now(exec().time()); /* force solving during start up if there are no time-step devices */ /* FIXME: Needs a more elegant solution */ - bool force_solve = (exec().time() < netlist_time::from_double(2 * m_params.m_max_timestep)); + bool force_solve = (now < netlist_time::from_double(2 * m_params.m_max_timestep)); std::size_t nthreads = std::min(static_cast(m_parallel()), plib::omp::get_max_threads()); @@ -104,16 +105,16 @@ NETLIB_UPDATE(solver) if (nthreads > 1 && solvers.size() > 1) { plib::omp::set_num_threads(nthreads); - plib::omp::for_static(static_cast(0), solvers.size(), [&solvers](std::size_t i) + plib::omp::for_static(static_cast(0), solvers.size(), [&solvers, now](std::size_t i) { - const netlist_time ts = solvers[i]->solve(); + const netlist_time ts = solvers[i]->solve(now); plib::unused_var(ts); }); } else for (auto & solver : solvers) { - const netlist_time ts = solver->solve(); + const netlist_time ts = solver->solve(now); plib::unused_var(ts); } diff --git a/src/lib/netlist/tools/nl_convert.cpp b/src/lib/netlist/tools/nl_convert.cpp index 998ebf53c7e..da9325d70d9 100644 --- a/src/lib/netlist/tools/nl_convert.cpp +++ b/src/lib/netlist/tools/nl_convert.cpp @@ -165,7 +165,6 @@ void nl_convert_base_t::dump_nl() net_t * net = i.second.get(); if (!net->is_no_export()) { - //printf("Net {}\n", net->name().c_str()); out("NET_C({}", net->terminals()[0].c_str() ); for (std::size_t j=1; jterminals().size(); j++) { diff --git a/src/mame/audio/nl_kidniki.cpp b/src/mame/audio/nl_kidniki.cpp index 835ed884545..7865ea40750 100644 --- a/src/mame/audio/nl_kidniki.cpp +++ b/src/mame/audio/nl_kidniki.cpp @@ -2,7 +2,7 @@ // copyright-holders:Andrew Gardner, Couriersud #include "netlist/devices/net_lib.h" -#define USE_FRONTIERS 0 +#define USE_FRONTIERS 1 #define USE_FIXED_STV 1 /* ---------------------------------------------------------------------------- @@ -326,8 +326,8 @@ NETLIST_START(kidniki) PARAM(Solver.ACCURACY, 1e-7) PARAM(Solver.NR_LOOPS, 100) PARAM(Solver.GS_LOOPS, 300) - //PARAM(Solver.METHOD, "MAT_CR") - PARAM(Solver.METHOD, "GMRES") + PARAM(Solver.METHOD, "MAT_CR") + //PARAM(Solver.METHOD, "GMRES") //PARAM(Solver.SOR_FACTOR, 1.73) //PARAM(Solver.METHOD, "SOR") #endif -- cgit v1.2.3-70-g09d2 From b9525773700243f29de378992327d1c7dc3b6ba2 Mon Sep 17 00:00:00 2001 From: couriersud Date: Fri, 1 Feb 2019 08:45:32 +0100 Subject: netlist: remove trampoline code. (nw) --- src/lib/netlist/analog/nld_opamps.cpp | 12 ++++++------ src/lib/netlist/analog/nlid_twoterm.h | 4 +++- src/lib/netlist/devices/nld_4066.cpp | 4 ++-- src/lib/netlist/devices/nld_4316.cpp | 2 +- src/lib/netlist/devices/nld_74123.cpp | 16 ++++++++-------- src/lib/netlist/devices/nld_74153.cpp | 6 +++--- src/lib/netlist/devices/nld_74ls629.cpp | 6 +++--- src/lib/netlist/devices/nld_9310.cpp | 4 ++-- src/lib/netlist/devices/nld_9322.cpp | 8 ++++---- src/lib/netlist/devices/nld_mm5837.cpp | 2 +- src/lib/netlist/devices/nld_ne555.cpp | 12 ++++++------ src/lib/netlist/devices/nld_schmitt.cpp | 8 ++++---- src/lib/netlist/devices/nld_system.cpp | 4 ++-- src/lib/netlist/devices/nlid_proxy.cpp | 4 ++-- src/lib/netlist/nl_base.cpp | 8 ++++---- src/lib/netlist/nl_base.h | 20 ++++---------------- src/lib/netlist/solver/nld_solver.cpp | 2 +- 17 files changed, 56 insertions(+), 66 deletions(-) (limited to 'src/lib/netlist/devices/nld_system.cpp') diff --git a/src/lib/netlist/analog/nld_opamps.cpp b/src/lib/netlist/analog/nld_opamps.cpp index 5f55a26f5d0..416fdbd76ee 100644 --- a/src/lib/netlist/analog/nld_opamps.cpp +++ b/src/lib/netlist/analog/nld_opamps.cpp @@ -201,7 +201,7 @@ namespace netlist NETLIB_RESET(opamp) { - m_G1.do_reset(); + m_G1.reset(); m_G1.m_RI.setTo(m_model.m_RI); if (m_type == 1) @@ -213,11 +213,11 @@ namespace netlist } else if (m_type == 3) { - m_EBUF->do_reset(); - m_DP->do_reset(); - m_DN->do_reset(); - m_CP->do_reset(); - m_RP.do_reset(); + m_EBUF->reset(); + m_DP->reset(); + m_DN->reset(); + m_CP->reset(); + m_RP.reset(); m_EBUF->m_G.setTo(1.0); m_EBUF->m_RO.setTo(m_model.m_RO); diff --git a/src/lib/netlist/analog/nlid_twoterm.h b/src/lib/netlist/analog/nlid_twoterm.h index ad59246643d..486efdc0add 100644 --- a/src/lib/netlist/analog/nlid_twoterm.h +++ b/src/lib/netlist/analog/nlid_twoterm.h @@ -78,9 +78,11 @@ NETLIB_OBJECT(twoterm) //NETLIB_UPDATE_TERMINALSI() { } //NETLIB_RESETI() { } - NETLIB_UPDATEI(); public: + + NETLIB_UPDATEI(); + void solve_now(); void set(const nl_double G, const nl_double V, const nl_double I) diff --git a/src/lib/netlist/devices/nld_4066.cpp b/src/lib/netlist/devices/nld_4066.cpp index 2871e4898ae..25b001b5151 100644 --- a/src/lib/netlist/devices/nld_4066.cpp +++ b/src/lib/netlist/devices/nld_4066.cpp @@ -67,14 +67,14 @@ namespace netlist // We only need to update the net first if this is a time stepping net if ((1)) // m_R.m_P.net().as_analog().solver().is_timestep()) { - m_R.update_dev(); + m_R.update(); m_R.set_R(R); m_R.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); } else { m_R.set_R(R); - m_R.update_dev(); + m_R.update(); } } } diff --git a/src/lib/netlist/devices/nld_4316.cpp b/src/lib/netlist/devices/nld_4316.cpp index 4290c65670c..a95cc67bfc3 100644 --- a/src/lib/netlist/devices/nld_4316.cpp +++ b/src/lib/netlist/devices/nld_4316.cpp @@ -43,7 +43,7 @@ namespace netlist { namespace devices { NETLIB_UPDATE(CD4316_GATE) { - m_R.update_dev(); + m_R.update(); if (m_S() && !m_E()) m_R.set_R(m_base_r()); else diff --git a/src/lib/netlist/devices/nld_74123.cpp b/src/lib/netlist/devices/nld_74123.cpp index ebc8eeebc83..24b79971062 100644 --- a/src/lib/netlist/devices/nld_74123.cpp +++ b/src/lib/netlist/devices/nld_74123.cpp @@ -257,8 +257,8 @@ namespace netlist { m_KP = 1.0 / (1.0 + exp(m_K())); - m_RP.do_reset(); - m_RN.do_reset(); + m_RP.reset(); + m_RN.reset(); //m_RP.set_R(R_OFF); //m_RN.set_R(R_OFF); @@ -276,8 +276,8 @@ namespace netlist NETLIB_RESET(74123_dip) { - //m_1.do_reset(); - //m_2.do_reset(); + //m_1.reset(); + //m_2.reset(); } NETLIB_UPDATE(9602_dip) @@ -289,8 +289,8 @@ namespace netlist NETLIB_RESET(9602_dip) { - //m_1.do_reset(); - //m_2.do_reset(); + //m_1.reset(); + //m_2.reset(); } NETLIB_UPDATE(4538_dip) @@ -302,8 +302,8 @@ namespace netlist NETLIB_RESET(4538_dip) { - m_1.do_reset(); - m_2.do_reset(); + m_1.reset(); + m_2.reset(); } NETLIB_DEVICE_IMPL_DEPRECATED(74123) diff --git a/src/lib/netlist/devices/nld_74153.cpp b/src/lib/netlist/devices/nld_74153.cpp index ee52ceb0721..b44b7c8a3de 100644 --- a/src/lib/netlist/devices/nld_74153.cpp +++ b/src/lib/netlist/devices/nld_74153.cpp @@ -120,15 +120,15 @@ namespace netlist NETLIB_UPDATE(74153) { m_sub.m_chan = (m_A() | (m_B()<<1)); - m_sub.update_dev(); + m_sub.update(); } NETLIB_UPDATE(74153_dip) { m_2.m_chan = m_1.m_chan = (m_A() | (m_B()<<1)); - m_1.update_dev(); - m_2.update_dev(); + m_1.update(); + m_2.update(); } NETLIB_DEVICE_IMPL(74153, "TTL_74153", "+C0,+C1,+C2,+C3,+A,+B,+G") diff --git a/src/lib/netlist/devices/nld_74ls629.cpp b/src/lib/netlist/devices/nld_74ls629.cpp index b08654c5e40..7017774266f 100644 --- a/src/lib/netlist/devices/nld_74ls629.cpp +++ b/src/lib/netlist/devices/nld_74ls629.cpp @@ -100,7 +100,7 @@ namespace netlist { m_R_FC.set_R(90000.0); m_R_RNG.set_R(90000.0); - m_clock.do_reset(); + m_clock.reset(); } NETLIB_UPDATEI(); @@ -148,8 +148,8 @@ namespace netlist NETLIB_RESETI() { - m_1.do_reset(); - m_2.do_reset(); + m_1.reset(); + m_2.reset(); } private: diff --git a/src/lib/netlist/devices/nld_9310.cpp b/src/lib/netlist/devices/nld_9310.cpp index 11929741aed..ff708924a37 100644 --- a/src/lib/netlist/devices/nld_9310.cpp +++ b/src/lib/netlist/devices/nld_9310.cpp @@ -140,8 +140,8 @@ namespace netlist NETLIB_RESET(9310) { - sub.do_reset(); - subABCD.do_reset(); + sub.reset(); + subABCD.reset(); } NETLIB_RESET(9310_subABCD) diff --git a/src/lib/netlist/devices/nld_9322.cpp b/src/lib/netlist/devices/nld_9322.cpp index d27386dd05f..d72b9a561df 100644 --- a/src/lib/netlist/devices/nld_9322.cpp +++ b/src/lib/netlist/devices/nld_9322.cpp @@ -105,10 +105,10 @@ namespace netlist NETLIB_UPDATE(9322) { - m_1.update_dev(); - m_2.update_dev(); - m_3.update_dev(); - m_4.update_dev(); + m_1.update(); + m_2.update(); + m_3.update(); + m_4.update(); } NETLIB_DEVICE_IMPL_DEPRECATED(9322) diff --git a/src/lib/netlist/devices/nld_mm5837.cpp b/src/lib/netlist/devices/nld_mm5837.cpp index 9bc678598d4..223c37c35af 100644 --- a/src/lib/netlist/devices/nld_mm5837.cpp +++ b/src/lib/netlist/devices/nld_mm5837.cpp @@ -107,7 +107,7 @@ namespace netlist // We only need to update the net first if this is a time stepping net if (m_is_timestep) - m_RV.update_dev(); + m_RV.update(); m_RV.set(NL_FCONST(1.0) / R, V, 0.0); m_RV.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); } diff --git a/src/lib/netlist/devices/nld_ne555.cpp b/src/lib/netlist/devices/nld_ne555.cpp index cb29f8b3e82..e357afa6947 100644 --- a/src/lib/netlist/devices/nld_ne555.cpp +++ b/src/lib/netlist/devices/nld_ne555.cpp @@ -128,10 +128,10 @@ namespace netlist NETLIB_RESET(NE555) { - m_R1.do_reset(); - m_R2.do_reset(); - m_R3.do_reset(); - m_RDIS.do_reset(); + m_R1.reset(); + m_R2.reset(); + m_R3.reset(); + m_RDIS.reset(); /* FIXME make resistance a parameter, properly model other variants */ m_R1.set_R(5000); @@ -163,13 +163,13 @@ namespace netlist if (m_last_out && !out) { - m_RDIS.update_dev(); + m_RDIS.update(); m_OUT.push(m_R3.m_N()); m_RDIS.set_R(R_ON); } else if (!m_last_out && out) { - m_RDIS.update_dev(); + m_RDIS.update(); // FIXME: Should be delayed by 100ns m_OUT.push(m_R1.m_P()); m_RDIS.set_R(R_OFF); diff --git a/src/lib/netlist/devices/nld_schmitt.cpp b/src/lib/netlist/devices/nld_schmitt.cpp index 43ba4573681..394513d63a4 100644 --- a/src/lib/netlist/devices/nld_schmitt.cpp +++ b/src/lib/netlist/devices/nld_schmitt.cpp @@ -82,8 +82,8 @@ namespace netlist NETLIB_RESETI() { m_last_state = 1; - m_RVI.do_reset(); - m_RVO.do_reset(); + m_RVI.reset(); + m_RVO.reset(); m_is_timestep = m_RVO.m_P.net().solver()->has_timestep_devices(); m_RVI.set(NL_FCONST(1.0) / m_model.m_RI, m_model.m_VI, 0.0); m_RVO.set(NL_FCONST(1.0) / m_model.m_ROL, m_model.m_VOL, 0.0); @@ -97,7 +97,7 @@ namespace netlist { m_last_state = 0; if (m_is_timestep) - m_RVO.update_dev(); + m_RVO.update(); m_RVO.set(NL_FCONST(1.0) / m_model.m_ROH, m_model.m_VOH, 0.0); m_RVO.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); } @@ -108,7 +108,7 @@ namespace netlist { m_last_state = 1; if (m_is_timestep) - m_RVO.update_dev(); + m_RVO.update(); m_RVO.set(NL_FCONST(1.0) / m_model.m_ROL, m_model.m_VOL, 0.0); m_RVO.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); } diff --git a/src/lib/netlist/devices/nld_system.cpp b/src/lib/netlist/devices/nld_system.cpp index 864362de783..bfc6f71e38f 100644 --- a/src/lib/netlist/devices/nld_system.cpp +++ b/src/lib/netlist/devices/nld_system.cpp @@ -72,7 +72,7 @@ namespace netlist // We only need to update the net first if this is a time stepping net if ((0)) // m_R->m_P.net().as_analog().solver()->is_timestep()) { - m_R.update_dev(); + m_R.update(); m_R.set_R(R); m_R.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); } @@ -80,7 +80,7 @@ namespace netlist { m_R.set_R(R); m_R.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); - //m_R->update_dev(); + //m_R->update(); } } } diff --git a/src/lib/netlist/devices/nlid_proxy.cpp b/src/lib/netlist/devices/nlid_proxy.cpp index 24396bb54d7..38a77c71423 100644 --- a/src/lib/netlist/devices/nlid_proxy.cpp +++ b/src/lib/netlist/devices/nlid_proxy.cpp @@ -137,7 +137,7 @@ namespace netlist //m_Q.initial(0.0); m_last_state = -1; - m_RV.do_reset(); + m_RV.reset(); m_is_timestep = m_RV.m_P.net().solver()->has_timestep_devices(); m_RV.set(NL_FCONST(1.0) / logic_family()->R_low(), logic_family()->low_V(0.0, supply_V), 0.0); @@ -158,7 +158,7 @@ namespace netlist // We only need to update the net first if this is a time stepping net if (m_is_timestep) { - m_RV.update_dev(); + m_RV.update(); } m_RV.set(NL_FCONST(1.0) / R, V, 0.0); m_RV.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index f878be1e48a..14807111ff2 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -341,7 +341,7 @@ void netlist_t::reset() if (m_mainclock != nullptr) m_mainclock->m_Q.net().set_time(netlist_time::zero()); //if (m_solver != nullptr) - // m_solver->do_reset(); + // m_solver->reset(); m_state->reset(); } @@ -359,7 +359,7 @@ void netlist_state_t::reset() // Reset all devices once ! log().verbose("Call reset on all devices:"); for (auto & dev : m_devices) - dev->do_reset(); + dev->reset(); // Make sure everything depending on parameters is set // Currently analog input and logic input also @@ -409,14 +409,14 @@ void netlist_state_t::reset() log().verbose("Using brute force backward startup strategy"); std::size_t i = m_devices.size(); while (i>0) - m_devices[--i]->update_dev(); + m_devices[--i]->update(); } break; case 2: // brute force forward { log().verbose("Using brute force forward startup strategy"); for (auto &d : m_devices) - d->update_dev(); + d->update(); } break; } diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index 69e7ede2b80..ca75046b3e5 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -129,9 +129,9 @@ class NETLIB_NAME(name) : public device_t #define NETLIB_UPDATE_TERMINALSI() public: virtual void update_terminals() override #define NETLIB_HANDLERI(name) private: virtual void name() NL_NOEXCEPT -#define NETLIB_UPDATEI() protected: virtual void update() NL_NOEXCEPT override +#define NETLIB_UPDATEI() public: virtual void update() NL_NOEXCEPT override #define NETLIB_UPDATE_PARAMI() public: virtual void update_param() override -#define NETLIB_RESETI() protected: virtual void reset() override +#define NETLIB_RESETI() public: virtual void reset() override #define NETLIB_TIMESTEP(chip) void NETLIB_NAME(chip) :: timestep(const nl_double step) @@ -1080,12 +1080,6 @@ namespace netlist virtual ~core_device_t(); - // FIXME: useless trampoline - void update_dev() NL_NOEXCEPT - { - do_update(); - } - void do_inc_active() NL_NOEXCEPT { if (m_hint_deactivate) @@ -1101,7 +1095,6 @@ namespace netlist dec_active(); } - void do_reset() { reset(); } void set_hint_deactivate(bool v) { m_hint_deactivate = v; } bool get_hint_deactivate() { return m_hint_deactivate; } @@ -1112,18 +1105,13 @@ namespace netlist nperfcount_t m_stat_call_count; nperfcount_t m_stat_inc_active; + virtual void update() NL_NOEXCEPT { } + virtual void reset() { } protected: - virtual void update() NL_NOEXCEPT { } virtual void inc_active() NL_NOEXCEPT { } virtual void dec_active() NL_NOEXCEPT { } - virtual void reset() { } - - void do_update() NL_NOEXCEPT - { - update(); - } log_type & log(); diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp index ac7f9155feb..372919814d9 100644 --- a/src/lib/netlist/solver/nld_solver.cpp +++ b/src/lib/netlist/solver/nld_solver.cpp @@ -71,7 +71,7 @@ namespace netlist NETLIB_RESET(solver) { for (std::size_t i = 0; i < m_mat_solvers.size(); i++) - m_mat_solvers[i]->do_reset(); + m_mat_solvers[i]->reset(); } void NETLIB_NAME(solver)::stop() -- cgit v1.2.3-70-g09d2 From 75146fd159f63b96c338ed8db7405b8bca048821 Mon Sep 17 00:00:00 2001 From: couriersud Date: Fri, 1 Feb 2019 22:46:12 +0100 Subject: netlist: All devices now specify parameters in factory constructor. (nw) This previously was part of net_lib.cpp and repeatedly caused bugs. --- src/lib/netlist/analog/nld_bjt.cpp | 4 +- src/lib/netlist/analog/nld_opamps.cpp | 2 +- src/lib/netlist/analog/nld_switches.cpp | 4 +- src/lib/netlist/analog/nlid_fourterm.cpp | 8 +- src/lib/netlist/analog/nlid_twoterm.cpp | 16 +- src/lib/netlist/devices/net_lib.cpp | 277 +++++++++++++++---------------- src/lib/netlist/devices/nld_2102A.cpp | 4 +- src/lib/netlist/devices/nld_2716.cpp | 4 +- src/lib/netlist/devices/nld_4020.cpp | 3 +- src/lib/netlist/devices/nld_4066.cpp | 2 +- src/lib/netlist/devices/nld_4316.cpp | 2 +- src/lib/netlist/devices/nld_74123.cpp | 8 +- src/lib/netlist/devices/nld_74164.cpp | 4 +- src/lib/netlist/devices/nld_74165.cpp | 4 +- src/lib/netlist/devices/nld_74166.cpp | 4 +- src/lib/netlist/devices/nld_74174.cpp | 4 +- src/lib/netlist/devices/nld_74175.cpp | 4 +- src/lib/netlist/devices/nld_74192.cpp | 4 +- src/lib/netlist/devices/nld_74193.cpp | 4 +- src/lib/netlist/devices/nld_74194.cpp | 4 +- src/lib/netlist/devices/nld_74365.cpp | 4 +- src/lib/netlist/devices/nld_7475.cpp | 8 +- src/lib/netlist/devices/nld_74ls629.cpp | 4 +- src/lib/netlist/devices/nld_82S115.cpp | 4 +- src/lib/netlist/devices/nld_82S123.cpp | 4 +- src/lib/netlist/devices/nld_82S126.cpp | 4 +- src/lib/netlist/devices/nld_82S16.cpp | 4 +- src/lib/netlist/devices/nld_9310.cpp | 4 +- src/lib/netlist/devices/nld_9316.cpp | 4 +- src/lib/netlist/devices/nld_9322.cpp | 4 +- src/lib/netlist/devices/nld_am2847.cpp | 4 +- src/lib/netlist/devices/nld_dm9314.cpp | 4 +- src/lib/netlist/devices/nld_dm9334.cpp | 4 +- src/lib/netlist/devices/nld_legacy.cpp | 4 +- src/lib/netlist/devices/nld_log.cpp | 4 +- src/lib/netlist/devices/nld_mm5837.cpp | 2 +- src/lib/netlist/devices/nld_ne555.cpp | 4 +- src/lib/netlist/devices/nld_r2r_dac.cpp | 2 +- src/lib/netlist/devices/nld_schmitt.cpp | 2 +- src/lib/netlist/devices/nld_system.cpp | 24 +-- src/lib/netlist/devices/nld_tms4800.cpp | 4 +- src/lib/netlist/devices/nld_tristate.cpp | 4 +- src/lib/netlist/nl_factory.cpp | 140 ++++++++-------- src/lib/netlist/nl_factory.h | 36 ++-- src/lib/netlist/solver/nld_solver.cpp | 2 +- 45 files changed, 317 insertions(+), 333 deletions(-) (limited to 'src/lib/netlist/devices/nld_system.cpp') diff --git a/src/lib/netlist/analog/nld_bjt.cpp b/src/lib/netlist/analog/nld_bjt.cpp index cf963465b09..bd2e55e145f 100644 --- a/src/lib/netlist/analog/nld_bjt.cpp +++ b/src/lib/netlist/analog/nld_bjt.cpp @@ -430,8 +430,8 @@ NETLIB_UPDATE_PARAM(QBJT_EB) } //namespace analog namespace devices { - NETLIB_DEVICE_IMPL_NS(analog, QBJT_EB) - NETLIB_DEVICE_IMPL_NS(analog, QBJT_switch) + NETLIB_DEVICE_IMPL_NS(analog, QBJT_EB, "QBJT_EB", "MODEL") + NETLIB_DEVICE_IMPL_NS(analog, QBJT_switch, "QBJT_SW", "MODEL") } } // namespace netlist diff --git a/src/lib/netlist/analog/nld_opamps.cpp b/src/lib/netlist/analog/nld_opamps.cpp index 416fdbd76ee..b65ff0a9edd 100644 --- a/src/lib/netlist/analog/nld_opamps.cpp +++ b/src/lib/netlist/analog/nld_opamps.cpp @@ -239,6 +239,6 @@ namespace netlist } //namespace analog namespace devices { - NETLIB_DEVICE_IMPL_NS(analog, opamp) + NETLIB_DEVICE_IMPL_NS(analog, opamp, "OPAMP", "MODEL") } } // namespace netlist diff --git a/src/lib/netlist/analog/nld_switches.cpp b/src/lib/netlist/analog/nld_switches.cpp index 1ecfae06f9d..a2494553988 100644 --- a/src/lib/netlist/analog/nld_switches.cpp +++ b/src/lib/netlist/analog/nld_switches.cpp @@ -136,7 +136,7 @@ namespace netlist } //namespace analog namespace devices { - NETLIB_DEVICE_IMPL_NS(analog, switch1) - NETLIB_DEVICE_IMPL_NS(analog, switch2) + NETLIB_DEVICE_IMPL_NS(analog, switch1, "SWITCH", "") + NETLIB_DEVICE_IMPL_NS(analog, switch2, "SWITCH2", "") } } // namespace netlist diff --git a/src/lib/netlist/analog/nlid_fourterm.cpp b/src/lib/netlist/analog/nlid_fourterm.cpp index 89784812fbe..7cd9bd83561 100644 --- a/src/lib/netlist/analog/nlid_fourterm.cpp +++ b/src/lib/netlist/analog/nlid_fourterm.cpp @@ -116,9 +116,9 @@ NETLIB_RESET(VCVS) } //namespace analog namespace devices { - NETLIB_DEVICE_IMPL_NS(analog, VCVS) - NETLIB_DEVICE_IMPL_NS(analog, VCCS) - NETLIB_DEVICE_IMPL_NS(analog, CCCS) - NETLIB_DEVICE_IMPL_NS(analog, LVCCS) + NETLIB_DEVICE_IMPL_NS(analog, VCVS, "VCVS", "") + NETLIB_DEVICE_IMPL_NS(analog, VCCS, "VCCS", "") + NETLIB_DEVICE_IMPL_NS(analog, CCCS, "CCCS", "") + NETLIB_DEVICE_IMPL_NS(analog, LVCCS, "LVCCS", "") } } // namespace netlist diff --git a/src/lib/netlist/analog/nlid_twoterm.cpp b/src/lib/netlist/analog/nlid_twoterm.cpp index 3b57279ffca..4e3c001030d 100644 --- a/src/lib/netlist/analog/nlid_twoterm.cpp +++ b/src/lib/netlist/analog/nlid_twoterm.cpp @@ -271,14 +271,14 @@ NETLIB_UPDATE_TERMINALS(D) } //namespace analog namespace devices { - NETLIB_DEVICE_IMPL_NS(analog, R) - NETLIB_DEVICE_IMPL_NS(analog, POT) - NETLIB_DEVICE_IMPL_NS(analog, POT2) - NETLIB_DEVICE_IMPL_NS(analog, C) - NETLIB_DEVICE_IMPL_NS(analog, L) - NETLIB_DEVICE_IMPL_NS(analog, D) - NETLIB_DEVICE_IMPL_NS(analog, VS) - NETLIB_DEVICE_IMPL_NS(analog, CS) + NETLIB_DEVICE_IMPL_NS(analog, R, "RES", "R") + NETLIB_DEVICE_IMPL_NS(analog, POT, "POT", "R") + NETLIB_DEVICE_IMPL_NS(analog, POT2, "POT2", "R") + NETLIB_DEVICE_IMPL_NS(analog, C, "CAP", "C") + NETLIB_DEVICE_IMPL_NS(analog, L, "IND", "L") + NETLIB_DEVICE_IMPL_NS(analog, D, "DIODE", "MODEL") + NETLIB_DEVICE_IMPL_NS(analog, VS, "VS", "V") + NETLIB_DEVICE_IMPL_NS(analog, CS, "CS", "I") } } // namespace netlist diff --git a/src/lib/netlist/devices/net_lib.cpp b/src/lib/netlist/devices/net_lib.cpp index 3ab864b67e1..fe1e9ee86b0 100644 --- a/src/lib/netlist/devices/net_lib.cpp +++ b/src/lib/netlist/devices/net_lib.cpp @@ -17,149 +17,148 @@ #define NETLIB_DEVICE_DECL(chip) extern factory::constructor_ptr_t decl_ ## chip -#define ENTRYX1(nic, name, defparam, decl) factory.register_device( decl (pstring(# name), pstring(xstr(nic)), pstring(defparam)) ); -#define ENTRYX(nic, name, defparam) { NETLIB_DEVICE_DECL(nic); ENTRYX1(NETLIB_NAME(nic), name, defparam, decl_ ## nic) } - -#define ENTRYX1_N(nic, decl) factory.register_device( decl (pstring(""), pstring(xstr(nic)), pstring("")) ); -#define ENTRYX_N(nic) { NETLIB_DEVICE_DECL(nic); ENTRYX1_N(NETLIB_NAME(nic), decl_ ## nic) } +#define LIB_DECL(nic, decl) factory.register_device( decl ( pstring(xstr(nic))) ); +#define LIB_ENTRY(nic) { NETLIB_DEVICE_DECL(nic); LIB_DECL(NETLIB_NAME(nic), decl_ ## nic) } namespace netlist { - namespace devices - { - void initialize_factory(factory::list_t &factory) +namespace devices { - ENTRYX(R, RES, "R") - ENTRYX(POT, POT, "R") - ENTRYX(POT2, POT2, "R") - ENTRYX(C, CAP, "C") - ENTRYX(L, IND, "L") - ENTRYX(D, DIODE, "MODEL") - ENTRYX(VS, VS, "V") - ENTRYX(CS, CS, "I") - ENTRYX(VCVS, VCVS, "") - ENTRYX(VCCS, VCCS, "") - ENTRYX(CCCS, CCCS, "") - ENTRYX(LVCCS, LVCCS, "") - ENTRYX(opamp, OPAMP, "MODEL") - ENTRYX(dummy_input, DUMMY_INPUT, "") - ENTRYX(frontier, FRONTIER_DEV, "+I,+G,+Q") // not intended to be used directly - ENTRYX(function, AFUNC, "N,FUNC") // only for macro devices - NO FEEDBACK loops - ENTRYX(QBJT_EB, QBJT_EB, "MODEL") - ENTRYX(QBJT_switch, QBJT_SW, "MODEL") - ENTRYX(logic_input, TTL_INPUT, "IN") - ENTRYX(logic_input, LOGIC_INPUT, "IN,FAMILY") - ENTRYX(analog_input, ANALOG_INPUT, "IN") - ENTRYX(log, LOG, "+I") - ENTRYX(logD, LOGD, "+I,+I2") - ENTRYX(clock, CLOCK, "FREQ") - ENTRYX(extclock, EXTCLOCK, "FREQ,PATTERN") - ENTRYX(mainclock, MAINCLOCK, "FREQ") - ENTRYX(gnd, GND, "") - ENTRYX(netlistparams, PARAMETER, "") - ENTRYX(solver, SOLVER, "FREQ") - ENTRYX(res_sw, RES_SWITCH, "+IN,+P1,+P2") - ENTRYX(switch1, SWITCH, "") - ENTRYX(switch2, SWITCH2, "") - ENTRYX(nicRSFF, NETDEV_RSFF, "") - ENTRYX(nicDelay, NETDEV_DELAY, "") - ENTRYX(2102A, RAM_2102A, "+CEQ,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+A9,+RWQ,+DI") - ENTRYX(2102A_dip, RAM_2102A_DIP, "") - ENTRYX(2716, EPROM_2716, "+GQ,+EPQ,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+A9,+A10") - ENTRYX(2716_dip, EPROM_2716_DIP, "") - ENTRYX_N(7448) - ENTRYX_N(7448_dip) - ENTRYX_N(7450) - ENTRYX_N(7450_dip) - ENTRYX_N(7473) - ENTRYX_N(7473_dip) - ENTRYX_N(7473A) - ENTRYX_N(7473A_dip) - ENTRYX_N(7474) - ENTRYX_N(7474_dip) - ENTRYX(7475, TTL_7475, "") - ENTRYX(7475_dip, TTL_7475_DIP, "") - ENTRYX(7477, TTL_7477, "") - ENTRYX(7477_dip, TTL_7477_DIP, "") - ENTRYX_N(7483) - ENTRYX_N(7483_dip) - ENTRYX_N(7485) - ENTRYX_N(7485_dip) - ENTRYX_N(7490) - ENTRYX_N(7490_dip) - ENTRYX_N(7493) - ENTRYX_N(7493_dip) - ENTRYX_N(7497) - ENTRYX_N(7497_dip) - ENTRYX_N(74107) - ENTRYX_N(74107_dip) - ENTRYX_N(74107A) // FIXME: implement missing DIP - ENTRYX(74123, TTL_74123, "") - ENTRYX(74123_dip, TTL_74123_DIP, "") - ENTRYX_N(74153) - ENTRYX_N(74153_dip) - ENTRYX_N(74161) - ENTRYX_N(74161_dip) - ENTRYX(74164, TTL_74164, "+A,+B,+CLRQ,+CLK") - ENTRYX(74164_dip, TTL_74164_DIP, "") - ENTRYX(74165, TTL_74165, "+CLK,+CLKINH,+SH_LDQ,+SER,+A,+B,+C,+D,+E,+F,+G,+H") - ENTRYX(74165_dip, TTL_74165_DIP, "") - ENTRYX(74166, TTL_74166, "+CLK,+CLKINH,+SH_LDQ,+SER,+A,+B,+C,+D,+E,+F,+G,+H,+CLRQ") - ENTRYX(74166_dip, TTL_74166_DIP, "") - ENTRYX(74174, TTL_74174, "+CLK,+D1,+D2,+D3,+D4,+D5,+D6,+CLRQ") - ENTRYX(74175, TTL_74175, "+CLK,+D1,+D2,+D3,+D4,+CLRQ") - ENTRYX(74192, TTL_74192, "+A,+B,+C,+D,+CLEAR,+LOADQ,+CU,+CD") - ENTRYX(74193, TTL_74193, "+A,+B,+C,+D,+CLEAR,+LOADQ,+CU,+CD") - ENTRYX(74194, TTL_74194, "+CLK,+S0,+S1,+SRIN,+A,+B,+C,+D,+SLIN,+CLRQ") - ENTRYX(74365, TTL_74365, "+G1Q,+G2Q,+A1,+A2,+A3,+A4,+A5,+A6") - //ENTRY(74279, TTL_74279, "") // only dip available - ENTRYX(SN74LS629, SN74LS629, "CAP") - ENTRYX(82S16, TTL_82S16, "") - ENTRYX(82S115, PROM_82S115, "+CE1Q,+CE2,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+STROBE") - ENTRYX(82S123, PROM_82S123, "+CEQ,+A0,+A1,+A2,+A3,+A4") - ENTRYX(82S126, PROM_82S126, "+CE1Q,+CE2Q,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7") - ENTRYX(9310, TTL_9310, "") - ENTRYX(9314, TTL_9314, "+EQ,+MRQ,+S0Q,+S1Q,+S2Q,+S3Q,+D0,+D1,+D2,+D3") - ENTRYX(9316, TTL_9316, "+CLK,+ENP,+ENT,+CLRQ,+LOADQ,+A,+B,+C,+D") - ENTRYX(9322, TTL_9322, "+SELECT,+A1,+B1,+A2,+B2,+A3,+B3,+A4,+B4,+STROBE") - ENTRYX(9334, TTL_9334, "+CQ,+EQ,+D,+A0,+A1,+A2") - ENTRYX(AM2847, TTL_AM2847, "+CP,+INA,+INB,+INC,+IND,+RCA,+RCB,+RCC,+RCD") - ENTRYX(CD4020, CD4020_WI, "+IP,+RESET,+VDD,+VSS") - ENTRYX(CD4020, CD4020, "") - ENTRYX(CD4066_GATE, CD4066_GATE, "") - ENTRYX(CD4316_GATE, CD4316_GATE, "") - ENTRYX(4538_dip, CD4538_DIP, "") - ENTRYX(schmitt_trigger, SCHMITT_TRIGGER, "MODEL") - /* entries with suffix WI are legacy only */ - //ENTRY(4066, CD_4066, "+A,B") - ENTRYX(NE555, NE555, "") - ENTRYX(TMS4800, ROM_TMS4800, "+AR,+OE1,+OE2,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+A9,+A10") - ENTRYX(TMS4800_dip, ROM_TMS4800_DIP, "") - ENTRYX(r2r_dac, R2R_DAC, "VIN,R,N") - ENTRYX(tristate, TTL_TRISTATE, "+CEQ1,+D1,+CEQ2,+D2") - ENTRYX(tristate3, TTL_TRISTATE3, "") - ENTRYX(74174_dip, TTL_74174_DIP, "") - ENTRYX(74175_dip, TTL_74175_DIP, "") - ENTRYX(74192_dip, TTL_74192_DIP, "") - ENTRYX(74193_dip, TTL_74193_DIP, "") - ENTRYX(74194_dip, TTL_74194_DIP, "") - ENTRYX(74365_dip, TTL_74365_DIP, "") - ENTRYX(82S16_dip, TTL_82S16_DIP, "") - ENTRYX(82S115_dip, PROM_82S115_DIP, "") - ENTRYX(82S123_dip, PROM_82S123_DIP, "") - ENTRYX(82S126_dip, PROM_82S126_DIP, "") - ENTRYX(9602_dip, TTL_9602_DIP, "") - ENTRYX(9310_dip, TTL_9310_DIP, "") - ENTRYX(9314_dip, TTL_9314_DIP, "") - ENTRYX(9316_dip, TTL_9316_DIP, "") - ENTRYX(9322_dip, TTL_9322_DIP, "") - ENTRYX(9334_dip, TTL_9334_DIP, "") - ENTRYX(AM2847_dip, TTL_AM2847_DIP, "") - ENTRYX(SN74LS629_dip, SN74LS629_DIP, "1.CAP1,2.CAP2") - ENTRYX(NE555_dip, NE555_DIP, "") - ENTRYX(MM5837_dip, MM5837_DIP, "") -} - } //namespace devices + void initialize_factory(factory::list_t &factory) + { + LIB_ENTRY(R) + LIB_ENTRY(POT) + LIB_ENTRY(POT2) + LIB_ENTRY(C) + LIB_ENTRY(L) + LIB_ENTRY(D) + LIB_ENTRY(VS) + LIB_ENTRY(CS) + LIB_ENTRY(VCVS) + LIB_ENTRY(VCCS) + LIB_ENTRY(CCCS) + LIB_ENTRY(LVCCS) + LIB_ENTRY(opamp) + LIB_ENTRY(dummy_input) + LIB_ENTRY(frontier) // not intended to be used directly + LIB_ENTRY(function) // only for macro devices - NO FEEDBACK loops + LIB_ENTRY(QBJT_EB) + LIB_ENTRY(QBJT_switch) + LIB_ENTRY(logic_input_ttl) + LIB_ENTRY(logic_input) + LIB_ENTRY(analog_input) + LIB_ENTRY(log) + LIB_ENTRY(logD) + LIB_ENTRY(clock) + LIB_ENTRY(extclock) + LIB_ENTRY(mainclock) + LIB_ENTRY(gnd) + LIB_ENTRY(netlistparams) + LIB_ENTRY(solver) + LIB_ENTRY(res_sw) + LIB_ENTRY(switch1) + LIB_ENTRY(switch2) + LIB_ENTRY(nicRSFF) + LIB_ENTRY(nicDelay) + LIB_ENTRY(2102A) + LIB_ENTRY(2102A_dip) + LIB_ENTRY(2716) + LIB_ENTRY(2716_dip) + LIB_ENTRY(7448) + LIB_ENTRY(7448_dip) + LIB_ENTRY(7450) + LIB_ENTRY(7450_dip) + LIB_ENTRY(7473) + LIB_ENTRY(7473_dip) + LIB_ENTRY(7473A) + LIB_ENTRY(7473A_dip) + LIB_ENTRY(7474) + LIB_ENTRY(7474_dip) + LIB_ENTRY(7475) + LIB_ENTRY(7475_dip) + LIB_ENTRY(7477) + LIB_ENTRY(7477_dip) + LIB_ENTRY(7483) + LIB_ENTRY(7483_dip) + LIB_ENTRY(7485) + LIB_ENTRY(7485_dip) + LIB_ENTRY(7490) + LIB_ENTRY(7490_dip) + LIB_ENTRY(7493) + LIB_ENTRY(7493_dip) + LIB_ENTRY(7497) + LIB_ENTRY(7497_dip) + LIB_ENTRY(74107) + LIB_ENTRY(74107_dip) + LIB_ENTRY(74107A) // FIXME: implement missing DIP + LIB_ENTRY(74123) + LIB_ENTRY(74123_dip) + LIB_ENTRY(74153) + LIB_ENTRY(74153_dip) + LIB_ENTRY(74161) + LIB_ENTRY(74161_dip) + LIB_ENTRY(74164) + LIB_ENTRY(74164_dip) + LIB_ENTRY(74165) + LIB_ENTRY(74165_dip) + LIB_ENTRY(74166) + LIB_ENTRY(74166_dip) + LIB_ENTRY(74174) + LIB_ENTRY(74175) + LIB_ENTRY(74192) + LIB_ENTRY(74193) + LIB_ENTRY(74194) + LIB_ENTRY(74365) + //ENTRY(74279, TTL_74279, "") // only dip available + LIB_ENTRY(SN74LS629) + LIB_ENTRY(82S16) + LIB_ENTRY(82S115) + LIB_ENTRY(82S123) + LIB_ENTRY(82S126) + LIB_ENTRY(9310) + LIB_ENTRY(9314) + LIB_ENTRY(9316) + LIB_ENTRY(9322) + LIB_ENTRY(9334) + LIB_ENTRY(AM2847) + // FIXME: duplicate? + LIB_ENTRY(CD4020_WI) + LIB_ENTRY(CD4020) + LIB_ENTRY(CD4066_GATE) + LIB_ENTRY(CD4316_GATE) + LIB_ENTRY(4538_dip) + LIB_ENTRY(schmitt_trigger) + /* entries with suffix WI are legacy only */ + //ENTRY(4066, CD_4066, "+A,B") + LIB_ENTRY(NE555) + LIB_ENTRY(TMS4800) + LIB_ENTRY(TMS4800_dip) + LIB_ENTRY(r2r_dac) + LIB_ENTRY(tristate) + LIB_ENTRY(tristate3) + LIB_ENTRY(74174_dip) + LIB_ENTRY(74175_dip) + LIB_ENTRY(74192_dip) + LIB_ENTRY(74193_dip) + LIB_ENTRY(74194_dip) + LIB_ENTRY(74365_dip) + LIB_ENTRY(82S16_dip) + LIB_ENTRY(82S115_dip) + LIB_ENTRY(82S123_dip) + LIB_ENTRY(82S126_dip) + LIB_ENTRY(9602_dip) + LIB_ENTRY(9310_dip) + LIB_ENTRY(9314_dip) + LIB_ENTRY(9316_dip) + LIB_ENTRY(9322_dip) + LIB_ENTRY(9334_dip) + LIB_ENTRY(AM2847_dip) + LIB_ENTRY(SN74LS629_dip) + LIB_ENTRY(NE555_dip) + LIB_ENTRY(MM5837_dip) + } + +} //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_2102A.cpp b/src/lib/netlist/devices/nld_2102A.cpp index 3a84dcc7aec..b364e7ff448 100644 --- a/src/lib/netlist/devices/nld_2102A.cpp +++ b/src/lib/netlist/devices/nld_2102A.cpp @@ -97,8 +97,8 @@ namespace netlist m_ram[i] = 0; } - NETLIB_DEVICE_IMPL_DEPRECATED(2102A) - NETLIB_DEVICE_IMPL_DEPRECATED(2102A_dip) + NETLIB_DEVICE_IMPL(2102A, "RAM_2102A", "+CEQ,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+A9,+RWQ,+DI") + NETLIB_DEVICE_IMPL(2102A_dip,"RAM_2102A_DIP","") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_2716.cpp b/src/lib/netlist/devices/nld_2716.cpp index 4f1438ddb76..b9f5deca132 100644 --- a/src/lib/netlist/devices/nld_2716.cpp +++ b/src/lib/netlist/devices/nld_2716.cpp @@ -92,8 +92,8 @@ namespace netlist m_D[i].push((d >> i) & 1, delay); } - NETLIB_DEVICE_IMPL_DEPRECATED(2716) - NETLIB_DEVICE_IMPL_DEPRECATED(2716_dip) + NETLIB_DEVICE_IMPL(2716, "EPROM_2716", "+GQ,+EPQ,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+A9,+A10") + NETLIB_DEVICE_IMPL(2716_dip, "EPROM_2716_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_4020.cpp b/src/lib/netlist/devices/nld_4020.cpp index b305c16ec7a..35daf46d854 100644 --- a/src/lib/netlist/devices/nld_4020.cpp +++ b/src/lib/netlist/devices/nld_4020.cpp @@ -113,7 +113,8 @@ namespace netlist m_Q[i].push((cnt >> i) & 1, out_delayQn[i]); } - NETLIB_DEVICE_IMPL_DEPRECATED(CD4020) + NETLIB_DEVICE_IMPL(CD4020, "CD4020", "") + NETLIB_DEVICE_IMPL_ALIAS(CD4020_WI, CD4020, "CD4020_WI", "+IP,+RESET,+VDD,+VSS") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_4066.cpp b/src/lib/netlist/devices/nld_4066.cpp index 25b001b5151..944f3f0f1c2 100644 --- a/src/lib/netlist/devices/nld_4066.cpp +++ b/src/lib/netlist/devices/nld_4066.cpp @@ -79,7 +79,7 @@ namespace netlist } } - NETLIB_DEVICE_IMPL_DEPRECATED(CD4066_GATE) + NETLIB_DEVICE_IMPL(CD4066_GATE, "CD4066_GATE", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_4316.cpp b/src/lib/netlist/devices/nld_4316.cpp index a95cc67bfc3..b21ff8685f0 100644 --- a/src/lib/netlist/devices/nld_4316.cpp +++ b/src/lib/netlist/devices/nld_4316.cpp @@ -51,6 +51,6 @@ namespace netlist { namespace devices { m_R.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); } - NETLIB_DEVICE_IMPL_DEPRECATED(CD4316_GATE) + NETLIB_DEVICE_IMPL(CD4316_GATE, "CD4316_GATE", "") } } // namesapce netlist::devices diff --git a/src/lib/netlist/devices/nld_74123.cpp b/src/lib/netlist/devices/nld_74123.cpp index 24b79971062..7b8dbc7998b 100644 --- a/src/lib/netlist/devices/nld_74123.cpp +++ b/src/lib/netlist/devices/nld_74123.cpp @@ -306,10 +306,10 @@ namespace netlist m_2.reset(); } - NETLIB_DEVICE_IMPL_DEPRECATED(74123) - NETLIB_DEVICE_IMPL_DEPRECATED(74123_dip) - NETLIB_DEVICE_IMPL_DEPRECATED(4538_dip) - NETLIB_DEVICE_IMPL_DEPRECATED(9602_dip) + NETLIB_DEVICE_IMPL(74123, "TTL_74123", "") + NETLIB_DEVICE_IMPL(74123_dip, "TTL_74123_DIP", "") + NETLIB_DEVICE_IMPL(4538_dip, "CD4538_DIP", "") + NETLIB_DEVICE_IMPL(9602_dip, "TTL_9602_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_74164.cpp b/src/lib/netlist/devices/nld_74164.cpp index cac5fe87022..ccc172ef41b 100644 --- a/src/lib/netlist/devices/nld_74164.cpp +++ b/src/lib/netlist/devices/nld_74164.cpp @@ -97,8 +97,8 @@ namespace netlist } } - NETLIB_DEVICE_IMPL_DEPRECATED(74164) - NETLIB_DEVICE_IMPL_DEPRECATED(74164_dip) + NETLIB_DEVICE_IMPL(74164, "TTL_74164", "+A,+B,+CLRQ,+CLK") + NETLIB_DEVICE_IMPL(74164_dip, "TTL_74164_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_74165.cpp b/src/lib/netlist/devices/nld_74165.cpp index 7db9f963a90..6ad95da091f 100644 --- a/src/lib/netlist/devices/nld_74165.cpp +++ b/src/lib/netlist/devices/nld_74165.cpp @@ -101,8 +101,8 @@ namespace netlist m_QH.push(qh, NLTIME_FROM_NS(20)); // FIXME: Timing } - NETLIB_DEVICE_IMPL_DEPRECATED(74165) - NETLIB_DEVICE_IMPL_DEPRECATED(74165_dip) + NETLIB_DEVICE_IMPL(74165, "TTL_74165", "+CLK,+CLKINH,+SH_LDQ,+SER,+A,+B,+C,+D,+E,+F,+G,+H") + NETLIB_DEVICE_IMPL(74165_dip, "TTL_74165_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_74166.cpp b/src/lib/netlist/devices/nld_74166.cpp index 02a69dce36c..e18191bb308 100644 --- a/src/lib/netlist/devices/nld_74166.cpp +++ b/src/lib/netlist/devices/nld_74166.cpp @@ -121,8 +121,8 @@ namespace netlist m_QH.push(qh, delay); //FIXME } - NETLIB_DEVICE_IMPL_DEPRECATED(74166) - NETLIB_DEVICE_IMPL_DEPRECATED(74166_dip) + NETLIB_DEVICE_IMPL(74166, "TTL_74166", "+CLK,+CLKINH,+SH_LDQ,+SER,+A,+B,+C,+D,+E,+F,+G,+H,+CLRQ") + NETLIB_DEVICE_IMPL(74166_dip,"TTL_74166_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_74174.cpp b/src/lib/netlist/devices/nld_74174.cpp index 53ee8053048..23ef77c5db2 100644 --- a/src/lib/netlist/devices/nld_74174.cpp +++ b/src/lib/netlist/devices/nld_74174.cpp @@ -134,8 +134,8 @@ namespace netlist //m_sub.do_reset(); } - NETLIB_DEVICE_IMPL_DEPRECATED(74174) - NETLIB_DEVICE_IMPL_DEPRECATED(74174_dip) + NETLIB_DEVICE_IMPL(74174, "TTL_74174", "+CLK,+D1,+D2,+D3,+D4,+D5,+D6,+CLRQ") + NETLIB_DEVICE_IMPL(74174_dip,"TTL_74174_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_74175.cpp b/src/lib/netlist/devices/nld_74175.cpp index f92c70db572..f46f1b90c3e 100644 --- a/src/lib/netlist/devices/nld_74175.cpp +++ b/src/lib/netlist/devices/nld_74175.cpp @@ -111,8 +111,8 @@ namespace netlist m_data = 0xFF; } - NETLIB_DEVICE_IMPL_DEPRECATED(74175) - NETLIB_DEVICE_IMPL_DEPRECATED(74175_dip) + NETLIB_DEVICE_IMPL(74175, "TTL_74175", "+CLK,+D1,+D2,+D3,+D4,+CLRQ") + NETLIB_DEVICE_IMPL(74175_dip,"TTL_74175_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_74192.cpp b/src/lib/netlist/devices/nld_74192.cpp index 660a231253f..18b9e42e37e 100644 --- a/src/lib/netlist/devices/nld_74192.cpp +++ b/src/lib/netlist/devices/nld_74192.cpp @@ -162,8 +162,8 @@ namespace netlist m_CARRYQ.push(tCarry, NLTIME_FROM_NS(20)); //FIXME } - NETLIB_DEVICE_IMPL_DEPRECATED(74192) - NETLIB_DEVICE_IMPL_DEPRECATED(74192_dip) + NETLIB_DEVICE_IMPL(74192, "TTL_74192", "+A,+B,+C,+D,+CLEAR,+LOADQ,+CU,+CD") + NETLIB_DEVICE_IMPL(74192_dip,"TTL_74192_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_74193.cpp b/src/lib/netlist/devices/nld_74193.cpp index 66431b749ca..7ba258a2d07 100644 --- a/src/lib/netlist/devices/nld_74193.cpp +++ b/src/lib/netlist/devices/nld_74193.cpp @@ -139,8 +139,8 @@ namespace netlist m_CARRYQ.push(tCarry, NLTIME_FROM_NS(20)); //FIXME timing } - NETLIB_DEVICE_IMPL_DEPRECATED(74193) - NETLIB_DEVICE_IMPL_DEPRECATED(74193_dip) + NETLIB_DEVICE_IMPL(74193, "TTL_74193", "+A,+B,+C,+D,+CLEAR,+LOADQ,+CU,+CD") + NETLIB_DEVICE_IMPL(74193_dip, "TTL_74193_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_74194.cpp b/src/lib/netlist/devices/nld_74194.cpp index 6dcbe1790bf..2fb17ea4f3d 100644 --- a/src/lib/netlist/devices/nld_74194.cpp +++ b/src/lib/netlist/devices/nld_74194.cpp @@ -116,8 +116,8 @@ namespace netlist m_Q[i].push((q >> i) & 1, NLTIME_FROM_NS(26)); // FIXME: Timing } - NETLIB_DEVICE_IMPL_DEPRECATED(74194) - NETLIB_DEVICE_IMPL_DEPRECATED(74194_dip) + NETLIB_DEVICE_IMPL(74194, "TTL_74194", "+CLK,+S0,+S1,+SRIN,+A,+B,+C,+D,+SLIN,+CLRQ") + NETLIB_DEVICE_IMPL(74194_dip, "TTL_74194_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_74365.cpp b/src/lib/netlist/devices/nld_74365.cpp index fb4ad027188..3ddc8e3958a 100644 --- a/src/lib/netlist/devices/nld_74365.cpp +++ b/src/lib/netlist/devices/nld_74365.cpp @@ -76,8 +76,8 @@ namespace netlist } } - NETLIB_DEVICE_IMPL_DEPRECATED(74365) - NETLIB_DEVICE_IMPL_DEPRECATED(74365_dip) + NETLIB_DEVICE_IMPL(74365, "TTL_74365", "+G1Q,+G2Q,+A1,+A2,+A3,+A4,+A5,+A6") + NETLIB_DEVICE_IMPL(74365_dip, "TTL_74365_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_7475.cpp b/src/lib/netlist/devices/nld_7475.cpp index 06e3c588081..17caaf6351b 100644 --- a/src/lib/netlist/devices/nld_7475.cpp +++ b/src/lib/netlist/devices/nld_7475.cpp @@ -148,10 +148,10 @@ namespace netlist } - NETLIB_DEVICE_IMPL_DEPRECATED(7475) - NETLIB_DEVICE_IMPL_DEPRECATED(7475_dip) - NETLIB_DEVICE_IMPL_DEPRECATED(7477) - NETLIB_DEVICE_IMPL_DEPRECATED(7477_dip) + NETLIB_DEVICE_IMPL(7475, "TTL_7475", "") + NETLIB_DEVICE_IMPL(7475_dip, "TTL_7475_DIP", "") + NETLIB_DEVICE_IMPL(7477, "TTL_7477", "") + NETLIB_DEVICE_IMPL(7477_dip, "TTL_7477_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_74ls629.cpp b/src/lib/netlist/devices/nld_74ls629.cpp index 7017774266f..bdebea3a45e 100644 --- a/src/lib/netlist/devices/nld_74ls629.cpp +++ b/src/lib/netlist/devices/nld_74ls629.cpp @@ -234,8 +234,8 @@ namespace netlist } } - NETLIB_DEVICE_IMPL_DEPRECATED(SN74LS629) - NETLIB_DEVICE_IMPL_DEPRECATED(SN74LS629_dip) + NETLIB_DEVICE_IMPL(SN74LS629, "SN74LS629", "CAP") + NETLIB_DEVICE_IMPL(SN74LS629_dip, "SN74LS629_DIP", "1.CAP1,2.CAP2") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_82S115.cpp b/src/lib/netlist/devices/nld_82S115.cpp index b2eed7cbd10..02d692b127d 100644 --- a/src/lib/netlist/devices/nld_82S115.cpp +++ b/src/lib/netlist/devices/nld_82S115.cpp @@ -106,8 +106,8 @@ namespace netlist m_O[i].push((o >> i) & 1, NLTIME_FROM_NS(40)); // FIXME: Timing } - NETLIB_DEVICE_IMPL_DEPRECATED(82S115) - NETLIB_DEVICE_IMPL_DEPRECATED(82S115_dip) + NETLIB_DEVICE_IMPL(82S115, "PROM_82S115", "+CE1Q,+CE2,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+STROBE") + NETLIB_DEVICE_IMPL(82S115_dip, "PROM_82S115_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_82S123.cpp b/src/lib/netlist/devices/nld_82S123.cpp index a4c57ed2d46..18dc696d80a 100644 --- a/src/lib/netlist/devices/nld_82S123.cpp +++ b/src/lib/netlist/devices/nld_82S123.cpp @@ -77,8 +77,8 @@ namespace netlist m_O[i].push((o >> i) & 1, delay); } - NETLIB_DEVICE_IMPL_DEPRECATED(82S123) - NETLIB_DEVICE_IMPL_DEPRECATED(82S123_dip) + NETLIB_DEVICE_IMPL(82S123, "PROM_82S123", "+CEQ,+A0,+A1,+A2,+A3,+A4") + NETLIB_DEVICE_IMPL(82S123_dip, "PROM_82S123_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_82S126.cpp b/src/lib/netlist/devices/nld_82S126.cpp index 7762312c229..59989df604b 100644 --- a/src/lib/netlist/devices/nld_82S126.cpp +++ b/src/lib/netlist/devices/nld_82S126.cpp @@ -79,8 +79,8 @@ namespace netlist m_O[i].push((o >> i) & 1, delay); } - NETLIB_DEVICE_IMPL_DEPRECATED(82S126) - NETLIB_DEVICE_IMPL_DEPRECATED(82S126_dip) + NETLIB_DEVICE_IMPL(82S126, "PROM_82S126", "+CE1Q,+CE2Q,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7") + NETLIB_DEVICE_IMPL(82S126_dip, "PROM_82S126_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_82S16.cpp b/src/lib/netlist/devices/nld_82S16.cpp index 52385cf7e5b..1b3362b40cd 100644 --- a/src/lib/netlist/devices/nld_82S16.cpp +++ b/src/lib/netlist/devices/nld_82S16.cpp @@ -130,8 +130,8 @@ namespace netlist m_enq = 0; } - NETLIB_DEVICE_IMPL_DEPRECATED(82S16) - NETLIB_DEVICE_IMPL_DEPRECATED(82S16_dip) + NETLIB_DEVICE_IMPL(82S16, "TTL_82S16", "") + NETLIB_DEVICE_IMPL(82S16_dip, "TTL_82S16_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_9310.cpp b/src/lib/netlist/devices/nld_9310.cpp index ff708924a37..4348de20417 100644 --- a/src/lib/netlist/devices/nld_9310.cpp +++ b/src/lib/netlist/devices/nld_9310.cpp @@ -263,8 +263,8 @@ namespace netlist #endif } - NETLIB_DEVICE_IMPL_DEPRECATED(9310) - NETLIB_DEVICE_IMPL_DEPRECATED(9310_dip) + NETLIB_DEVICE_IMPL(9310, "TTL_9310", "") + NETLIB_DEVICE_IMPL(9310_dip, "TTL_9310_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_9316.cpp b/src/lib/netlist/devices/nld_9316.cpp index a557a509aca..20858ebc74f 100644 --- a/src/lib/netlist/devices/nld_9316.cpp +++ b/src/lib/netlist/devices/nld_9316.cpp @@ -167,8 +167,8 @@ namespace netlist } - NETLIB_DEVICE_IMPL_DEPRECATED(9316) - NETLIB_DEVICE_IMPL_DEPRECATED(9316_dip) + NETLIB_DEVICE_IMPL(9316, "TTL_9316", "+CLK,+ENP,+ENT,+CLRQ,+LOADQ,+A,+B,+C,+D") + NETLIB_DEVICE_IMPL(9316_dip, "TTL_9316_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_9322.cpp b/src/lib/netlist/devices/nld_9322.cpp index d72b9a561df..854af3d549c 100644 --- a/src/lib/netlist/devices/nld_9322.cpp +++ b/src/lib/netlist/devices/nld_9322.cpp @@ -111,8 +111,8 @@ namespace netlist m_4.update(); } - NETLIB_DEVICE_IMPL_DEPRECATED(9322) - NETLIB_DEVICE_IMPL_DEPRECATED(9322_dip) + NETLIB_DEVICE_IMPL(9322, "TTL_9322", "+SELECT,+A1,+B1,+A2,+B2,+A3,+B3,+A4,+B4,+STROBE") + NETLIB_DEVICE_IMPL(9322_dip, "TTL_9322_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_am2847.cpp b/src/lib/netlist/devices/nld_am2847.cpp index 6c045cca4ea..af7cf1ff2f7 100644 --- a/src/lib/netlist/devices/nld_am2847.cpp +++ b/src/lib/netlist/devices/nld_am2847.cpp @@ -130,8 +130,8 @@ namespace netlist m_OUT.push(out, NLTIME_FROM_NS(200)); } - NETLIB_DEVICE_IMPL_DEPRECATED(AM2847) - NETLIB_DEVICE_IMPL_DEPRECATED(AM2847_dip) + NETLIB_DEVICE_IMPL(AM2847, "TTL_AM2847", "+CP,+INA,+INB,+INC,+IND,+RCA,+RCB,+RCC,+RCD") + NETLIB_DEVICE_IMPL(AM2847_dip, "TTL_AM2847_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_dm9314.cpp b/src/lib/netlist/devices/nld_dm9314.cpp index 0ccff10d85a..b98eb57625e 100644 --- a/src/lib/netlist/devices/nld_dm9314.cpp +++ b/src/lib/netlist/devices/nld_dm9314.cpp @@ -107,8 +107,8 @@ namespace netlist } } - NETLIB_DEVICE_IMPL_DEPRECATED(9314) - NETLIB_DEVICE_IMPL_DEPRECATED(9314_dip) + NETLIB_DEVICE_IMPL(9314, "TTL_9314", "+EQ,+MRQ,+S0Q,+S1Q,+S2Q,+S3Q,+D0,+D1,+D2,+D3") + NETLIB_DEVICE_IMPL(9314_dip, "TTL_9314_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_dm9334.cpp b/src/lib/netlist/devices/nld_dm9334.cpp index d404c530449..c79803a7ecb 100644 --- a/src/lib/netlist/devices/nld_dm9334.cpp +++ b/src/lib/netlist/devices/nld_dm9334.cpp @@ -143,8 +143,8 @@ namespace netlist m_Q[i].push((q >> i) & 1, delay); } - NETLIB_DEVICE_IMPL_DEPRECATED(9334) - NETLIB_DEVICE_IMPL_DEPRECATED(9334_dip) + NETLIB_DEVICE_IMPL(9334, "TTL_9334", "+CQ,+EQ,+D,+A0,+A1,+A2") + NETLIB_DEVICE_IMPL(9334_dip, "TTL_9334_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_legacy.cpp b/src/lib/netlist/devices/nld_legacy.cpp index cc77d6b7063..df0bbc111cb 100644 --- a/src/lib/netlist/devices/nld_legacy.cpp +++ b/src/lib/netlist/devices/nld_legacy.cpp @@ -100,8 +100,8 @@ namespace netlist m_last = nval; } - NETLIB_DEVICE_IMPL_DEPRECATED(nicRSFF) - NETLIB_DEVICE_IMPL_DEPRECATED(nicDelay) + NETLIB_DEVICE_IMPL(nicRSFF, "NETDEV_RSFF", "") + NETLIB_DEVICE_IMPL(nicDelay, "NETDEV_DELAY", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_log.cpp b/src/lib/netlist/devices/nld_log.cpp index 03f7cae779c..107cd3863c0 100644 --- a/src/lib/netlist/devices/nld_log.cpp +++ b/src/lib/netlist/devices/nld_log.cpp @@ -89,8 +89,8 @@ namespace netlist #endif - NETLIB_DEVICE_IMPL_DEPRECATED(log) - NETLIB_DEVICE_IMPL_DEPRECATED(logD) + NETLIB_DEVICE_IMPL(log, "LOG", "+I") + NETLIB_DEVICE_IMPL(logD, "LOGD", "+I,+I2") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_mm5837.cpp b/src/lib/netlist/devices/nld_mm5837.cpp index 223c37c35af..713c7288df1 100644 --- a/src/lib/netlist/devices/nld_mm5837.cpp +++ b/src/lib/netlist/devices/nld_mm5837.cpp @@ -114,7 +114,7 @@ namespace netlist } - NETLIB_DEVICE_IMPL_DEPRECATED(MM5837_dip) + NETLIB_DEVICE_IMPL(MM5837_dip, "MM5837_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_ne555.cpp b/src/lib/netlist/devices/nld_ne555.cpp index e357afa6947..513aeefc66f 100644 --- a/src/lib/netlist/devices/nld_ne555.cpp +++ b/src/lib/netlist/devices/nld_ne555.cpp @@ -177,8 +177,8 @@ namespace netlist m_last_out = out; } - NETLIB_DEVICE_IMPL_DEPRECATED(NE555) - NETLIB_DEVICE_IMPL_DEPRECATED(NE555_dip) + NETLIB_DEVICE_IMPL(NE555, "NE555", "") + NETLIB_DEVICE_IMPL(NE555_dip, "NE555_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_r2r_dac.cpp b/src/lib/netlist/devices/nld_r2r_dac.cpp index 3a0ec2aea80..a622ebe52ab 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 } //namespace analog namespace devices { - NETLIB_DEVICE_IMPL_NS(analog, r2r_dac) + NETLIB_DEVICE_IMPL_NS(analog, r2r_dac, "R2R_DAC", "VIN,R,N") } } // namespace netlist diff --git a/src/lib/netlist/devices/nld_schmitt.cpp b/src/lib/netlist/devices/nld_schmitt.cpp index 394513d63a4..6f526ca7f42 100644 --- a/src/lib/netlist/devices/nld_schmitt.cpp +++ b/src/lib/netlist/devices/nld_schmitt.cpp @@ -125,7 +125,7 @@ namespace netlist bool m_is_timestep; }; - NETLIB_DEVICE_IMPL_DEPRECATED(schmitt_trigger) + NETLIB_DEVICE_IMPL(schmitt_trigger, "SCHMITT_TRIGGER", "MODEL") } // namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_system.cpp b/src/lib/netlist/devices/nld_system.cpp index bfc6f71e38f..24af4527a70 100644 --- a/src/lib/netlist/devices/nld_system.cpp +++ b/src/lib/netlist/devices/nld_system.cpp @@ -104,17 +104,19 @@ namespace netlist } - NETLIB_DEVICE_IMPL_DEPRECATED(dummy_input) - NETLIB_DEVICE_IMPL_DEPRECATED(frontier) - NETLIB_DEVICE_IMPL_DEPRECATED(function) - NETLIB_DEVICE_IMPL_DEPRECATED(logic_input) - NETLIB_DEVICE_IMPL_DEPRECATED(analog_input) - NETLIB_DEVICE_IMPL_DEPRECATED(clock) - NETLIB_DEVICE_IMPL_DEPRECATED(extclock) - NETLIB_DEVICE_IMPL_DEPRECATED(res_sw) - NETLIB_DEVICE_IMPL_DEPRECATED(mainclock) - NETLIB_DEVICE_IMPL_DEPRECATED(gnd) - NETLIB_DEVICE_IMPL_DEPRECATED(netlistparams) + NETLIB_DEVICE_IMPL(dummy_input, "DUMMY_INPUT", "") + NETLIB_DEVICE_IMPL(frontier, "FRONTIER_DEV", "+I,+G,+Q") + NETLIB_DEVICE_IMPL(function, "AFUNC", "N,FUNC") + NETLIB_DEVICE_IMPL(analog_input, "ANALOG_INPUT", "IN") + NETLIB_DEVICE_IMPL(clock, "CLOCK", "FREQ") + NETLIB_DEVICE_IMPL(extclock, "EXTCLOCK", "FREQ,PATTERN") + NETLIB_DEVICE_IMPL(res_sw, "RES_SWITCH", "+IN,+P1,+P2") + NETLIB_DEVICE_IMPL(mainclock, "MAINCLOCK", "FREQ") + NETLIB_DEVICE_IMPL(gnd, "GND", "") + NETLIB_DEVICE_IMPL(netlistparams, "PARAMETER", "") + + NETLIB_DEVICE_IMPL(logic_input, "LOGIC_INPUT", "IN,FAMILY") + NETLIB_DEVICE_IMPL_ALIAS(logic_input_ttl, logic_input, "TTL_INPUT", "IN") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_tms4800.cpp b/src/lib/netlist/devices/nld_tms4800.cpp index 6184cf487c5..d9c832b7d62 100644 --- a/src/lib/netlist/devices/nld_tms4800.cpp +++ b/src/lib/netlist/devices/nld_tms4800.cpp @@ -97,8 +97,8 @@ namespace netlist } } - NETLIB_DEVICE_IMPL_DEPRECATED(TMS4800) - NETLIB_DEVICE_IMPL_DEPRECATED(TMS4800_dip) + NETLIB_DEVICE_IMPL(TMS4800, "ROM_TMS4800", "+AR,+OE1,+OE2,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+A9,+A10") + NETLIB_DEVICE_IMPL(TMS4800_dip, "ROM_TMS4800_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_tristate.cpp b/src/lib/netlist/devices/nld_tristate.cpp index 1e7ad397d60..781ba014b4b 100644 --- a/src/lib/netlist/devices/nld_tristate.cpp +++ b/src/lib/netlist/devices/nld_tristate.cpp @@ -70,8 +70,8 @@ namespace netlist m_Q.push(q, NLTIME_FROM_NS(1)); } - NETLIB_DEVICE_IMPL_DEPRECATED(tristate) - NETLIB_DEVICE_IMPL_DEPRECATED(tristate3) + NETLIB_DEVICE_IMPL(tristate, "TTL_TRISTATE", "+CEQ1,+D1,+CEQ2,+D2") + NETLIB_DEVICE_IMPL(tristate3, "TTL_TRISTATE3", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/nl_factory.cpp b/src/lib/netlist/nl_factory.cpp index 998f1a5870b..eca8de4d4b2 100644 --- a/src/lib/netlist/nl_factory.cpp +++ b/src/lib/netlist/nl_factory.cpp @@ -17,95 +17,85 @@ namespace netlist { namespace factory { -class NETLIB_NAME(wrapper) : public device_t -{ -public: - NETLIB_NAME(wrapper)(netlist_base_t &anetlist, const pstring &name) - : device_t(anetlist, name) + class NETLIB_NAME(wrapper) : public device_t + { + public: + NETLIB_NAME(wrapper)(netlist_base_t &anetlist, const pstring &name) + : device_t(anetlist, name) + { + } + protected: + NETLIB_RESETI() { } + NETLIB_UPDATEI() { }; + }; + + element_t::element_t(const pstring &name, const pstring &classname, + const pstring &def_param, const pstring &sourcefile) + : m_name(name), m_classname(classname), m_def_param(def_param), + m_sourcefile(sourcefile) { } -protected: - NETLIB_RESETI(); - NETLIB_UPDATEI(); -}; - + element_t::element_t(const pstring &name, const pstring &classname, + const pstring &def_param) + : m_name(name), m_classname(classname), m_def_param(def_param), + m_sourcefile("") + { + } -element_t::element_t(const pstring &name, const pstring &classname, - const pstring &def_param, const pstring &sourcefile) - : m_name(name), m_classname(classname), m_def_param(def_param), - m_sourcefile(sourcefile) -{ -} - -element_t::element_t(const pstring &name, const pstring &classname, - const pstring &def_param) - : m_name(name), m_classname(classname), m_def_param(def_param), - m_sourcefile("") -{ -} - -element_t::~element_t() -{ -} - -// ---------------------------------------------------------------------------------------- -// net_device_t_base_factory -// ---------------------------------------------------------------------------------------- - -list_t::list_t( setup_t &setup) -: m_setup(setup) -{ -} + element_t::~element_t() + { + } -list_t::~list_t() -{ - clear(); -} + // ---------------------------------------------------------------------------------------- + // net_device_t_base_factory + // ---------------------------------------------------------------------------------------- -void list_t::register_device(std::unique_ptr &&factory) -{ - for (auto & e : *this) - if (e->name() == factory->name()) - m_setup.log().fatal(MF_1_FACTORY_ALREADY_CONTAINS_1, factory->name()); - push_back(std::move(factory)); -} - -factory::element_t * list_t::factory_by_name(const pstring &devname) -{ - for (auto & e : *this) + list_t::list_t( setup_t &setup) + : m_setup(setup) { - if (e->name() == devname) - return e.get(); } - m_setup.log().fatal(MF_1_CLASS_1_NOT_FOUND, devname); - return nullptr; // appease code analysis -} + list_t::~list_t() + { + clear(); + } -// ----------------------------------------------------------------------------- -// factory_lib_entry_t: factory class to wrap macro based chips/elements -// ----------------------------------------------------------------------------- + void list_t::register_device(std::unique_ptr &&factory) + { + for (auto & e : *this) + if (e->name() == factory->name()) + m_setup.log().fatal(MF_1_FACTORY_ALREADY_CONTAINS_1, factory->name()); + push_back(std::move(factory)); + } -plib::owned_ptr library_element_t::Create(netlist_base_t &anetlist, const pstring &name) -{ - return plib::owned_ptr::Create(anetlist, name); -} + factory::element_t * list_t::factory_by_name(const pstring &devname) + { + for (auto & e : *this) + { + if (e->name() == devname) + return e.get(); + } + + m_setup.log().fatal(MF_1_CLASS_1_NOT_FOUND, devname); + return nullptr; // appease code analysis + } -void library_element_t::macro_actions(netlist_base_t &anetlist, const pstring &name) -{ - anetlist.setup().namespace_push(name); - anetlist.setup().include(this->name()); - anetlist.setup().namespace_pop(); -} + // ----------------------------------------------------------------------------- + // factory_lib_entry_t: factory class to wrap macro based chips/elements + // ----------------------------------------------------------------------------- -NETLIB_RESET(wrapper) -{ -} + plib::owned_ptr library_element_t::Create(netlist_base_t &anetlist, const pstring &name) + { + return plib::owned_ptr::Create(anetlist, name); + } -NETLIB_UPDATE(wrapper) -{ -} + void library_element_t::macro_actions(netlist_base_t &anetlist, const pstring &name) + { + anetlist.setup().namespace_push(name); + anetlist.setup().include(this->name()); + anetlist.setup().namespace_pop(); + } } } diff --git a/src/lib/netlist/nl_factory.h b/src/lib/netlist/nl_factory.h index 4dc0409da00..a20ba400234 100644 --- a/src/lib/netlist/nl_factory.h +++ b/src/lib/netlist/nl_factory.h @@ -9,35 +9,28 @@ #ifndef NLFACTORY_H_ #define NLFACTORY_H_ +#include + #include "plib/palloc.h" #include "plib/ptypes.h" -// deprecated! -#define NETLIB_DEVICE_IMPL_DEPRECATED(chip) \ - static std::unique_ptr NETLIB_NAME(chip ## _c)( \ - const pstring &name, const pstring &classname, const pstring &def_param) \ - { \ - return std::unique_ptr(plib::palloc>(name, classname, def_param, pstring(__FILE__))); \ - } \ - factory::constructor_ptr_t decl_ ## chip = NETLIB_NAME(chip ## _c); +#define NETLIB_DEVICE_IMPL_ALIAS(p_alias, chip, p_name, p_def_param) \ + NETLIB_DEVICE_IMPL_BASE(devices, p_alias, chip, p_name, p_def_param) \ -// the new way ... #define NETLIB_DEVICE_IMPL(chip, p_name, p_def_param) \ - static std::unique_ptr NETLIB_NAME(chip ## _c)( \ - const pstring &name, const pstring &classname, const pstring &def_param) \ - { \ - return std::unique_ptr(plib::palloc>(p_name, classname, p_def_param, pstring(__FILE__))); \ - } \ - factory::constructor_ptr_t decl_ ## chip = NETLIB_NAME(chip ## _c); + NETLIB_DEVICE_IMPL_NS(devices, chip, p_name, p_def_param) + +#define NETLIB_DEVICE_IMPL_NS(ns, chip, p_name, p_def_param) \ + NETLIB_DEVICE_IMPL_BASE(ns, chip, chip, p_name, p_def_param) \ -#define NETLIB_DEVICE_IMPL_NS(ns, chip) \ - static std::unique_ptr NETLIB_NAME(chip ## _c)( \ - const pstring &name, const pstring &classname, const pstring &def_param) \ +#define NETLIB_DEVICE_IMPL_BASE(ns, p_alias, chip, p_name, p_def_param) \ + static std::unique_ptr NETLIB_NAME(p_alias ## _c) \ + (const pstring &classname) \ { \ - return std::unique_ptr(plib::palloc>(name, classname, def_param, pstring(__FILE__))); \ + return std::unique_ptr(plib::palloc>(p_name, classname, p_def_param, pstring(__FILE__))); \ } \ \ - factory::constructor_ptr_t decl_ ## chip = NETLIB_NAME(chip ## _c); + factory::constructor_ptr_t decl_ ## p_alias = NETLIB_NAME(p_alias ## _c); namespace netlist { class device_t; @@ -121,8 +114,7 @@ namespace factory { // factory_creator_ptr_t // ----------------------------------------------------------------------------- - using constructor_ptr_t = std::unique_ptr (*)(const pstring &name, const pstring &classname, - const pstring &def_param); + using constructor_ptr_t = std::unique_ptr (*)(const pstring &classname); template std::unique_ptr constructor_t(const pstring &name, const pstring &classname, diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp index 372919814d9..4350f892716 100644 --- a/src/lib/netlist/solver/nld_solver.cpp +++ b/src/lib/netlist/solver/nld_solver.cpp @@ -418,7 +418,7 @@ void NETLIB_NAME(solver)::create_solver_code(std::map &mp) } } - NETLIB_DEVICE_IMPL_DEPRECATED(solver) + NETLIB_DEVICE_IMPL(solver, "SOLVER", "FREQ") } //namespace devices } // namespace netlist -- cgit v1.2.3-70-g09d2 From c87a487d6de35479210d36dcf53d2c96a478601a Mon Sep 17 00:00:00 2001 From: couriersud Date: Mon, 4 Feb 2019 00:27:23 +0100 Subject: netlist: Refactoring and some functionality enhancements. (nw) - Removed dead code. - nltool now adds a define NLTOOL_VERSION. This can be tested in netlists. It is used in kidniki to ensure I stop committing debug parameters. - Optimized the proposal for no-deactivate hints. - Documented in breakout that hints were manually optimized. - Minor optimizations in the order of 2% enhancement. --- src/devices/machine/netlist.cpp | 6 +-- src/devices/machine/netlist.h | 1 - src/lib/netlist/devices/nld_9310.cpp | 31 +++++++------- src/lib/netlist/devices/nld_9316.cpp | 34 +++++----------- src/lib/netlist/devices/nld_system.cpp | 23 +++++++++++ src/lib/netlist/devices/nlid_system.h | 15 +++---- src/lib/netlist/devices/nlid_truthtable.h | 4 +- src/lib/netlist/nl_base.cpp | 68 ++++++++++--------------------- src/lib/netlist/nl_base.h | 59 +++++++++++++++++++++------ src/lib/netlist/nl_setup.cpp | 11 ++--- src/lib/netlist/nl_setup.h | 13 ++++-- src/lib/netlist/plib/plists.h | 3 +- src/lib/netlist/plib/poptions.cpp | 6 +-- src/lib/netlist/plib/poptions.h | 26 ++++++------ src/lib/netlist/plib/pparser.cpp | 14 +++---- src/lib/netlist/plib/pparser.h | 6 ++- src/lib/netlist/plib/pstate.cpp | 4 +- src/lib/netlist/plib/pstate.h | 4 +- src/lib/netlist/plib/putil.h | 4 ++ src/lib/netlist/prg/nltool.cpp | 21 ++++++---- src/lib/netlist/prg/nlwav.cpp | 10 ++--- src/mame/audio/nl_kidniki.cpp | 9 ++++ src/mame/machine/nl_breakout.cpp | 47 ++++++++++++++++++--- 23 files changed, 250 insertions(+), 169 deletions(-) (limited to 'src/lib/netlist/devices/nld_system.cpp') diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp index 6795dcb9d6a..fc76132a731 100644 --- a/src/devices/machine/netlist.cpp +++ b/src/devices/machine/netlist.cpp @@ -301,7 +301,7 @@ public: { int pos = (upto - m_last_buffer_time) / m_sample_time; if (pos > m_bufsize) - state().log().fatal("sound {1}: pos {2} exceeded bufsize {3}\n", name().c_str(), pos, m_bufsize); + throw emu_fatalerror("sound %s: pos %d exceeded bufsize %d\n", name().c_str(), pos, m_bufsize); while (m_last_pos < pos ) { m_buffer[m_last_pos++] = (stream_sample_t) m_cur; @@ -1050,10 +1050,8 @@ ATTR_COLD uint64_t netlist_mame_cpu_device::execute_cycles_to_clocks(uint64_t cy ATTR_HOT void netlist_mame_cpu_device::execute_run() { - bool check_debugger = ((device_t::machine().debug_flags & DEBUG_FLAG_ENABLED) != 0); - // debugging //m_ppc = m_pc; // copy PC to previous PC - if (check_debugger) + if (debugger_enabled()) { while (m_icount > 0) { diff --git a/src/devices/machine/netlist.h b/src/devices/machine/netlist.h index d79e9e298c2..06edb4beaa4 100644 --- a/src/devices/machine/netlist.h +++ b/src/devices/machine/netlist.h @@ -109,7 +109,6 @@ public: ATTR_HOT inline netlist::setup_t &setup(); ATTR_HOT inline netlist_mame_t &netlist() { return *m_netlist; } - ATTR_HOT inline const netlist::netlist_time last_time_update() { return m_old; } ATTR_HOT void update_icount(netlist::netlist_time time); ATTR_HOT void check_mame_abort_slice(); diff --git a/src/lib/netlist/devices/nld_9310.cpp b/src/lib/netlist/devices/nld_9310.cpp index 4348de20417..cbc197a70d8 100644 --- a/src/lib/netlist/devices/nld_9310.cpp +++ b/src/lib/netlist/devices/nld_9310.cpp @@ -158,32 +158,35 @@ namespace netlist NETLIB_UPDATE(9310_sub) { + auto cnt(m_cnt); + if (m_loadq) { - if (m_cnt < MAXCNT - 1) + if (cnt < MAXCNT - 1) { - ++m_cnt; - update_outputs(m_cnt); + ++cnt; + update_outputs(cnt); } - else if (m_cnt == MAXCNT - 1) + else if (cnt == MAXCNT - 1) { - m_cnt = MAXCNT; + cnt = MAXCNT; m_RC.push(m_ent, NLTIME_FROM_NS(20)); m_QA.push(1, NLTIME_FROM_NS(20)); } else // MAXCNT { m_RC.push(0, NLTIME_FROM_NS(20)); - m_cnt = 0; - update_outputs_all(m_cnt, NLTIME_FROM_NS(20)); + cnt = 0; + update_outputs_all(cnt, NLTIME_FROM_NS(20)); } } else { - m_cnt = m_ABCD->read_ABCD(); - m_RC.push(m_ent & (m_cnt == MAXCNT), NLTIME_FROM_NS(27)); - update_outputs_all(m_cnt, NLTIME_FROM_NS(22)); + cnt = m_ABCD->read_ABCD(); + m_RC.push(m_ent & (cnt == MAXCNT), NLTIME_FROM_NS(27)); + update_outputs_all(cnt, NLTIME_FROM_NS(22)); } + m_cnt = cnt; } NETLIB_UPDATE(9310) @@ -224,10 +227,10 @@ namespace netlist #if 0 // for (int i=0; i<4; i++) // m_Q[i], (cnt >> i) & 1, delay[i]); - m_QA, (cnt >> 0) & 1, out_delay); - m_QB, (cnt >> 1) & 1, out_delay); - m_QC, (cnt >> 2) & 1, out_delay); - m_QD, (cnt >> 3) & 1, out_delay); + m_QA.push((cnt >> 0) & 1, out_delay); + m_QB.push((cnt >> 1) & 1, out_delay); + m_QC.push((cnt >> 2) & 1, out_delay); + m_QD.push((cnt >> 3) & 1, out_delay); #else if ((cnt & 1) == 1) m_QA.push(1, out_delay); diff --git a/src/lib/netlist/devices/nld_9316.cpp b/src/lib/netlist/devices/nld_9316.cpp index 20858ebc74f..69dd1c1c6ca 100644 --- a/src/lib/netlist/devices/nld_9316.cpp +++ b/src/lib/netlist/devices/nld_9316.cpp @@ -105,27 +105,15 @@ namespace netlist NETLIB_HANDLER(9316, clk) { + auto cnt(m_cnt); if (m_LOADQ()) { - ++m_cnt &= MAXCNT; - //m_RC.push(m_ENT() && (m_cnt == MAXCNT), NLTIME_FROM_NS(27)); -#if 0 - if (m_cnt == MAXCNT) - { - m_RC.push(m_ENT(), NLTIME_FROM_NS(27)); - update_outputs_all(MAXCNT, NLTIME_FROM_NS(20)); - } - else if (m_cnt == 0) - { - m_RC.push(0, NLTIME_FROM_NS(27)); - update_outputs_all(0, NLTIME_FROM_NS(20)); - } - else - update_outputs_all(m_cnt, NLTIME_FROM_NS(20)); -#else - if (m_cnt > 0 && m_cnt < MAXCNT) - update_outputs_all(m_cnt, NLTIME_FROM_NS(20)); - else if (m_cnt == 0) + ++cnt &= MAXCNT; + //m_RC.push(m_ENT() && (cnt == MAXCNT), NLTIME_FROM_NS(27)); + + if (cnt > 0 && cnt < MAXCNT) + update_outputs_all(cnt, NLTIME_FROM_NS(20)); + else if (cnt == 0) { m_RC.push(0, NLTIME_FROM_NS(27)); update_outputs_all(0, NLTIME_FROM_NS(20)); @@ -135,14 +123,14 @@ namespace netlist m_RC.push(m_ENT(), NLTIME_FROM_NS(27)); update_outputs_all(MAXCNT, NLTIME_FROM_NS(20)); } -#endif } else { - m_cnt = m_abcd; - m_RC.push(m_ENT() && (m_cnt == MAXCNT), NLTIME_FROM_NS(27)); - update_outputs_all(m_cnt, NLTIME_FROM_NS(22)); + cnt = m_abcd; + m_RC.push(m_ENT() && (cnt == MAXCNT), NLTIME_FROM_NS(27)); + update_outputs_all(cnt, NLTIME_FROM_NS(22)); } + m_cnt = cnt; } NETLIB_UPDATE(9316) diff --git a/src/lib/netlist/devices/nld_system.cpp b/src/lib/netlist/devices/nld_system.cpp index 24af4527a70..134017d06b0 100644 --- a/src/lib/netlist/devices/nld_system.cpp +++ b/src/lib/netlist/devices/nld_system.cpp @@ -40,15 +40,38 @@ namespace netlist { m_cnt = 0; m_off = netlist_time::from_double(m_offset()); + m_feedback.m_delegate = NETLIB_DELEGATE(extclock, update); + + //m_feedback.m_delegate .set(&NETLIB_NAME(extclock)::update, this); //m_Q.initial(0); } + NETLIB_HANDLER(extclock, clk2) + { + m_Q.push((m_cnt & 1) ^ 1, m_inc[m_cnt]); + if (++m_cnt >= m_size) + m_cnt = 0; + } + + NETLIB_HANDLER(extclock, clk2_pow2) + { + m_Q.push((m_cnt & 1) ^ 1, m_inc[m_cnt]); + m_cnt = (++m_cnt) & (m_size-1); + } + NETLIB_UPDATE(extclock) { m_Q.push((m_cnt & 1) ^ 1, m_inc[m_cnt] + m_off); m_off = netlist_time::zero(); if (++m_cnt >= m_size) m_cnt = 0; + + // continue with optimized clock handlers .... + + if ((m_size & (m_size-1)) == 0) // power of 2? + m_feedback.m_delegate.set(&NETLIB_NAME(extclock)::clk2_pow2, this); + else + m_feedback.m_delegate.set(&NETLIB_NAME(extclock)::clk2, this); } // ----------------------------------------------------------------------------- diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h index 3d878646549..7271084bbc1 100644 --- a/src/lib/netlist/devices/nlid_system.h +++ b/src/lib/netlist/devices/nlid_system.h @@ -52,7 +52,7 @@ namespace netlist NETLIB_RESETI() { - m_Q.net().set_time(netlist_time::zero()); + m_Q.net().set_next_scheduled_time(netlist_time::zero()); } NETLIB_UPDATE_PARAMI() @@ -65,7 +65,7 @@ namespace netlist logic_net_t &net = m_Q.net(); // this is only called during setup ... net.toggle_new_Q(); - net.set_time(exec().time() + m_inc); + net.set_next_scheduled_time(exec().time() + m_inc); } public: @@ -73,13 +73,6 @@ namespace netlist param_double_t m_freq; netlist_time m_inc; - - static void mc_update(logic_net_t &net) - { - net.toggle_new_Q(); - net.update_devs(); - } - }; // ----------------------------------------------------------------------------- @@ -158,6 +151,10 @@ namespace netlist NETLIB_UPDATEI(); NETLIB_RESETI(); //NETLIB_UPDATE_PARAMI(); + + NETLIB_HANDLERI(clk2); + NETLIB_HANDLERI(clk2_pow2); + protected: param_double_t m_freq; diff --git a/src/lib/netlist/devices/nlid_truthtable.h b/src/lib/netlist/devices/nlid_truthtable.h index f0f85e037de..c633a6991a1 100644 --- a/src/lib/netlist/devices/nlid_truthtable.h +++ b/src/lib/netlist/devices/nlid_truthtable.h @@ -179,7 +179,7 @@ namespace devices m_I[i].activate(); //nstate |= (m_I[i]() ? (1 << i) : 0); nstate |= (m_I[i]() << i); - mt = std::max(this->m_I[i].net().time(), mt); + mt = std::max(this->m_I[i].net().next_scheduled_time(), mt); } else for (std::size_t i = 0; i < m_NI; i++) @@ -208,7 +208,7 @@ namespace devices { //nstate |= (m_I[i]() ? (1 << i) : 0); nstate |= (m_I[i]() << i); - mt = std::max(this->m_I[i].net().time(), mt); + mt = std::max(this->m_I[i].net().next_scheduled_time(), mt); } else for (std::size_t i = 0; i < m_NI; i++) diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index 14807111ff2..4ce980dbba8 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -164,11 +164,9 @@ void detail::queue_t::register_state(plib::state_manager_t &manager, const pstri manager.save_item(this, &m_net_ids[0], module + "." + "names", m_net_ids.size()); } -void detail::queue_t::on_pre_save() +void detail::queue_t::on_pre_save(plib::state_manager_t &manager) { - state().log().debug("on_pre_save\n"); m_qsize = this->size(); - state().log().debug("qsize {1}\n", m_qsize); for (std::size_t i = 0; i < m_qsize; i++ ) { m_times[i] = this->listptr()[i].m_exec_time.as_raw(); @@ -177,10 +175,9 @@ void detail::queue_t::on_pre_save() } -void detail::queue_t::on_post_load() +void detail::queue_t::on_post_load(plib::state_manager_t &manager) { this->clear(); - state().log().debug("qsize {1}\n", m_qsize); for (std::size_t i = 0; i < m_qsize; i++ ) { detail::net_t *n = state().nets()[m_net_ids[i]].get(); @@ -247,11 +244,11 @@ detail::terminal_type detail::core_terminal_t::type() const // ---------------------------------------------------------------------------------------- netlist_t::netlist_t(const pstring &aname, std::unique_ptr callbacks) - : m_state(plib::make_unique(aname, + : m_time(netlist_time::zero()) + , m_mainclock(nullptr) + , m_state(plib::make_unique(aname, std::move(callbacks), plib::make_unique(*this))) // FIXME, ugly but needed to have netlist_state_t constructed first - , m_time(netlist_time::zero()) - , m_mainclock(nullptr) , m_queue(*m_state) , m_solver(nullptr) { @@ -272,8 +269,7 @@ netlist_t::~netlist_t() netlist_state_t::netlist_state_t(const pstring &aname, std::unique_ptr &&callbacks, std::unique_ptr &&setup) -: m_params(nullptr) -, m_name(aname) +: m_name(aname) , m_state() , m_callbacks(std::move(callbacks)) // Order is important here , m_log(*m_callbacks) @@ -339,7 +335,7 @@ void netlist_t::reset() m_time = netlist_time::zero(); m_queue.clear(); if (m_mainclock != nullptr) - m_mainclock->m_Q.net().set_time(netlist_time::zero()); + m_mainclock->m_Q.net().set_next_scheduled_time(netlist_time::zero()); //if (m_solver != nullptr) // m_solver->reset(); @@ -452,7 +448,7 @@ void netlist_t::process_queue(const netlist_time delta) NL_NOEXCEPT { logic_net_t &mc_net(m_mainclock->m_Q.net()); const netlist_time inc(m_mainclock->m_inc); - netlist_time mc_time(mc_net.time()); + netlist_time mc_time(mc_net.next_scheduled_time()); do { @@ -474,7 +470,7 @@ void netlist_t::process_queue(const netlist_time delta) NL_NOEXCEPT else break; } while (true); //while (e.m_object != nullptr); - mc_net.set_time(mc_time); + mc_net.set_next_scheduled_time(mc_time); } m_stat_mainloop.stop(); } @@ -503,6 +499,9 @@ void netlist_t::print_stats() const total_count += entry->m_stat_total_time.count(); } + log().verbose("Total calls : {1:12} {2:12} {3:12}", total_count, + total_time, total_time / total_count); + nperftime_t overhead; nperftime_t test; overhead.start(); @@ -531,10 +530,16 @@ void netlist_t::print_stats() const / static_cast::type>(m_queue.m_prof_call()); log().verbose("Overhead per pop {1:11}", overhead_per_pop ); log().verbose(""); + + auto trigger = total_count * 200 / 1000000; // 200 ppm for (auto &entry : m_state->m_devices) { - if (entry->m_stat_inc_active() > 3 * entry->m_stat_total_time.count()) - log().verbose("HINT({}, NO_DEACTIVATE)", entry->name()); + // Factor of 3 offers best performace increase + if (entry->m_stat_inc_active() > 3 * entry->m_stat_total_time.count() + && entry->m_stat_inc_active() > trigger) + log().verbose("HINT({}, NO_DEACTIVATE) // {} {} {}", entry->name(), + static_cast(entry->m_stat_inc_active()) / static_cast(entry->m_stat_total_time.count()), + entry->m_stat_inc_active(), entry->m_stat_total_time.count()); } } } @@ -687,7 +692,7 @@ detail::net_t::net_t(netlist_base_t &nl, const pstring &aname, core_terminal_t * , m_new_Q(*this, "m_new_Q", 0) , m_cur_Q (*this, "m_cur_Q", 0) , m_in_queue(*this, "m_in_queue", QS_DELIVERED) - , m_time(*this, "m_time", netlist_time::zero()) + , m_next_scheduled_time(*this, "m_time", netlist_time::zero()) , m_railterminal(mr) { } @@ -697,35 +702,6 @@ detail::net_t::~net_t() state().run_state_manager().remove_save_items(this); } -void detail::net_t::add_to_active_list(core_terminal_t &term) NL_NOEXCEPT -{ - const bool was_empty = m_list_active.empty(); - m_list_active.push_front(&term); - if (was_empty) - { - railterminal().device().do_inc_active(); - if (m_in_queue == QS_DELAYED_DUE_TO_INACTIVE) - { - if (m_time > exec().time()) - { - m_in_queue = QS_QUEUED; /* pending */ - exec().queue().push({m_time, this}); - } - else - { - m_in_queue = QS_DELIVERED; - m_cur_Q = m_new_Q; - } - } - } -} - -void detail::net_t::remove_from_active_list(core_terminal_t &term) NL_NOEXCEPT -{ - m_list_active.remove(&term); - if (m_list_active.empty()) - railterminal().device().do_dec_active(); -} void detail::net_t::rebuild_list() { @@ -779,7 +755,7 @@ void detail::net_t::update_devs() NL_NOEXCEPT void detail::net_t::reset() { - m_time = netlist_time::zero(); + m_next_scheduled_time = netlist_time::zero(); m_in_queue = QS_DELIVERED; m_new_Q = 0; diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index ca75046b3e5..35ecc694cfd 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -732,8 +732,8 @@ namespace netlist void update_devs() NL_NOEXCEPT; - const netlist_time time() const noexcept { return m_time; } - void set_time(netlist_time ntime) noexcept { m_time = ntime; } + const netlist_time next_scheduled_time() const noexcept { return m_next_scheduled_time; } + void set_next_scheduled_time(netlist_time ntime) noexcept { m_next_scheduled_time = ntime; } bool isRailNet() const noexcept { return !(m_railterminal == nullptr); } core_terminal_t & railterminal() const noexcept { return *m_railterminal; } @@ -761,7 +761,7 @@ namespace netlist state_var m_cur_Q; state_var m_in_queue; /* 0: not in queue, 1: in queue, 2: last was taken */ - state_var m_time; + state_var m_next_scheduled_time; private: plib::linkedlist_t m_list_active; @@ -803,7 +803,7 @@ namespace netlist if (newQ != m_new_Q) { m_in_queue = QS_DELAYED_DUE_TO_INACTIVE; - m_time = at; + m_next_scheduled_time = at; } m_cur_Q = m_new_Q = newQ; } @@ -1204,8 +1204,8 @@ namespace netlist protected: void register_state(plib::state_manager_t &manager, const pstring &module) override; - void on_pre_save() override; - void on_post_load() override; + void on_pre_save(plib::state_manager_t &manager) override; + void on_post_load(plib::state_manager_t &manager) override; private: std::size_t m_qsize; @@ -1272,8 +1272,6 @@ namespace netlist template void register_net(plib::owned_ptr &&net) { m_nets.push_back(std::move(net)); } - devices::NETLIB_NAME(netlistparams) *m_params; - template inline std::vector get_device_list() { @@ -1387,11 +1385,10 @@ namespace netlist void print_stats() const; private: - std::unique_ptr m_state; - /* mostly rw */ netlist_time m_time; devices::NETLIB_NAME(mainclock) * m_mainclock; + std::unique_ptr m_state; detail::queue_t m_queue; devices::NETLIB_NAME(solver) * m_solver; @@ -1517,15 +1514,50 @@ namespace netlist { if ((num_cons() != 0)) { + auto &lexec(exec()); + auto &q(lexec.queue()); + auto nst(lexec.time() + delay); + if (is_queued()) - exec().queue().remove(this); - m_time = exec().time() + delay; + q.remove(this); m_in_queue = (!m_list_active.empty()) ? QS_QUEUED : QS_DELAYED_DUE_TO_INACTIVE; /* queued ? */ if (m_in_queue == QS_QUEUED) - exec().queue().push(queue_t::entry_t(m_time, this)); + q.push(queue_t::entry_t(nst, this)); + m_next_scheduled_time = nst; } } + inline void detail::net_t::add_to_active_list(core_terminal_t &term) NL_NOEXCEPT + { + if (m_list_active.empty()) + { + m_list_active.push_front(&term); + railterminal().device().do_inc_active(); + if (m_in_queue == QS_DELAYED_DUE_TO_INACTIVE) + { + if (m_next_scheduled_time > exec().time()) + { + m_in_queue = QS_QUEUED; /* pending */ + exec().queue().push({m_next_scheduled_time, this}); + } + else + { + m_in_queue = QS_DELIVERED; + m_cur_Q = m_new_Q; + } + } + } + else + m_list_active.push_front(&term); + } + + inline void detail::net_t::remove_from_active_list(core_terminal_t &term) NL_NOEXCEPT + { + m_list_active.remove(&term); + if (m_list_active.empty()) + railterminal().device().do_dec_active(); + } + inline const analog_net_t & analog_t::net() const NL_NOEXCEPT { return static_cast(core_terminal_t::net()); @@ -1583,6 +1615,7 @@ namespace netlist return m_device.exec(); } + inline const netlist_t &detail::device_object_t::exec() const NL_NOEXCEPT { return m_device.exec(); diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp index 291e95add83..cef51f481db 100644 --- a/src/lib/netlist/nl_setup.cpp +++ b/src/lib/netlist/nl_setup.cpp @@ -27,6 +27,7 @@ namespace netlist { setup_t::setup_t(netlist_t &netlist) : m_netlist(netlist) + , m_netlist_params(nullptr) , m_factory(*this) , m_proxy_cnt(0) , m_frontier_cnt(0) @@ -970,13 +971,13 @@ std::unique_ptr setup_t::get_data_stream(const pstring &name) return std::unique_ptr(nullptr); } -void setup_t::register_define(const pstring &defstr) +void setup_t::add_define(const pstring &defstr) { auto p = defstr.find("="); if (p != pstring::npos) - register_define(plib::left(defstr, p), defstr.substr(p+1)); + add_define(plib::left(defstr, p), defstr.substr(p+1)); else - register_define(defstr, "1"); + add_define(defstr, "1"); } // ---------------------------------------------------------------------------------------- @@ -1024,7 +1025,7 @@ void setup_t::prepare_to_run() log().debug("Searching for solver and parameters ...\n"); auto solver = netlist().get_single_device("solver"); - netlist().m_params = netlist().get_single_device("parameter"); + m_netlist_params = netlist().get_single_device("parameter"); /* create devices */ @@ -1039,7 +1040,7 @@ void setup_t::prepare_to_run() } } - bool use_deactivate = (netlist().m_params->m_use_deactivate() ? true : false); + bool use_deactivate = m_netlist_params->m_use_deactivate() ? true : false; for (auto &d : netlist().devices()) { diff --git a/src/lib/netlist/nl_setup.h b/src/lib/netlist/nl_setup.h index 4becfe1ee0c..25201bee1b5 100644 --- a/src/lib/netlist/nl_setup.h +++ b/src/lib/netlist/nl_setup.h @@ -123,6 +123,7 @@ namespace netlist namespace devices { class nld_base_proxy; + class nld_netlistparams; } class core_device_t; @@ -274,8 +275,12 @@ namespace netlist m_sources.push_back(std::move(src)); } - void register_define(pstring def, pstring val) { m_defines.push_back(plib::ppreprocessor::define_t(def, val)); } - void register_define(const pstring &defstr); + void add_define(pstring def, pstring val) + { + m_defines.insert({ def, plib::ppreprocessor::define_t(def, val)}); + } + + void add_define(const pstring &defstr); factory::list_t &factory() { return m_factory; } const factory::list_t &factory() const { return m_factory; } @@ -337,14 +342,16 @@ namespace netlist std::unordered_map m_terminals; netlist_t &m_netlist; + devices::nld_netlistparams *m_netlist_params; std::unordered_map m_params; + std::vector m_links; factory::list_t m_factory; std::unordered_map m_models; std::stack m_namespace_stack; source_t::list_t m_sources; - std::vector m_defines; + plib::ppreprocessor::defines_map_type m_defines; unsigned m_proxy_cnt; unsigned m_frontier_cnt; diff --git a/src/lib/netlist/plib/plists.h b/src/lib/netlist/plib/plists.h index 5574f095484..d440d76de2a 100644 --- a/src/lib/netlist/plib/plists.h +++ b/src/lib/netlist/plib/plists.h @@ -152,9 +152,10 @@ public: void remove(const LC *elem) noexcept { auto p = &m_head; - for ( ; *p != elem; p = &((*p)->m_next)) + while(*p != elem) { //nl_assert(*p != nullptr); + p = &((*p)->m_next); } (*p) = elem->m_next; } diff --git a/src/lib/netlist/plib/poptions.cpp b/src/lib/netlist/plib/poptions.cpp index 43e992f9225..dcb8e3931f3 100644 --- a/src/lib/netlist/plib/poptions.cpp +++ b/src/lib/netlist/plib/poptions.cpp @@ -219,7 +219,7 @@ namespace plib { } pstring options::help(pstring description, pstring usage, - unsigned width, unsigned indent) + unsigned width, unsigned indent) const { pstring ret; @@ -293,7 +293,7 @@ namespace plib { return ret; } - option *options::getopt_short(pstring arg) + option *options::getopt_short(pstring arg) const { for (auto & optbase : m_opts) { @@ -303,7 +303,7 @@ namespace plib { } return nullptr; } - option *options::getopt_long(pstring arg) + option *options::getopt_long(pstring arg) const { for (auto & optbase : m_opts) { diff --git a/src/lib/netlist/plib/poptions.h b/src/lib/netlist/plib/poptions.h index 4a8e6d788d7..925329e80d4 100644 --- a/src/lib/netlist/plib/poptions.h +++ b/src/lib/netlist/plib/poptions.h @@ -27,7 +27,7 @@ public: option_base(options &parent, pstring help); virtual ~option_base(); - pstring help() { return m_help; } + pstring help() const { return m_help; } private: pstring m_help; }; @@ -39,7 +39,7 @@ public: : option_base(parent, help), m_group(group) { } ~option_group(); - pstring group() { return m_group; } + pstring group() const { return m_group; } private: pstring m_group; }; @@ -51,7 +51,7 @@ public: : option_base(parent, help), m_example(group) { } ~option_example(); - pstring example() { return m_example; } + pstring example() const { return m_example; } private: pstring m_example; }; @@ -93,7 +93,7 @@ public: : option(parent, ashort, along, help, true), m_val(defval) {} - pstring operator ()() { return m_val; } + pstring operator ()() const { return m_val; } protected: virtual int parse(const pstring &argument) override; @@ -128,7 +128,7 @@ public: { } - T operator ()() { return m_val; } + T operator ()() const { return m_val; } pstring as_string() const { return limit()[m_val]; } @@ -157,7 +157,7 @@ public: : option(parent, ashort, along, help, false), m_val(false) {} - bool operator ()() { return m_val; } + bool operator ()() const { return m_val; } protected: virtual int parse(const pstring &argument) override; @@ -180,7 +180,7 @@ public: , m_max(maxval) {} - T operator ()() { return m_val; } + T operator ()() const { return m_val; } protected: virtual int parse(const pstring &argument) override @@ -203,7 +203,7 @@ public: : option(parent, ashort, along, help, true) {} - std::vector operator ()() { return m_val; } + const std::vector &operator ()() const { return m_val; } protected: virtual int parse(const pstring &argument) override; @@ -233,9 +233,9 @@ public: int parse(int argc, char *argv[]); pstring help(pstring description, pstring usage, - unsigned width = 72, unsigned indent = 20); + unsigned width = 72, unsigned indent = 20) const; - pstring app() { return m_app; } + pstring app() const { return m_app; } private: static pstring split_paragraphs(pstring text, unsigned width, unsigned indent, @@ -244,7 +244,7 @@ private: void check_consistency(); template - T *getopt_type() + T *getopt_type() const { for (auto & optbase : m_opts ) { @@ -254,8 +254,8 @@ private: return nullptr; } - option *getopt_short(pstring arg); - option *getopt_long(pstring arg); + option *getopt_short(pstring arg) const; + option *getopt_long(pstring arg) const; std::vector m_opts; pstring m_app; diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp index 48e29570b4c..d666ad11054 100644 --- a/src/lib/netlist/plib/pparser.cpp +++ b/src/lib/netlist/plib/pparser.cpp @@ -268,7 +268,7 @@ void ptokenizer::error(const pstring &errs) // A simple preprocessor // ---------------------------------------------------------------------------------------- -ppreprocessor::ppreprocessor(std::vector *defines) +ppreprocessor::ppreprocessor(defines_map_type *defines) : pistream() , m_ifflag(0) , m_level(0) @@ -292,12 +292,7 @@ ppreprocessor::ppreprocessor(std::vector *defines) m_defines.insert({"__PLIB_PREPROCESSOR__", define_t("__PLIB_PREPROCESSOR__", "1")}); if (defines != nullptr) - { - for (auto & p : *defines) - { - m_defines.insert({p.m_name, p}); - } - } + m_defines = *defines; } void ppreprocessor::error(const pstring &err) @@ -524,7 +519,10 @@ pstring ppreprocessor::process_line(pstring line) } } else - error(pfmt("unknown directive on line {1}: {2}")(m_lineno)(line)); + { + if (m_ifflag == 0) + error(pfmt("unknown directive on line {1}: {2}")(m_lineno)(replace_macros(line))); + } } else { diff --git a/src/lib/netlist/plib/pparser.h b/src/lib/netlist/plib/pparser.h index 1eeb92d797b..3829e8cdcc8 100644 --- a/src/lib/netlist/plib/pparser.h +++ b/src/lib/netlist/plib/pparser.h @@ -163,7 +163,9 @@ public: pstring m_replace; }; - explicit ppreprocessor(std::vector *defines = nullptr); + using defines_map_type = std::unordered_map; + + explicit ppreprocessor(defines_map_type *defines = nullptr); virtual ~ppreprocessor() override {} template @@ -214,7 +216,7 @@ private: pstring process_line(pstring line); pstring process_comments(pstring line); - std::unordered_map m_defines; + defines_map_type m_defines; std::vector m_expr_sep; std::uint_least64_t m_ifflag; // 31 if levels diff --git a/src/lib/netlist/plib/pstate.cpp b/src/lib/netlist/plib/pstate.cpp index 3cab5dec127..a5465bfed46 100644 --- a/src/lib/netlist/plib/pstate.cpp +++ b/src/lib/netlist/plib/pstate.cpp @@ -48,13 +48,13 @@ void state_manager_t::remove_save_items(const void *owner) void state_manager_t::pre_save() { for (auto & s : m_custom) - s->m_callback->on_pre_save(); + s->m_callback->on_pre_save(*this); } void state_manager_t::post_load() { for (auto & s : m_custom) - s->m_callback->on_post_load(); + s->m_callback->on_post_load(*this); } template<> void state_manager_t::save_item(const void *owner, callback_t &state, const pstring &stname) diff --git a/src/lib/netlist/plib/pstate.h b/src/lib/netlist/plib/pstate.h index 5b8acc92221..3a908cba2d2 100644 --- a/src/lib/netlist/plib/pstate.h +++ b/src/lib/netlist/plib/pstate.h @@ -56,8 +56,8 @@ public: virtual ~callback_t(); virtual void register_state(state_manager_t &manager, const pstring &module) = 0; - virtual void on_pre_save() = 0; - virtual void on_post_load() = 0; + virtual void on_pre_save(state_manager_t &manager) = 0; + virtual void on_post_load(state_manager_t &manager) = 0; protected: }; diff --git a/src/lib/netlist/plib/putil.h b/src/lib/netlist/plib/putil.h index 4212677c81c..023a0271ce2 100644 --- a/src/lib/netlist/plib/putil.h +++ b/src/lib/netlist/plib/putil.h @@ -14,6 +14,10 @@ #include #include // <<= needed by windows build +#define PSTRINGIFY_HELP(y) # y +#define PSTRINGIFY(x) PSTRINGIFY_HELP(x) + + namespace plib { diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index 3c9839a7845..984f8703079 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -17,6 +17,8 @@ #include +#define NLTOOL_VERSION 20190202 + class tool_app_t : public plib::app { public: @@ -36,7 +38,7 @@ public: opt_name(*this, "n", "name", "", "the netlist in file specified by ""-f"" option to run; default is first one"), opt_grp3(*this, "Options for run command", "These options are only used by the run command."), - opt_ttr (*this, "t", "time_to_run", 1.0, "time to run the emulation (seconds)"), + opt_ttr (*this, "t", "time_to_run", 1.0, "time to run the emulation (seconds)\n\n abc def\n\n xyz"), opt_logs(*this, "l", "log" , "define terminal to log. This option may be specified repeatedly."), opt_inp(*this, "i", "input", "", "input file to process (default is none)"), opt_loadstate(*this,"", "loadstate", "", "load state from file and continue from there"), @@ -99,6 +101,8 @@ private: void listdevices(); + std::vector m_options; + }; static NETLIST_START(dummy) @@ -186,7 +190,7 @@ public: // read the netlist ... for (auto & d : defines) - setup().register_define(d); + setup().add_define(d); for (auto & r : roms) setup().register_source(plib::make_unique_base(setup(), r)); @@ -347,7 +351,7 @@ void tool_app_t::run() nt.read_netlist(opt_file(), opt_name(), opt_logs(), - opt_defines(), opt_rfolders()); + m_options, opt_rfolders()); std::vector inps = read_input(nt.setup(), opt_inp()); @@ -423,7 +427,7 @@ void tool_app_t::static_compile() nt.read_netlist(opt_file(), opt_name(), opt_logs(), - opt_defines(), opt_rfolders()); + m_options, opt_rfolders()); plib::putf8_writer w(&pout_strm); std::map mp; @@ -543,9 +547,9 @@ void tool_app_t::create_header() if (last_source != e->sourcefile()) { last_source = e->sourcefile(); - pout("{1}\n", plib::rpad(pstring("// "), pstring("-"), 72)); + pout("{1}\n", plib::rpad(pstring("// "), pstring("-"), opt_linewidth())); pout("{1}{2}\n", pstring("// Source: "), plib::replace_all(e->sourcefile(), "../", "")); - pout("{1}\n", plib::rpad(pstring("// "), pstring("-"), 72)); + pout("{1}\n", plib::rpad(pstring("// "), pstring("-"), opt_linewidth())); } cmac(e.get()); } @@ -697,7 +701,7 @@ int tool_app_t::execute() if (opt_version()) { pout( - "nltool (netlist) 0.1\n" + "nltool (netlist) " PSTRINGIFY(NLTOOL_VERSION) "\n" "Copyright (C) 2019 Couriersud\n" "License GPLv2+: GNU GPL version 2 or later .\n" "This is free software: you are free to change and redistribute it.\n" @@ -706,6 +710,9 @@ int tool_app_t::execute() return 0; } + m_options = opt_defines(); + m_options.push_back("NLTOOL_VERSION=" PSTRINGIFY(NLTOOL_VERSION)); + try { pstring cmd = opt_cmd.as_string(); diff --git a/src/lib/netlist/prg/nlwav.cpp b/src/lib/netlist/prg/nlwav.cpp index 8116e48111a..c25330627b6 100644 --- a/src/lib/netlist/prg/nlwav.cpp +++ b/src/lib/netlist/prg/nlwav.cpp @@ -381,11 +381,11 @@ public: nlwav_app() : plib::app(), opt_fmt(*this, "f", "format", 0, std::vector({"wav","vcda","vcdd"}), - "output format. Available options are wav|vcda|vcdd.\n" - "wav : multichannel wav output\n" - "vcda : analog VCD output\n" - "vcdd : digital VCD output\n" - "Digital signals are created using the high and low options" + "output format. Available options are wav|vcda|vcdd." + " wav : multichannel wav output" + " vcda : analog VCD output" + " vcdd : digital VCD output" + " Digital signals are created using the --high and --low options" ), opt_out(*this, "o", "output", "-", "output file"), opt_rate(*this, "r", "rate", 48000, "sample rate of output file"), diff --git a/src/mame/audio/nl_kidniki.cpp b/src/mame/audio/nl_kidniki.cpp index 7865ea40750..9e8c47247af 100644 --- a/src/mame/audio/nl_kidniki.cpp +++ b/src/mame/audio/nl_kidniki.cpp @@ -2,8 +2,17 @@ // copyright-holders:Andrew Gardner, Couriersud #include "netlist/devices/net_lib.h" +#ifdef NLBASE_H_ +#error Somehow nl_base.h made it into the include chain. +#endif + +#ifndef NLTOOL_VERSION #define USE_FRONTIERS 1 #define USE_FIXED_STV 1 +#else +#define USE_FRONTIERS 0 +#define USE_FIXED_STV 1 +#endif /* ---------------------------------------------------------------------------- * Library section header START diff --git a/src/mame/machine/nl_breakout.cpp b/src/mame/machine/nl_breakout.cpp index 87426734036..0823df42350 100644 --- a/src/mame/machine/nl_breakout.cpp +++ b/src/mame/machine/nl_breakout.cpp @@ -1702,22 +1702,19 @@ CIRCUIT_LAYOUT( breakout ) NET_C(GND, D9.1, D9.2, D9.13, D9.3, D9.4, D9.5) - HINT(A3.1.sub, NO_DEACTIVATE) +#if 1 + // 158% -- manually optimized HINT(B6.s3, NO_DEACTIVATE) HINT(C4.s3, NO_DEACTIVATE) HINT(C4.s4, NO_DEACTIVATE) HINT(C5.s3, NO_DEACTIVATE) HINT(C5.s4, NO_DEACTIVATE) - HINT(D3.2.sub, NO_DEACTIVATE) HINT(E2.s2, NO_DEACTIVATE) HINT(E3.s2, NO_DEACTIVATE) HINT(E5.s4, NO_DEACTIVATE) - HINT(E8.2.sub, NO_DEACTIVATE) HINT(E9.s6, NO_DEACTIVATE) - HINT(F5.2.sub, NO_DEACTIVATE) HINT(H2.s1, NO_DEACTIVATE) HINT(H3.s1, NO_DEACTIVATE) - HINT(H6.sub, NO_DEACTIVATE) HINT(J3.s4, NO_DEACTIVATE) HINT(J5, NO_DEACTIVATE) HINT(J6.sub, NO_DEACTIVATE) @@ -1729,9 +1726,47 @@ CIRCUIT_LAYOUT( breakout ) HINT(M4.s2, NO_DEACTIVATE) HINT(M6.sub, NO_DEACTIVATE) HINT(M8.s1, NO_DEACTIVATE) - HINT(N6.sub, NO_DEACTIVATE) HINT(N7.s3, NO_DEACTIVATE) +#else + // 152% hints provided by log output + HINT(M4.s2, NO_DEACTIVATE) // 29.001761 197676 6816 + HINT(M3.s3, NO_DEACTIVATE) // inf 129571 0 + HINT(N7.s3, NO_DEACTIVATE) // inf 7850387 0 + HINT(M3.s2, NO_DEACTIVATE) // 23.234535 395870 17038 + HINT(M3.s1, NO_DEACTIVATE) // 14.500880 197676 13632 + HINT(L7.s3, NO_DEACTIVATE) // 122672.000000 122672 1 + HINT(L7.s2, NO_DEACTIVATE) // 122672.000000 122672 1 + HINT(K7.s4, NO_DEACTIVATE) // 122673.000000 122673 1 + HINT(K7.s3, NO_DEACTIVATE) // 122672.000000 122672 1 + HINT(K7.s2, NO_DEACTIVATE) // 122673.000000 122673 1 + HINT(K7.s1, NO_DEACTIVATE) // 122673.000000 122673 1 + HINT(K4.s4, NO_DEACTIVATE) // 1438.774735 4202661 2921 + HINT(K4.s2, NO_DEACTIVATE) // 3.939380 847790 215209 + HINT(E2.s2, NO_DEACTIVATE) // 108.050000 315506 2920 + HINT(L7.s4, NO_DEACTIVATE) // 122672.000000 122672 1 + HINT(E9.s6, NO_DEACTIVATE) // inf 129571 0 + HINT(J2.s6, NO_DEACTIVATE) // 493.408951 959187 1944 + HINT(C5.s3, NO_DEACTIVATE) // inf 195514 0 + HINT(M3.s4, NO_DEACTIVATE) // 27.744898 418726 15092 + HINT(J8.s1, NO_DEACTIVATE) // 40890.000000 122670 3 + HINT(E3.s2, NO_DEACTIVATE) // 203581.000000 203581 1 + HINT(M9.s4, NO_DEACTIVATE) // inf 323268 0 + HINT(L4.s2, NO_DEACTIVATE) // 7.290053 1192536 163584 + HINT(J3.s4, NO_DEACTIVATE) // 393.639951 957726 2433 + HINT(L7.s1, NO_DEACTIVATE) // inf 122672 0 + HINT(F2.s1, NO_DEACTIVATE) // 286289.000000 286289 1 + HINT(M8.s1, NO_DEACTIVATE) // 129571.000000 129571 1 + HINT(J7.s2, NO_DEACTIVATE) // inf 122672 0 + HINT(H2.s1, NO_DEACTIVATE) // 393.839704 958212 2433 + HINT(H3.s1, NO_DEACTIVATE) // 3.932473 850122 216180 + HINT(J2.s5, NO_DEACTIVATE) // 26.140344 203581 7788 + HINT(J7.s1, NO_DEACTIVATE) // inf 122672 0 + HINT(J8.s3, NO_DEACTIVATE) // 40890.000000 122670 3 + + +#endif + CIRCUIT_LAYOUT_END /* -- cgit v1.2.3-70-g09d2 From 6a7c3a8079c8068978c0a1c3fcd73142d60ed3eb Mon Sep 17 00:00:00 2001 From: couriersud Date: Mon, 4 Feb 2019 23:17:18 +0100 Subject: netlist: align solver calls. (nw) --- src/lib/netlist/devices/nld_4066.cpp | 15 +++------------ src/lib/netlist/devices/nld_4316.cpp | 2 +- src/lib/netlist/devices/nld_mm5837.cpp | 4 ++-- src/lib/netlist/devices/nld_schmitt.cpp | 4 ++-- src/lib/netlist/devices/nld_system.cpp | 17 ++++------------- src/lib/netlist/devices/nlid_proxy.cpp | 2 +- 6 files changed, 13 insertions(+), 31 deletions(-) (limited to 'src/lib/netlist/devices/nld_system.cpp') diff --git a/src/lib/netlist/devices/nld_4066.cpp b/src/lib/netlist/devices/nld_4066.cpp index 944f3f0f1c2..c4598f4fd1a 100644 --- a/src/lib/netlist/devices/nld_4066.cpp +++ b/src/lib/netlist/devices/nld_4066.cpp @@ -64,18 +64,9 @@ namespace netlist } if (R > NL_FCONST(0.0)) { - // We only need to update the net first if this is a time stepping net - if ((1)) // m_R.m_P.net().as_analog().solver().is_timestep()) - { - m_R.update(); - m_R.set_R(R); - m_R.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); - } - else - { - m_R.set_R(R); - m_R.update(); - } + m_R.update(); + m_R.set_R(R); + m_R.solve_later(); } } diff --git a/src/lib/netlist/devices/nld_4316.cpp b/src/lib/netlist/devices/nld_4316.cpp index b21ff8685f0..6774e1e1408 100644 --- a/src/lib/netlist/devices/nld_4316.cpp +++ b/src/lib/netlist/devices/nld_4316.cpp @@ -48,7 +48,7 @@ namespace netlist { namespace devices { m_R.set_R(m_base_r()); else m_R.set_R(NL_FCONST(1.0) / exec().gmin()); - m_R.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); + m_R.solve_later(NLTIME_FROM_NS(1)); } NETLIB_DEVICE_IMPL(CD4316_GATE, "CD4316_GATE", "") diff --git a/src/lib/netlist/devices/nld_mm5837.cpp b/src/lib/netlist/devices/nld_mm5837.cpp index 713c7288df1..eb2840d31fa 100644 --- a/src/lib/netlist/devices/nld_mm5837.cpp +++ b/src/lib/netlist/devices/nld_mm5837.cpp @@ -75,7 +75,7 @@ namespace netlist log().warning(MW_1_FREQUENCY_OUTSIDE_OF_SPECS_1, m_FREQ()); m_shift = 0x1ffff; - m_is_timestep = m_RV.m_P.net().solver()->is_timestep(); + m_is_timestep = m_RV.m_P.net().solver()->has_timestep_devices(); } NETLIB_UPDATE_PARAM(MM5837_dip) @@ -109,7 +109,7 @@ namespace netlist if (m_is_timestep) m_RV.update(); m_RV.set(NL_FCONST(1.0) / R, V, 0.0); - m_RV.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); + m_RV.solve_later(NLTIME_FROM_NS(1)); } } diff --git a/src/lib/netlist/devices/nld_schmitt.cpp b/src/lib/netlist/devices/nld_schmitt.cpp index 6f526ca7f42..a21f50c0681 100644 --- a/src/lib/netlist/devices/nld_schmitt.cpp +++ b/src/lib/netlist/devices/nld_schmitt.cpp @@ -99,7 +99,7 @@ namespace netlist if (m_is_timestep) m_RVO.update(); m_RVO.set(NL_FCONST(1.0) / m_model.m_ROH, m_model.m_VOH, 0.0); - m_RVO.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); + m_RVO.solve_later(); } } else @@ -110,7 +110,7 @@ namespace netlist if (m_is_timestep) m_RVO.update(); m_RVO.set(NL_FCONST(1.0) / m_model.m_ROL, m_model.m_VOL, 0.0); - m_RVO.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); + m_RVO.solve_later(); } } } diff --git a/src/lib/netlist/devices/nld_system.cpp b/src/lib/netlist/devices/nld_system.cpp index 134017d06b0..8613a1b2c5c 100644 --- a/src/lib/netlist/devices/nld_system.cpp +++ b/src/lib/netlist/devices/nld_system.cpp @@ -92,19 +92,10 @@ namespace netlist m_last_state = state; const nl_double R = state ? m_RON() : m_ROFF(); - // We only need to update the net first if this is a time stepping net - if ((0)) // m_R->m_P.net().as_analog().solver()->is_timestep()) - { - m_R.update(); - m_R.set_R(R); - m_R.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); - } - else - { - m_R.set_R(R); - m_R.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); - //m_R->update(); - } + // FIXME: We only need to update the net first if this is a time stepping net + m_R.update(); + m_R.set_R(R); + m_R.solve_later(); } } diff --git a/src/lib/netlist/devices/nlid_proxy.cpp b/src/lib/netlist/devices/nlid_proxy.cpp index 38a77c71423..741c864246d 100644 --- a/src/lib/netlist/devices/nlid_proxy.cpp +++ b/src/lib/netlist/devices/nlid_proxy.cpp @@ -161,7 +161,7 @@ namespace netlist m_RV.update(); } m_RV.set(NL_FCONST(1.0) / R, V, 0.0); - m_RV.m_P.schedule_solve_after(NLTIME_FROM_NS(1)); + m_RV.solve_later(); } } -- cgit v1.2.3-70-g09d2 From a65390cad5e43765ab518e8e253bf32be06c99d6 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sat, 23 Feb 2019 18:54:16 +0100 Subject: netlist: Fix relative include paths and a conflict. (nw) nl_types.h is part of libc++. Any project with a file with the same name on the include path just fails to compile. Renamed to nltypes.h --- src/devices/machine/netlist.h | 2 +- src/lib/netlist/analog/nld_bjt.cpp | 4 +- src/lib/netlist/analog/nld_bjt.h | 2 +- src/lib/netlist/analog/nld_fourterm.h | 2 +- src/lib/netlist/analog/nld_opamps.cpp | 4 +- src/lib/netlist/analog/nld_opamps.h | 2 +- src/lib/netlist/analog/nld_switches.h | 2 +- src/lib/netlist/analog/nld_twoterm.h | 2 +- src/lib/netlist/analog/nlid_fourterm.cpp | 4 +- src/lib/netlist/analog/nlid_fourterm.h | 2 +- src/lib/netlist/analog/nlid_twoterm.cpp | 4 +- src/lib/netlist/devices/net_lib.cpp | 4 +- src/lib/netlist/devices/net_lib.h | 20 ++-- src/lib/netlist/devices/nld_2102A.cpp | 2 +- src/lib/netlist/devices/nld_2102A.h | 2 +- src/lib/netlist/devices/nld_2716.cpp | 2 +- src/lib/netlist/devices/nld_2716.h | 2 +- src/lib/netlist/devices/nld_4020.h | 2 +- src/lib/netlist/devices/nld_4066.h | 2 +- src/lib/netlist/devices/nld_4316.h | 2 +- src/lib/netlist/devices/nld_74107.cpp | 2 +- src/lib/netlist/devices/nld_74107.h | 2 +- src/lib/netlist/devices/nld_74123.cpp | 2 +- src/lib/netlist/devices/nld_74123.h | 2 +- src/lib/netlist/devices/nld_74153.cpp | 2 +- src/lib/netlist/devices/nld_74153.h | 2 +- src/lib/netlist/devices/nld_74161.cpp | 2 +- src/lib/netlist/devices/nld_74161.h | 2 +- src/lib/netlist/devices/nld_74164.cpp | 2 +- src/lib/netlist/devices/nld_74164.h | 2 +- src/lib/netlist/devices/nld_74165.cpp | 2 +- src/lib/netlist/devices/nld_74165.h | 2 +- src/lib/netlist/devices/nld_74166.cpp | 2 +- src/lib/netlist/devices/nld_74166.h | 2 +- src/lib/netlist/devices/nld_74174.cpp | 2 +- src/lib/netlist/devices/nld_74174.h | 2 +- src/lib/netlist/devices/nld_74175.cpp | 2 +- src/lib/netlist/devices/nld_74175.h | 2 +- src/lib/netlist/devices/nld_74192.cpp | 2 +- src/lib/netlist/devices/nld_74192.h | 2 +- src/lib/netlist/devices/nld_74193.cpp | 2 +- src/lib/netlist/devices/nld_74193.h | 2 +- src/lib/netlist/devices/nld_74194.cpp | 2 +- src/lib/netlist/devices/nld_74194.h | 2 +- src/lib/netlist/devices/nld_74365.cpp | 2 +- src/lib/netlist/devices/nld_74365.h | 2 +- src/lib/netlist/devices/nld_7448.h | 2 +- src/lib/netlist/devices/nld_7450.cpp | 2 +- src/lib/netlist/devices/nld_7450.h | 2 +- src/lib/netlist/devices/nld_7473.cpp | 2 +- src/lib/netlist/devices/nld_7473.h | 2 +- src/lib/netlist/devices/nld_7474.cpp | 2 +- src/lib/netlist/devices/nld_7474.h | 2 +- src/lib/netlist/devices/nld_7475.cpp | 2 +- src/lib/netlist/devices/nld_7475.h | 2 +- src/lib/netlist/devices/nld_7483.cpp | 2 +- src/lib/netlist/devices/nld_7483.h | 2 +- src/lib/netlist/devices/nld_7485.cpp | 2 +- src/lib/netlist/devices/nld_7485.h | 2 +- src/lib/netlist/devices/nld_7490.cpp | 2 +- src/lib/netlist/devices/nld_7490.h | 2 +- src/lib/netlist/devices/nld_7493.cpp | 2 +- src/lib/netlist/devices/nld_7493.h | 2 +- src/lib/netlist/devices/nld_7497.cpp | 2 +- src/lib/netlist/devices/nld_7497.h | 2 +- src/lib/netlist/devices/nld_74ls629.cpp | 2 +- src/lib/netlist/devices/nld_74ls629.h | 2 +- src/lib/netlist/devices/nld_82S115.cpp | 2 +- src/lib/netlist/devices/nld_82S115.h | 2 +- src/lib/netlist/devices/nld_82S123.cpp | 2 +- src/lib/netlist/devices/nld_82S123.h | 2 +- src/lib/netlist/devices/nld_82S126.cpp | 2 +- src/lib/netlist/devices/nld_82S126.h | 2 +- src/lib/netlist/devices/nld_82S16.cpp | 2 +- src/lib/netlist/devices/nld_82S16.h | 2 +- src/lib/netlist/devices/nld_9310.cpp | 2 +- src/lib/netlist/devices/nld_9310.h | 2 +- src/lib/netlist/devices/nld_9316.cpp | 2 +- src/lib/netlist/devices/nld_9316.h | 2 +- src/lib/netlist/devices/nld_9322.cpp | 2 +- src/lib/netlist/devices/nld_9322.h | 2 +- src/lib/netlist/devices/nld_am2847.cpp | 2 +- src/lib/netlist/devices/nld_am2847.h | 2 +- src/lib/netlist/devices/nld_dm9314.cpp | 2 +- src/lib/netlist/devices/nld_dm9314.h | 2 +- src/lib/netlist/devices/nld_dm9334.cpp | 2 +- src/lib/netlist/devices/nld_dm9334.h | 2 +- src/lib/netlist/devices/nld_legacy.cpp | 2 +- src/lib/netlist/devices/nld_legacy.h | 2 +- src/lib/netlist/devices/nld_log.cpp | 2 +- src/lib/netlist/devices/nld_log.h | 2 +- src/lib/netlist/devices/nld_mm5837.cpp | 4 +- src/lib/netlist/devices/nld_mm5837.h | 2 +- src/lib/netlist/devices/nld_ne555.cpp | 4 +- src/lib/netlist/devices/nld_ne555.h | 2 +- src/lib/netlist/devices/nld_r2r_dac.cpp | 6 +- src/lib/netlist/devices/nld_r2r_dac.h | 2 +- src/lib/netlist/devices/nld_schmitt.cpp | 8 +- src/lib/netlist/devices/nld_schmitt.h | 2 +- src/lib/netlist/devices/nld_system.cpp | 4 +- src/lib/netlist/devices/nld_system.h | 2 +- src/lib/netlist/devices/nld_tms4800.cpp | 2 +- src/lib/netlist/devices/nld_tms4800.h | 2 +- src/lib/netlist/devices/nld_tristate.cpp | 2 +- src/lib/netlist/devices/nld_tristate.h | 2 +- src/lib/netlist/devices/nlid_cmos.h | 4 +- src/lib/netlist/devices/nlid_proxy.cpp | 2 +- src/lib/netlist/devices/nlid_proxy.h | 4 +- src/lib/netlist/devices/nlid_system.h | 6 +- src/lib/netlist/devices/nlid_truthtable.cpp | 2 +- src/lib/netlist/devices/nlid_truthtable.h | 4 +- src/lib/netlist/macro/nlm_base.cpp | 4 +- src/lib/netlist/macro/nlm_base.h | 2 +- src/lib/netlist/macro/nlm_cd4xxx.cpp | 8 +- src/lib/netlist/macro/nlm_cd4xxx.h | 2 +- src/lib/netlist/macro/nlm_opamp.cpp | 2 +- src/lib/netlist/macro/nlm_opamp.h | 2 +- src/lib/netlist/macro/nlm_other.cpp | 2 +- src/lib/netlist/macro/nlm_other.h | 2 +- src/lib/netlist/macro/nlm_ttl74xx.cpp | 4 +- src/lib/netlist/macro/nlm_ttl74xx.h | 2 +- src/lib/netlist/nl_base.h | 2 +- src/lib/netlist/nl_factory.h | 2 +- src/lib/netlist/nl_lists.h | 3 +- src/lib/netlist/nl_setup.h | 2 +- src/lib/netlist/nl_types.h | 140 --------------------------- src/lib/netlist/nltypes.h | 144 ++++++++++++++++++++++++++++ src/lib/netlist/prg/nlwav.cpp | 2 +- src/lib/netlist/solver/nld_solver.cpp | 4 +- src/lib/netlist/solver/nld_solver.h | 2 +- 130 files changed, 306 insertions(+), 301 deletions(-) delete mode 100644 src/lib/netlist/nl_types.h create mode 100644 src/lib/netlist/nltypes.h (limited to 'src/lib/netlist/devices/nld_system.cpp') diff --git a/src/devices/machine/netlist.h b/src/devices/machine/netlist.h index 58a8c065b14..db27b2860df 100644 --- a/src/devices/machine/netlist.h +++ b/src/devices/machine/netlist.h @@ -13,7 +13,7 @@ #include -#include "../../lib/netlist/nl_types.h" +#include "../../lib/netlist/nltypes.h" class nld_sound_out; class nld_sound_in; diff --git a/src/lib/netlist/analog/nld_bjt.cpp b/src/lib/netlist/analog/nld_bjt.cpp index fb8aeafda1c..06835009f50 100644 --- a/src/lib/netlist/analog/nld_bjt.cpp +++ b/src/lib/netlist/analog/nld_bjt.cpp @@ -5,8 +5,8 @@ * */ -#include "../solver/nld_solver.h" -#include "../nl_setup.h" +#include "netlist/solver/nld_solver.h" +#include "netlist/nl_setup.h" #include "nlid_twoterm.h" #include diff --git a/src/lib/netlist/analog/nld_bjt.h b/src/lib/netlist/analog/nld_bjt.h index 9e1f82afbaa..3a8478f19f7 100644 --- a/src/lib/netlist/analog/nld_bjt.h +++ b/src/lib/netlist/analog/nld_bjt.h @@ -8,7 +8,7 @@ #ifndef NLD_BJT_H_ #define NLD_BJT_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" // ----------------------------------------------------------------------------- // Macros diff --git a/src/lib/netlist/analog/nld_fourterm.h b/src/lib/netlist/analog/nld_fourterm.h index b4bb5db1059..66c47c0be29 100644 --- a/src/lib/netlist/analog/nld_fourterm.h +++ b/src/lib/netlist/analog/nld_fourterm.h @@ -9,7 +9,7 @@ #define NLD_FOURTERM_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" // ---------------------------------------------------------------------------------------- // Macros diff --git a/src/lib/netlist/analog/nld_opamps.cpp b/src/lib/netlist/analog/nld_opamps.cpp index 53ba7b3897d..4b5a5f8ba38 100644 --- a/src/lib/netlist/analog/nld_opamps.cpp +++ b/src/lib/netlist/analog/nld_opamps.cpp @@ -6,8 +6,8 @@ */ #include "nld_opamps.h" -#include "../nl_base.h" -#include "../nl_errstr.h" +#include "netlist/nl_base.h" +#include "netlist/nl_errstr.h" #include "nlid_fourterm.h" #include "nlid_twoterm.h" diff --git a/src/lib/netlist/analog/nld_opamps.h b/src/lib/netlist/analog/nld_opamps.h index d05a19aa3dc..4a07f646587 100644 --- a/src/lib/netlist/analog/nld_opamps.h +++ b/src/lib/netlist/analog/nld_opamps.h @@ -10,7 +10,7 @@ #ifndef NLD_OPAMPS_H_ #define NLD_OPAMPS_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" // ---------------------------------------------------------------------------------------- // Macros diff --git a/src/lib/netlist/analog/nld_switches.h b/src/lib/netlist/analog/nld_switches.h index 3cd561f84b1..7aa31c925ae 100644 --- a/src/lib/netlist/analog/nld_switches.h +++ b/src/lib/netlist/analog/nld_switches.h @@ -10,7 +10,7 @@ #ifndef NLD_SWITCHES_H_ #define NLD_SWITCHES_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" // ---------------------------------------------------------------------------------------- // Macros diff --git a/src/lib/netlist/analog/nld_twoterm.h b/src/lib/netlist/analog/nld_twoterm.h index d5cf6f6d228..b175f40af97 100644 --- a/src/lib/netlist/analog/nld_twoterm.h +++ b/src/lib/netlist/analog/nld_twoterm.h @@ -4,7 +4,7 @@ #ifndef NLD_TWOTERM_H_ #define NLD_TWOTERM_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" // ----------------------------------------------------------------------------- // Macros diff --git a/src/lib/netlist/analog/nlid_fourterm.cpp b/src/lib/netlist/analog/nlid_fourterm.cpp index 9323e7fc649..9e5c2e46932 100644 --- a/src/lib/netlist/analog/nlid_fourterm.cpp +++ b/src/lib/netlist/analog/nlid_fourterm.cpp @@ -5,8 +5,8 @@ * */ -#include "../solver/nld_solver.h" -#include "../nl_factory.h" +#include "netlist/solver/nld_solver.h" +#include "netlist/nl_factory.h" #include "nlid_fourterm.h" #include diff --git a/src/lib/netlist/analog/nlid_fourterm.h b/src/lib/netlist/analog/nlid_fourterm.h index 9eb2fbc5f36..0b0f75d378b 100644 --- a/src/lib/netlist/analog/nlid_fourterm.h +++ b/src/lib/netlist/analog/nlid_fourterm.h @@ -8,7 +8,7 @@ #ifndef NLID_FOURTERM_H_ #define NLID_FOURTERM_H_ -#include "../nl_base.h" +#include "netlist/nl_base.h" #include "plib/putil.h" namespace netlist { diff --git a/src/lib/netlist/analog/nlid_twoterm.cpp b/src/lib/netlist/analog/nlid_twoterm.cpp index 832b343ac15..9b79c323ba4 100644 --- a/src/lib/netlist/analog/nlid_twoterm.cpp +++ b/src/lib/netlist/analog/nlid_twoterm.cpp @@ -5,9 +5,9 @@ * */ -#include "../solver/nld_solver.h" +#include "netlist/solver/nld_solver.h" -#include "../nl_factory.h" +#include "netlist/nl_factory.h" #include "nlid_twoterm.h" #include diff --git a/src/lib/netlist/devices/net_lib.cpp b/src/lib/netlist/devices/net_lib.cpp index fe1e9ee86b0..3598654b971 100644 --- a/src/lib/netlist/devices/net_lib.cpp +++ b/src/lib/netlist/devices/net_lib.cpp @@ -9,8 +9,8 @@ ****************************************************************************/ #include "net_lib.h" -#include "../nl_factory.h" -#include "../solver/nld_solver.h" +#include "netlist/nl_factory.h" +#include "netlist/solver/nld_solver.h" #define xstr(s) # s diff --git a/src/lib/netlist/devices/net_lib.h b/src/lib/netlist/devices/net_lib.h index 6cd2b6349f1..6cc6749eee6 100644 --- a/src/lib/netlist/devices/net_lib.h +++ b/src/lib/netlist/devices/net_lib.h @@ -85,16 +85,16 @@ #include "nld_log.h" -#include "../macro/nlm_cd4xxx.h" -#include "../macro/nlm_opamp.h" -#include "../macro/nlm_other.h" -#include "../macro/nlm_ttl74xx.h" - -#include "../analog/nld_bjt.h" -#include "../analog/nld_fourterm.h" -#include "../analog/nld_opamps.h" -#include "../analog/nld_switches.h" -#include "../analog/nld_twoterm.h" +#include "netlist/macro/nlm_cd4xxx.h" +#include "netlist/macro/nlm_opamp.h" +#include "netlist/macro/nlm_other.h" +#include "netlist/macro/nlm_ttl74xx.h" + +#include "netlist/analog/nld_bjt.h" +#include "netlist/analog/nld_fourterm.h" +#include "netlist/analog/nld_opamps.h" +#include "netlist/analog/nld_switches.h" +#include "netlist/analog/nld_twoterm.h" #include "nld_legacy.h" #endif diff --git a/src/lib/netlist/devices/nld_2102A.cpp b/src/lib/netlist/devices/nld_2102A.cpp index 59d9a9b5788..d256a1e244d 100644 --- a/src/lib/netlist/devices/nld_2102A.cpp +++ b/src/lib/netlist/devices/nld_2102A.cpp @@ -6,7 +6,7 @@ */ #include "nld_2102A.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" #define ADDR2BYTE(a) ((a) >> 3) #define ADDR2BIT(a) ((a) & 0x7) diff --git a/src/lib/netlist/devices/nld_2102A.h b/src/lib/netlist/devices/nld_2102A.h index 52d892d4d40..aa53efde47d 100644 --- a/src/lib/netlist/devices/nld_2102A.h +++ b/src/lib/netlist/devices/nld_2102A.h @@ -24,7 +24,7 @@ #ifndef NLD_2102A_H_ #define NLD_2102A_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define RAM_2102A(name, cCEQ, cA0, cA1, cA2, cA3, cA4, cA5, cA6, cA7, cA8, cA9, cRWQ, cDI) \ NET_REGISTER_DEV(RAM_2102A, name) \ diff --git a/src/lib/netlist/devices/nld_2716.cpp b/src/lib/netlist/devices/nld_2716.cpp index b9f5deca132..b021bc95003 100644 --- a/src/lib/netlist/devices/nld_2716.cpp +++ b/src/lib/netlist/devices/nld_2716.cpp @@ -6,7 +6,7 @@ */ #include "nld_2716.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_2716.h b/src/lib/netlist/devices/nld_2716.h index f4776242e6a..363086d6a37 100644 --- a/src/lib/netlist/devices/nld_2716.h +++ b/src/lib/netlist/devices/nld_2716.h @@ -28,7 +28,7 @@ #ifndef NLD_2716_H_ #define NLD_2716_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define EPROM_2716(name, cGQ, cEPQ, cA0, cA1, cA2, cA3, cA4, cA5, cA6, cA7, cA8, cA9, cA10) \ NET_REGISTER_DEV(EPROM_2716, name) \ diff --git a/src/lib/netlist/devices/nld_4020.h b/src/lib/netlist/devices/nld_4020.h index fd6b234da46..f24251fb1dc 100644 --- a/src/lib/netlist/devices/nld_4020.h +++ b/src/lib/netlist/devices/nld_4020.h @@ -27,7 +27,7 @@ #ifndef NLD_4020_H_ #define NLD_4020_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" /* FIXME: only used in mario.c */ #define CD4020_WI(name, cIP, cRESET, cVDD, cVSS) \ diff --git a/src/lib/netlist/devices/nld_4066.h b/src/lib/netlist/devices/nld_4066.h index e9fd579496c..d339464a108 100644 --- a/src/lib/netlist/devices/nld_4066.h +++ b/src/lib/netlist/devices/nld_4066.h @@ -24,7 +24,7 @@ #ifndef NLD_4066_H_ #define NLD_4066_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define CD4066_GATE(name) \ NET_REGISTER_DEV(CD4066_GATE, name) diff --git a/src/lib/netlist/devices/nld_4316.h b/src/lib/netlist/devices/nld_4316.h index eb1d13f5542..278a2793a6f 100644 --- a/src/lib/netlist/devices/nld_4316.h +++ b/src/lib/netlist/devices/nld_4316.h @@ -25,7 +25,7 @@ #ifndef NLD_4316_H_ #define NLD_4316_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define CD4316_GATE(name) \ NET_REGISTER_DEV(CD4316_GATE, name) diff --git a/src/lib/netlist/devices/nld_74107.cpp b/src/lib/netlist/devices/nld_74107.cpp index 42cd36b4448..6939a5d6db6 100644 --- a/src/lib/netlist/devices/nld_74107.cpp +++ b/src/lib/netlist/devices/nld_74107.cpp @@ -6,7 +6,7 @@ */ #include "nld_74107.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_74107.h b/src/lib/netlist/devices/nld_74107.h index b59848cbb05..c6f8864610a 100644 --- a/src/lib/netlist/devices/nld_74107.h +++ b/src/lib/netlist/devices/nld_74107.h @@ -64,7 +64,7 @@ #ifndef NLD_74107_H_ #define NLD_74107_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_74107A(name, cCLK, cJ, cK, cCLRQ) \ NET_REGISTER_DEV(TTL_74107A, name) \ diff --git a/src/lib/netlist/devices/nld_74123.cpp b/src/lib/netlist/devices/nld_74123.cpp index 7b8dbc7998b..32e47a47ef2 100644 --- a/src/lib/netlist/devices/nld_74123.cpp +++ b/src/lib/netlist/devices/nld_74123.cpp @@ -6,7 +6,7 @@ */ #include "nlid_system.h" -#include "../analog/nlid_twoterm.h" +#include "netlist/analog/nlid_twoterm.h" #include diff --git a/src/lib/netlist/devices/nld_74123.h b/src/lib/netlist/devices/nld_74123.h index dfd75f746c7..3eca141b613 100644 --- a/src/lib/netlist/devices/nld_74123.h +++ b/src/lib/netlist/devices/nld_74123.h @@ -49,7 +49,7 @@ #ifndef NLD_74123_H_ #define NLD_74123_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_74123(name) \ NET_REGISTER_DEV(TTL_74123, name) diff --git a/src/lib/netlist/devices/nld_74153.cpp b/src/lib/netlist/devices/nld_74153.cpp index b44b7c8a3de..136fe61520b 100644 --- a/src/lib/netlist/devices/nld_74153.cpp +++ b/src/lib/netlist/devices/nld_74153.cpp @@ -6,7 +6,7 @@ */ #include "nld_74153.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_74153.h b/src/lib/netlist/devices/nld_74153.h index ee77d4224ce..f1c0f056cf7 100644 --- a/src/lib/netlist/devices/nld_74153.h +++ b/src/lib/netlist/devices/nld_74153.h @@ -45,7 +45,7 @@ #ifndef NLD_74153_H_ #define NLD_74153_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_74153(name, cC0, cC1, cC2, cC3, cA, cB, cG) \ NET_REGISTER_DEV(TTL_74153, name) \ diff --git a/src/lib/netlist/devices/nld_74161.cpp b/src/lib/netlist/devices/nld_74161.cpp index 6442f22a9f8..e75eaf10c88 100644 --- a/src/lib/netlist/devices/nld_74161.cpp +++ b/src/lib/netlist/devices/nld_74161.cpp @@ -6,7 +6,7 @@ */ #include "nld_74161.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_74161.h b/src/lib/netlist/devices/nld_74161.h index 363bc3c7f0d..f3fa3eab043 100644 --- a/src/lib/netlist/devices/nld_74161.h +++ b/src/lib/netlist/devices/nld_74161.h @@ -25,7 +25,7 @@ #ifndef NLD_74161_H_ #define NLD_74161_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_74161(name, cA, cB, cC, cD, cCLRQ, cLOADQ, cCLK, cENABLEP, cENABLET) \ NET_REGISTER_DEV(TTL_74161, name) \ diff --git a/src/lib/netlist/devices/nld_74164.cpp b/src/lib/netlist/devices/nld_74164.cpp index ccc172ef41b..b1eb30bb1ba 100644 --- a/src/lib/netlist/devices/nld_74164.cpp +++ b/src/lib/netlist/devices/nld_74164.cpp @@ -9,7 +9,7 @@ */ #include "nld_74164.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_74164.h b/src/lib/netlist/devices/nld_74164.h index d7f29d386de..dd4e6bd1303 100644 --- a/src/lib/netlist/devices/nld_74164.h +++ b/src/lib/netlist/devices/nld_74164.h @@ -42,7 +42,7 @@ #ifndef NLD_74164_H_ #define NLD_74164_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_74164(name, cA, cB, cCLRQ, cCLK) \ NET_REGISTER_DEV(TTL_74164, name) \ diff --git a/src/lib/netlist/devices/nld_74165.cpp b/src/lib/netlist/devices/nld_74165.cpp index a8aef44b623..521bf4d63d2 100644 --- a/src/lib/netlist/devices/nld_74165.cpp +++ b/src/lib/netlist/devices/nld_74165.cpp @@ -6,7 +6,7 @@ */ #include "nld_74165.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_74165.h b/src/lib/netlist/devices/nld_74165.h index e38ca7bab86..d282bab622b 100644 --- a/src/lib/netlist/devices/nld_74165.h +++ b/src/lib/netlist/devices/nld_74165.h @@ -27,7 +27,7 @@ #ifndef NLD_74165_H_ #define NLD_74165_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_74165(name, cCLK, cCLKINH, cSH_LDQ, cSER, cA, cB, cC, cD, cE, cF, cG, cH) \ NET_REGISTER_DEV(TTL_74165, name) \ diff --git a/src/lib/netlist/devices/nld_74166.cpp b/src/lib/netlist/devices/nld_74166.cpp index e18191bb308..a5049014576 100644 --- a/src/lib/netlist/devices/nld_74166.cpp +++ b/src/lib/netlist/devices/nld_74166.cpp @@ -6,7 +6,7 @@ */ #include "nld_74166.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_74166.h b/src/lib/netlist/devices/nld_74166.h index b8a8a204374..80c86bb3422 100644 --- a/src/lib/netlist/devices/nld_74166.h +++ b/src/lib/netlist/devices/nld_74166.h @@ -27,7 +27,7 @@ #ifndef NLD_74166_H_ #define NLD_74166_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_74166(name, cCLK, cCLKINH, cSH_LDQ, cSER, cA, cB, cC, cD, cE, cF, cG, cH, cCLRQ) \ NET_REGISTER_DEV(TTL_74166, name) \ diff --git a/src/lib/netlist/devices/nld_74174.cpp b/src/lib/netlist/devices/nld_74174.cpp index 23ef77c5db2..13ceb370cfd 100644 --- a/src/lib/netlist/devices/nld_74174.cpp +++ b/src/lib/netlist/devices/nld_74174.cpp @@ -6,7 +6,7 @@ */ #include "nld_74174.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_74174.h b/src/lib/netlist/devices/nld_74174.h index 66824abb7aa..f1854801291 100644 --- a/src/lib/netlist/devices/nld_74174.h +++ b/src/lib/netlist/devices/nld_74174.h @@ -36,7 +36,7 @@ #ifndef NLD_74174_H_ #define NLD_74174_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_74174(name, cCLK, cD1, cD2, cD3, cD4, cD5, cD6, cCLRQ) \ NET_REGISTER_DEV(TTL_74174, name) \ diff --git a/src/lib/netlist/devices/nld_74175.cpp b/src/lib/netlist/devices/nld_74175.cpp index f46f1b90c3e..6c902df48fc 100644 --- a/src/lib/netlist/devices/nld_74175.cpp +++ b/src/lib/netlist/devices/nld_74175.cpp @@ -6,7 +6,7 @@ */ #include "nld_74175.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_74175.h b/src/lib/netlist/devices/nld_74175.h index 27e01b55b05..4bc8c1175ba 100644 --- a/src/lib/netlist/devices/nld_74175.h +++ b/src/lib/netlist/devices/nld_74175.h @@ -36,7 +36,7 @@ #ifndef NLD_74175_H_ #define NLD_74175_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_74175(name, cCLK, cD1, cD2, cD3, cD4, cCLRQ) \ NET_REGISTER_DEV(TTL_74175, name) \ diff --git a/src/lib/netlist/devices/nld_74192.cpp b/src/lib/netlist/devices/nld_74192.cpp index 18b9e42e37e..81edfd050be 100644 --- a/src/lib/netlist/devices/nld_74192.cpp +++ b/src/lib/netlist/devices/nld_74192.cpp @@ -6,7 +6,7 @@ */ #include "nld_74192.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_74192.h b/src/lib/netlist/devices/nld_74192.h index 613d463cf47..9b0139070b8 100644 --- a/src/lib/netlist/devices/nld_74192.h +++ b/src/lib/netlist/devices/nld_74192.h @@ -29,7 +29,7 @@ #ifndef NLD_74192_H_ #define NLD_74192_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_74192(name, cA, cB, cC, cD, cCLEAR, cLOADQ, cCU, cCD) \ NET_REGISTER_DEV(TTL_74192, name) \ diff --git a/src/lib/netlist/devices/nld_74193.cpp b/src/lib/netlist/devices/nld_74193.cpp index 7ba258a2d07..c5d46df3618 100644 --- a/src/lib/netlist/devices/nld_74193.cpp +++ b/src/lib/netlist/devices/nld_74193.cpp @@ -6,7 +6,7 @@ */ #include "nld_74193.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_74193.h b/src/lib/netlist/devices/nld_74193.h index bb14a301f38..a4c745d5386 100644 --- a/src/lib/netlist/devices/nld_74193.h +++ b/src/lib/netlist/devices/nld_74193.h @@ -26,7 +26,7 @@ #ifndef NLD_74193_H_ #define NLD_74193_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_74193(name, cA, cB, cC, cD, cCLEAR, cLOADQ, cCU, cCD) \ NET_REGISTER_DEV(TTL_74193, name) \ diff --git a/src/lib/netlist/devices/nld_74194.cpp b/src/lib/netlist/devices/nld_74194.cpp index 2fb17ea4f3d..205263c2d44 100644 --- a/src/lib/netlist/devices/nld_74194.cpp +++ b/src/lib/netlist/devices/nld_74194.cpp @@ -6,7 +6,7 @@ */ #include "nld_74194.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_74194.h b/src/lib/netlist/devices/nld_74194.h index 5124a66bcc0..5a507982b81 100644 --- a/src/lib/netlist/devices/nld_74194.h +++ b/src/lib/netlist/devices/nld_74194.h @@ -26,7 +26,7 @@ #ifndef NLD_74194_H_ #define NLD_74194_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_74194(name, cCLK, cS0, cS1, cSRIN, cA, cB, cC, cD, cSLIN, cCLRQ) \ NET_REGISTER_DEV(TTL_74194, name) \ diff --git a/src/lib/netlist/devices/nld_74365.cpp b/src/lib/netlist/devices/nld_74365.cpp index 3ddc8e3958a..753f16bfd22 100644 --- a/src/lib/netlist/devices/nld_74365.cpp +++ b/src/lib/netlist/devices/nld_74365.cpp @@ -6,7 +6,7 @@ */ #include "nld_74365.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_74365.h b/src/lib/netlist/devices/nld_74365.h index ca0eacf6ba1..a50b535383f 100644 --- a/src/lib/netlist/devices/nld_74365.h +++ b/src/lib/netlist/devices/nld_74365.h @@ -25,7 +25,7 @@ #ifndef NLD_74365_H_ #define NLD_74365_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_74365(name, cG1Q, cG2Q, cA1, cA2, cA3, cA4, cA5, cA6) \ NET_REGISTER_DEV(TTL_74365, name) \ diff --git a/src/lib/netlist/devices/nld_7448.h b/src/lib/netlist/devices/nld_7448.h index 89528707bc1..b9c03ae6360 100644 --- a/src/lib/netlist/devices/nld_7448.h +++ b/src/lib/netlist/devices/nld_7448.h @@ -24,7 +24,7 @@ #ifndef NLD_7448_H_ #define NLD_7448_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #ifndef NL_AUTO_DEVICES diff --git a/src/lib/netlist/devices/nld_7450.cpp b/src/lib/netlist/devices/nld_7450.cpp index a3e7e8d99cc..aacab46a021 100644 --- a/src/lib/netlist/devices/nld_7450.cpp +++ b/src/lib/netlist/devices/nld_7450.cpp @@ -6,7 +6,7 @@ */ #include "nld_7450.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_7450.h b/src/lib/netlist/devices/nld_7450.h index 652516758ad..6718afd8f9e 100644 --- a/src/lib/netlist/devices/nld_7450.h +++ b/src/lib/netlist/devices/nld_7450.h @@ -24,7 +24,7 @@ #ifndef NLD_7450_H_ #define NLD_7450_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_7450_ANDORINVERT(name, cI1, cI2, cI3, cI4) \ NET_REGISTER_DEV(TTL_7450_ANDORINVERT, name) \ diff --git a/src/lib/netlist/devices/nld_7473.cpp b/src/lib/netlist/devices/nld_7473.cpp index 63680d3e0d1..c8abd829264 100644 --- a/src/lib/netlist/devices/nld_7473.cpp +++ b/src/lib/netlist/devices/nld_7473.cpp @@ -6,7 +6,7 @@ */ #include "nld_7473.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_7473.h b/src/lib/netlist/devices/nld_7473.h index 5313d18570c..3fbaaf4efbc 100644 --- a/src/lib/netlist/devices/nld_7473.h +++ b/src/lib/netlist/devices/nld_7473.h @@ -60,7 +60,7 @@ #ifndef NLD_7473_H_ #define NLD_7473_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_7473(name, cCLK, cJ, cK, cCLRQ) \ NET_REGISTER_DEV(TTL_7473, name) \ diff --git a/src/lib/netlist/devices/nld_7474.cpp b/src/lib/netlist/devices/nld_7474.cpp index d9129ad1ba9..2934e780552 100644 --- a/src/lib/netlist/devices/nld_7474.cpp +++ b/src/lib/netlist/devices/nld_7474.cpp @@ -7,7 +7,7 @@ */ #include "nld_7474.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_7474.h b/src/lib/netlist/devices/nld_7474.h index aa48e240387..48fd4f3d842 100644 --- a/src/lib/netlist/devices/nld_7474.h +++ b/src/lib/netlist/devices/nld_7474.h @@ -42,7 +42,7 @@ #ifndef NLD_7474_H_ #define NLD_7474_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_7474(name, cCLK, cD, cCLRQ, cPREQ) \ NET_REGISTER_DEV(TTL_7474, name) \ diff --git a/src/lib/netlist/devices/nld_7475.cpp b/src/lib/netlist/devices/nld_7475.cpp index 17caaf6351b..63fd355d406 100644 --- a/src/lib/netlist/devices/nld_7475.cpp +++ b/src/lib/netlist/devices/nld_7475.cpp @@ -7,7 +7,7 @@ */ #include "nld_7475.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_7475.h b/src/lib/netlist/devices/nld_7475.h index 51d09e75a66..b16fabe61b6 100644 --- a/src/lib/netlist/devices/nld_7475.h +++ b/src/lib/netlist/devices/nld_7475.h @@ -35,7 +35,7 @@ #ifndef NLD_7475_H_ #define NLD_7475_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define PARAMS_7475_7477(name, cC1C2, cC3C4, cD1, cD2, cD3, cD4) \ NET_CONNECT(name, C1C2, cC1C2) \ diff --git a/src/lib/netlist/devices/nld_7483.cpp b/src/lib/netlist/devices/nld_7483.cpp index 285fbeee19e..5f820162209 100644 --- a/src/lib/netlist/devices/nld_7483.cpp +++ b/src/lib/netlist/devices/nld_7483.cpp @@ -6,7 +6,7 @@ */ #include "nld_7483.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_7483.h b/src/lib/netlist/devices/nld_7483.h index 24952bf0501..ba82d5bbb9c 100644 --- a/src/lib/netlist/devices/nld_7483.h +++ b/src/lib/netlist/devices/nld_7483.h @@ -27,7 +27,7 @@ #ifndef NLD_7483_H_ #define NLD_7483_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_7483(name, cA1, cA2, cA3, cA4, cB1, cB2, cB3, cB4, cCI) \ NET_REGISTER_DEV(TTL_7483, name) \ diff --git a/src/lib/netlist/devices/nld_7485.cpp b/src/lib/netlist/devices/nld_7485.cpp index 0326833db19..cadb73000ff 100644 --- a/src/lib/netlist/devices/nld_7485.cpp +++ b/src/lib/netlist/devices/nld_7485.cpp @@ -6,7 +6,7 @@ */ #include "nld_7485.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_7485.h b/src/lib/netlist/devices/nld_7485.h index 61b87c37ba3..7890f4dbd2a 100644 --- a/src/lib/netlist/devices/nld_7485.h +++ b/src/lib/netlist/devices/nld_7485.h @@ -23,7 +23,7 @@ #ifndef NLD_7485_H_ #define NLD_7485_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_7485(name, cA0, cA1, cA2, cA3, cB0, cB1, cB2, cB3, cLTIN, cEQIN, cGTIN) \ NET_REGISTER_DEV(TTL_7485, name) \ diff --git a/src/lib/netlist/devices/nld_7490.cpp b/src/lib/netlist/devices/nld_7490.cpp index 585d8503777..3dabd026cd7 100644 --- a/src/lib/netlist/devices/nld_7490.cpp +++ b/src/lib/netlist/devices/nld_7490.cpp @@ -6,7 +6,7 @@ */ #include "nld_7490.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_7490.h b/src/lib/netlist/devices/nld_7490.h index 5ff18543b03..e2fa5094911 100644 --- a/src/lib/netlist/devices/nld_7490.h +++ b/src/lib/netlist/devices/nld_7490.h @@ -55,7 +55,7 @@ #ifndef NLD_7490_H_ #define NLD_7490_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_7490(name, cA, cB, cR1, cR2, cR91, cR92) \ NET_REGISTER_DEV(TTL_7490, name) \ diff --git a/src/lib/netlist/devices/nld_7493.cpp b/src/lib/netlist/devices/nld_7493.cpp index f9eca065dc6..e19614329a9 100644 --- a/src/lib/netlist/devices/nld_7493.cpp +++ b/src/lib/netlist/devices/nld_7493.cpp @@ -6,7 +6,7 @@ */ #include "nld_7493.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_7493.h b/src/lib/netlist/devices/nld_7493.h index ce9566aa28f..68ad90885ec 100644 --- a/src/lib/netlist/devices/nld_7493.h +++ b/src/lib/netlist/devices/nld_7493.h @@ -57,7 +57,7 @@ #ifndef NLD_7493_H_ #define NLD_7493_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_7493(name, cCLKA, cCLKB, cR1, cR2) \ NET_REGISTER_DEV(TTL_7493, name) \ diff --git a/src/lib/netlist/devices/nld_7497.cpp b/src/lib/netlist/devices/nld_7497.cpp index 42974fe8e68..f74e386faac 100644 --- a/src/lib/netlist/devices/nld_7497.cpp +++ b/src/lib/netlist/devices/nld_7497.cpp @@ -10,7 +10,7 @@ */ #include "nld_7497.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_7497.h b/src/lib/netlist/devices/nld_7497.h index 70ab06f6c59..8d14e08a49b 100644 --- a/src/lib/netlist/devices/nld_7497.h +++ b/src/lib/netlist/devices/nld_7497.h @@ -35,7 +35,7 @@ #ifndef NLD_7497_H_ #define NLD_7497_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_7497(name, cCLK, cSTRB, cEN, cUNITY, cCLR, cB0, cB1, cB2, cB3, cB4, cB5) \ NET_REGISTER_DEV(TTL_7497, name) \ diff --git a/src/lib/netlist/devices/nld_74ls629.cpp b/src/lib/netlist/devices/nld_74ls629.cpp index afdd6d9ac4a..b7bb729b334 100644 --- a/src/lib/netlist/devices/nld_74ls629.cpp +++ b/src/lib/netlist/devices/nld_74ls629.cpp @@ -40,7 +40,7 @@ #include "nld_74ls629.h" -#include "../analog/nlid_twoterm.h" +#include "netlist/analog/nlid_twoterm.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_74ls629.h b/src/lib/netlist/devices/nld_74ls629.h index 3351524a60b..30d15d70865 100644 --- a/src/lib/netlist/devices/nld_74ls629.h +++ b/src/lib/netlist/devices/nld_74ls629.h @@ -28,7 +28,7 @@ #ifndef NLD_74LS629_H_ #define NLD_74LS629_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define SN74LS629(name, p_cap) \ NET_REGISTER_DEV(SN74LS629, name) \ diff --git a/src/lib/netlist/devices/nld_82S115.cpp b/src/lib/netlist/devices/nld_82S115.cpp index 02d692b127d..8ae6cbb6097 100644 --- a/src/lib/netlist/devices/nld_82S115.cpp +++ b/src/lib/netlist/devices/nld_82S115.cpp @@ -6,7 +6,7 @@ */ #include "nld_82S115.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_82S115.h b/src/lib/netlist/devices/nld_82S115.h index ef7f1ec3910..8c13fd8b51e 100644 --- a/src/lib/netlist/devices/nld_82S115.h +++ b/src/lib/netlist/devices/nld_82S115.h @@ -28,7 +28,7 @@ #ifndef NLD_82S115_H_ #define NLD_82S115_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define PROM_82S115(name, cCE1Q, cCE2, cA0, cA1, cA2, cA3, cA4, cA5, cA6, cA7, cA8, cSTROBE) \ NET_REGISTER_DEV(PROM_82S115, name) \ diff --git a/src/lib/netlist/devices/nld_82S123.cpp b/src/lib/netlist/devices/nld_82S123.cpp index 18dc696d80a..4a80b57e349 100644 --- a/src/lib/netlist/devices/nld_82S123.cpp +++ b/src/lib/netlist/devices/nld_82S123.cpp @@ -6,7 +6,7 @@ */ #include "nld_82S123.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_82S123.h b/src/lib/netlist/devices/nld_82S123.h index dbf6bf63180..2c18377934d 100644 --- a/src/lib/netlist/devices/nld_82S123.h +++ b/src/lib/netlist/devices/nld_82S123.h @@ -25,7 +25,7 @@ #ifndef NLD_82S123_H_ #define NLD_82S123_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define PROM_82S123(name, cCEQ, cA0, cA1, cA2, cA3, cA4) \ NET_REGISTER_DEV(PROM_82S123, name) \ diff --git a/src/lib/netlist/devices/nld_82S126.cpp b/src/lib/netlist/devices/nld_82S126.cpp index 59989df604b..b1752908645 100644 --- a/src/lib/netlist/devices/nld_82S126.cpp +++ b/src/lib/netlist/devices/nld_82S126.cpp @@ -6,7 +6,7 @@ */ #include "nld_82S126.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_82S126.h b/src/lib/netlist/devices/nld_82S126.h index 3079bb8e2e0..ed7aa131819 100644 --- a/src/lib/netlist/devices/nld_82S126.h +++ b/src/lib/netlist/devices/nld_82S126.h @@ -24,7 +24,7 @@ #ifndef NLD_82S126_H_ #define NLD_82S126_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define PROM_82S126(name, cCE1Q, cCE2Q, cA0, cA1, cA2, cA3, cA4, cA5, cA6, cA7) \ NET_REGISTER_DEV(PROM_82S126, name) \ diff --git a/src/lib/netlist/devices/nld_82S16.cpp b/src/lib/netlist/devices/nld_82S16.cpp index fe64334b0c2..e3176c7b30f 100644 --- a/src/lib/netlist/devices/nld_82S16.cpp +++ b/src/lib/netlist/devices/nld_82S16.cpp @@ -6,7 +6,7 @@ */ #include "nld_82S16.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_82S16.h b/src/lib/netlist/devices/nld_82S16.h index d1117246d87..47d6189a79b 100644 --- a/src/lib/netlist/devices/nld_82S16.h +++ b/src/lib/netlist/devices/nld_82S16.h @@ -24,7 +24,7 @@ #ifndef NLD_82S16_H_ #define NLD_82S16_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_82S16(name) \ NET_REGISTER_DEV(TTL_82S16, name) diff --git a/src/lib/netlist/devices/nld_9310.cpp b/src/lib/netlist/devices/nld_9310.cpp index cbc197a70d8..b416015df24 100644 --- a/src/lib/netlist/devices/nld_9310.cpp +++ b/src/lib/netlist/devices/nld_9310.cpp @@ -6,7 +6,7 @@ */ #include "nld_9310.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" #define MAXCNT 9 diff --git a/src/lib/netlist/devices/nld_9310.h b/src/lib/netlist/devices/nld_9310.h index 02cb45b2d86..65df9c04ce4 100644 --- a/src/lib/netlist/devices/nld_9310.h +++ b/src/lib/netlist/devices/nld_9310.h @@ -45,7 +45,7 @@ #ifndef NLD_9310_H_ #define NLD_9310_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_9310(name, cCLK, cENP, cENT, cCLRQ, cLOADQ, cA, cB, cC, cD) \ NET_REGISTER_DEV(TTL_9310, name) \ diff --git a/src/lib/netlist/devices/nld_9316.cpp b/src/lib/netlist/devices/nld_9316.cpp index d392250d8a5..390e3285fc2 100644 --- a/src/lib/netlist/devices/nld_9316.cpp +++ b/src/lib/netlist/devices/nld_9316.cpp @@ -6,7 +6,7 @@ */ #include "nld_9316.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_9316.h b/src/lib/netlist/devices/nld_9316.h index 8deb21dfccd..8ab1789d7c7 100644 --- a/src/lib/netlist/devices/nld_9316.h +++ b/src/lib/netlist/devices/nld_9316.h @@ -51,7 +51,7 @@ #ifndef NLD_9316_H_ #define NLD_9316_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_9316(name, cCLK, cENP, cENT, cCLRQ, cLOADQ, cA, cB, cC, cD) \ NET_REGISTER_DEV(TTL_9316, name) \ diff --git a/src/lib/netlist/devices/nld_9322.cpp b/src/lib/netlist/devices/nld_9322.cpp index 854af3d549c..abf9bf9f6ef 100644 --- a/src/lib/netlist/devices/nld_9322.cpp +++ b/src/lib/netlist/devices/nld_9322.cpp @@ -6,7 +6,7 @@ */ #include "nld_9322.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_9322.h b/src/lib/netlist/devices/nld_9322.h index 7de0f053b05..986c6b9e7f7 100644 --- a/src/lib/netlist/devices/nld_9322.h +++ b/src/lib/netlist/devices/nld_9322.h @@ -21,7 +21,7 @@ #ifndef NLD_9322_H_ #define NLD_9322_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_9322(name, cSELECT, cA1, cB1, cA2, cB2, cA3, cB3, cA4, cB4, cSTROBE) \ NET_REGISTER_DEV(TTL_9322, name) \ diff --git a/src/lib/netlist/devices/nld_am2847.cpp b/src/lib/netlist/devices/nld_am2847.cpp index 4ebc9ed27dc..825696f0938 100644 --- a/src/lib/netlist/devices/nld_am2847.cpp +++ b/src/lib/netlist/devices/nld_am2847.cpp @@ -6,7 +6,7 @@ */ #include "nld_am2847.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_am2847.h b/src/lib/netlist/devices/nld_am2847.h index 70d288d3eec..ff4a95b8e81 100644 --- a/src/lib/netlist/devices/nld_am2847.h +++ b/src/lib/netlist/devices/nld_am2847.h @@ -21,7 +21,7 @@ #ifndef NLD_AM2847_H_ #define NLD_AM2847_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_AM2847(name, cCP, cINA, cINB, cINC, cIND, cRCA, cRCB, cRCC, cRCD) \ NET_REGISTER_DEV(TTL_AM2847, name) \ diff --git a/src/lib/netlist/devices/nld_dm9314.cpp b/src/lib/netlist/devices/nld_dm9314.cpp index b98eb57625e..93b958de539 100644 --- a/src/lib/netlist/devices/nld_dm9314.cpp +++ b/src/lib/netlist/devices/nld_dm9314.cpp @@ -6,7 +6,7 @@ */ #include "nld_dm9314.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_dm9314.h b/src/lib/netlist/devices/nld_dm9314.h index 6188bbef42f..59c60591ce7 100644 --- a/src/lib/netlist/devices/nld_dm9314.h +++ b/src/lib/netlist/devices/nld_dm9314.h @@ -21,7 +21,7 @@ #ifndef NLD_DM9314_H_ #define NLD_DM9314_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_9314(name, cEQ, cMRQ, cS0Q, cS1Q, cS2Q, cS3Q, cD0, cD1, cD2, cD3) \ NET_REGISTER_DEV(TTL_9314, name) \ diff --git a/src/lib/netlist/devices/nld_dm9334.cpp b/src/lib/netlist/devices/nld_dm9334.cpp index c79803a7ecb..c08ce53efed 100644 --- a/src/lib/netlist/devices/nld_dm9334.cpp +++ b/src/lib/netlist/devices/nld_dm9334.cpp @@ -6,7 +6,7 @@ */ #include "nld_dm9334.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_dm9334.h b/src/lib/netlist/devices/nld_dm9334.h index 1a07e051333..e54208e3ba4 100644 --- a/src/lib/netlist/devices/nld_dm9334.h +++ b/src/lib/netlist/devices/nld_dm9334.h @@ -65,7 +65,7 @@ #ifndef NLD_DM9334_H_ #define NLD_DM9334_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_9334(name, cCQ, cEQ, cD, cA0, cA1, cA2) \ NET_REGISTER_DEV(TTL_9334, name) \ diff --git a/src/lib/netlist/devices/nld_legacy.cpp b/src/lib/netlist/devices/nld_legacy.cpp index ed695a91417..738230646e0 100644 --- a/src/lib/netlist/devices/nld_legacy.cpp +++ b/src/lib/netlist/devices/nld_legacy.cpp @@ -6,7 +6,7 @@ */ #include "nld_legacy.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_legacy.h b/src/lib/netlist/devices/nld_legacy.h index 33f7d0caaf8..aa3aec6f147 100644 --- a/src/lib/netlist/devices/nld_legacy.h +++ b/src/lib/netlist/devices/nld_legacy.h @@ -13,7 +13,7 @@ #ifndef NLD_LEGACY_H_ #define NLD_LEGACY_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" // ---------------------------------------------------------------------------------------- // Macros diff --git a/src/lib/netlist/devices/nld_log.cpp b/src/lib/netlist/devices/nld_log.cpp index 8cbcf0c81ca..3ecfe65f40c 100644 --- a/src/lib/netlist/devices/nld_log.cpp +++ b/src/lib/netlist/devices/nld_log.cpp @@ -5,7 +5,7 @@ * */ -#include "../nl_base.h" +#include "netlist/nl_base.h" #include "plib/pfmtlog.h" #include "plib/pstream.h" #include "nld_log.h" diff --git a/src/lib/netlist/devices/nld_log.h b/src/lib/netlist/devices/nld_log.h index a2ccaf66ad6..13c71ea7257 100644 --- a/src/lib/netlist/devices/nld_log.h +++ b/src/lib/netlist/devices/nld_log.h @@ -18,7 +18,7 @@ #ifndef NLD_LOG_H_ #define NLD_LOG_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define LOG(name, cI) \ NET_REGISTER_DEV(LOG, name) \ diff --git a/src/lib/netlist/devices/nld_mm5837.cpp b/src/lib/netlist/devices/nld_mm5837.cpp index 79f1f08dec6..917fcee4221 100644 --- a/src/lib/netlist/devices/nld_mm5837.cpp +++ b/src/lib/netlist/devices/nld_mm5837.cpp @@ -6,8 +6,8 @@ */ #include "nld_mm5837.h" -#include "../analog/nlid_twoterm.h" -#include "../solver/nld_matrix_solver.h" +#include "netlist/analog/nlid_twoterm.h" +#include "netlist/solver/nld_matrix_solver.h" #define R_LOW (1000.0) #define R_HIGH (1000.0) diff --git a/src/lib/netlist/devices/nld_mm5837.h b/src/lib/netlist/devices/nld_mm5837.h index 4af397d9965..8f764aa651f 100644 --- a/src/lib/netlist/devices/nld_mm5837.h +++ b/src/lib/netlist/devices/nld_mm5837.h @@ -19,7 +19,7 @@ #ifndef NLD_MM5837_H_ #define NLD_MM5837_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define MM5837_DIP(name) \ NET_REGISTER_DEV(MM5837_DIP, name) diff --git a/src/lib/netlist/devices/nld_ne555.cpp b/src/lib/netlist/devices/nld_ne555.cpp index 513aeefc66f..d1d34835f14 100644 --- a/src/lib/netlist/devices/nld_ne555.cpp +++ b/src/lib/netlist/devices/nld_ne555.cpp @@ -46,8 +46,8 @@ */ #include "nld_ne555.h" -#include "../analog/nlid_twoterm.h" -#include "../solver/nld_solver.h" +#include "netlist/analog/nlid_twoterm.h" +#include "netlist/solver/nld_solver.h" #define R_OFF (1E20) #define R_ON (25) // Datasheet states a maximum discharge of 200mA, R = 5V / 0.2 diff --git a/src/lib/netlist/devices/nld_ne555.h b/src/lib/netlist/devices/nld_ne555.h index c629253f08f..a074937d829 100644 --- a/src/lib/netlist/devices/nld_ne555.h +++ b/src/lib/netlist/devices/nld_ne555.h @@ -4,7 +4,7 @@ #ifndef NLD_NE555_H_ #define NLD_NE555_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define NE555(name) \ NET_REGISTER_DEV(NE555, name) diff --git a/src/lib/netlist/devices/nld_r2r_dac.cpp b/src/lib/netlist/devices/nld_r2r_dac.cpp index 594ee185600..ac1e26a4e1d 100644 --- a/src/lib/netlist/devices/nld_r2r_dac.cpp +++ b/src/lib/netlist/devices/nld_r2r_dac.cpp @@ -5,9 +5,9 @@ * */ -#include "../nl_base.h" -#include "../analog/nlid_twoterm.h" -#include "../nl_factory.h" +#include "netlist/nl_base.h" +#include "netlist/analog/nlid_twoterm.h" +#include "netlist/nl_factory.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_r2r_dac.h b/src/lib/netlist/devices/nld_r2r_dac.h index 18e5bddc053..8a4257a3cbf 100644 --- a/src/lib/netlist/devices/nld_r2r_dac.h +++ b/src/lib/netlist/devices/nld_r2r_dac.h @@ -46,7 +46,7 @@ #ifndef NLD_R2R_DAC_H_ #define NLD_R2R_DAC_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define R2R_DAC(name, p_VIN, p_R, p_N) \ NET_REGISTER_DEV(R2R_DAC, name) \ diff --git a/src/lib/netlist/devices/nld_schmitt.cpp b/src/lib/netlist/devices/nld_schmitt.cpp index 1ca486ba9be..92bf75b5a89 100644 --- a/src/lib/netlist/devices/nld_schmitt.cpp +++ b/src/lib/netlist/devices/nld_schmitt.cpp @@ -7,10 +7,10 @@ #include "nld_schmitt.h" -#include "../analog/nlid_twoterm.h" -#include "../nl_base.h" -#include "../nl_errstr.h" -#include "../solver/nld_solver.h" +#include "netlist/analog/nlid_twoterm.h" +#include "netlist/nl_base.h" +#include "netlist/nl_errstr.h" +#include "netlist/solver/nld_solver.h" #include diff --git a/src/lib/netlist/devices/nld_schmitt.h b/src/lib/netlist/devices/nld_schmitt.h index ecce59be616..20666b29cf7 100644 --- a/src/lib/netlist/devices/nld_schmitt.h +++ b/src/lib/netlist/devices/nld_schmitt.h @@ -11,7 +11,7 @@ #define NLD_SCHMITT_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" // ---------------------------------------------------------------------------------------- // Macros diff --git a/src/lib/netlist/devices/nld_system.cpp b/src/lib/netlist/devices/nld_system.cpp index 8613a1b2c5c..03aa5c678f1 100644 --- a/src/lib/netlist/devices/nld_system.cpp +++ b/src/lib/netlist/devices/nld_system.cpp @@ -5,8 +5,8 @@ * */ -#include "../solver/nld_solver.h" -#include "../solver/nld_matrix_solver.h" +#include "netlist/solver/nld_solver.h" +#include "netlist/solver/nld_matrix_solver.h" #include "nlid_system.h" namespace netlist diff --git a/src/lib/netlist/devices/nld_system.h b/src/lib/netlist/devices/nld_system.h index 69a7c75dbf3..5158e098cfa 100644 --- a/src/lib/netlist/devices/nld_system.h +++ b/src/lib/netlist/devices/nld_system.h @@ -9,7 +9,7 @@ #ifndef NLD_SYSTEM_H_ #define NLD_SYSTEM_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" // ----------------------------------------------------------------------------- // Macros diff --git a/src/lib/netlist/devices/nld_tms4800.cpp b/src/lib/netlist/devices/nld_tms4800.cpp index d9c832b7d62..04d87f9201d 100644 --- a/src/lib/netlist/devices/nld_tms4800.cpp +++ b/src/lib/netlist/devices/nld_tms4800.cpp @@ -6,7 +6,7 @@ */ #include "nld_tms4800.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_tms4800.h b/src/lib/netlist/devices/nld_tms4800.h index dc72354cb03..c5bcd1337f0 100644 --- a/src/lib/netlist/devices/nld_tms4800.h +++ b/src/lib/netlist/devices/nld_tms4800.h @@ -28,7 +28,7 @@ #ifndef NLD_TMS4800_H_ #define NLD_TMS4800_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define ROM_TMS4800(name, cAR, cOE1, cOE2, cA0, cA1, cA2, cA3, cA4, cA5, cA6, cA7, cA8, cA9, cA10) \ NET_REGISTER_DEV(ROM_TMS4800, name) \ diff --git a/src/lib/netlist/devices/nld_tristate.cpp b/src/lib/netlist/devices/nld_tristate.cpp index 781ba014b4b..b05d09ea71e 100644 --- a/src/lib/netlist/devices/nld_tristate.cpp +++ b/src/lib/netlist/devices/nld_tristate.cpp @@ -6,7 +6,7 @@ */ #include "nld_tristate.h" -#include "../nl_base.h" +#include "netlist/nl_base.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_tristate.h b/src/lib/netlist/devices/nld_tristate.h index a5ff22fac96..71f97d9812d 100644 --- a/src/lib/netlist/devices/nld_tristate.h +++ b/src/lib/netlist/devices/nld_tristate.h @@ -10,7 +10,7 @@ #ifndef NLD_TRISTATE_H_ #define NLD_TRISTATE_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #define TTL_TRISTATE(name, cCEQ1, cD1, cCEQ2, cD2) \ NET_REGISTER_DEV(TTL_TRISTATE, name) \ diff --git a/src/lib/netlist/devices/nlid_cmos.h b/src/lib/netlist/devices/nlid_cmos.h index 053cc9b5b5e..d91d691453a 100644 --- a/src/lib/netlist/devices/nlid_cmos.h +++ b/src/lib/netlist/devices/nlid_cmos.h @@ -8,8 +8,8 @@ #ifndef NLID_CMOS_H_ #define NLID_CMOS_H_ -#include "../nl_base.h" -#include "../nl_setup.h" +#include "netlist/nl_base.h" +#include "netlist/nl_setup.h" namespace netlist { diff --git a/src/lib/netlist/devices/nlid_proxy.cpp b/src/lib/netlist/devices/nlid_proxy.cpp index 82393e0e595..883aea738f0 100644 --- a/src/lib/netlist/devices/nlid_proxy.cpp +++ b/src/lib/netlist/devices/nlid_proxy.cpp @@ -6,7 +6,7 @@ */ #include "nlid_proxy.h" -#include "../solver/nld_solver.h" +#include "netlist/solver/nld_solver.h" //#include "plib/pstream.h" //#include "plib/pfmtlog.h" //#include "nld_log.h" diff --git a/src/lib/netlist/devices/nlid_proxy.h b/src/lib/netlist/devices/nlid_proxy.h index a6967a87a9f..9543b8db234 100644 --- a/src/lib/netlist/devices/nlid_proxy.h +++ b/src/lib/netlist/devices/nlid_proxy.h @@ -11,8 +11,8 @@ #ifndef NLID_PROXY_H_ #define NLID_PROXY_H_ -#include "../analog/nlid_twoterm.h" -#include "../nl_setup.h" +#include "netlist/analog/nlid_twoterm.h" +#include "netlist/nl_setup.h" namespace netlist { diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h index e744ee11dc6..8625010e92b 100644 --- a/src/lib/netlist/devices/nlid_system.h +++ b/src/lib/netlist/devices/nlid_system.h @@ -11,9 +11,9 @@ #ifndef NLID_SYSTEM_H_ #define NLID_SYSTEM_H_ -#include "../analog/nlid_twoterm.h" -#include "../nl_base.h" -#include "../nl_setup.h" +#include "netlist/analog/nlid_twoterm.h" +#include "netlist/nl_base.h" +#include "netlist/nl_setup.h" #include "plib/putil.h" namespace netlist diff --git a/src/lib/netlist/devices/nlid_truthtable.cpp b/src/lib/netlist/devices/nlid_truthtable.cpp index e1a6f5e9046..1e9cc8b1ec1 100644 --- a/src/lib/netlist/devices/nlid_truthtable.cpp +++ b/src/lib/netlist/devices/nlid_truthtable.cpp @@ -6,7 +6,7 @@ */ #include "nlid_truthtable.h" -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #include "plib/palloc.h" #include "plib/plists.h" diff --git a/src/lib/netlist/devices/nlid_truthtable.h b/src/lib/netlist/devices/nlid_truthtable.h index c995b1c766e..1217d7ee873 100644 --- a/src/lib/netlist/devices/nlid_truthtable.h +++ b/src/lib/netlist/devices/nlid_truthtable.h @@ -10,8 +10,8 @@ #ifndef NLID_TRUTHTABLE_H_ #define NLID_TRUTHTABLE_H_ -#include "../nl_base.h" -#include "../nl_setup.h" +#include "netlist/nl_base.h" +#include "netlist/nl_setup.h" #include "plib/putil.h" #define NETLIB_TRUTHTABLE(cname, nIN, nOUT) \ diff --git a/src/lib/netlist/macro/nlm_base.cpp b/src/lib/netlist/macro/nlm_base.cpp index 6a75f3ddc89..d2028574561 100644 --- a/src/lib/netlist/macro/nlm_base.cpp +++ b/src/lib/netlist/macro/nlm_base.cpp @@ -1,7 +1,7 @@ // license:GPL-2.0+ // copyright-holders:Couriersud -#include "../nl_setup.h" -#include "../devices/net_lib.h" +#include "netlist/nl_setup.h" +#include "netlist/devices/net_lib.h" #include "nlm_base.h" /* ---------------------------------------------------------------------------- diff --git a/src/lib/netlist/macro/nlm_base.h b/src/lib/netlist/macro/nlm_base.h index 5ecf8071e98..6a88ad5a1be 100644 --- a/src/lib/netlist/macro/nlm_base.h +++ b/src/lib/netlist/macro/nlm_base.h @@ -10,7 +10,7 @@ #ifndef __PLIB_PREPROCESSOR__ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" /* ---------------------------------------------------------------------------- * Netlist Macros diff --git a/src/lib/netlist/macro/nlm_cd4xxx.cpp b/src/lib/netlist/macro/nlm_cd4xxx.cpp index a9d622032fd..5ebd5593123 100644 --- a/src/lib/netlist/macro/nlm_cd4xxx.cpp +++ b/src/lib/netlist/macro/nlm_cd4xxx.cpp @@ -2,10 +2,10 @@ // copyright-holders:Couriersud #include "nlm_cd4xxx.h" -#include "../devices/nld_4020.h" -#include "../devices/nld_4066.h" -#include "../devices/nld_4316.h" -#include "../devices/nld_system.h" +#include "netlist/devices/nld_4020.h" +#include "netlist/devices/nld_4066.h" +#include "netlist/devices/nld_4316.h" +#include "netlist/devices/nld_system.h" /* * CD4001BC: Quad 2-Input NOR Buffered B Series Gate diff --git a/src/lib/netlist/macro/nlm_cd4xxx.h b/src/lib/netlist/macro/nlm_cd4xxx.h index 527336c1e8e..d4d9c97fdc2 100644 --- a/src/lib/netlist/macro/nlm_cd4xxx.h +++ b/src/lib/netlist/macro/nlm_cd4xxx.h @@ -3,7 +3,7 @@ #ifndef NLD_CD4XXX_H_ #define NLD_CD4XXX_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" /* * Devices: diff --git a/src/lib/netlist/macro/nlm_opamp.cpp b/src/lib/netlist/macro/nlm_opamp.cpp index 122b324f777..849f7820046 100644 --- a/src/lib/netlist/macro/nlm_opamp.cpp +++ b/src/lib/netlist/macro/nlm_opamp.cpp @@ -1,7 +1,7 @@ // license:GPL-2.0+ // copyright-holders:Couriersud #include "nlm_opamp.h" -#include "../devices/net_lib.h" +#include "netlist/devices/net_lib.h" /* * Generic layout with 4 opamps, VCC on pin 4 and GND on pin 11 diff --git a/src/lib/netlist/macro/nlm_opamp.h b/src/lib/netlist/macro/nlm_opamp.h index 9cffbb29c87..fbd7547c976 100644 --- a/src/lib/netlist/macro/nlm_opamp.h +++ b/src/lib/netlist/macro/nlm_opamp.h @@ -3,7 +3,7 @@ #ifndef NLM_OPAMP_H_ #define NLM_OPAMP_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #ifndef __PLIB_PREPROCESSOR__ diff --git a/src/lib/netlist/macro/nlm_other.cpp b/src/lib/netlist/macro/nlm_other.cpp index 7e31ae27bb4..ea0eb1539a8 100644 --- a/src/lib/netlist/macro/nlm_other.cpp +++ b/src/lib/netlist/macro/nlm_other.cpp @@ -2,7 +2,7 @@ // copyright-holders:Couriersud #include "nlm_other.h" -#include "../devices/nld_system.h" +#include "netlist/devices/nld_system.h" /* * MC14584B: Hex Schmitt Trigger diff --git a/src/lib/netlist/macro/nlm_other.h b/src/lib/netlist/macro/nlm_other.h index 7c38d8ad363..ee231fbd6db 100644 --- a/src/lib/netlist/macro/nlm_other.h +++ b/src/lib/netlist/macro/nlm_other.h @@ -3,7 +3,7 @@ #ifndef NLM_OTHER_H_ #define NLM_OTHER_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #ifndef __PLIB_PREPROCESSOR__ diff --git a/src/lib/netlist/macro/nlm_ttl74xx.cpp b/src/lib/netlist/macro/nlm_ttl74xx.cpp index 6fef8253224..58cab049ae7 100644 --- a/src/lib/netlist/macro/nlm_ttl74xx.cpp +++ b/src/lib/netlist/macro/nlm_ttl74xx.cpp @@ -2,8 +2,8 @@ // copyright-holders:Couriersud #include "nlm_ttl74xx.h" -#include "../devices/nld_schmitt.h" -#include "../devices/nld_system.h" +#include "netlist/devices/nld_schmitt.h" +#include "netlist/devices/nld_system.h" /* diff --git a/src/lib/netlist/macro/nlm_ttl74xx.h b/src/lib/netlist/macro/nlm_ttl74xx.h index c8868e45f7f..21ff99f2efe 100644 --- a/src/lib/netlist/macro/nlm_ttl74xx.h +++ b/src/lib/netlist/macro/nlm_ttl74xx.h @@ -3,7 +3,7 @@ #ifndef NLD_TTL74XX_H_ #define NLD_TTL74XX_H_ -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #ifndef __PLIB_PREPROCESSOR__ diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index adbda1d679d..e210bd13089 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -24,7 +24,7 @@ #include "plib/pstate.h" #include "plib/pstream.h" -#include "nl_types.h" +#include "nltypes.h" #include "nl_errstr.h" #include "nl_lists.h" #include "plib/ptime.h" diff --git a/src/lib/netlist/nl_factory.h b/src/lib/netlist/nl_factory.h index abf41ef9f93..ee6b4a8ac8f 100644 --- a/src/lib/netlist/nl_factory.h +++ b/src/lib/netlist/nl_factory.h @@ -11,7 +11,7 @@ #include -#include "nl_types.h" +#include "nltypes.h" #include "plib/palloc.h" #include "plib/ptypes.h" diff --git a/src/lib/netlist/nl_lists.h b/src/lib/netlist/nl_lists.h index 32e31998b7a..c0d3bfd6548 100644 --- a/src/lib/netlist/nl_lists.h +++ b/src/lib/netlist/nl_lists.h @@ -20,7 +20,8 @@ #include #include #include -#include "nl_types.h" + +#include "nltypes.h" // ---------------------------------------------------------------------------------------- // timed queue diff --git a/src/lib/netlist/nl_setup.h b/src/lib/netlist/nl_setup.h index dd4f9b381ac..2cadd3b3e1c 100644 --- a/src/lib/netlist/nl_setup.h +++ b/src/lib/netlist/nl_setup.h @@ -20,7 +20,7 @@ #include "nl_config.h" #include "nl_factory.h" -#include "nl_types.h" +#include "nltypes.h" //============================================================ // MACROS / inline netlist definitions diff --git a/src/lib/netlist/nl_types.h b/src/lib/netlist/nl_types.h deleted file mode 100644 index 8b229e85bf5..00000000000 --- a/src/lib/netlist/nl_types.h +++ /dev/null @@ -1,140 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/*! - * - * \file nl_types.h - * - */ - -#ifndef NL_TYPES_H_ -#define NL_TYPES_H_ - -#include "nl_config.h" -#include "plib/ptime.h" -#include "plib/pchrono.h" -#include "plib/pfmtlog.h" -#include "plib/pmempool.h" -#include "plib/pstring.h" -#include "plib/pstate.h" - -#include -#include - -namespace netlist -{ - /*! @brief netlist_sig_t is the type used for logic signals. - * - * This may be any of bool, uint8_t, uint16_t, uin32_t and uint64_t. - * The choice has little to no impact on performance. - */ - using netlist_sig_t = std::uint32_t; - - /* FIXME: belongs into nl_base.h to nlstate */ - /** - * @brief Interface definition for netlist callbacks into calling code - * - * A class inheriting from netlist_callbacks_t has to be passed to the netlist_t - * constructor. Netlist does processing during construction and thus needs - * the object passed completely constructed. - * - */ - class callbacks_t - { - public: - - callbacks_t() = default; - /* what is done before this is passed as a unique_ptr to netlist - * we should not limit. - */ - virtual ~callbacks_t() = default; - COPYASSIGNMOVE(callbacks_t, default) - - /* logging callback */ - virtual void vlog(const plib::plog_level &l, const pstring &ls) const = 0; - - }; - - using log_type = plib::plog_base; - - - //============================================================ - // Performance tracking - //============================================================ - - template - using nperftime_t = plib::chrono::timer; - - template - using nperfcount_t = plib::chrono::counter; - - //============================================================ - // Types needed by various includes - //============================================================ - - /*! The memory pool for netlist objects - * - * \note This is not the right location yet. - * - */ - -#if (USE_MEMPOOL) - using nlmempool = plib::mempool; -#else - using nlmempool = plib::mempool_default; -#endif - - /*! Owned pointer type for pooled allocations. - * - */ - template - using poolptr = nlmempool::poolptr; - - inline nlmempool &pool() - { - static nlmempool static_pool(655360, 16); - return static_pool; - } - - namespace detail { - - /*! Enum specifying the type of object */ - enum terminal_type { - TERMINAL = 0, /*!< object is an analog terminal */ - INPUT = 1, /*!< object is an input */ - OUTPUT = 2, /*!< object is an output */ - }; - - /*! Type of the model map used. - * This is used to hold all #Models in an unordered map - */ - using model_map_t = std::unordered_map; - - } // namespace detail - -#if (PHAS_INT128) - using netlist_time = ptime; -#else - using netlist_time = plib::ptime; - static_assert(noexcept(netlist_time::from_nsec(1)) == true, "Not evaluated as constexpr"); -#endif - - //============================================================ - // MACROS - //============================================================ - - template inline constexpr netlist_time NLTIME_FROM_NS(T &&t) noexcept { return netlist_time::from_nsec(t); } - template inline constexpr netlist_time NLTIME_FROM_US(T &&t) noexcept { return netlist_time::from_usec(t); } - template inline constexpr netlist_time NLTIME_FROM_MS(T &&t) noexcept { return netlist_time::from_msec(t); } - -} // namespace netlist - -namespace plib { - - template<> - inline void state_manager_t::save_item(const void *owner, netlist::netlist_time &nlt, const pstring &stname) - { - save_state_ptr(owner, stname, datatype_t(sizeof(netlist::netlist_time::internal_type), true, false), 1, nlt.get_internaltype_ptr()); - } -} // namespace plib - -#endif /* NL_TYPES_H_ */ diff --git a/src/lib/netlist/nltypes.h b/src/lib/netlist/nltypes.h new file mode 100644 index 00000000000..ca1972ee527 --- /dev/null +++ b/src/lib/netlist/nltypes.h @@ -0,0 +1,144 @@ +// license:GPL-2.0+ +// copyright-holders:Couriersud +/*! + * + * \file nltypes.h + * + */ + +/* \note never change the name to nl_types.h. This creates a conflict + * with nl_types.h file provided by libc++ (clang, macosx) + */ + +#ifndef NLTYPES_H_ +#define NLTYPES_H_ + +#include "nl_config.h" +#include "plib/ptime.h" +#include "plib/pchrono.h" +#include "plib/pfmtlog.h" +#include "plib/pmempool.h" +#include "plib/pstring.h" +#include "plib/pstate.h" + +#include +#include + +namespace netlist +{ + /*! @brief netlist_sig_t is the type used for logic signals. + * + * This may be any of bool, uint8_t, uint16_t, uin32_t and uint64_t. + * The choice has little to no impact on performance. + */ + using netlist_sig_t = std::uint32_t; + + /* FIXME: belongs into nl_base.h to nlstate */ + /** + * @brief Interface definition for netlist callbacks into calling code + * + * A class inheriting from netlist_callbacks_t has to be passed to the netlist_t + * constructor. Netlist does processing during construction and thus needs + * the object passed completely constructed. + * + */ + class callbacks_t + { + public: + + callbacks_t() = default; + /* what is done before this is passed as a unique_ptr to netlist + * we should not limit. + */ + virtual ~callbacks_t() = default; + COPYASSIGNMOVE(callbacks_t, default) + + /* logging callback */ + virtual void vlog(const plib::plog_level &l, const pstring &ls) const = 0; + + }; + + using log_type = plib::plog_base; + + + //============================================================ + // Performance tracking + //============================================================ + + template + using nperftime_t = plib::chrono::timer; + + template + using nperfcount_t = plib::chrono::counter; + + //============================================================ + // Types needed by various includes + //============================================================ + + /*! The memory pool for netlist objects + * + * \note This is not the right location yet. + * + */ + +#if (USE_MEMPOOL) + using nlmempool = plib::mempool; +#else + using nlmempool = plib::mempool_default; +#endif + + /*! Owned pointer type for pooled allocations. + * + */ + template + using poolptr = nlmempool::poolptr; + + inline nlmempool &pool() + { + static nlmempool static_pool(655360, 16); + return static_pool; + } + + namespace detail { + + /*! Enum specifying the type of object */ + enum terminal_type { + TERMINAL = 0, /*!< object is an analog terminal */ + INPUT = 1, /*!< object is an input */ + OUTPUT = 2, /*!< object is an output */ + }; + + /*! Type of the model map used. + * This is used to hold all #Models in an unordered map + */ + using model_map_t = std::unordered_map; + + } // namespace detail + +#if (PHAS_INT128) + using netlist_time = ptime; +#else + using netlist_time = plib::ptime; + static_assert(noexcept(netlist_time::from_nsec(1)) == true, "Not evaluated as constexpr"); +#endif + + //============================================================ + // MACROS + //============================================================ + + template inline constexpr netlist_time NLTIME_FROM_NS(T &&t) noexcept { return netlist_time::from_nsec(t); } + template inline constexpr netlist_time NLTIME_FROM_US(T &&t) noexcept { return netlist_time::from_usec(t); } + template inline constexpr netlist_time NLTIME_FROM_MS(T &&t) noexcept { return netlist_time::from_msec(t); } + +} // namespace netlist + +namespace plib { + + template<> + inline void state_manager_t::save_item(const void *owner, netlist::netlist_time &nlt, const pstring &stname) + { + save_state_ptr(owner, stname, datatype_t(sizeof(netlist::netlist_time::internal_type), true, false), 1, nlt.get_internaltype_ptr()); + } +} // namespace plib + +#endif /* NLTYPES_H_ */ diff --git a/src/lib/netlist/prg/nlwav.cpp b/src/lib/netlist/prg/nlwav.cpp index 384d11f5781..c4ddf152515 100644 --- a/src/lib/netlist/prg/nlwav.cpp +++ b/src/lib/netlist/prg/nlwav.cpp @@ -1,7 +1,7 @@ // license:GPL-2.0+ // copyright-holders:Couriersud #include "plib/pstring.h" -#include "../nl_setup.h" +#include "netlist/nl_setup.h" #include "plib/plists.h" #include "plib/pmain.h" #include "plib/ppmf.h" diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp index ab75b7d7dc4..77bf710c9c9 100644 --- a/src/lib/netlist/solver/nld_solver.cpp +++ b/src/lib/netlist/solver/nld_solver.cpp @@ -31,11 +31,11 @@ #pragma GCC optimize "ivopts" #endif -#include "../nl_lists.h" +#include "netlist/nl_lists.h" #include "plib/pomp.h" -#include "../nl_factory.h" +#include "netlist/nl_factory.h" #include "nld_matrix_solver.h" #include "nld_solver.h" diff --git a/src/lib/netlist/solver/nld_solver.h b/src/lib/netlist/solver/nld_solver.h index 87e02d215ec..fb6d05fbbcb 100644 --- a/src/lib/netlist/solver/nld_solver.h +++ b/src/lib/netlist/solver/nld_solver.h @@ -8,7 +8,7 @@ #ifndef NLD_SOLVER_H_ #define NLD_SOLVER_H_ -#include "../nl_base.h" +#include "netlist/nl_base.h" #include "plib/pstream.h" #include "nld_matrix_solver.h" -- cgit v1.2.3-70-g09d2