blob: a0c28e6b3025b21bfbb5775515722d1afca6fee7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
// license:GPL-2.0+
// copyright-holders:Couriersud
#ifndef NLD_SOLVER_H_
#define NLD_SOLVER_H_
///
/// \file nld_solver.h
///
#include "../plib/pstream.h"
#include "netlist/nl_base.h"
#include "nld_matrix_solver.h"
#include <map>
#include <memory>
#include <vector>
// ----------------------------------------------------------------------------------------
// solver
// ----------------------------------------------------------------------------------------
namespace netlist
{
namespace devices
{
NETLIB_OBJECT(solver)
{
NETLIB_CONSTRUCTOR(solver)
, m_fb_step(*this, "FB_step")
, m_Q_step(*this, "Q_step")
, m_params(*this)
{
// internal staff
connect(m_fb_step, m_Q_step);
}
void post_start();
void stop();
nl_fptype gmin() const { return m_params.m_gmin(); }
solver::static_compile_container create_solver_code(solver::static_compile_target target);
NETLIB_UPDATEI();
NETLIB_RESETI();
// NETLIB_UPDATE_PARAMI();
private:
logic_input_t m_fb_step;
logic_output_t m_Q_step;
// FIXME: these should be created in device space
std::vector<host_arena::unique_ptr<solver::matrix_solver_t>> m_mat_solvers;
std::vector<solver::matrix_solver_t *> m_mat_solvers_all;
std::vector<solver::matrix_solver_t *> m_mat_solvers_timestepping;
solver::solver_parameters_t m_params;
template <typename FT, int SIZE>
host_arena::unique_ptr<solver::matrix_solver_t> create_solver(std::size_t size,
const pstring &solvername, analog_net_t::list_t &nets);
template <typename FT>
host_arena::unique_ptr<solver::matrix_solver_t> create_solvers(
const pstring &sname, analog_net_t::list_t &nets);
};
} // namespace devices
} // namespace netlist
#endif // NLD_SOLVER_H_
|