mirror of
https://github.com/holub/mame
synced 2025-05-03 21:13:18 +03:00
netlist: maintenance and bug fixes, remove DUMMY_INPUT. [Couriersud]
- Removed DUMMY_INPUT. NC (not connected) pins should now use NC_PIN. If a NC_PIN is actually connected, an error will be logged and validation will fail. - Enabled "extended" validation. This will catch now if power terminals are not connected. - Added const and noexcept where appropriate. - Removed dead code. - Fixed the 7414 Schmitt-Trigger device to use nld_power_pins
This commit is contained in:
parent
df14344669
commit
bcfa9eae6f
@ -1089,7 +1089,7 @@ plib::unique_ptr<netlist::netlist_state_t> netlist_mame_device::base_validity_ch
|
||||
//netlist_mame_t lnetlist(*this, "netlist", plib::make_unique<netlist_validate_callbacks_t>());
|
||||
auto lnetlist = plib::make_unique<netlist::netlist_state_t>("netlist", plib::make_unique<netlist_validate_callbacks_t>());
|
||||
// enable validation mode
|
||||
lnetlist->setup().set_extended_validation(false);
|
||||
lnetlist->setup().set_extended_validation(true);
|
||||
common_dev_start(lnetlist.get());
|
||||
|
||||
for (device_t &d : subdevices())
|
||||
|
@ -18,22 +18,22 @@ namespace analog
|
||||
, m_VT_inv(plib::reciprocal(m_VT))
|
||||
{}
|
||||
|
||||
diode(const nl_fptype Is, const nl_fptype n)
|
||||
diode(nl_fptype Is, nl_fptype n)
|
||||
{
|
||||
m_Is = Is;
|
||||
m_VT = nlconst::magic(0.0258) * n;
|
||||
m_VT_inv = plib::reciprocal(m_VT);
|
||||
}
|
||||
void set(const nl_fptype Is, const nl_fptype n)
|
||||
void set(nl_fptype Is, nl_fptype n) noexcept
|
||||
{
|
||||
m_Is = Is;
|
||||
m_VT = nlconst::magic(0.0258) * n;
|
||||
m_VT_inv = plib::reciprocal(m_VT);
|
||||
}
|
||||
nl_fptype I(const nl_fptype V) const { return m_Is * plib::exp(V * m_VT_inv) - m_Is; }
|
||||
nl_fptype g(const nl_fptype V) const { return m_Is * m_VT_inv * plib::exp(V * m_VT_inv); }
|
||||
nl_fptype V(const nl_fptype I) const { return plib::log1p(I / m_Is) * m_VT; } // log1p(x)=log(1.0 + x)
|
||||
nl_fptype gI(const nl_fptype I) const { return m_VT_inv * (I + m_Is); }
|
||||
nl_fptype I(nl_fptype V) const noexcept { return m_Is * plib::exp(V * m_VT_inv) - m_Is; }
|
||||
nl_fptype g(nl_fptype V) const noexcept { return m_Is * m_VT_inv * plib::exp(V * m_VT_inv); }
|
||||
nl_fptype V(nl_fptype I) const noexcept { return plib::log1p(I / m_Is) * m_VT; } // log1p(x)=log(1.0 + x)
|
||||
nl_fptype gI(nl_fptype I) const noexcept { return m_VT_inv * (I + m_Is); }
|
||||
|
||||
private:
|
||||
nl_fptype m_Is;
|
||||
@ -140,9 +140,9 @@ namespace analog
|
||||
//NETLIB_RESETI();
|
||||
NETLIB_UPDATEI();
|
||||
|
||||
q_type qtype() const { return m_qtype; }
|
||||
bool is_qtype(q_type atype) const { return m_qtype == atype; }
|
||||
void set_qtype(q_type atype) { m_qtype = atype; }
|
||||
q_type qtype() const noexcept { return m_qtype; }
|
||||
bool is_qtype(q_type atype) const noexcept { return m_qtype == atype; }
|
||||
void set_qtype(q_type atype) noexcept { m_qtype = atype; }
|
||||
protected:
|
||||
|
||||
bjt_model_t m_model;
|
||||
|
@ -43,7 +43,7 @@ namespace analog
|
||||
{
|
||||
}
|
||||
|
||||
static capacitor_e type() { return capacitor_e::VARIABLE_CAPACITY; }
|
||||
static capacitor_e type() noexcept { return capacitor_e::VARIABLE_CAPACITY; }
|
||||
|
||||
// Circuit Simulation, page 284, 5.360
|
||||
// q(un+1) - q(un) = int(un, un+1, C(U)) = (C0+C1)/2 * (un+1-un)
|
||||
@ -52,14 +52,14 @@ namespace analog
|
||||
// so that G depends on un+1 only and Ieq on un only.
|
||||
// In both cases, i = G * un+1 + Ieq
|
||||
|
||||
nl_fptype G(nl_fptype cap) const
|
||||
nl_fptype G(nl_fptype cap) const noexcept
|
||||
{
|
||||
//return m_h * cap + m_gmin;
|
||||
return m_h * nlconst::half() * (cap + m_c) + m_gmin;
|
||||
//return m_h * cap + m_gmin;
|
||||
}
|
||||
|
||||
nl_fptype Ieq(nl_fptype cap, nl_fptype v) const
|
||||
nl_fptype Ieq(nl_fptype cap, nl_fptype v) const noexcept
|
||||
{
|
||||
plib::unused_var(v);
|
||||
//return -m_h * 0.5 * ((cap + m_c) * m_v + (cap - m_c) * v) ;
|
||||
@ -67,14 +67,14 @@ namespace analog
|
||||
//return -m_h * cap * m_v;
|
||||
}
|
||||
|
||||
void timestep(nl_fptype cap, nl_fptype v, nl_fptype step)
|
||||
void timestep(nl_fptype cap, nl_fptype v, nl_fptype step) noexcept
|
||||
{
|
||||
m_h = plib::reciprocal(step);
|
||||
m_c = cap;
|
||||
m_v = v;
|
||||
}
|
||||
|
||||
void setparams(nl_fptype gmin) { m_gmin = gmin; }
|
||||
void setparams(nl_fptype gmin) noexcept { m_gmin = gmin; }
|
||||
|
||||
private:
|
||||
state_var<nl_fptype> m_h;
|
||||
@ -95,21 +95,21 @@ namespace analog
|
||||
{
|
||||
}
|
||||
|
||||
static capacitor_e type() { return capacitor_e::CONSTANT_CAPACITY; }
|
||||
nl_fptype G(nl_fptype cap) const { return cap * m_h + m_gmin; }
|
||||
nl_fptype Ieq(nl_fptype cap, nl_fptype v) const
|
||||
static capacitor_e type() noexcept { return capacitor_e::CONSTANT_CAPACITY; }
|
||||
nl_fptype G(nl_fptype cap) const noexcept { return cap * m_h + m_gmin; }
|
||||
nl_fptype Ieq(nl_fptype cap, nl_fptype v) const noexcept
|
||||
{
|
||||
plib::unused_var(v);
|
||||
return - G(cap) * m_v;
|
||||
}
|
||||
|
||||
void timestep(nl_fptype cap, nl_fptype v, nl_fptype step)
|
||||
void timestep(nl_fptype cap, nl_fptype v, nl_fptype step) noexcept
|
||||
{
|
||||
plib::unused_var(cap);
|
||||
m_h = plib::reciprocal(step);
|
||||
m_v = v;
|
||||
}
|
||||
void setparams(nl_fptype gmin) { m_gmin = gmin; }
|
||||
void setparams(nl_fptype gmin) noexcept { m_gmin = gmin; }
|
||||
private:
|
||||
state_var<nl_fptype> m_h;
|
||||
state_var<nl_fptype> m_v;
|
||||
@ -151,7 +151,7 @@ namespace analog
|
||||
, nlconst::magic(300.0));
|
||||
}
|
||||
|
||||
void update_diode(const nl_fptype nVd)
|
||||
void update_diode(nl_fptype nVd) noexcept
|
||||
{
|
||||
nl_fptype IseVDVt(nlconst::zero());
|
||||
|
||||
@ -198,7 +198,7 @@ namespace analog
|
||||
}
|
||||
}
|
||||
|
||||
void set_param(const nl_fptype Is, const nl_fptype n, nl_fptype gmin, nl_fptype temp)
|
||||
void set_param(nl_fptype Is, nl_fptype n, nl_fptype gmin, nl_fptype temp) noexcept
|
||||
{
|
||||
m_Is = Is;
|
||||
m_logIs = plib::log(Is);
|
||||
|
@ -165,9 +165,9 @@ namespace analog
|
||||
//NETLIB_RESETI();
|
||||
NETLIB_UPDATEI() { }
|
||||
|
||||
q_type qtype() const { return m_qtype; }
|
||||
bool is_qtype(q_type atype) const { return m_qtype == atype; }
|
||||
void set_qtype(q_type atype) { m_qtype = atype; }
|
||||
q_type qtype() const noexcept { return m_qtype; }
|
||||
bool is_qtype(q_type atype) const noexcept { return m_qtype == atype; }
|
||||
void set_qtype(q_type atype) noexcept { m_qtype = atype; }
|
||||
protected:
|
||||
|
||||
fet_model_t m_model;
|
||||
|
@ -24,7 +24,7 @@ namespace analog
|
||||
m_N.solve_now();
|
||||
}
|
||||
|
||||
void NETLIB_NAME(twoterm)::solve_later(netlist_time delay)
|
||||
void NETLIB_NAME(twoterm)::solve_later(netlist_time delay) noexcept
|
||||
{
|
||||
// we only need to call the non-rail terminal
|
||||
if (m_P.has_net() && !m_P.net().isRailNet())
|
||||
|
@ -88,7 +88,7 @@ namespace analog
|
||||
|
||||
void solve_now();
|
||||
|
||||
void solve_later(netlist_time delay = netlist_time::quantum());
|
||||
void solve_later(netlist_time delay = netlist_time::quantum()) noexcept;
|
||||
|
||||
void set_G_V_I(nl_fptype G, nl_fptype V, nl_fptype I) const noexcept
|
||||
{
|
||||
@ -134,7 +134,7 @@ namespace analog
|
||||
{
|
||||
}
|
||||
|
||||
void set_R(nl_fptype R)
|
||||
void set_R(nl_fptype R) const noexcept
|
||||
{
|
||||
const nl_fptype G = plib::reciprocal(R);
|
||||
set_mat( G, -G, nlconst::zero(),
|
||||
|
@ -40,7 +40,7 @@ namespace devices
|
||||
LIB_ENTRY(CCCS)
|
||||
LIB_ENTRY(LVCCS)
|
||||
LIB_ENTRY(opamp)
|
||||
LIB_ENTRY(dummy_input)
|
||||
LIB_ENTRY(nc_pin)
|
||||
LIB_ENTRY(frontier) // not intended to be used directly
|
||||
LIB_ENTRY(function) // only for macro devices - NO FEEDBACK loops
|
||||
LIB_ENTRY(QBJT_EB)
|
||||
|
@ -19,7 +19,7 @@ namespace netlist
|
||||
{
|
||||
NETLIB_CONSTRUCTOR(CD4066_GATE)
|
||||
NETLIB_FAMILY("CD4XXX")
|
||||
, m_supply(*this, "VDD", "VSS", true)
|
||||
, m_supply(*this, "VDD", "VSS")
|
||||
, m_R(*this, "R")
|
||||
, m_control(*this, "CTL")
|
||||
, m_base_r(*this, "BASER", nlconst::magic(270.0))
|
||||
@ -47,10 +47,10 @@ namespace netlist
|
||||
|
||||
NETLIB_UPDATE(CD4066_GATE)
|
||||
{
|
||||
nl_fptype sup = (m_supply.VCC() - m_supply.GND());
|
||||
nl_fptype sup = (m_supply.VCC().Q_Analog() - m_supply.GND().Q_Analog());
|
||||
nl_fptype low = nlconst::magic(0.45) * sup;
|
||||
nl_fptype high = nlconst::magic(0.55) * sup;
|
||||
nl_fptype in = m_control() - m_supply.GND();
|
||||
nl_fptype in = m_control() - m_supply.GND().Q_Analog();
|
||||
nl_fptype rON = m_base_r() * nlconst::magic(5.0) / sup;
|
||||
nl_fptype R = -nlconst::one();
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "nld_schmitt.h"
|
||||
|
||||
#include "netlist/analog/nlid_twoterm.h"
|
||||
#include "netlist/devices/nlid_system.h"
|
||||
#include "netlist/nl_base.h"
|
||||
#include "netlist/nl_errstr.h"
|
||||
#include "netlist/solver/nld_solver.h"
|
||||
@ -61,7 +62,7 @@ namespace netlist
|
||||
{
|
||||
NETLIB_CONSTRUCTOR(schmitt_trigger)
|
||||
, m_A(*this, "A")
|
||||
, m_GND(*this, "GND")
|
||||
, m_supply(*this)
|
||||
, m_RVI(*this, "RVI")
|
||||
, m_RVO(*this, "RVO")
|
||||
, m_model(*this, "MODEL", "TTL_7414_GATE")
|
||||
@ -71,8 +72,8 @@ namespace netlist
|
||||
register_subalias("Q", m_RVO.m_P);
|
||||
|
||||
connect(m_A, m_RVI.m_P);
|
||||
connect(m_GND, m_RVI.m_N);
|
||||
connect(m_GND, m_RVO.m_N);
|
||||
connect(m_supply.GND(), m_RVI.m_N);
|
||||
connect(m_supply.GND(), m_RVO.m_N);
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -88,9 +89,10 @@ namespace netlist
|
||||
|
||||
NETLIB_UPDATEI()
|
||||
{
|
||||
const auto va(m_A.Q_Analog() - m_supply.GND().Q_Analog());
|
||||
if (m_last_state)
|
||||
{
|
||||
if (m_A.Q_Analog() < m_model.m_VTM)
|
||||
if (va < m_model.m_VTM)
|
||||
{
|
||||
m_last_state = 0;
|
||||
if (m_is_timestep)
|
||||
@ -101,7 +103,7 @@ namespace netlist
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_A.Q_Analog() > m_model.m_VTP)
|
||||
if (va > m_model.m_VTP)
|
||||
{
|
||||
m_last_state = 1;
|
||||
if (m_is_timestep)
|
||||
@ -114,7 +116,7 @@ namespace netlist
|
||||
|
||||
private:
|
||||
analog_input_t m_A;
|
||||
analog_input_t m_GND;
|
||||
NETLIB_NAME(power_pins) m_supply;
|
||||
analog::NETLIB_SUB(twoterm) m_RVI;
|
||||
analog::NETLIB_SUB(twoterm) m_RVO;
|
||||
schmitt_trigger_model_t m_model;
|
||||
|
@ -61,7 +61,7 @@ namespace devices
|
||||
}
|
||||
|
||||
|
||||
NETLIB_DEVICE_IMPL(dummy_input, "DUMMY_INPUT", "")
|
||||
NETLIB_DEVICE_IMPL(nc_pin, "NC_PIN", "")
|
||||
NETLIB_DEVICE_IMPL(frontier, "FRONTIER_DEV", "+I,+G,+Q")
|
||||
NETLIB_DEVICE_IMPL(function, "AFUNC", "N,FUNC")
|
||||
NETLIB_DEVICE_IMPL(analog_input, "ANALOG_INPUT", "IN")
|
||||
|
@ -47,8 +47,8 @@
|
||||
#define GNDA() \
|
||||
NET_REGISTER_DEV(GNDA, GND)
|
||||
|
||||
#define DUMMY_INPUT(name) \
|
||||
NET_REGISTER_DEV(DUMMY_INPUT, name)
|
||||
#define NC_PIN(name) \
|
||||
NET_REGISTER_DEV(NC_PIN, name)
|
||||
|
||||
//FIXME: Usage discouraged, use OPTIMIZE_FRONTIER instead
|
||||
#define FRONTIER_DEV(name, cIN, cG, cOUT) \
|
||||
|
@ -18,12 +18,10 @@ namespace netlist
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
nld_base_proxy::nld_base_proxy(netlist_state_t &anetlist, const pstring &name,
|
||||
logic_t *inout_proxied, detail::core_terminal_t *proxy_inout)
|
||||
logic_t *inout_proxied)
|
||||
: device_t(anetlist, name)
|
||||
, m_tp(nullptr)
|
||||
, m_tn(nullptr)
|
||||
, m_term_proxied(inout_proxied)
|
||||
, m_proxy_term(proxy_inout)
|
||||
{
|
||||
m_logic_family = inout_proxied->logic_family();
|
||||
|
||||
@ -60,29 +58,10 @@ namespace netlist
|
||||
}
|
||||
}
|
||||
}
|
||||
//FIXME: Use power terminals and change info to warning or error
|
||||
if (!f)
|
||||
{
|
||||
#if 1
|
||||
if (logic_family()->fixed_V() == nlconst::zero())
|
||||
log().error(MI_NO_POWER_TERMINALS_ON_DEVICE_2(name, anetlist.setup().de_alias(inout_proxied->device().name())));
|
||||
else
|
||||
log().warning(MI_NO_POWER_TERMINALS_ON_DEVICE_2(name, anetlist.setup().de_alias(inout_proxied->device().name())));
|
||||
#endif
|
||||
m_GNDHack = plib::make_unique<analog_output_t>(*this, "_QGND");
|
||||
m_VCCHack = plib::make_unique<analog_output_t>(*this, "_QVCC");
|
||||
|
||||
m_tp = m_VCCHack.get();
|
||||
m_tn = m_GNDHack.get();
|
||||
m_need_hack = true;
|
||||
}
|
||||
log().error(MI_NO_POWER_TERMINALS_ON_DEVICE_2(name, anetlist.setup().de_alias(inout_proxied->device().name())));
|
||||
else
|
||||
{
|
||||
log().verbose("D/A Proxy: Found power terminals on device {1}", inout_proxied->device().name());
|
||||
m_need_hack = false;
|
||||
}
|
||||
//printf("vcc: %f\n", logic_family()->fixed_V());
|
||||
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
@ -90,53 +69,24 @@ namespace netlist
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
nld_base_a_to_d_proxy::nld_base_a_to_d_proxy(netlist_state_t &anetlist, const pstring &name,
|
||||
logic_input_t *in_proxied, detail::core_terminal_t *in_proxy)
|
||||
: nld_base_proxy(anetlist, name, in_proxied, in_proxy)
|
||||
, m_Q(*this, "Q")
|
||||
logic_input_t *in_proxied)
|
||||
: nld_base_proxy(anetlist, name, in_proxied)
|
||||
{
|
||||
}
|
||||
|
||||
nld_a_to_d_proxy::nld_a_to_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *in_proxied)
|
||||
: nld_base_a_to_d_proxy(anetlist, name, in_proxied, &m_I)
|
||||
: nld_base_a_to_d_proxy(anetlist, name, in_proxied)
|
||||
, m_Q(*this, "Q")
|
||||
, m_I(*this, "I")
|
||||
{
|
||||
}
|
||||
|
||||
NETLIB_RESET(a_to_d_proxy)
|
||||
{
|
||||
// FIXME: Variable voltage
|
||||
nl_fptype supply_V = logic_family()->fixed_V();
|
||||
// FIXME: comparison to zero
|
||||
if (supply_V == nlconst::zero())
|
||||
supply_V = nlconst::magic(5.0);
|
||||
|
||||
if (need_hack())
|
||||
{
|
||||
if (m_tn)
|
||||
m_GNDHack->initial(0);
|
||||
if (m_tp)
|
||||
m_VCCHack->initial(supply_V);
|
||||
}
|
||||
}
|
||||
|
||||
NETLIB_UPDATE(a_to_d_proxy)
|
||||
{
|
||||
#if 0
|
||||
nl_assert(m_logic_family != nullptr);
|
||||
// FIXME: Variable supply voltage!
|
||||
nl_fptype supply_V = logic_family()->fixed_V();
|
||||
// FIXME: bad hack
|
||||
if (supply_V == nlconst::zero()) supply_V = nlconst::magic(5.0);
|
||||
|
||||
if (m_I.Q_Analog() > logic_family()->high_thresh_V(nlconst::zero(), supply_V))
|
||||
out().push(1, netlist_time::quantum());
|
||||
else if (m_I.Q_Analog() < logic_family()->low_thresh_V(nlconst::zero(), supply_V))
|
||||
out().push(0, netlist_time::quantum());
|
||||
else
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
#else
|
||||
const auto v(m_I.Q_Analog());
|
||||
const auto vn(m_tn->net().Q_Analog());
|
||||
const auto vp(m_tp->net().Q_Analog());
|
||||
@ -149,7 +99,6 @@ namespace netlist
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
@ -157,14 +106,14 @@ namespace netlist
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
nld_base_d_to_a_proxy::nld_base_d_to_a_proxy(netlist_state_t &anetlist, const pstring &name,
|
||||
logic_output_t *out_proxied, detail::core_terminal_t &proxy_out)
|
||||
: nld_base_proxy(anetlist, name, out_proxied, &proxy_out)
|
||||
, m_I(*this, "I")
|
||||
logic_output_t *out_proxied)
|
||||
: nld_base_proxy(anetlist, name, out_proxied)
|
||||
{
|
||||
}
|
||||
|
||||
nld_d_to_a_proxy::nld_d_to_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *out_proxied)
|
||||
: nld_base_d_to_a_proxy(anetlist, name, out_proxied, m_RN.m_P)
|
||||
: nld_base_d_to_a_proxy(anetlist, name, out_proxied)
|
||||
, m_I(*this, "I")
|
||||
, m_RP(*this, "RP")
|
||||
, m_RN(*this, "RN")
|
||||
, m_last_state(*this, "m_last_var", -1)
|
||||
@ -172,62 +121,30 @@ namespace netlist
|
||||
{
|
||||
register_subalias("Q", m_RN.m_P);
|
||||
|
||||
if (need_hack())
|
||||
log().verbose("D/A Proxy: Found power terminals on device {1}", out_proxied->device().name());
|
||||
if (anetlist.setup().is_extended_validation())
|
||||
{
|
||||
if (anetlist.setup().is_extended_validation())
|
||||
{
|
||||
// During validation, don't connect to terminals found
|
||||
// This will cause terminals not connected to a rail net to
|
||||
// fail connection stage.
|
||||
connect(m_RN.m_N, m_RP.m_P);
|
||||
}
|
||||
else
|
||||
{
|
||||
connect(m_RN.m_N, *m_tn);
|
||||
connect(m_RP.m_P, *m_tp);
|
||||
}
|
||||
connect(m_RN.m_P, m_RP.m_N);
|
||||
// During validation, don't connect to terminals found
|
||||
// This will cause terminals not connected to a rail net to
|
||||
// fail connection stage.
|
||||
connect(m_RN.m_N, m_RP.m_P);
|
||||
}
|
||||
else
|
||||
{
|
||||
log().verbose("D/A Proxy: Found power terminals on device {1}", out_proxied->device().name());
|
||||
if (anetlist.setup().is_extended_validation())
|
||||
{
|
||||
// During validation, don't connect to terminals found
|
||||
// This will cause terminals not connected to a rail net to
|
||||
// fail connection stage.
|
||||
connect(m_RN.m_N, m_RP.m_P);
|
||||
}
|
||||
else
|
||||
{
|
||||
connect(m_RN.m_N, *m_tn);
|
||||
connect(m_RP.m_P, *m_tp);
|
||||
}
|
||||
connect(m_RN.m_P, m_RP.m_N);
|
||||
connect(m_RN.m_N, *m_tn);
|
||||
connect(m_RP.m_P, *m_tp);
|
||||
}
|
||||
connect(m_RN.m_P, m_RP.m_N);
|
||||
//printf("vcc: %f\n", logic_family()->fixed_V());
|
||||
}
|
||||
|
||||
|
||||
void nld_d_to_a_proxy::reset()
|
||||
{
|
||||
// FIXME: Variable voltage
|
||||
nl_fptype supply_V = logic_family()->fixed_V();
|
||||
// FIXME: comparison to zero
|
||||
if (supply_V == nlconst::zero())
|
||||
supply_V = nlconst::magic(5.0);
|
||||
|
||||
//m_Q.initial(0.0);
|
||||
m_last_state = -1;
|
||||
m_RN.reset();
|
||||
m_RP.reset();
|
||||
if (need_hack())
|
||||
{
|
||||
if (m_tn)
|
||||
m_GNDHack->initial(0);
|
||||
if (m_tp)
|
||||
m_VCCHack->initial(supply_V);
|
||||
}
|
||||
m_is_timestep = m_RN.m_P.net().solver()->has_timestep_devices();
|
||||
m_RN.set_G_V_I(plib::reciprocal(logic_family()->R_low()),
|
||||
logic_family()->low_offset_V(), nlconst::zero());
|
||||
|
@ -27,10 +27,10 @@ namespace devices
|
||||
{
|
||||
public:
|
||||
nld_base_proxy(netlist_state_t &anetlist, const pstring &name,
|
||||
logic_t *inout_proxied, detail::core_terminal_t *proxy_inout);
|
||||
logic_t *inout_proxied);
|
||||
|
||||
logic_t &term_proxied() const { return *m_term_proxied; }
|
||||
detail::core_terminal_t &proxy_term() const { return *m_proxy_term; }
|
||||
// only used during setup
|
||||
virtual detail::core_terminal_t &proxy_term() noexcept = 0;
|
||||
|
||||
protected:
|
||||
// FIXME: these should be core_terminal_t and only used for connecting
|
||||
@ -38,14 +38,6 @@ namespace devices
|
||||
analog_t *m_tp;
|
||||
analog_t *m_tn;
|
||||
|
||||
plib::unique_ptr<analog_output_t> m_GNDHack; // FIXME: Long term, we need to connect proxy gnd to device gnd
|
||||
plib::unique_ptr<analog_output_t> m_VCCHack; // FIXME: Long term, we need to connect proxy gnd to device gnd
|
||||
|
||||
bool need_hack() const noexcept { return m_need_hack; }
|
||||
private:
|
||||
logic_t *m_term_proxied;
|
||||
detail::core_terminal_t *m_proxy_term;
|
||||
bool m_need_hack;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@ -55,33 +47,34 @@ namespace devices
|
||||
NETLIB_OBJECT_DERIVED(base_a_to_d_proxy, base_proxy)
|
||||
{
|
||||
public:
|
||||
|
||||
virtual logic_output_t &out() { return m_Q; }
|
||||
virtual logic_output_t &out() noexcept = 0;
|
||||
|
||||
protected:
|
||||
|
||||
nld_base_a_to_d_proxy(netlist_state_t &anetlist, const pstring &name,
|
||||
logic_input_t *in_proxied, detail::core_terminal_t *in_proxy);
|
||||
|
||||
private:
|
||||
|
||||
logic_output_t m_Q;
|
||||
logic_input_t *in_proxied);
|
||||
|
||||
};
|
||||
|
||||
NETLIB_OBJECT_DERIVED(a_to_d_proxy, base_a_to_d_proxy)
|
||||
{
|
||||
public:
|
||||
nld_a_to_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *in_proxied);
|
||||
nld_a_to_d_proxy(netlist_state_t &anetlist, const pstring &name,
|
||||
logic_input_t *in_proxied);
|
||||
|
||||
analog_input_t m_I;
|
||||
virtual logic_output_t &out() noexcept override { return m_Q; }
|
||||
|
||||
virtual detail::core_terminal_t &proxy_term() noexcept override
|
||||
{
|
||||
return m_I;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
NETLIB_RESETI();
|
||||
NETLIB_UPDATEI();
|
||||
|
||||
private:
|
||||
logic_output_t m_Q;
|
||||
analog_input_t m_I;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@ -91,20 +84,27 @@ namespace devices
|
||||
NETLIB_OBJECT_DERIVED(base_d_to_a_proxy, base_proxy)
|
||||
{
|
||||
public:
|
||||
|
||||
virtual logic_input_t &in() { return m_I; }
|
||||
// only used in setup
|
||||
virtual logic_input_t &in() noexcept = 0;
|
||||
|
||||
protected:
|
||||
nld_base_d_to_a_proxy(netlist_state_t &anetlist, const pstring &name,
|
||||
logic_output_t *out_proxied, detail::core_terminal_t &proxy_out);
|
||||
logic_output_t *out_proxied);
|
||||
|
||||
logic_input_t m_I;
|
||||
};
|
||||
|
||||
NETLIB_OBJECT_DERIVED(d_to_a_proxy, base_d_to_a_proxy)
|
||||
{
|
||||
public:
|
||||
nld_d_to_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *out_proxied);
|
||||
nld_d_to_a_proxy(netlist_state_t &anetlist, const pstring &name,
|
||||
logic_output_t *out_proxied);
|
||||
|
||||
virtual logic_input_t &in() noexcept override { return m_I; }
|
||||
|
||||
virtual detail::core_terminal_t &proxy_term() noexcept override
|
||||
{
|
||||
return m_RN.m_P;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@ -115,6 +115,7 @@ namespace devices
|
||||
|
||||
static constexpr const nl_fptype G_OFF = nlconst::magic(1e-9);
|
||||
|
||||
logic_input_t m_I;
|
||||
analog::NETLIB_NAME(twoterm) m_RP;
|
||||
analog::NETLIB_NAME(twoterm) m_RN;
|
||||
state_var<int> m_last_state;
|
||||
|
@ -48,40 +48,30 @@ namespace devices
|
||||
///
|
||||
/// Power Pins are passive inputs. Delegate noop will silently ignore any
|
||||
/// updates.
|
||||
|
||||
class nld_power_pins
|
||||
{
|
||||
public:
|
||||
explicit nld_power_pins(device_t &owner, const pstring &sVCC = sPowerVCC,
|
||||
const pstring &sGND = sPowerGND, bool force_analog_input = true)
|
||||
const pstring &sGND = sPowerGND)
|
||||
: m_VCC(owner, sVCC, NETLIB_DELEGATE(power_pins, noop))
|
||||
, m_GND(owner, sGND, NETLIB_DELEGATE(power_pins, noop))
|
||||
{
|
||||
if (owner.state().setup().is_extended_validation() || force_analog_input)
|
||||
{
|
||||
m_GND = owner.state().make_object<analog_input_t>(owner, sGND, NETLIB_DELEGATE(power_pins, noop));
|
||||
m_VCC = owner.state().make_object<analog_input_t>(owner, sVCC, NETLIB_DELEGATE(power_pins, noop));
|
||||
}
|
||||
else
|
||||
{
|
||||
owner.create_and_register_subdevice(sPowerDevRes, m_RVG);
|
||||
owner.register_subalias(sVCC, pstring(sPowerDevRes) + ".1");
|
||||
owner.register_subalias(sGND, pstring(sPowerDevRes) + ".2");
|
||||
}
|
||||
}
|
||||
|
||||
nl_fptype VCC() const noexcept
|
||||
const analog_input_t &VCC() const noexcept
|
||||
{
|
||||
return (m_VCC ? m_VCC->Q_Analog() : m_RVG->V1P());
|
||||
return m_VCC;
|
||||
}
|
||||
nl_fptype GND() const noexcept
|
||||
const analog_input_t &GND() const noexcept
|
||||
{
|
||||
return (m_GND ? m_GND->Q_Analog() : m_RVG->V2N());
|
||||
return m_GND;
|
||||
}
|
||||
|
||||
private:
|
||||
void noop() { }
|
||||
unique_pool_ptr<analog_input_t> m_VCC; // only used during validation or force_analog_input
|
||||
unique_pool_ptr<analog_input_t> m_GND; // only used during validation or force_analog_input
|
||||
|
||||
NETLIB_SUB_UPTR(analog, R) m_RVG; // dummy resistor between VCC and GND
|
||||
analog_input_t m_VCC;
|
||||
analog_input_t m_GND;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@ -287,19 +277,18 @@ namespace devices
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// nld_dummy_input
|
||||
// nld_nc_pin
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
NETLIB_OBJECT(dummy_input)
|
||||
NETLIB_OBJECT(nc_pin)
|
||||
{
|
||||
public:
|
||||
NETLIB_CONSTRUCTOR(dummy_input)
|
||||
NETLIB_CONSTRUCTOR(nc_pin)
|
||||
, m_I(*this, "I")
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
NETLIB_RESETI() { }
|
||||
NETLIB_UPDATEI() { }
|
||||
|
||||
@ -381,7 +370,6 @@ namespace devices
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
NETLIB_RESETI()
|
||||
{
|
||||
//m_Q.initial(0.0);
|
||||
@ -395,8 +383,8 @@ namespace devices
|
||||
}
|
||||
m_Q.push(m_compiled.evaluate(m_vals));
|
||||
}
|
||||
private:
|
||||
|
||||
private:
|
||||
param_int_t m_N;
|
||||
param_str_t m_func;
|
||||
analog_output_t m_Q;
|
||||
@ -404,6 +392,7 @@ namespace devices
|
||||
|
||||
std::vector<nl_fptype> m_vals;
|
||||
plib::pfunction<nl_fptype> m_compiled;
|
||||
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@ -447,6 +436,7 @@ namespace devices
|
||||
|
||||
//NETLIB_UPDATE_PARAMI();
|
||||
|
||||
// used by 74123
|
||||
analog::NETLIB_SUB(R_base) m_R;
|
||||
logic_input_t m_I;
|
||||
param_fp_t m_RON;
|
||||
|
@ -266,7 +266,7 @@ namespace devices
|
||||
if (m_family_desc == nullptr)
|
||||
plib::pthrow<nl_exception>("family description not found for {1}", m_family_name);
|
||||
|
||||
return pool.make_unique<tt_type>(anetlist, name, m_family_desc, *m_ttbl, m_desc);
|
||||
return pool.make_unique<tt_type>(anetlist, name, *m_family_desc, *m_ttbl, m_desc);
|
||||
}
|
||||
private:
|
||||
unique_pool_ptr<typename nld_truthtable_t<m_NI, m_NO>::truthtable_t> m_ttbl;
|
||||
@ -480,7 +480,8 @@ namespace factory
|
||||
|
||||
truthtable_base_element_t::truthtable_base_element_t(const pstring &name, const pstring &classname,
|
||||
const pstring &def_param, const pstring &sourcefile)
|
||||
: factory::element_t(name, classname, def_param, sourcefile), m_family_desc(family_TTL())
|
||||
: factory::element_t(name, classname, def_param, sourcefile)
|
||||
, m_family_desc(family_TTL())
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ namespace devices
|
||||
|
||||
template <class C>
|
||||
nld_truthtable_t(C &owner, const pstring &name,
|
||||
const logic_family_desc_t *fam,
|
||||
const logic_family_desc_t &fam,
|
||||
truthtable_t &ttp, const std::vector<pstring> &desc)
|
||||
: device_t(owner, name)
|
||||
, m_fam(*this, fam)
|
||||
|
@ -245,6 +245,7 @@ static NETLIST_START(TTL_7414_GATE)
|
||||
ALIAS(A, X.A)
|
||||
ALIAS(Q, X.Q)
|
||||
ALIAS(GND, X.GND)
|
||||
ALIAS(VCC, X.VCC)
|
||||
NETLIST_END()
|
||||
|
||||
static NETLIST_START(TTL_74LS14_GATE)
|
||||
@ -252,6 +253,7 @@ static NETLIST_START(TTL_74LS14_GATE)
|
||||
ALIAS(A, X.A)
|
||||
ALIAS(Q, X.Q)
|
||||
ALIAS(GND, X.GND)
|
||||
ALIAS(VCC, X.VCC)
|
||||
NETLIST_END()
|
||||
|
||||
static NETLIST_START(TTL_7414_DIP)
|
||||
@ -263,7 +265,7 @@ static NETLIST_START(TTL_7414_DIP)
|
||||
SCHMITT_TRIGGER(F, "DM7414")
|
||||
|
||||
NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND)
|
||||
DUMMY_INPUT(VCC)
|
||||
NET_C(A.VCC, B.VCC, C.VCC, D.VCC, E.VCC, F.VCC)
|
||||
|
||||
DIPPINS( /* +--------------+ */
|
||||
A.A, /* A1 |1 ++ 14| VCC */ VCC.I,
|
||||
@ -286,7 +288,7 @@ static NETLIST_START(TTL_74LS14_DIP)
|
||||
SCHMITT_TRIGGER(F, "DM74LS14")
|
||||
|
||||
NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND)
|
||||
DUMMY_INPUT(VCC)
|
||||
NET_C(A.VCC, B.VCC, C.VCC, D.VCC, E.VCC, F.VCC)
|
||||
|
||||
DIPPINS( /* +--------------+ */
|
||||
A.A, /* A1 |1 ++ 14| VCC */ VCC.I,
|
||||
@ -353,7 +355,7 @@ static NETLIST_START(TTL_7420_DIP)
|
||||
|
||||
NET_C(A.VCC, B.VCC)
|
||||
NET_C(A.GND, B.GND)
|
||||
DUMMY_INPUT(NC)
|
||||
NC_PIN(NC)
|
||||
|
||||
DIPPINS( /* +--------------+ */
|
||||
A.A, /* A1 |1 ++ 14| VCC */ A.VCC,
|
||||
@ -395,13 +397,14 @@ static NETLIST_START(TTL_7425_DIP)
|
||||
|
||||
NET_C(A.VCC, B.VCC)
|
||||
NET_C(A.GND, B.GND)
|
||||
DUMMY_INPUT(X)
|
||||
NC_PIN(XA) // FIXME: Functionality needs to be implemented
|
||||
NC_PIN(XB) // FIXME: Functionality needs to be implemented
|
||||
|
||||
DIPPINS( /* +--------------+ */
|
||||
A.A, /* A1 |1 ++ 14| VCC */ A.VCC,
|
||||
A.B, /* B1 |2 13| D2 */ B.D,
|
||||
X.I, /* X1 |3 12| C2 */ B.C,
|
||||
A.C, /* C1 |4 7425 11| X2 */ X.I,
|
||||
XA.I, /* X1 |3 12| C2 */ B.C,
|
||||
A.C, /* C1 |4 7425 11| X2 */ XB.I,
|
||||
A.D, /* D1 |5 10| B2 */ B.B,
|
||||
A.Q, /* Y1 |6 9| A2 */ B.A,
|
||||
A.GND,/* GND |7 8| Y2 */ B.Q
|
||||
@ -471,15 +474,17 @@ NETLIST_END()
|
||||
static NETLIST_START(TTL_7430_DIP)
|
||||
TTL_7430_GATE(A)
|
||||
|
||||
DUMMY_INPUT(NC)
|
||||
NC_PIN(NC9)
|
||||
NC_PIN(NC10)
|
||||
NC_PIN(NC13)
|
||||
|
||||
DIPPINS( /* +--------------+ */
|
||||
A.A, /* A |1 ++ 14| VCC */ A.VCC,
|
||||
A.B, /* B |2 13| NC */ NC.I,
|
||||
A.B, /* B |2 13| NC */ NC13.I,
|
||||
A.C, /* C |3 12| H */ A.H,
|
||||
A.D, /* D |4 7430 11| G */ A.G,
|
||||
A.E, /* E |5 10| NC */ NC.I,
|
||||
A.F, /* F |6 9| NC */ NC.I,
|
||||
A.E, /* E |5 10| NC */ NC10.I,
|
||||
A.F, /* F |6 9| NC */ NC9.I,
|
||||
A.GND,/* GND |7 8| Y */ A.Q
|
||||
/* +--------------+ */
|
||||
)
|
||||
|
@ -585,7 +585,7 @@ namespace netlist
|
||||
state().setup().register_alias_nofqn(alias, aliased_fqn);
|
||||
}
|
||||
|
||||
void device_t::connect(detail::core_terminal_t &t1, detail::core_terminal_t &t2)
|
||||
void device_t::connect(const detail::core_terminal_t &t1, const detail::core_terminal_t &t2)
|
||||
{
|
||||
state().setup().register_link_fqn(t1.name(), t2.name());
|
||||
}
|
||||
@ -621,9 +621,9 @@ namespace netlist
|
||||
dev.set_logic_family(dev.state().setup().family_from_model(desc));
|
||||
}
|
||||
|
||||
detail::family_setter_t::family_setter_t(core_device_t &dev, const logic_family_desc_t *desc)
|
||||
detail::family_setter_t::family_setter_t(core_device_t &dev, const logic_family_desc_t &desc)
|
||||
{
|
||||
dev.set_logic_family(desc);
|
||||
dev.set_logic_family(&desc);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
@ -787,7 +787,7 @@ namespace netlist
|
||||
net().solver()->update_forced();
|
||||
}
|
||||
|
||||
void terminal_t::schedule_solve_after(netlist_time after)
|
||||
void terminal_t::schedule_solve_after(netlist_time after) noexcept
|
||||
{
|
||||
// Nets may belong to railnets which do not have a solver attached
|
||||
if (this->has_net())
|
||||
@ -896,14 +896,14 @@ namespace netlist
|
||||
}
|
||||
|
||||
|
||||
pstring param_t::get_initial(const device_t &dev, bool *found)
|
||||
pstring param_t::get_initial(const device_t &dev, bool *found) const
|
||||
{
|
||||
pstring res = dev.state().setup().get_initial_param_val(this->name(), "");
|
||||
*found = (res != "");
|
||||
return res;
|
||||
}
|
||||
|
||||
const pstring param_model_t::type()
|
||||
pstring param_model_t::type()
|
||||
{
|
||||
return state().setup().models().type(str());
|
||||
}
|
||||
|
@ -819,7 +819,7 @@ namespace netlist
|
||||
}
|
||||
|
||||
void solve_now();
|
||||
void schedule_solve_after(netlist_time after);
|
||||
void schedule_solve_after(netlist_time after) noexcept;
|
||||
|
||||
void set_ptrs(nl_fptype *gt, nl_fptype *go, nl_fptype *Idr) noexcept(false);
|
||||
|
||||
@ -903,7 +903,6 @@ namespace netlist
|
||||
nl_fptype Q_Analog() const noexcept;
|
||||
};
|
||||
|
||||
|
||||
class logic_net_t : public detail::net_t
|
||||
{
|
||||
public:
|
||||
@ -1081,7 +1080,7 @@ namespace netlist
|
||||
void register_subalias(const pstring &name, const pstring &aliased);
|
||||
|
||||
void connect(const pstring &t1, const pstring &t2);
|
||||
void connect(detail::core_terminal_t &t1, detail::core_terminal_t &t2);
|
||||
void connect(const detail::core_terminal_t &t1, const detail::core_terminal_t &t2);
|
||||
void connect_post_start(detail::core_terminal_t &t1, detail::core_terminal_t &t2);
|
||||
protected:
|
||||
|
||||
@ -1121,7 +1120,7 @@ namespace netlist
|
||||
device().update_param();
|
||||
}
|
||||
|
||||
pstring get_initial(const device_t &dev, bool *found);
|
||||
pstring get_initial(const device_t &dev, bool *found) const;
|
||||
|
||||
template<typename C>
|
||||
void set(C &p, const C v) noexcept
|
||||
@ -1194,8 +1193,8 @@ namespace netlist
|
||||
public:
|
||||
param_str_t(device_t &device, const pstring &name, const pstring &val);
|
||||
|
||||
pstring operator()() const noexcept { return str(); }
|
||||
void setTo(const pstring ¶m) noexcept
|
||||
const pstring &operator()() const noexcept { return str(); }
|
||||
void setTo(const pstring ¶m)
|
||||
{
|
||||
if (m_param != param)
|
||||
{
|
||||
@ -1206,9 +1205,8 @@ namespace netlist
|
||||
}
|
||||
protected:
|
||||
virtual void changed() noexcept;
|
||||
pstring str() const noexcept { return m_param; }
|
||||
const pstring &str() const noexcept { return m_param; }
|
||||
private:
|
||||
PALIGNAS_CACHELINE()
|
||||
pstring m_param;
|
||||
};
|
||||
|
||||
@ -1236,15 +1234,12 @@ namespace netlist
|
||||
|
||||
using value_t = value_base_t<nl_fptype>;
|
||||
|
||||
template <typename T>
|
||||
friend class value_base_t;
|
||||
|
||||
param_model_t(device_t &device, const pstring &name, const pstring &val)
|
||||
: param_str_t(device, name, val) { }
|
||||
|
||||
pstring value_str(const pstring &entity);
|
||||
nl_fptype value(const pstring &entity);
|
||||
const pstring type();
|
||||
pstring type();
|
||||
// hide this
|
||||
void setTo(const pstring ¶m) = delete;
|
||||
protected:
|
||||
@ -1302,7 +1297,7 @@ namespace netlist
|
||||
// NOLINTNEXTLINE(modernize-use-equals-default)
|
||||
family_setter_t();
|
||||
family_setter_t(core_device_t &dev, const pstring &desc);
|
||||
family_setter_t(core_device_t &dev, const logic_family_desc_t *desc);
|
||||
family_setter_t(core_device_t &dev, const logic_family_desc_t &desc);
|
||||
};
|
||||
|
||||
template <class T, bool TS>
|
||||
@ -1407,7 +1402,7 @@ namespace netlist
|
||||
/// \return vector with pointers to devices
|
||||
|
||||
template<class C>
|
||||
inline std::vector<C *> get_device_list()
|
||||
inline std::vector<C *> get_device_list() const
|
||||
{
|
||||
std::vector<C *> tmp;
|
||||
for (auto &d : m_devices)
|
||||
@ -1421,18 +1416,18 @@ namespace netlist
|
||||
|
||||
// logging and name
|
||||
|
||||
pstring name() const noexcept { return m_name; }
|
||||
const pstring &name() const noexcept { return m_name; }
|
||||
|
||||
log_type & log() noexcept { return m_log; }
|
||||
const log_type &log() const noexcept { return m_log; }
|
||||
|
||||
plib::dynlib &lib() const noexcept { return *m_lib; }
|
||||
|
||||
netlist_t &exec() { return *m_netlist; }
|
||||
const netlist_t &exec() const { return *m_netlist; }
|
||||
netlist_t &exec() noexcept { return *m_netlist; }
|
||||
const netlist_t &exec() const noexcept { return *m_netlist; }
|
||||
|
||||
// state handling
|
||||
plib::state_manager_t &run_state_manager() { return m_state; }
|
||||
plib::state_manager_t &run_state_manager() noexcept { return m_state; }
|
||||
|
||||
template<typename O, typename C>
|
||||
void save(O &owner, C &state, const pstring &module, const pstring &stname)
|
||||
@ -1458,7 +1453,7 @@ namespace netlist
|
||||
///
|
||||
/// \return core_device_t pointer if device exists, else nullptr
|
||||
|
||||
core_device_t *find_device(const pstring &name)
|
||||
core_device_t *find_device(const pstring &name) const
|
||||
{
|
||||
for (auto & d : m_devices)
|
||||
if (d.first == name)
|
||||
@ -1745,16 +1740,6 @@ namespace netlist
|
||||
pstring p = this->get_initial(device, &found);
|
||||
if (found)
|
||||
{
|
||||
#if 0
|
||||
bool err = false;
|
||||
auto vald = plib::pstonum_ne<T>(p, err);
|
||||
if (err)
|
||||
{
|
||||
device.state().log().fatal(MF_INVALID_NUMBER_CONVERSION_1_2(name, p));
|
||||
plib::pthrow<nl_exception>(MF_INVALID_NUMBER_CONVERSION_1_2(name, p));
|
||||
}
|
||||
m_param = vald;
|
||||
#else
|
||||
plib::pfunction<nl_fptype> func;
|
||||
func.compile_infix(p, {});
|
||||
auto valx = func.evaluate();
|
||||
@ -1762,7 +1747,6 @@ namespace netlist
|
||||
if (plib::abs(valx - plib::trunc(valx)) > nlconst::magic(1e-6))
|
||||
plib::pthrow<nl_exception>(MF_INVALID_NUMBER_CONVERSION_1_2(device.name() + "." + name, p));
|
||||
m_param = static_cast<T>(valx);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
m_param = val;
|
||||
|
@ -231,7 +231,7 @@ namespace netlist
|
||||
//============================================================
|
||||
|
||||
#if defined(MAME_DEBUG) || (NL_DEBUG == true)
|
||||
#define nl_assert(x) passert_always(x);
|
||||
#define nl_assert(x) passert_always(x)
|
||||
#else
|
||||
#define nl_assert(x) do { } while (0)
|
||||
#endif
|
||||
|
@ -22,7 +22,7 @@
|
||||
template<typename... Args> explicit name(Args&&... args) \
|
||||
: m_m(plib::pfmt(str)(std::forward<Args>(args)...)) \
|
||||
{ static_assert(narg == sizeof...(args), "Argument count mismatch"); } \
|
||||
operator pstring() const noexcept { return m_m; } \
|
||||
operator pstring() const { return m_m; } \
|
||||
pstring m_m; \
|
||||
};
|
||||
|
||||
@ -30,7 +30,6 @@ namespace netlist
|
||||
{
|
||||
|
||||
static constexpr const char sHINT_NO_DEACTIVATE[] = ".HINT_NO_DEACTIVATE";
|
||||
static constexpr const char sPowerDevRes[] = "_RVG";
|
||||
static constexpr const char sPowerGND[] = "GND";
|
||||
static constexpr const char sPowerVCC[] = "VCC";
|
||||
|
||||
@ -98,7 +97,7 @@ namespace netlist
|
||||
|
||||
PERRMSGV(MW_OVERWRITING_PARAM_1_OLD_2_NEW_3, 3, "Overwriting {1} old <{2}> new <{3}>")
|
||||
PERRMSGV(MW_CONNECTING_1_TO_ITSELF, 1, "Connecting {1} to itself. This may be right, though")
|
||||
PERRMSGV(MI_DUMMY_1_WITHOUT_CONNECTIONS, 1, "Found dummy terminal {1} without connections")
|
||||
PERRMSGV(ME_NC_PIN_1_WITH_CONNECTIONS, 1, "Found NC (not connected) terminal {1} with connections")
|
||||
PERRMSGV(MI_ANALOG_OUTPUT_1_WITHOUT_CONNECTIONS,1, "Found analog output {1} without connections")
|
||||
PERRMSGV(MI_LOGIC_OUTPUT_1_WITHOUT_CONNECTIONS, 1, "Found logic output {1} without connections")
|
||||
PERRMSGV(MW_LOGIC_INPUT_1_WITHOUT_CONNECTIONS, 1, "Found logic input {1} without connections")
|
||||
@ -108,7 +107,6 @@ namespace netlist
|
||||
PERRMSGV(MF_TERMINALS_WITHOUT_NET, 0, "Found terminals without a net")
|
||||
|
||||
PERRMSGV(MI_REMOVE_DEVICE_1_CONNECTED_ONLY_TO_RAILS_2_3, 3, "Found device {1} connected only to railterminals {2}/{3}. Will be removed")
|
||||
PERRMSGV(MI_POWER_TERMINALS_1_CONNECTED_ANALOG_2_3, 3, "Power terminals {1} connected to analog nets {2}/{3}.")
|
||||
|
||||
PERRMSGV(MW_DATA_1_NOT_FOUND, 1, "unable to find data {1} in sources collection")
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
#include "nl_setup.h"
|
||||
#include "plib/putil.h"
|
||||
|
||||
namespace netlist { namespace factory
|
||||
{
|
||||
namespace netlist {
|
||||
namespace factory {
|
||||
|
||||
class NETLIB_NAME(wrapper) : public device_t
|
||||
{
|
||||
|
@ -64,10 +64,10 @@ namespace factory {
|
||||
plib::unused_var(name);
|
||||
}
|
||||
|
||||
const pstring &name() const { return m_name; }
|
||||
const pstring &classname() const { return m_classname; }
|
||||
const pstring ¶m_desc() const { return m_def_param; }
|
||||
const pstring &sourcefile() const { return m_sourcefile; }
|
||||
const pstring &name() const noexcept { return m_name; }
|
||||
const pstring &classname() const noexcept { return m_classname; }
|
||||
const pstring ¶m_desc() const noexcept { return m_def_param; }
|
||||
const pstring &sourcefile() const noexcept { return m_sourcefile; }
|
||||
|
||||
private:
|
||||
pstring m_name; ///< device name
|
||||
@ -115,7 +115,7 @@ namespace factory {
|
||||
element_t * factory_by_name(const pstring &devname);
|
||||
|
||||
template <class C>
|
||||
bool is_class(element_t *f)
|
||||
bool is_class(element_t *f) noexcept
|
||||
{
|
||||
return dynamic_cast<device_element_t<C> *>(f) != nullptr;
|
||||
}
|
||||
|
@ -552,8 +552,8 @@ param_t *setup_t::find_param(const pstring ¶m_in, bool required) const
|
||||
{
|
||||
const pstring param_in_fqn = build_fqn(param_in);
|
||||
|
||||
const pstring &outname = resolve_alias(param_in_fqn);
|
||||
auto ret = m_params.find(outname);
|
||||
const pstring outname(resolve_alias(param_in_fqn));
|
||||
auto ret(m_params.find(outname));
|
||||
if (ret == m_params.end() && required)
|
||||
{
|
||||
log().fatal(MF_PARAMETER_1_2_NOT_FOUND(param_in_fqn, outname));
|
||||
@ -561,7 +561,7 @@ param_t *setup_t::find_param(const pstring ¶m_in, bool required) const
|
||||
}
|
||||
if (ret != m_params.end())
|
||||
log().debug("Found parameter {1}\n", outname);
|
||||
return (ret == m_params.end() ? nullptr : &ret->second.m_param);
|
||||
return (ret == m_params.end() ? nullptr : ret->second.param());
|
||||
}
|
||||
|
||||
devices::nld_base_proxy *setup_t::get_d_a_proxy(detail::core_terminal_t &out)
|
||||
@ -935,8 +935,16 @@ void setup_t::resolve_inputs()
|
||||
for (auto & i : m_terminals)
|
||||
{
|
||||
detail::core_terminal_t *term = i.second;
|
||||
if (!term->has_net() && dynamic_cast< devices::NETLIB_NAME(dummy_input) *>(&term->device()) != nullptr)
|
||||
log().info(MI_DUMMY_1_WITHOUT_CONNECTIONS(term->name()));
|
||||
bool is_nc(dynamic_cast< devices::NETLIB_NAME(nc_pin) *>(&term->device()) != nullptr);
|
||||
if (term->has_net() && is_nc)
|
||||
{
|
||||
log().error(ME_NC_PIN_1_WITH_CONNECTIONS(term->name()));
|
||||
err = true;
|
||||
}
|
||||
else if (is_nc)
|
||||
{
|
||||
/* ignore */
|
||||
}
|
||||
else if (!term->has_net())
|
||||
{
|
||||
log().error(ME_TERMINAL_1_WITHOUT_NET(setup().de_alias(term->name())));
|
||||
@ -1295,20 +1303,12 @@ void setup_t::prepare_to_run()
|
||||
{
|
||||
if (t->m_N.net().isRailNet() && t->m_P.net().isRailNet())
|
||||
{
|
||||
// We are not interested in power terminals - This is intended behaviour
|
||||
if (!plib::endsWith(t->name(), pstring(".") + sPowerDevRes))
|
||||
log().info(MI_REMOVE_DEVICE_1_CONNECTED_ONLY_TO_RAILS_2_3(
|
||||
t->name(), t->m_N.net().name(), t->m_P.net().name()));
|
||||
log().info(MI_REMOVE_DEVICE_1_CONNECTED_ONLY_TO_RAILS_2_3(
|
||||
t->name(), t->m_N.net().name(), t->m_P.net().name()));
|
||||
t->m_N.net().remove_terminal(t->m_N);
|
||||
t->m_P.net().remove_terminal(t->m_P);
|
||||
m_nlstate.remove_device(t);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (plib::endsWith(t->name(), pstring(".") + sPowerDevRes))
|
||||
log().info(MI_POWER_TERMINALS_1_CONNECTED_ANALOG_2_3(
|
||||
t->name(), t->m_N.net().name(), t->m_P.net().name()));
|
||||
}
|
||||
}
|
||||
|
||||
log().verbose("initialize solver ...\n");
|
||||
|
@ -165,6 +165,10 @@ namespace netlist
|
||||
, m_device(device)
|
||||
, m_param(param)
|
||||
{ }
|
||||
const pstring &name() const noexcept { return m_name; }
|
||||
const core_device_t &device() const noexcept { return m_device; }
|
||||
param_t *param() const noexcept { return &m_param; }
|
||||
private:
|
||||
pstring m_name;
|
||||
core_device_t &m_device;
|
||||
param_t &m_param;
|
||||
@ -317,11 +321,11 @@ namespace netlist
|
||||
|
||||
void add_define(const pstring &defstr);
|
||||
|
||||
factory::list_t &factory() { return m_factory; }
|
||||
const factory::list_t &factory() const { return m_factory; }
|
||||
factory::list_t &factory() noexcept { return m_factory; }
|
||||
const factory::list_t &factory() const noexcept { return m_factory; }
|
||||
|
||||
log_type &log() { return m_log; }
|
||||
const log_type &log() const { return m_log; }
|
||||
log_type &log() noexcept { return m_log; }
|
||||
const log_type &log() const noexcept { return m_log; }
|
||||
|
||||
// FIXME: sources may need access to the netlist parent type
|
||||
// since they may be created in a context in which they don't
|
||||
@ -330,11 +334,11 @@ namespace netlist
|
||||
// We thus need a better approach to creating netlists in a context
|
||||
// other than static procedures.
|
||||
|
||||
setup_t &setup() { return m_setup; }
|
||||
const setup_t &setup() const { return m_setup; }
|
||||
setup_t &setup() noexcept { return m_setup; }
|
||||
const setup_t &setup() const noexcept { return m_setup; }
|
||||
|
||||
models_t &models() { return m_models; }
|
||||
const models_t &models() const { return m_models; }
|
||||
models_t &models() noexcept { return m_models; }
|
||||
const models_t &models() const noexcept { return m_models; }
|
||||
|
||||
protected:
|
||||
models_t m_models;
|
||||
|
@ -24,14 +24,14 @@ namespace plib {
|
||||
template <typename FT, int SIZE>
|
||||
struct sizeabs
|
||||
{
|
||||
static constexpr std::size_t ABS() { return (SIZE < 0) ? static_cast<std::size_t>(0 - SIZE) : static_cast<std::size_t>(SIZE); }
|
||||
static constexpr std::size_t ABS() noexcept { return (SIZE < 0) ? static_cast<std::size_t>(0 - SIZE) : static_cast<std::size_t>(SIZE); }
|
||||
using container = typename std::array<FT, ABS()> ;
|
||||
};
|
||||
|
||||
template <typename FT>
|
||||
struct sizeabs<FT, 0>
|
||||
{
|
||||
static constexpr std::size_t ABS() { return 0; }
|
||||
static constexpr std::size_t ABS() noexcept { return 0; }
|
||||
//using container = typename std::vector<FT, arena_allocator<mempool, FT, 64>>;
|
||||
using container = typename std::vector<FT, aligned_allocator<FT, PALIGN_VECTOROPT>>;
|
||||
};
|
||||
@ -55,7 +55,7 @@ namespace plib {
|
||||
struct parray
|
||||
{
|
||||
public:
|
||||
static constexpr std::size_t SIZEABS() { return sizeabs<FT, SIZE>::ABS(); }
|
||||
static constexpr std::size_t SIZEABS() noexcept { return sizeabs<FT, SIZE>::ABS(); }
|
||||
|
||||
using base_type = typename sizeabs<FT, SIZE>::container;
|
||||
using size_type = typename base_type::size_type;
|
||||
|
@ -194,7 +194,7 @@ namespace plib {
|
||||
{
|
||||
guard_t() = delete;
|
||||
explicit guard_t(timer &m) noexcept : m_m(m) { m_m.m_time -= T::start(); }
|
||||
~guard_t() { m_m.m_time += T::stop(); ++m_m.m_count; }
|
||||
~guard_t() noexcept { m_m.m_time += T::stop(); ++m_m.m_count; }
|
||||
|
||||
COPYASSIGNMOVE(guard_t, default)
|
||||
|
||||
@ -208,7 +208,7 @@ namespace plib {
|
||||
|
||||
type operator()() const { return m_time; }
|
||||
|
||||
void reset() { m_time = 0; m_count = 0; }
|
||||
void reset() noexcept { m_time = 0; m_count = 0; }
|
||||
type average() const noexcept { return (m_count == 0) ? 0 : m_time / m_count; }
|
||||
type total() const noexcept { return m_time; }
|
||||
ctype count() const noexcept { return m_count; }
|
||||
@ -237,7 +237,7 @@ namespace plib {
|
||||
// unused local variable.
|
||||
|
||||
// NOLINTNEXTLINE(modernize-use-equals-default)
|
||||
~guard_t() { }
|
||||
~guard_t() noexcept { }
|
||||
};
|
||||
|
||||
constexpr type operator()() const noexcept { return 0; }
|
||||
|
@ -132,12 +132,7 @@ dynlib::~dynlib()
|
||||
}
|
||||
}
|
||||
|
||||
bool dynlib::isLoaded() const
|
||||
{
|
||||
return m_isLoaded;
|
||||
}
|
||||
|
||||
void *dynlib::getsym_p(const pstring &name)
|
||||
void *dynlib::getsym_p(const pstring &name) const noexcept
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return (void *) GetProcAddress((HMODULE) m_lib, name.c_str());
|
||||
|
@ -25,15 +25,15 @@ public:
|
||||
~dynlib();
|
||||
COPYASSIGNMOVE(dynlib, delete)
|
||||
|
||||
bool isLoaded() const;
|
||||
bool isLoaded() const { return m_isLoaded; }
|
||||
|
||||
template <typename T>
|
||||
T getsym(const pstring &name)
|
||||
T getsym(const pstring &name) const noexcept
|
||||
{
|
||||
return reinterpret_cast<T>(getsym_p(name));
|
||||
}
|
||||
private:
|
||||
void *getsym_p(const pstring &name);
|
||||
void *getsym_p(const pstring &name) const noexcept;
|
||||
|
||||
bool m_isLoaded;
|
||||
void *m_lib;
|
||||
@ -47,12 +47,12 @@ public:
|
||||
|
||||
dynproc() : m_sym(nullptr) { }
|
||||
|
||||
dynproc(dynlib &dl, const pstring &name)
|
||||
dynproc(dynlib &dl, const pstring &name) noexcept
|
||||
{
|
||||
m_sym = dl.getsym<calltype>(name);
|
||||
}
|
||||
|
||||
void load(dynlib &dl, const pstring &name)
|
||||
void load(dynlib &dl, const pstring &name) noexcept
|
||||
{
|
||||
m_sym = dl.getsym<calltype>(name);
|
||||
}
|
||||
@ -63,7 +63,7 @@ public:
|
||||
//return m_sym(args...);
|
||||
}
|
||||
|
||||
bool resolved() const { return m_sym != nullptr; }
|
||||
bool resolved() const noexcept { return m_sym != nullptr; }
|
||||
private:
|
||||
calltype m_sym;
|
||||
};
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <stack>
|
||||
|
||||
template<typename F>
|
||||
int pstring_t<F>::compare(const pstring_t &right) const
|
||||
int pstring_t<F>::compare(const pstring_t &right) const noexcept
|
||||
{
|
||||
if (mem_t_size() == 0 && right.mem_t_size() == 0)
|
||||
return 0;
|
||||
@ -54,7 +54,7 @@ pstring_t<F> pstring_t<F>::substr(size_type start, size_type nlen) const
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
typename pstring_t<F>::size_type pstring_t<F>::find(const pstring_t &search, size_type start) const
|
||||
typename pstring_t<F>::size_type pstring_t<F>::find(const pstring_t &search, size_type start) const noexcept
|
||||
{
|
||||
auto istart = std::next(begin(), static_cast<difference_type>(start));
|
||||
for (; istart != end(); ++istart)
|
||||
@ -74,7 +74,7 @@ typename pstring_t<F>::size_type pstring_t<F>::find(const pstring_t &search, siz
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
typename pstring_t<F>::size_type pstring_t<F>::find(code_t search, size_type start) const
|
||||
typename pstring_t<F>::size_type pstring_t<F>::find(code_t search, size_type start) const noexcept
|
||||
{
|
||||
pstring_t ss;
|
||||
traits_type::encode(search, ss.m_str);
|
||||
|
@ -161,26 +161,26 @@ public:
|
||||
using iterator = pstring_const_iterator<pstring_t<F> >;
|
||||
using const_iterator = pstring_const_iterator<pstring_t<F> >;
|
||||
|
||||
iterator begin() { return iterator(m_str.begin()); }
|
||||
iterator end() { return iterator(m_str.end()); }
|
||||
const_iterator begin() const { return const_iterator(m_str.begin()); }
|
||||
const_iterator end() const { return const_iterator(m_str.end()); }
|
||||
const_iterator cbegin() const { return const_iterator(m_str.begin()); }
|
||||
const_iterator cend() const { return const_iterator(m_str.end()); }
|
||||
iterator begin() noexcept { return iterator(m_str.begin()); }
|
||||
iterator end() noexcept { return iterator(m_str.end()); }
|
||||
const_iterator begin() const noexcept { return const_iterator(m_str.begin()); }
|
||||
const_iterator end() const noexcept { return const_iterator(m_str.end()); }
|
||||
const_iterator cbegin() const noexcept { return const_iterator(m_str.begin()); }
|
||||
const_iterator cend() const noexcept { return const_iterator(m_str.end()); }
|
||||
|
||||
// C string conversion helpers
|
||||
const mem_t *c_str() const { return static_cast<const mem_t *>(m_str.c_str()); }
|
||||
const mem_t *data() const { return c_str(); }
|
||||
const mem_t *c_str() const noexcept { return static_cast<const mem_t *>(m_str.c_str()); }
|
||||
const mem_t *data() const noexcept { return c_str(); }
|
||||
|
||||
size_type length() const { return traits_type::len(m_str); }
|
||||
size_type size() const { return traits_type::len(m_str); }
|
||||
bool empty() const { return m_str.size() == 0; }
|
||||
size_type length() const noexcept { return traits_type::len(m_str); }
|
||||
size_type size() const noexcept { return traits_type::len(m_str); }
|
||||
bool empty() const noexcept { return m_str.size() == 0; }
|
||||
|
||||
pstring_t substr(size_type start, size_type nlen = npos) const;
|
||||
int compare(const pstring_t &right) const;
|
||||
int compare(const pstring_t &right) const noexcept;
|
||||
|
||||
size_type find(const pstring_t &search, size_type start = 0) const;
|
||||
size_type find(code_t search, size_type start = 0) const;
|
||||
size_type find(const pstring_t &search, size_type start = 0) const noexcept;
|
||||
size_type find(code_t search, size_type start = 0) const noexcept;
|
||||
|
||||
// concatenation operators
|
||||
pstring_t& operator+=(const pstring_t &string) { m_str.append(string.m_str); return *this; }
|
||||
@ -190,13 +190,13 @@ public:
|
||||
friend pstring_t operator+(const code_t lhs, const pstring_t &rhs) { return pstring_t(1, lhs) += rhs; }
|
||||
|
||||
// comparison operators
|
||||
bool operator==(const pstring_t &string) const { return (compare(string) == 0); }
|
||||
bool operator!=(const pstring_t &string) const { return (compare(string) != 0); }
|
||||
bool operator==(const pstring_t &string) const noexcept { return (compare(string) == 0); }
|
||||
bool operator!=(const pstring_t &string) const noexcept { return (compare(string) != 0); }
|
||||
|
||||
bool operator<(const pstring_t &string) const { return (compare(string) < 0); }
|
||||
bool operator<=(const pstring_t &string) const { return (compare(string) <= 0); }
|
||||
bool operator>(const pstring_t &string) const { return (compare(string) > 0); }
|
||||
bool operator>=(const pstring_t &string) const { return (compare(string) >= 0); }
|
||||
bool operator<(const pstring_t &string) const noexcept { return (compare(string) < 0); }
|
||||
bool operator<=(const pstring_t &string) const noexcept { return (compare(string) <= 0); }
|
||||
bool operator>(const pstring_t &string) const noexcept { return (compare(string) > 0); }
|
||||
bool operator>=(const pstring_t &string) const noexcept { return (compare(string) >= 0); }
|
||||
|
||||
friend auto operator<<(std::basic_ostream<typename string_type::value_type> &ostrm, const pstring_t &str) -> std::basic_ostream<typename string_type::value_type> &
|
||||
{
|
||||
@ -211,7 +211,7 @@ public:
|
||||
// the following are extensions to <string>
|
||||
|
||||
// FIXME: remove those
|
||||
size_type mem_t_size() const { return m_str.size(); }
|
||||
size_type mem_t_size() const noexcept { return m_str.size(); }
|
||||
|
||||
private:
|
||||
string_type m_str;
|
||||
@ -222,12 +222,12 @@ struct pu8_traits
|
||||
using mem_t = char;
|
||||
using code_t = char;
|
||||
using string_type = std::string;
|
||||
static std::size_t len(const string_type &p) { return p.size(); }
|
||||
static std::size_t codelen(const mem_t *p) { plib::unused_var(p); return 1; }
|
||||
static std::size_t codelen(const code_t c) { plib::unused_var(c); return 1; }
|
||||
static code_t code(const mem_t *p) { return *p; }
|
||||
static std::size_t len(const string_type &p) noexcept { return p.size(); }
|
||||
static std::size_t codelen(const mem_t *p) noexcept { plib::unused_var(p); return 1; }
|
||||
static std::size_t codelen(const code_t c) noexcept { plib::unused_var(c); return 1; }
|
||||
static code_t code(const mem_t *p) noexcept { return *p; }
|
||||
static void encode(const code_t c, string_type &s) { s += static_cast<mem_t>(c); }
|
||||
static const mem_t *nthcode(const mem_t *p, const std::size_t n) { return &(p[n]); }
|
||||
static const mem_t *nthcode(const mem_t *p, const std::size_t n) noexcept { return &(p[n]); }
|
||||
};
|
||||
|
||||
// No checking, this may deliver invalid codes
|
||||
@ -236,7 +236,7 @@ struct putf8_traits
|
||||
using mem_t = char;
|
||||
using code_t = char32_t;
|
||||
using string_type = std::string;
|
||||
static std::size_t len(const string_type &p)
|
||||
static std::size_t len(const string_type &p) noexcept
|
||||
{
|
||||
std::size_t ret = 0;
|
||||
for (const auto &c : p)
|
||||
@ -246,7 +246,7 @@ struct putf8_traits
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
static std::size_t codelen(const mem_t *p)
|
||||
static std::size_t codelen(const mem_t *p) noexcept
|
||||
{
|
||||
const auto p1 = reinterpret_cast<const unsigned char *>(p);
|
||||
if ((*p1 & 0xE0) == 0xC0)
|
||||
@ -262,7 +262,7 @@ struct putf8_traits
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
static std::size_t codelen(const code_t c)
|
||||
static std::size_t codelen(const code_t c) noexcept
|
||||
{
|
||||
if (c < 0x0080)
|
||||
return 1;
|
||||
@ -273,7 +273,7 @@ struct putf8_traits
|
||||
else // U+10000 U+1FFFFF
|
||||
return 4; // no checks
|
||||
}
|
||||
static code_t code(const mem_t *p)
|
||||
static code_t code(const mem_t *p) noexcept
|
||||
{
|
||||
const auto p1 = reinterpret_cast<const unsigned char *>(p);
|
||||
if ((*p1 & 0x80) == 0x00)
|
||||
@ -312,7 +312,7 @@ struct putf8_traits
|
||||
s += static_cast<mem_t>(0x80 | (c & 0x3f));
|
||||
}
|
||||
}
|
||||
static const mem_t *nthcode(const mem_t *p, const std::size_t n)
|
||||
static const mem_t *nthcode(const mem_t *p, const std::size_t n) noexcept
|
||||
{
|
||||
const mem_t *p1 = p;
|
||||
std::size_t i = n;
|
||||
@ -327,7 +327,7 @@ struct putf16_traits
|
||||
using mem_t = char16_t;
|
||||
using code_t = char32_t;
|
||||
using string_type = std::u16string;
|
||||
static std::size_t len(const string_type &p)
|
||||
static std::size_t len(const string_type &p) noexcept
|
||||
{
|
||||
std::size_t ret = 0;
|
||||
auto i = p.begin();
|
||||
@ -340,19 +340,19 @@ struct putf16_traits
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
static std::size_t codelen(const mem_t *p)
|
||||
static std::size_t codelen(const mem_t *p) noexcept
|
||||
{
|
||||
auto c = static_cast<uint16_t>(*p);
|
||||
return ((c & 0xd800) == 0xd800) ? 2 : 1;
|
||||
}
|
||||
static std::size_t codelen(const code_t c)
|
||||
static std::size_t codelen(const code_t c) noexcept
|
||||
{
|
||||
if (c < 0x10000)
|
||||
return 1;
|
||||
else // U+10000 U+1FFFFF
|
||||
return 2;
|
||||
}
|
||||
static code_t code(const mem_t *p)
|
||||
static code_t code(const mem_t *p) noexcept
|
||||
{
|
||||
auto c = static_cast<uint32_t>(*p++);
|
||||
if ((c & 0xd800) == 0xd800)
|
||||
@ -362,7 +362,7 @@ struct putf16_traits
|
||||
}
|
||||
return static_cast<code_t>(c);
|
||||
}
|
||||
static void encode(code_t c, string_type &s)
|
||||
static void encode(code_t c, string_type &s) noexcept
|
||||
{
|
||||
auto cu = static_cast<uint32_t>(c);
|
||||
if (c > 0xffff)
|
||||
@ -377,7 +377,7 @@ struct putf16_traits
|
||||
s += static_cast<mem_t>(cu);
|
||||
}
|
||||
}
|
||||
static const mem_t *nthcode(const mem_t *p, const std::size_t n)
|
||||
static const mem_t *nthcode(const mem_t *p, const std::size_t n) noexcept
|
||||
{
|
||||
std::size_t i = n;
|
||||
while (i-- > 0)
|
||||
@ -391,7 +391,7 @@ struct pwchar_traits
|
||||
using mem_t = wchar_t;
|
||||
using code_t = char32_t;
|
||||
using string_type = std::wstring;
|
||||
static std::size_t len(const string_type &p)
|
||||
static std::size_t len(const string_type &p) noexcept
|
||||
{
|
||||
if (sizeof(wchar_t) == 2)
|
||||
{
|
||||
@ -410,7 +410,7 @@ struct pwchar_traits
|
||||
return p.size();
|
||||
}
|
||||
|
||||
static std::size_t codelen(const mem_t *p)
|
||||
static std::size_t codelen(const mem_t *p) noexcept
|
||||
{
|
||||
if (sizeof(wchar_t) == 2)
|
||||
{
|
||||
@ -421,7 +421,7 @@ struct pwchar_traits
|
||||
return 1;
|
||||
}
|
||||
|
||||
static std::size_t codelen(const code_t c)
|
||||
static std::size_t codelen(const code_t c) noexcept
|
||||
{
|
||||
if (sizeof(wchar_t) == 2)
|
||||
return ((c & 0xd800) == 0xd800) ? 2 : 1;
|
||||
@ -463,7 +463,7 @@ struct pwchar_traits
|
||||
else
|
||||
s += static_cast<wchar_t>(c);
|
||||
}
|
||||
static const mem_t *nthcode(const mem_t *p, const std::size_t n)
|
||||
static const mem_t *nthcode(const mem_t *p, const std::size_t n) noexcept
|
||||
{
|
||||
if (sizeof(wchar_t) == 2)
|
||||
{
|
||||
|
@ -57,12 +57,12 @@ namespace plib
|
||||
struct nocopyassignmove
|
||||
{
|
||||
nocopyassignmove(const nocopyassignmove &) = delete;
|
||||
nocopyassignmove(nocopyassignmove &&) = delete;
|
||||
nocopyassignmove(nocopyassignmove &&) noexcept = delete;
|
||||
nocopyassignmove &operator=(const nocopyassignmove &) = delete;
|
||||
nocopyassignmove &operator=(nocopyassignmove &&) = delete;
|
||||
nocopyassignmove &operator=(nocopyassignmove &&) noexcept = delete;
|
||||
protected:
|
||||
nocopyassignmove() = default;
|
||||
~nocopyassignmove() = default;
|
||||
~nocopyassignmove() noexcept = default;
|
||||
};
|
||||
|
||||
struct nocopyassign
|
||||
@ -71,9 +71,9 @@ namespace plib
|
||||
nocopyassign &operator=(const nocopyassign &) = delete;
|
||||
protected:
|
||||
nocopyassign() = default;
|
||||
~nocopyassign() = default;
|
||||
nocopyassign(nocopyassign &&) = default;
|
||||
nocopyassign &operator=(nocopyassign &&) = default;
|
||||
~nocopyassign() noexcept = default;
|
||||
nocopyassign(nocopyassign &&) noexcept = default;
|
||||
nocopyassign &operator=(nocopyassign &&) noexcept = default;
|
||||
};
|
||||
|
||||
//============================================================
|
||||
|
@ -186,7 +186,7 @@ namespace solver
|
||||
bool has_timestep_devices() const noexcept { return m_step_devices.size() > 0; }
|
||||
|
||||
void update_forced();
|
||||
void update_after(const netlist_time after)
|
||||
void update_after(netlist_time after) noexcept
|
||||
{
|
||||
m_Q_sync.net().toggle_and_push_to_queue(after);
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ NETLIST_START(zac1b11142_schematics)
|
||||
NET_C(R112.2, U5D.1, C50.1, R113.1, U5B1.MINUS)
|
||||
NET_C(R95.2, U5B1.PLUS)
|
||||
NET_C(U5D.2, C50.2, R113.2, U5B1.OUT, R96.1)
|
||||
NET_C(VCC, R64.1, R65.1, R94.1, R110.1, U5B1.VCC)
|
||||
NET_C(VCC, R64.1, R65.1, R94.1, R110.1, U5B1.VCC, U4A1.VCC)
|
||||
NET_C(GND, R66.2, C28.2, R40.2, T6.E, C37.2, R108.2, R111.2, U5B1.GND, U4A1.GND)
|
||||
ALIAS(TROMBA, R96.2)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user