mirror of
https://github.com/holub/mame
synced 2025-10-05 08:41:31 +03:00
Implemented a fallback to Gaussian elimination if Gauss-Seidel exceeds a certain number of iterations.
This commit is contained in:
parent
2f899313a0
commit
4376c828fd
@ -577,6 +577,9 @@ ATTR_HOT inline int netlist_matrix_solver_gauss_seidel_t<m_N, _storage_N>::solve
|
||||
resched_cnt++;
|
||||
} while (resched && (resched_cnt < m_resched_loops / 3 ));
|
||||
|
||||
if (resched)
|
||||
return m_fallback.solve_non_dynamic();
|
||||
|
||||
return resched_cnt;
|
||||
}
|
||||
|
||||
@ -770,7 +773,7 @@ ATTR_COLD void NETLIB_NAME(solver)::post_start()
|
||||
ms = new netlist_matrix_solver_direct_t<4,4>();
|
||||
//ms = new netlist_matrix_solver_gauss_seidel_t<4,4>();
|
||||
break;
|
||||
#if 1
|
||||
#if 0
|
||||
case 5:
|
||||
ms = new netlist_matrix_solver_direct_t<5,5>();
|
||||
//ms = new netlist_matrix_solver_gauss_seidel_t<4,4>();
|
||||
|
@ -119,15 +119,21 @@ public:
|
||||
ATTR_COLD virtual void setup(netlist_net_t::list_t &nets, NETLIB_NAME(solver) &owner)
|
||||
{
|
||||
netlist_matrix_solver_t::setup(nets, owner);
|
||||
m_fallback.setup(nets, owner);
|
||||
}
|
||||
|
||||
ATTR_HOT int solve_non_dynamic();
|
||||
|
||||
ATTR_HOT inline const int N() const { if (m_N == 0) return m_nets.count(); else return m_N; }
|
||||
|
||||
ATTR_COLD virtual void reset() { netlist_matrix_solver_t::reset(); }
|
||||
ATTR_COLD virtual void reset()
|
||||
{
|
||||
netlist_matrix_solver_t::reset();
|
||||
m_fallback.reset();
|
||||
}
|
||||
|
||||
private:
|
||||
netlist_matrix_solver_direct_t<m_N, _storage_N> m_fallback;
|
||||
};
|
||||
|
||||
class netlist_matrix_solver_direct1_t: public netlist_matrix_solver_direct_t<1,1>
|
||||
|
@ -16,8 +16,6 @@ NETLIB_START(nicRSFF)
|
||||
|
||||
NETLIB_RESET(nicRSFF)
|
||||
{
|
||||
// m_Q.initial(0);
|
||||
// m_QQ.initial(1);
|
||||
}
|
||||
|
||||
NETLIB_UPDATE(nicRSFF)
|
||||
|
@ -51,15 +51,11 @@ NETLIB_RESET(ttl_input)
|
||||
|
||||
NETLIB_UPDATE(ttl_input)
|
||||
{
|
||||
//m_Q.net().m_new.Q = !(m_IN.Value() & 1);
|
||||
//OUTLOGIC(m_Q, m_IN.Value() & 1, NLTIME_IMMEDIATE);
|
||||
OUTLOGIC(m_Q, m_IN.Value() & 1, netlist_time::from_nsec(1));
|
||||
}
|
||||
|
||||
NETLIB_UPDATE_PARAM(ttl_input)
|
||||
{
|
||||
//m_Q.net().m_new.Q = !(m_IN.Value() & 1);
|
||||
//OUTLOGIC(m_Q, m_IN.Value() & 1, NLTIME_IMMEDIATE);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
@ -83,5 +79,4 @@ NETLIB_UPDATE(analog_input)
|
||||
|
||||
NETLIB_UPDATE_PARAM(analog_input)
|
||||
{
|
||||
//OUTANALOG(m_Q, m_IN.Value(), NLTIME_IMMEDIATE);
|
||||
}
|
||||
|
@ -98,7 +98,6 @@ protected:
|
||||
|
||||
ATTR_COLD void reset()
|
||||
{
|
||||
//m_Q.initial(0.001); // Make sure update outputs something
|
||||
}
|
||||
|
||||
ATTR_HOT ATTR_ALIGN void update()
|
||||
|
@ -435,7 +435,6 @@ ATTR_COLD netlist_net_t::netlist_net_t(const type_t atype, const family_t afamil
|
||||
, m_in_queue(2)
|
||||
, m_railterminal(NULL)
|
||||
{
|
||||
//m_last.Analog = -123456789.0; // set to something we will never hit.
|
||||
m_last.Analog = 0.0; // set to something we will never hit.
|
||||
m_new.Analog = 0.0;
|
||||
m_cur.Analog = 0.0;
|
||||
@ -443,7 +442,6 @@ ATTR_COLD netlist_net_t::netlist_net_t(const type_t atype, const family_t afamil
|
||||
|
||||
ATTR_COLD void netlist_net_t::reset()
|
||||
{
|
||||
//m_last.Analog = -123456789.0; // set to something we will never hit.
|
||||
m_last.Analog = 0.0; // set to something we will never hit.
|
||||
m_cur.Analog = 0.0;
|
||||
m_last.Q = 0; // set to something we will never hit.
|
||||
|
Loading…
Reference in New Issue
Block a user