diff options
author | Couriersud <couriersud@gmx.org> | 2020-09-05 19:43:54 +0200 |
---|---|---|
committer | Couriersud <couriersud@gmx.org> | 2020-09-05 21:31:49 +0200 |
commit | f3eb6324652fea263972087146fbdde9e32f9a0f (patch) | |
tree | f63d352948c3a4fcf62857839cc5c5359804b0f5 /src/lib/netlist/solver | |
parent | 4dd7e21f565b12e8487b884089d769f0b30147c6 (diff) |
netlist: code maintenance and performance optimizations.
* rename some misleading type names
* remove callback_t and replace by better scalable approach
* hide implementations details
* move sources classes from putil.h to psources.h
* reduce code complexity
* improve parsing performance, parsing netlists now is twice as fast.
* fix issues around multi-byte string support
* moved psplit into pstrutil.h
Diffstat (limited to 'src/lib/netlist/solver')
-rw-r--r-- | src/lib/netlist/solver/nld_ms_gcr.h | 6 | ||||
-rw-r--r-- | src/lib/netlist/solver/nld_solver.cpp | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/netlist/solver/nld_ms_gcr.h b/src/lib/netlist/solver/nld_ms_gcr.h index 53bf9208649..61bfa012fa7 100644 --- a/src/lib/netlist/solver/nld_ms_gcr.h +++ b/src/lib/netlist/solver/nld_ms_gcr.h @@ -98,10 +98,10 @@ namespace solver // During extended validation there is no reason to check for // differences in the generated code since during // extended validation this will be different (and non-functional) - if (!this->state().is_extended_validation() && this->state().lib().isLoaded()) + if (!this->state().is_extended_validation() && this->state().static_solver_lib().isLoaded()) { pstring symname = static_compile_name(); - m_proc.load(this->state().lib(), symname); + m_proc.load(this->state().static_solver_lib(), symname); if (m_proc.resolved()) { this->state().log().info("External static solver {1} found ...", symname); @@ -313,7 +313,7 @@ namespace solver generate_code(strm); strm.writeline("}\n"); // some compilers (_WIN32, _WIN64, mac osx) need an explicit cast - return std::pair<pstring, pstring>(name, pstring(t.str())); + return std::pair<pstring, pstring>(name, putf8string(t.str())); } template <typename FT, int SIZE> diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp index 34e1ae16cb3..78493c64d2b 100644 --- a/src/lib/netlist/solver/nld_solver.cpp +++ b/src/lib/netlist/solver/nld_solver.cpp @@ -59,7 +59,7 @@ namespace devices plib::uninitialised_array<netlist_time, config::MAX_SOLVER_QUEUE_SIZE::value> nt; std::size_t p=0; - while (m_queue.size() > 0) + while (!m_queue.empty()) { auto t = m_queue.top().exec_time(); auto o = m_queue.top().object(); @@ -112,7 +112,7 @@ namespace devices tmp[i]->update_inputs(); } } - if (m_queue.size() > 0) + if (!m_queue.empty()) m_Q_step.net().toggle_and_push_to_queue(m_queue.top().exec_time() - now); } |