Permalink
Browse files

Rename misleading solver parameters. (nw)

  • Loading branch information...
1 parent d790daa commit e26e327ef9abb1d93d9116e6a6de151ddd45adc1 couriersud committed Jan 8, 2017
@@ -37,7 +37,7 @@ NETLIST_START(cap_delay)
SOLVER(Solver, P_FREQ)
PARAM(Solver.ACCURACY, 1e-20)
PARAM(Solver.DYNAMIC_TS, P_DTS)
- PARAM(Solver.MIN_TIMESTEP, 1e-6)
+ PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 1e-6)
CLOCK(clk, 5000)
TTL_7400_NAND(n1,clk,clk)
@@ -46,7 +46,7 @@ NETLIST_START(dummy)
PARAM(Solver.NR_LOOPS, 9000)
PARAM(Solver.SOR_FACTOR, 0.001)
PARAM(Solver.GS_LOOPS, 1)
- PARAM(Solver.ITERATIVE, "MAT_CR")
+ PARAM(Solver.METHOD, "MAT_CR")
#if USE_OPTMIZATIONS
SOLVER(Solver, 24000)
@@ -55,7 +55,7 @@ NETLIST_START(dummy)
SOLVER(Solver, 24000)
PARAM(Solver.DYNAMIC_TS, 1)
PARAM(Solver.DYNAMIC_LTE, 1e-4)
- PARAM(Solver.MIN_TIMESTEP, 5e-7)
+ PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 5e-7)
PARAM(Solver.PARALLEL, 0)
PARAM(Solver.PIVOT, 0)
#endif
View
@@ -13,14 +13,14 @@ NETLIST_START(dummy)
PARAM(Solver.ACCURACY, 1e-8)
PARAM(Solver.NR_LOOPS, 300)
PARAM(Solver.GS_LOOPS, 1)
- //PARAM(Solver.ITERATIVE, "W")
- PARAM(Solver.ITERATIVE, "MAT_CR")
- //PARAM(Solver.ITERATIVE, "MAT")
- //PARAM(Solver.ITERATIVE, "GMRES")
- //PARAM(Solver.ITERATIVE, "SOR")
+ //PARAM(Solver.METHOD, "W")
+ PARAM(Solver.METHOD, "MAT_CR")
+ //PARAM(Solver.METHOD, "MAT")
+ //PARAM(Solver.METHOD, "GMRES")
+ //PARAM(Solver.METHOD, "SOR")
PARAM(Solver.DYNAMIC_TS, 0)
PARAM(Solver.DYNAMIC_LTE, 5e-3)
- PARAM(Solver.MIN_TIMESTEP, 10e-6)
+ PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 10e-6)
PARAM(Solver.PARALLEL, 0)
PARAM(Solver.SOR_FACTOR, 1.00)
PARAM(Solver.PIVOT, 0)
@@ -29,7 +29,7 @@ NETLIST_START(dummy)
PARAM(Solver.ACCURACY, 1e-8)
PARAM(Solver.NR_LOOPS, 300)
PARAM(Solver.GS_LOOPS, 20)
- PARAM(Solver.ITERATIVE, "GMRES")
+ PARAM(Solver.METHOD, "GMRES")
PARAM(Solver.PARALLEL, 0)
#endif
//FIXME proper models!
View
@@ -17,7 +17,7 @@ NETLIST_START(lr)
SOLVER(Solver, 48000)
PARAM(Solver.ACCURACY, 1e-6)
CLOCK(clk, 50)
- PARAM(Solver.ITERATIVE, "MAT_CR")
+ PARAM(Solver.METHOD, "MAT_CR")
IND(L1, 10)
RES(R1, 10000)
@@ -425,7 +425,7 @@ void matrix_solver_t::solve_base()
{
log().warning("NEWTON_LOOPS exceeded on net {1}... reschedule", this->name());
m_Q_sync.net().toggle_new_Q();
- m_Q_sync.net().reschedule_in_queue(m_params.m_nt_sync_delay);
+ m_Q_sync.net().reschedule_in_queue(m_params.m_nr_recalc_delay);
}
}
else
@@ -31,7 +31,7 @@ namespace netlist
bool m_dynamic;
unsigned m_gs_loops;
unsigned m_nr_loops;
- netlist_time m_nt_sync_delay;
+ netlist_time m_nr_recalc_delay;
bool m_log_stats;
};
@@ -147,47 +147,47 @@ std::unique_ptr<matrix_solver_t> NETLIB_NAME(solver)::create_solver(unsigned siz
return plib::make_unique<matrix_solver_direct2_t>(netlist(), solvername, &m_params);
else
{
- if (pstring("SOR_MAT").equals(m_iterative_solver()))
+ if (pstring("SOR_MAT").equals(m_method()))
{
return create_it<matrix_solver_SOR_mat_t<m_N, storage_N>>(netlist(), solvername, m_params, size);
//typedef matrix_solver_SOR_mat_t<m_N,storage_N> solver_sor_mat;
//return plib::make_unique<solver_sor_mat>(netlist(), solvername, &m_params, size);
}
- else if (pstring("MAT_CR").equals(m_iterative_solver()))
+ else if (pstring("MAT_CR").equals(m_method()))
{
typedef matrix_solver_GCR_t<m_N,storage_N> solver_mat;
return plib::make_unique<solver_mat>(netlist(), solvername, &m_params, size);
}
- else if (pstring("MAT").equals(m_iterative_solver()))
+ else if (pstring("MAT").equals(m_method()))
{
typedef matrix_solver_direct_t<m_N,storage_N> solver_mat;
return plib::make_unique<solver_mat>(netlist(), solvername, &m_params, size);
}
- else if (pstring("SM").equals(m_iterative_solver()))
+ else if (pstring("SM").equals(m_method()))
{
/* Sherman-Morrison Formula */
typedef matrix_solver_sm_t<m_N,storage_N> solver_mat;
return plib::make_unique<solver_mat>(netlist(), solvername, &m_params, size);
}
- else if (pstring("W").equals(m_iterative_solver()))
+ else if (pstring("W").equals(m_method()))
{
/* Woodbury Formula */
typedef matrix_solver_w_t<m_N,storage_N> solver_mat;
return plib::make_unique<solver_mat>(netlist(), solvername, &m_params, size);
}
- else if (pstring("SOR").equals(m_iterative_solver()))
+ else if (pstring("SOR").equals(m_method()))
{
typedef matrix_solver_SOR_t<m_N,storage_N> solver_GS;
return plib::make_unique<solver_GS>(netlist(), solvername, &m_params, size);
}
- else if (pstring("GMRES").equals(m_iterative_solver()))
+ else if (pstring("GMRES").equals(m_method()))
{
typedef matrix_solver_GMRES_t<m_N,storage_N> solver_GMRES;
return plib::make_unique<solver_GMRES>(netlist(), solvername, &m_params, size);
}
else
{
- netlist().log().fatal("Unknown solver type: {1}\n", m_iterative_solver());
+ netlist().log().fatal("Unknown solver type: {1}\n", m_method());
return nullptr;
}
}
@@ -255,12 +255,12 @@ void NETLIB_NAME(solver)::post_start()
/* FIXME: Throw when negative */
m_params.m_gs_loops = static_cast<unsigned>(m_gs_loops());
m_params.m_nr_loops = static_cast<unsigned>(m_nr_loops());
- m_params.m_nt_sync_delay = netlist_time::from_double(m_sync_delay());
- m_params.m_lte = m_lte();
- m_params.m_sor = m_sor();
+ m_params.m_nr_recalc_delay = netlist_time::from_double(m_nr_recalc_delay());
+ m_params.m_lte = m_dynamic_lte();
+ m_params.m_sor = m_gs_sor();
- m_params.m_min_timestep = m_min_timestep();
- m_params.m_dynamic = (m_dynamic() == 1 ? true : false);
+ m_params.m_min_timestep = m_dynamic_min_ts();
+ m_params.m_dynamic = (m_dynamic_ts() == 1 ? true : false);
m_params.m_max_timestep = netlist_time::from_double(1.0 / m_freq()).as_double();
if (m_params.m_dynamic)
@@ -42,25 +42,25 @@ NETLIB_OBJECT(solver)
NETLIB_CONSTRUCTOR(solver)
, m_fb_step(*this, "FB_step")
, m_Q_step(*this, "Q_step")
- , m_sync_delay(*this, "SYNC_DELAY", NLTIME_FROM_NS(10).as_double())
, m_freq(*this, "FREQ", 48000.0)
/* iteration parameters */
- , m_sor(*this, "SOR_FACTOR", 1.059)
- , m_iterative_solver(*this, "ITERATIVE", "SOR")
+ , m_gs_sor(*this, "SOR_FACTOR", 1.059)
+ , m_method(*this, "ITERATIVE", "MAT_CR")
, m_accuracy(*this, "ACCURACY", 1e-7)
, m_gs_loops(*this, "GS_LOOPS",9) // Gauss-Seidel loops
/* general parameters */
, m_gmin(*this, "GMIN", NETLIST_GMIN_DEFAULT)
, m_pivot(*this, "PIVOT", 0) // use pivoting - on supported solvers
, m_nr_loops(*this, "NR_LOOPS", 250) // Newton-Raphson loops
+ , m_nr_recalc_delay(*this, "NR_RECALC_DELAY", NLTIME_FROM_NS(10).as_double()) // Delay to next solve attempt if nr loops exceeded
, m_parallel(*this, "PARALLEL", 0)
/* automatic time step */
- , m_dynamic(*this, "DYNAMIC_TS", 0)
- , m_lte(*this, "DYNAMIC_LTE", 5e-5) // diff/timestep
- , m_min_timestep(*this, "MIN_TIMESTEP", 1e-6) // nl_double timestep resolution
+ , m_dynamic_ts(*this, "DYNAMIC_TS", 0)
+ , m_dynamic_lte(*this, "DYNAMIC_LTE", 5e-5) // diff/timestep
+ , m_dynamic_min_ts(*this, "DYNAMIC_MIN_TIMESTEP", 1e-6) // nl_double timestep resolution
, m_log_stats(*this, "LOG_STATS", 1) // nl_double timestep resolution
{
@@ -86,20 +86,19 @@ NETLIB_OBJECT(solver)
logic_input_t m_fb_step;
logic_output_t m_Q_step;
- param_double_t m_sync_delay;
param_double_t m_freq;
- param_double_t m_sor;
- param_str_t m_iterative_solver;
+ param_double_t m_gs_sor;
+ param_str_t m_method;
param_double_t m_accuracy;
param_int_t m_gs_loops;
param_double_t m_gmin;
param_logic_t m_pivot;
param_int_t m_nr_loops;
+ param_double_t m_nr_recalc_delay;
param_int_t m_parallel;
- param_logic_t m_dynamic;
- param_double_t m_lte;
- param_double_t m_min_timestep;
-
+ param_logic_t m_dynamic_ts;
+ param_double_t m_dynamic_lte;
+ param_double_t m_dynamic_min_ts;
param_logic_t m_log_stats;
@@ -313,20 +313,20 @@ NETLIST_START(kidniki)
PARAM(Solver.ACCURACY, 1e-8)
PARAM(Solver.NR_LOOPS, 300)
PARAM(Solver.GS_LOOPS, 1)
- //PARAM(Solver.ITERATIVE, "SOR")
- PARAM(Solver.ITERATIVE, "MAT_CR")
- //PARAM(Solver.ITERATIVE, "GMRES")
+ //PARAM(Solver.METHOD, "SOR")
+ PARAM(Solver.METHOD, "MAT_CR")
+ //PARAM(Solver.METHOD, "GMRES")
PARAM(Solver.PARALLEL, 0)
PARAM(Solver.SOR_FACTOR, 1.00)
PARAM(Solver.DYNAMIC_TS, 0)
PARAM(Solver.DYNAMIC_LTE, 5e-4)
- PARAM(Solver.MIN_TIMESTEP, 20e-6)
+ PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 20e-6)
#else
SOLVER(Solver, 12000)
PARAM(Solver.ACCURACY, 1e-8)
PARAM(Solver.NR_LOOPS, 300)
PARAM(Solver.GS_LOOPS, 20)
- PARAM(Solver.ITERATIVE, "GMRES")
+ PARAM(Solver.METHOD, "GMRES")
PARAM(Solver.PARALLEL, 0)
#endif
@@ -96,8 +96,8 @@ CIRCUIT_LAYOUT( breakout )
PARAM(Solver.ACCURACY, 1e-6)
PARAM(Solver.DYNAMIC_TS, 0)
//PARAM(Solver.LTE, 1e-10)
- PARAM(Solver.MIN_TIMESTEP, 1e-8)
- PARAM(Solver.ITERATIVE, "MAT_CR")
+ PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 1e-8)
+ PARAM(Solver.METHOD, "MAT_CR")
#endif
PARAM(NETLIST.USE_DEACTIVATE, 1)

0 comments on commit e26e327

Please sign in to comment.