mirror of
https://github.com/holub/mame
synced 2025-04-20 15:32:45 +03:00
netlist: rename some camel case names. (nw)
This commit is contained in:
parent
bd32fdecd9
commit
104090ae0e
@ -547,7 +547,7 @@ protected:
|
||||
if (m_channels[i].m_buffer == nullptr)
|
||||
break; // stop, called outside of stream_update
|
||||
const nl_fptype v = m_channels[i].m_buffer[m_pos];
|
||||
m_channels[i].m_param->setTo(v * (*m_channels[i].m_param_mult)() + (*m_channels[i].m_param_offset)());
|
||||
m_channels[i].m_param->set(v * (*m_channels[i].m_param_mult)() + (*m_channels[i].m_param_offset)());
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -652,7 +652,7 @@ void netlist_mame_analog_input_device::write(const double val)
|
||||
void netlist_mame_analog_input_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
update_to_current_time();
|
||||
m_param->setTo(*((double *) ptr));
|
||||
m_param->set(*((double *) ptr));
|
||||
}
|
||||
|
||||
void netlist_mame_int_input_device::write(const uint32_t val)
|
||||
@ -672,13 +672,13 @@ void netlist_mame_logic_input_device::write(const uint32_t val)
|
||||
void netlist_mame_int_input_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
update_to_current_time();
|
||||
m_param->setTo(param);
|
||||
m_param->set(param);
|
||||
}
|
||||
|
||||
void netlist_mame_logic_input_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
update_to_current_time();
|
||||
m_param->setTo(param);
|
||||
m_param->set(param);
|
||||
}
|
||||
|
||||
void netlist_mame_ram_pointer_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
|
@ -300,11 +300,11 @@ namespace analog
|
||||
NETLIB_UPDATE(QBJT_switch)
|
||||
{
|
||||
// FIXME: this should never be called
|
||||
if (!m_RB.m_P.net().isRailNet())
|
||||
if (!m_RB.m_P.net().is_rail_net())
|
||||
m_RB.m_P.solve_now(); // Basis
|
||||
else if (!m_RB.m_N.net().isRailNet())
|
||||
else if (!m_RB.m_N.net().is_rail_net())
|
||||
m_RB.m_N.solve_now(); // Emitter
|
||||
else if (!m_RC.m_P.net().isRailNet())
|
||||
else if (!m_RC.m_P.net().is_rail_net())
|
||||
m_RC.m_P.solve_now(); // Collector
|
||||
}
|
||||
|
||||
@ -366,9 +366,9 @@ namespace analog
|
||||
NETLIB_UPDATE(QBJT_EB)
|
||||
{
|
||||
// FIXME: this should never be called
|
||||
if (!m_D_EB.m_P.net().isRailNet())
|
||||
if (!m_D_EB.m_P.net().is_rail_net())
|
||||
m_D_EB.m_P.solve_now(); // Basis
|
||||
else if (!m_D_EB.m_N.net().isRailNet())
|
||||
else if (!m_D_EB.m_N.net().is_rail_net())
|
||||
m_D_EB.m_N.solve_now(); // Emitter
|
||||
else
|
||||
m_D_CB.m_N.solve_now(); // Collector
|
||||
@ -380,12 +380,12 @@ namespace analog
|
||||
if (m_CJE)
|
||||
{
|
||||
m_CJE->reset();
|
||||
m_CJE->m_C.setTo(m_model.m_CJE);
|
||||
m_CJE->m_C.set(m_model.m_CJE);
|
||||
}
|
||||
if (m_CJC)
|
||||
{
|
||||
m_CJC->reset();
|
||||
m_CJC->m_C.setTo(m_model.m_CJC);
|
||||
m_CJC->m_C.set(m_model.m_CJC);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -431,9 +431,9 @@ namespace analog
|
||||
NETLIB_UPDATE(MOSFET)
|
||||
{
|
||||
// FIXME: This should never be called
|
||||
if (!m_SG.m_P.net().isRailNet())
|
||||
if (!m_SG.m_P.net().is_rail_net())
|
||||
m_SG.m_P.solve_now(); // Basis
|
||||
else if (!m_SG.m_N.net().isRailNet())
|
||||
else if (!m_SG.m_N.net().is_rail_net())
|
||||
m_SG.m_N.solve_now(); // Emitter
|
||||
else
|
||||
m_DG.m_N.solve_now(); // Collector
|
||||
|
@ -226,14 +226,14 @@ namespace netlist
|
||||
|
||||
NETLIB_UPDATE_PARAM(opamp)
|
||||
{
|
||||
m_G1.m_RI.setTo(m_model.m_RI);
|
||||
m_G1.m_RI.set(m_model.m_RI);
|
||||
|
||||
if (m_type == 1)
|
||||
{
|
||||
nl_fptype RO = m_model.m_RO;
|
||||
nl_fptype G = m_model.m_UGF / m_model.m_FPF / RO;
|
||||
m_RP.set_R(RO);
|
||||
m_G1.m_G.setTo(G);
|
||||
m_G1.m_G.set(G);
|
||||
}
|
||||
if (m_type == 3 || m_type == 2)
|
||||
{
|
||||
@ -245,29 +245,29 @@ namespace netlist
|
||||
if (m_model.m_SLEW / (nlconst::four() * nlconst::pi() * nlconst::magic(0.0258)) < m_model.m_UGF)
|
||||
log().warning(MW_OPAMP_FAIL_CONVERGENCE(this->name()));
|
||||
|
||||
m_CP->m_C.setTo(CP);
|
||||
m_CP->m_C.set(CP);
|
||||
m_RP.set_R(RP);
|
||||
m_G1.m_G.setTo(G);
|
||||
m_G1.m_G.set(G);
|
||||
|
||||
}
|
||||
if (m_type == 2)
|
||||
{
|
||||
m_EBUF->m_G.setTo(nlconst::one());
|
||||
m_EBUF->m_G.set(nlconst::one());
|
||||
#if TEST_ALT_OUTPUT
|
||||
m_EBUF->m_RO.setTo(0.001);
|
||||
m_EBUF->m_RO.set(0.001);
|
||||
m_RO->set_R(m_model.m_RO);
|
||||
#else
|
||||
m_EBUF->m_RO.setTo(m_model.m_RO);
|
||||
m_EBUF->m_RO.set(m_model.m_RO);
|
||||
#endif
|
||||
}
|
||||
if (m_type == 3)
|
||||
{
|
||||
m_EBUF->m_G.setTo(nlconst::one());
|
||||
m_EBUF->m_G.set(nlconst::one());
|
||||
#if TEST_ALT_OUTPUT
|
||||
m_EBUF->m_RO.setTo(0.001);
|
||||
m_EBUF->m_RO.set(0.001);
|
||||
m_RO->set_R(m_model.m_RO);
|
||||
#else
|
||||
m_EBUF->m_RO.setTo(m_model.m_RO);
|
||||
m_EBUF->m_RO.set(m_model.m_RO);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -33,13 +33,13 @@ NETLIB_RESET(VCCS)
|
||||
NETLIB_UPDATE(VCCS)
|
||||
{
|
||||
// only called if connected to a rail net ==> notify the solver to recalculate
|
||||
if (!m_IP.net().isRailNet())
|
||||
if (!m_IP.net().is_rail_net())
|
||||
m_IP.solve_now();
|
||||
else if (!m_IN.net().isRailNet())
|
||||
else if (!m_IN.net().is_rail_net())
|
||||
m_IN.solve_now();
|
||||
else if (!m_OP.net().isRailNet())
|
||||
else if (!m_OP.net().is_rail_net())
|
||||
m_OP.solve_now();
|
||||
else if (!m_ON.net().isRailNet())
|
||||
else if (!m_ON.net().is_rail_net())
|
||||
m_ON.solve_now();
|
||||
}
|
||||
|
||||
|
@ -18,18 +18,18 @@ namespace analog
|
||||
void NETLIB_NAME(twoterm)::solve_now()
|
||||
{
|
||||
// we only need to call the non-rail terminal
|
||||
if (m_P.has_net() && !m_P.net().isRailNet())
|
||||
if (m_P.has_net() && !m_P.net().is_rail_net())
|
||||
m_P.solve_now();
|
||||
else if (m_N.has_net() && !m_N.net().isRailNet())
|
||||
else if (m_N.has_net() && !m_N.net().is_rail_net())
|
||||
m_N.solve_now();
|
||||
}
|
||||
|
||||
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())
|
||||
if (m_P.has_net() && !m_P.net().is_rail_net())
|
||||
m_P.schedule_solve_after(delay);
|
||||
else if (m_N.has_net() && !m_N.net().isRailNet())
|
||||
else if (m_N.has_net() && !m_N.net().is_rail_net())
|
||||
m_N.schedule_solve_after(delay);
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ namespace netlist
|
||||
|
||||
NETLIB_RESET(2102A)
|
||||
{
|
||||
m_RAM.setTo(&m_ram[0]);
|
||||
m_RAM.set(&m_ram[0]);
|
||||
for (std::size_t i=0; i<128; i++)
|
||||
m_ram[i] = 0;
|
||||
}
|
||||
|
@ -46,8 +46,8 @@ namespace netlist
|
||||
connect(m_RN.m_R.m_P, m_RP.m_R.m_N);
|
||||
connect(m_CV, m_RN.m_R.m_P);
|
||||
|
||||
m_RP.m_RON.setTo(m_RI());
|
||||
m_RN.m_RON.setTo(m_RI());
|
||||
m_RP.m_RON.set(m_RI());
|
||||
m_RN.m_RON.set(m_RI());
|
||||
}
|
||||
|
||||
NETLIB_RESETI();
|
||||
|
@ -95,7 +95,7 @@ namespace devices
|
||||
#endif
|
||||
}
|
||||
for (auto &q : m_Q)
|
||||
if (q.has_net() && q.net().num_cons() > 0)
|
||||
if (q.has_net() && q.net().has_connections())
|
||||
active_outputs++;
|
||||
set_active_outputs(active_outputs);
|
||||
}
|
||||
|
@ -673,6 +673,7 @@ namespace netlist
|
||||
, m_next_scheduled_time(*this, "m_time", netlist_time_ext::zero())
|
||||
, m_railterminal(railterminal)
|
||||
{
|
||||
props::add(this, props::value_type());
|
||||
}
|
||||
|
||||
void detail::net_t::rebuild_list()
|
||||
@ -680,7 +681,7 @@ namespace netlist
|
||||
// rebuild m_list
|
||||
|
||||
m_list_active.clear();
|
||||
for (auto & term : m_core_terms)
|
||||
for (auto & term : core_terms())
|
||||
if (term->terminal_state() != logic_t::STATE_INP_PASSIVE)
|
||||
{
|
||||
m_list_active.push_back(term);
|
||||
@ -705,7 +706,7 @@ namespace netlist
|
||||
// rebuild m_list and reset terminals to active or analog out state
|
||||
|
||||
m_list_active.clear();
|
||||
for (core_terminal_t *ct : m_core_terms)
|
||||
for (core_terminal_t *ct : core_terms())
|
||||
{
|
||||
ct->reset();
|
||||
if (ct->terminal_state() != logic_t::STATE_INP_PASSIVE)
|
||||
@ -716,7 +717,7 @@ namespace netlist
|
||||
|
||||
void detail::net_t::add_terminal(detail::core_terminal_t &terminal) noexcept(false)
|
||||
{
|
||||
for (auto &t : m_core_terms)
|
||||
for (auto &t : core_terms())
|
||||
if (t == &terminal)
|
||||
{
|
||||
state().log().fatal(MF_NET_1_DUPLICATE_TERMINAL_2(name(), t->name()));
|
||||
@ -725,15 +726,15 @@ namespace netlist
|
||||
|
||||
terminal.set_net(this);
|
||||
|
||||
m_core_terms.push_back(&terminal);
|
||||
core_terms().push_back(&terminal);
|
||||
}
|
||||
|
||||
void detail::net_t::remove_terminal(detail::core_terminal_t &terminal) noexcept(false)
|
||||
{
|
||||
if (plib::container::contains(m_core_terms, &terminal))
|
||||
if (plib::container::contains(core_terms(), &terminal))
|
||||
{
|
||||
terminal.set_net(nullptr);
|
||||
plib::container::remove(m_core_terms, &terminal);
|
||||
plib::container::remove(core_terms(), &terminal);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -744,9 +745,9 @@ namespace netlist
|
||||
|
||||
void detail::net_t::move_connections(detail::net_t &dest_net)
|
||||
{
|
||||
for (auto &ct : m_core_terms)
|
||||
for (auto &ct : core_terms())
|
||||
dest_net.add_terminal(*ct);
|
||||
m_core_terms.clear();
|
||||
core_terms().clear();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
@ -425,12 +425,14 @@ namespace netlist
|
||||
template <typename C, typename T>
|
||||
struct property_store_t
|
||||
{
|
||||
static void add(const C *obj, const T &aname) noexcept
|
||||
using value_type = T;
|
||||
using key_type = const C *;
|
||||
static void add(key_type obj, const value_type &aname) noexcept
|
||||
{
|
||||
store().insert({obj, aname});
|
||||
}
|
||||
|
||||
static const T *get(const C *obj) noexcept
|
||||
static value_type *get(key_type obj) noexcept
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -441,18 +443,18 @@ namespace netlist
|
||||
catch (...)
|
||||
{
|
||||
nl_assert_always(true, "exception in property_store_t.get()");
|
||||
return static_cast<T *>(nullptr);
|
||||
return static_cast<value_type *>(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
static void remove(const C *obj) noexcept
|
||||
static void remove(key_type obj) noexcept
|
||||
{
|
||||
store().erase(store().find(obj));
|
||||
}
|
||||
|
||||
static std::unordered_map<const C *, T> &store() noexcept
|
||||
static std::unordered_map<key_type, value_type> &store() noexcept
|
||||
{
|
||||
static std::unordered_map<const C *, T> lstore;
|
||||
static std::unordered_map<key_type, value_type> lstore;
|
||||
return lstore;
|
||||
}
|
||||
|
||||
@ -657,8 +659,7 @@ namespace netlist
|
||||
// net_t
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
class net_t :
|
||||
public netlist_object_t
|
||||
class net_t : public netlist_object_t
|
||||
{
|
||||
public:
|
||||
|
||||
@ -694,10 +695,10 @@ namespace netlist
|
||||
netlist_time_ext next_scheduled_time() const noexcept { return m_next_scheduled_time; }
|
||||
void set_next_scheduled_time(netlist_time_ext ntime) noexcept { m_next_scheduled_time = ntime; }
|
||||
|
||||
bool isRailNet() const noexcept { return !(m_railterminal == nullptr); }
|
||||
bool is_rail_net() const noexcept { return !(m_railterminal == nullptr); }
|
||||
core_terminal_t & railterminal() const noexcept { return *m_railterminal; }
|
||||
|
||||
std::size_t num_cons() const noexcept { return m_core_terms.size(); }
|
||||
bool has_connections() const noexcept { return !m_core_terms.empty(); }
|
||||
|
||||
void add_to_active_list(core_terminal_t &term) noexcept;
|
||||
void remove_from_active_list(core_terminal_t &term) noexcept;
|
||||
@ -937,7 +938,7 @@ namespace netlist
|
||||
analog_net_t(netlist_state_t &nl, const pstring &aname, detail::core_terminal_t *railterminal = nullptr);
|
||||
|
||||
nl_fptype Q_Analog() const noexcept { return m_cur_Analog; }
|
||||
void set_Q_Analog(const nl_fptype v) noexcept { m_cur_Analog = v; }
|
||||
void set_Q_Analog(nl_fptype v) noexcept { m_cur_Analog = v; }
|
||||
nl_fptype *Q_Analog_state_ptr() noexcept { return m_cur_Analog.ptr(); }
|
||||
|
||||
//FIXME: needed by current solver code
|
||||
@ -1132,7 +1133,7 @@ namespace netlist
|
||||
pstring get_initial(const device_t &dev, bool *found) const;
|
||||
|
||||
template<typename C>
|
||||
void set(C &p, const C v) noexcept
|
||||
void set_and_update_param(C &p, const C v) noexcept
|
||||
{
|
||||
if (p != v)
|
||||
{
|
||||
@ -1156,7 +1157,7 @@ namespace netlist
|
||||
T operator()() const noexcept { return m_param; }
|
||||
operator T() const noexcept { return m_param; }
|
||||
|
||||
void setTo(const T ¶m) noexcept { set(m_param, param); }
|
||||
void set(const T ¶m) noexcept { set_and_update_param(m_param, param); }
|
||||
private:
|
||||
T m_param;
|
||||
};
|
||||
@ -1169,7 +1170,7 @@ namespace netlist
|
||||
|
||||
T operator()() const noexcept { return T(m_param); }
|
||||
operator T() const noexcept { return T(m_param); }
|
||||
void setTo(const T ¶m) noexcept { set(m_param, static_cast<int>(param)); }
|
||||
void set(const T ¶m) noexcept { set_and_update_param(m_param, static_cast<int>(param)); }
|
||||
private:
|
||||
int m_param;
|
||||
};
|
||||
@ -1188,7 +1189,7 @@ namespace netlist
|
||||
public:
|
||||
param_ptr_t(device_t &device, const pstring &name, std::uint8_t* val);
|
||||
std::uint8_t * operator()() const noexcept { return m_param; }
|
||||
void setTo(std::uint8_t *param) noexcept { set(m_param, param); }
|
||||
void set(std::uint8_t *param) noexcept { set_and_update_param(m_param, param); }
|
||||
private:
|
||||
std::uint8_t* m_param;
|
||||
};
|
||||
@ -1203,7 +1204,7 @@ namespace netlist
|
||||
param_str_t(device_t &device, const pstring &name, const pstring &val);
|
||||
|
||||
const pstring &operator()() const noexcept { return str(); }
|
||||
void setTo(const pstring ¶m)
|
||||
void set(const pstring ¶m)
|
||||
{
|
||||
if (m_param != param)
|
||||
{
|
||||
@ -1250,7 +1251,7 @@ namespace netlist
|
||||
nl_fptype value(const pstring &entity);
|
||||
pstring type();
|
||||
// hide this
|
||||
void setTo(const pstring ¶m) = delete;
|
||||
void set(const pstring ¶m) = delete;
|
||||
protected:
|
||||
void changed() noexcept override;
|
||||
private:
|
||||
@ -1872,7 +1873,7 @@ namespace netlist
|
||||
|
||||
inline void detail::net_t::push_to_queue(netlist_time delay) noexcept
|
||||
{
|
||||
if ((num_cons() != 0))
|
||||
if (has_connections())
|
||||
{
|
||||
m_next_scheduled_time = exec().time() + delay;
|
||||
|
||||
@ -2076,7 +2077,7 @@ namespace netlist
|
||||
template <bool KEEP_STATS>
|
||||
inline void detail::net_t::update_devs() noexcept
|
||||
{
|
||||
nl_assert(this->isRailNet());
|
||||
nl_assert(this->is_rail_net());
|
||||
|
||||
m_in_queue = queue_status::DELIVERED; // mark as taken ...
|
||||
if (m_new_Q ^ m_cur_Q)
|
||||
|
@ -672,13 +672,13 @@ void setup_t::merge_nets(detail::net_t &thisnet, detail::net_t &othernet)
|
||||
return; // Nothing to do
|
||||
}
|
||||
|
||||
if (thisnet.isRailNet() && othernet.isRailNet())
|
||||
if (thisnet.is_rail_net() && othernet.is_rail_net())
|
||||
{
|
||||
log().fatal(MF_MERGE_RAIL_NETS_1_AND_2(thisnet.name(), othernet.name()));
|
||||
throw nl_exception(MF_MERGE_RAIL_NETS_1_AND_2(thisnet.name(), othernet.name()));
|
||||
}
|
||||
|
||||
if (othernet.isRailNet())
|
||||
if (othernet.is_rail_net())
|
||||
{
|
||||
log().debug("othernet is railnet\n");
|
||||
merge_nets(othernet, thisnet);
|
||||
@ -799,7 +799,7 @@ bool setup_t::connect_input_input(detail::core_terminal_t &t1, detail::core_term
|
||||
bool ret = false;
|
||||
if (t1.has_net())
|
||||
{
|
||||
if (t1.net().isRailNet())
|
||||
if (t1.net().is_rail_net())
|
||||
ret = connect(t2, t1.net().railterminal());
|
||||
if (!ret)
|
||||
{
|
||||
@ -814,7 +814,7 @@ bool setup_t::connect_input_input(detail::core_terminal_t &t1, detail::core_term
|
||||
}
|
||||
if (!ret && t2.has_net())
|
||||
{
|
||||
if (t2.net().isRailNet())
|
||||
if (t2.net().is_rail_net())
|
||||
ret = connect(t1, t2.net().railterminal());
|
||||
if (!ret)
|
||||
{
|
||||
@ -839,7 +839,7 @@ bool setup_t::connect(detail::core_terminal_t &t1_in, detail::core_terminal_t &t
|
||||
|
||||
if (t1.is_type(detail::terminal_type::OUTPUT) && t2.is_type(detail::terminal_type::INPUT))
|
||||
{
|
||||
if (t2.has_net() && t2.net().isRailNet())
|
||||
if (t2.has_net() && t2.net().is_rail_net())
|
||||
{
|
||||
log().fatal(MF_INPUT_1_ALREADY_CONNECTED(t2.name()));
|
||||
throw nl_exception(MF_INPUT_1_ALREADY_CONNECTED(t2.name()));
|
||||
@ -848,7 +848,7 @@ bool setup_t::connect(detail::core_terminal_t &t1_in, detail::core_terminal_t &t
|
||||
}
|
||||
else if (t1.is_type(detail::terminal_type::INPUT) && t2.is_type(detail::terminal_type::OUTPUT))
|
||||
{
|
||||
if (t1.has_net() && t1.net().isRailNet())
|
||||
if (t1.has_net() && t1.net().is_rail_net())
|
||||
{
|
||||
log().fatal(MF_INPUT_1_ALREADY_CONNECTED(t1.name()));
|
||||
throw nl_exception(MF_INPUT_1_ALREADY_CONNECTED(t1.name()));
|
||||
@ -947,7 +947,7 @@ void setup_t::resolve_inputs()
|
||||
log().error(ME_TERMINAL_1_WITHOUT_NET(setup().de_alias(term->name())));
|
||||
err = true;
|
||||
}
|
||||
else if (term->net().num_cons() == 0)
|
||||
else if (!term->net().has_connections())
|
||||
{
|
||||
if (term->is_logic_input())
|
||||
log().warning(MW_LOGIC_INPUT_1_WITHOUT_CONNECTIONS(term->name()));
|
||||
@ -1183,12 +1183,12 @@ void setup_t::delete_empty_nets()
|
||||
{
|
||||
m_nlstate.nets().erase(
|
||||
std::remove_if(m_nlstate.nets().begin(), m_nlstate.nets().end(),
|
||||
[](owned_pool_ptr<detail::net_t> &x)
|
||||
[](owned_pool_ptr<detail::net_t> &net)
|
||||
{
|
||||
if (x->num_cons() == 0)
|
||||
if (!net->has_connections())
|
||||
{
|
||||
x->state().log().verbose("Deleting net {1} ...", x->name());
|
||||
x->state().run_state_manager().remove_save_items(x.get());
|
||||
net->state().log().verbose("Deleting net {1} ...", net->name());
|
||||
net->state().run_state_manager().remove_save_items(net.get());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -1293,7 +1293,7 @@ void setup_t::prepare_to_run()
|
||||
log().verbose("looking for two terms connected to rail nets ...");
|
||||
for (auto & t : m_nlstate.get_device_list<analog::NETLIB_NAME(twoterm)>())
|
||||
{
|
||||
if (t->m_N.net().isRailNet() && t->m_P.net().isRailNet())
|
||||
if (t->m_N.net().is_rail_net() && t->m_P.net().is_rail_net())
|
||||
{
|
||||
log().info(MI_REMOVE_DEVICE_1_CONNECTED_ONLY_TO_RAILS_2_3(
|
||||
t->name(), t->m_N.net().name(), t->m_P.net().name()));
|
||||
|
@ -374,13 +374,13 @@ struct input_t
|
||||
case netlist::param_t::POINTER:
|
||||
throw netlist::nl_exception(plib::pfmt("param {1} is not numeric\n")(m_param->name()));
|
||||
case netlist::param_t::DOUBLE:
|
||||
static_cast<netlist::param_fp_t*>(m_param)->setTo(m_value);
|
||||
static_cast<netlist::param_fp_t*>(m_param)->set(m_value);
|
||||
break;
|
||||
case netlist::param_t::INTEGER:
|
||||
static_cast<netlist::param_int_t*>(m_param)->setTo(static_cast<int>(m_value));
|
||||
static_cast<netlist::param_int_t*>(m_param)->set(static_cast<int>(m_value));
|
||||
break;
|
||||
case netlist::param_t::LOGIC:
|
||||
static_cast<netlist::param_logic_t*>(m_param)->setTo(static_cast<bool>(m_value));
|
||||
static_cast<netlist::param_logic_t*>(m_param)->set(static_cast<bool>(m_value));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ namespace solver
|
||||
|
||||
for (auto &p : net->core_terms())
|
||||
{
|
||||
log().debug("{1} {2} {3}\n", p->name(), net->name(), net->isRailNet());
|
||||
log().debug("{1} {2} {3}\n", p->name(), net->name(), net->is_rail_net());
|
||||
switch (p->type())
|
||||
{
|
||||
case detail::terminal_type::TERMINAL:
|
||||
@ -558,7 +558,7 @@ namespace solver
|
||||
|
||||
void matrix_solver_t::add_term(std::size_t net_idx, terminal_t *term)
|
||||
{
|
||||
if (get_connected_net(term)->isRailNet())
|
||||
if (get_connected_net(term)->is_rail_net())
|
||||
{
|
||||
m_rails_temp[net_idx].add_terminal(term, -1, false);
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ namespace devices
|
||||
for (auto & net : netlist.nets())
|
||||
{
|
||||
netlist.log().verbose("processing {1}", net->name());
|
||||
if (!net->isRailNet() && net->num_cons() > 0)
|
||||
if (!net->is_rail_net() && net->has_connections())
|
||||
{
|
||||
netlist.log().verbose(" ==> not a rail net");
|
||||
// Must be an analog net
|
||||
@ -242,7 +242,7 @@ namespace devices
|
||||
bool already_processed(const analog_net_t &n) const
|
||||
{
|
||||
// no need to process rail nets - these are known variables
|
||||
if (n.isRailNet())
|
||||
if (n.is_rail_net())
|
||||
return true;
|
||||
// if it's already processed - no need to continue
|
||||
for (const auto & grp : groups)
|
||||
@ -254,7 +254,7 @@ namespace devices
|
||||
bool check_if_processed_and_join(const analog_net_t &n)
|
||||
{
|
||||
// no need to process rail nets - these are known variables
|
||||
if (n.isRailNet())
|
||||
if (n.is_rail_net())
|
||||
return true;
|
||||
// First check if it is in a previous group.
|
||||
// In this case we need to merge this group into the current group
|
||||
@ -282,23 +282,24 @@ namespace devices
|
||||
{
|
||||
// ignore empty nets. FIXME: print a warning message
|
||||
netlist.log().verbose("Net {}", n.name());
|
||||
if (n.num_cons() == 0)
|
||||
return;
|
||||
// add the net
|
||||
groupspre.back().push_back(&n);
|
||||
// process all terminals connected to this net
|
||||
for (auto &term : n.core_terms())
|
||||
if (n.has_connections())
|
||||
{
|
||||
netlist.log().verbose("Term {} {}", term->name(), static_cast<int>(term->type()));
|
||||
// only process analog terminals
|
||||
if (term->is_type(detail::terminal_type::TERMINAL))
|
||||
// add the net
|
||||
groupspre.back().push_back(&n);
|
||||
// process all terminals connected to this net
|
||||
for (auto &term : n.core_terms())
|
||||
{
|
||||
auto *pt = static_cast<terminal_t *>(term);
|
||||
// check the connected terminal
|
||||
analog_net_t &connected_net = netlist.setup().get_connected_terminal(*pt)->net();
|
||||
netlist.log().verbose(" Connected net {}", connected_net.name());
|
||||
if (!check_if_processed_and_join(connected_net))
|
||||
process_net(netlist, connected_net);
|
||||
netlist.log().verbose("Term {} {}", term->name(), static_cast<int>(term->type()));
|
||||
// only process analog terminals
|
||||
if (term->is_type(detail::terminal_type::TERMINAL))
|
||||
{
|
||||
auto *pt = static_cast<terminal_t *>(term);
|
||||
// check the connected terminal
|
||||
analog_net_t &connected_net = netlist.setup().get_connected_terminal(*pt)->net();
|
||||
netlist.log().verbose(" Connected net {}", connected_net.name());
|
||||
if (!check_if_processed_and_join(connected_net))
|
||||
process_net(netlist, connected_net);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user