diff options
Diffstat (limited to 'src/emu/netlist/analog/nld_ms_gauss_seidel.h')
-rw-r--r-- | src/emu/netlist/analog/nld_ms_gauss_seidel.h | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/src/emu/netlist/analog/nld_ms_gauss_seidel.h b/src/emu/netlist/analog/nld_ms_gauss_seidel.h index d57168a436d..2cc7a8cda3d 100644 --- a/src/emu/netlist/analog/nld_ms_gauss_seidel.h +++ b/src/emu/netlist/analog/nld_ms_gauss_seidel.h @@ -21,7 +21,13 @@ public: , m_lp_fact(0) , m_gs_fail(0) , m_gs_total(0) - {} + { + const char *p = osd_getenv("NETLIST_STATS"); + if (p != NULL) + m_log_stats = (bool) atoi(p); + else + m_log_stats = false; + } virtual ~netlist_matrix_solver_gauss_seidel_t() {} @@ -35,6 +41,7 @@ private: nl_double m_lp_fact; int m_gs_fail; int m_gs_total; + bool m_log_stats; }; @@ -45,22 +52,21 @@ private: template <int m_N, int _storage_N> void netlist_matrix_solver_gauss_seidel_t<m_N, _storage_N>::log_stats() { -#if 1 - if (this->m_stat_calculations == 0) - return; - printf("==============================================\n"); - printf("Solver %s\n", this->name().cstr()); - printf(" ==> %d nets\n", this->N()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr()); - printf(" has %s elements\n", this->is_dynamic() ? "dynamic" : "no dynamic"); - printf(" has %s elements\n", this->is_timestep() ? "timestep" : "no timestep"); - printf(" %6.3f average newton raphson loops\n", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls); - printf(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average\n", - this->m_stat_calculations, - this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0), - this->m_gs_fail, - 100.0 * (double) this->m_gs_fail / (double) this->m_stat_calculations, - (double) this->m_gs_total / (double) this->m_stat_calculations); -#endif + if (this->m_stat_calculations != 0 && m_log_stats) + { + printf("==============================================\n"); + printf("Solver %s\n", this->name().cstr()); + printf(" ==> %d nets\n", this->N()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr()); + printf(" has %s elements\n", this->is_dynamic() ? "dynamic" : "no dynamic"); + printf(" has %s elements\n", this->is_timestep() ? "timestep" : "no timestep"); + printf(" %6.3f average newton raphson loops\n", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls); + printf(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average\n", + this->m_stat_calculations, + this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0), + this->m_gs_fail, + 100.0 * (double) this->m_gs_fail / (double) this->m_stat_calculations, + (double) this->m_gs_total / (double) this->m_stat_calculations); + } } template <int m_N, int _storage_N> |