summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/core/setup.h
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2020-09-29 22:35:18 +0200
committer couriersud <couriersud@gmx.org>2020-09-30 08:37:42 +0200
commit91ca668d141570b26879cf111d644515aca173e2 (patch)
tree2d2425a73751e928a57c6843c7ce0d529ea54c07 /src/lib/netlist/core/setup.h
parentd838120e37300e42b940b8bdfaf41e0bfada4037 (diff)
netlist: Fix a net splitting issue with four term devices.
* Under cirtum circumstances the splitter would create "ghost" solvers consisting of terminals already used in another and complete solver. This may impact all netlist which use opamps and thus is committed early in the cycle. * This commit adds functionality to instruct the splitter code to include terminals which will not create matrix elements into the parsing of net groups for solvers.
Diffstat (limited to 'src/lib/netlist/core/setup.h')
-rw-r--r--src/lib/netlist/core/setup.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/lib/netlist/core/setup.h b/src/lib/netlist/core/setup.h
index 8b8a49dbc34..ba783c52130 100644
--- a/src/lib/netlist/core/setup.h
+++ b/src/lib/netlist/core/setup.h
@@ -144,13 +144,21 @@ namespace netlist
pstring get_initial_param_val(const pstring &name, const pstring &def) const;
void register_term(detail::core_terminal_t &term);
- void register_term(terminal_t &term, terminal_t &other_term);
+ void register_term(terminal_t &term, terminal_t *other_term, const std::array<terminal_t *, 2> &splitter_terms);
- // called from net_splitter
+ // called from matrix_solver_t::get_connected_net
+ // returns the terminal being part of a two terminal device.
terminal_t *get_connected_terminal(const terminal_t &term) const noexcept
{
auto ret(m_connected_terminals.find(&term));
- return (ret != m_connected_terminals.end()) ? ret->second : nullptr;
+ return (ret != m_connected_terminals.end()) ? ret->second[0] : nullptr;
+ }
+
+ // called from net_splitter
+ const std::array<terminal_t *, 4> *get_connected_terminals(const terminal_t &term) const noexcept
+ {
+ auto ret(m_connected_terminals.find(&term));
+ return (ret != m_connected_terminals.end()) ? &ret->second : nullptr;
}
// get family -> truthtable
@@ -223,7 +231,9 @@ namespace netlist
// FIXME: can be cleared before run
std::unordered_map<pstring, detail::core_terminal_t *> m_terminals;
- std::unordered_map<const terminal_t *, terminal_t *> m_connected_terminals;
+ // FIXME: Limited to 3 additional terminals
+ std::unordered_map<const terminal_t *,
+ std::array<terminal_t *, 4>> m_connected_terminals;
std::unordered_map<pstring, param_ref_t> m_params;
std::unordered_map<const detail::core_terminal_t *,
devices::nld_base_proxy *> m_proxies;