summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/nl_base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/netlist/nl_base.cpp')
-rw-r--r--src/lib/netlist/nl_base.cpp304
1 files changed, 141 insertions, 163 deletions
diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp
index dc610a99db9..6c1df62290d 100644
--- a/src/lib/netlist/nl_base.cpp
+++ b/src/lib/netlist/nl_base.cpp
@@ -5,21 +5,22 @@
*
*/
+#include <cstring>
+
#include "solver/nld_matrix_solver.h"
+#include "solver/nld_solver.h"
+#include "plib/putil.h"
#include "plib/palloc.h"
#include "nl_base.h"
#include "devices/nlid_system.h"
-#include "nl_util.h"
-
-const netlist::netlist_time netlist::netlist_time::zero = netlist::netlist_time(0);
namespace netlist
{
#if (NL_USE_MEMPOOL)
-static plib::pmempool p(65536, 16);
+static plib::mempool p(65536, 8);
void * object_t::operator new (size_t size)
{
@@ -67,7 +68,6 @@ public:
}
};
-//FIXME: set to proper values
class logic_family_cd4xxx_t : public logic_family_desc_t
{
public:
@@ -115,20 +115,20 @@ queue_t::queue_t(netlist_t &nl)
void queue_t::register_state(plib::pstate_manager_t &manager, const pstring &module)
{
netlist().log().debug("register_state\n");
- manager.save_item(m_qsize, this, module + "." + "qsize");
- manager.save_item(&m_times[0], this, module + "." + "times", m_times.size());
- manager.save_item(&(m_names[0].m_buf[0]), this, module + "." + "names", m_names.size() * sizeof(names_t));
+ manager.save_item(this, m_qsize, module + "." + "qsize");
+ manager.save_item(this, &m_times[0], module + "." + "times", m_times.size());
+ manager.save_item(this, &(m_names[0].m_buf[0]), module + "." + "names", m_names.size() * sizeof(names_t));
}
void queue_t::on_pre_save()
{
netlist().log().debug("on_pre_save\n");
- m_qsize = this->count();
+ m_qsize = this->size();
netlist().log().debug("current time {1} qsize {2}\n", netlist().time().as_double(), m_qsize);
for (int i = 0; i < m_qsize; i++ )
{
- m_times[i] = this->listptr()[i].exec_time().as_raw();
- pstring p = this->listptr()[i].object()->name();
+ m_times[i] = this->listptr()[i].m_exec_time.as_raw();
+ pstring p = this->listptr()[i].m_object->name();
int n = p.len();
n = std::min(63, n);
std::strncpy(m_names[i].m_buf, p.cstr(), n);
@@ -146,7 +146,7 @@ void queue_t::on_post_load()
net_t *n = netlist().find_net(m_names[i].m_buf);
//log().debug("Got {1} ==> {2}\n", qtemp[i].m_name, n));
//log().debug("schedule time {1} ({2})\n", n->time().as_double(), netlist_time::from_raw(m_times[i]).as_double()));
- this->push(queue_t::entry_t(netlist_time::from_raw(m_times[i]), n));
+ this->push(netlist_time::from_raw(m_times[i]), n);
}
}
@@ -154,18 +154,18 @@ void queue_t::on_post_load()
// object_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD object_t::object_t(netlist_t &nl, const pstring &aname, const type_t atype)
-: m_name(aname)
-, m_objtype(atype)
-, m_netlist(&nl)
+object_t::object_t(netlist_t &nl, const pstring &aname, const type_t atype)
+ : m_netlist(nl)
+ , m_name(aname)
+ , m_objtype(atype)
{
}
-ATTR_COLD object_t::~object_t()
+object_t::~object_t()
{
}
-ATTR_COLD const pstring &object_t::name() const
+const pstring &object_t::name() const
{
return m_name;
}
@@ -174,9 +174,9 @@ ATTR_COLD const pstring &object_t::name() const
// device_object_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD device_object_t::device_object_t(core_device_t &dev, const pstring &aname, const type_t atype)
+device_object_t::device_object_t(core_device_t &dev, const pstring &aname, const type_t atype)
: object_t(dev.netlist(), aname, atype)
-, m_device(&dev)
+, m_device(dev)
{
}
@@ -187,8 +187,8 @@ ATTR_COLD device_object_t::device_object_t(core_device_t &dev, const pstring &an
netlist_t::netlist_t(const pstring &aname)
: pstate_manager_t(),
- m_stop(netlist_time::zero),
- m_time(netlist_time::zero),
+ m_stop(netlist_time::zero()),
+ m_time(netlist_time::zero()),
m_use_deactivate(0),
m_queue(*this),
m_mainclock(nullptr),
@@ -200,8 +200,8 @@ netlist_t::netlist_t(const pstring &aname)
m_log(this),
m_lib(nullptr)
{
- save_item(static_cast<plib::pstate_callback_t &>(m_queue), this, "m_queue");
- save_item(m_time, this, "m_time");
+ save_item(this, static_cast<plib::pstate_callback_t &>(m_queue), "m_queue");
+ save_item(this, m_time, "m_time");
}
netlist_t::~netlist_t()
@@ -214,16 +214,16 @@ netlist_t::~netlist_t()
pstring::resetmem();
}
-ATTR_HOT nl_double netlist_t::gmin() const
+nl_double netlist_t::gmin() const
{
return solver()->gmin();
}
-ATTR_COLD void netlist_t::start()
+void netlist_t::start()
{
/* load the library ... */
- pstring libpath = nl_util::environment("NL_BOOSTLIB", nl_util::buildpath({".", "nlboost.so"}));
+ pstring libpath = plib::util::environment("NL_BOOSTLIB", plib::util::buildpath({".", "nlboost.so"}));
m_lib = plib::palloc<plib::dynlib>(libpath);
@@ -237,7 +237,7 @@ ATTR_COLD void netlist_t::start()
|| setup().factory().is_class<devices::NETLIB_NAME(netlistparams)>(e.second))
{
auto dev = plib::owned_ptr<device_t>(e.second->Create(*this, e.first));
- setup().register_dev_s(std::move(dev));
+ setup().register_dev(std::move(dev));
}
}
@@ -260,13 +260,13 @@ ATTR_COLD void netlist_t::start()
&& !setup().factory().is_class<devices::NETLIB_NAME(netlistparams)>(e.second))
{
auto dev = plib::owned_ptr<device_t>(e.second->Create(*this, e.first));
- setup().register_dev_s(std::move(dev));
+ setup().register_dev(std::move(dev));
}
}
}
-ATTR_COLD void netlist_t::stop()
+void netlist_t::stop()
{
/* find the main clock and solver ... */
@@ -275,7 +275,7 @@ ATTR_COLD void netlist_t::stop()
dev->stop_dev();
}
-ATTR_COLD net_t *netlist_t::find_net(const pstring &name)
+net_t *netlist_t::find_net(const pstring &name)
{
for (auto & net : m_nets)
if (net->name() == name)
@@ -284,25 +284,25 @@ ATTR_COLD net_t *netlist_t::find_net(const pstring &name)
return nullptr;
}
-ATTR_COLD void netlist_t::rebuild_lists()
+void netlist_t::rebuild_lists()
{
for (auto & net : m_nets)
net->rebuild_list();
}
-ATTR_COLD void netlist_t::reset()
+void netlist_t::reset()
{
- m_time = netlist_time::zero;
+ m_time = netlist_time::zero();
m_queue.clear();
if (m_mainclock != nullptr)
- m_mainclock->m_Q.net().set_time(netlist_time::zero);
+ m_mainclock->m_Q.net().set_time(netlist_time::zero());
//if (m_solver != nullptr)
// m_solver->do_reset();
// Reset all nets once !
- for (std::size_t i = 0; i < m_nets.size(); i++)
- m_nets[i]->do_reset();
+ for (auto & n : m_nets)
+ n->reset();
// Reset all devices once !
for (auto & dev : m_devices)
@@ -329,33 +329,33 @@ ATTR_COLD void netlist_t::reset()
}
-ATTR_HOT void netlist_t::process_queue(const netlist_time &delta)
+void netlist_t::process_queue(const netlist_time &delta)
{
m_stop = m_time + delta;
if (m_mainclock == nullptr)
{
- while ( (m_time < m_stop) && (m_queue.is_not_empty()))
+ while ( (m_time < m_stop) & (!m_queue.empty()))
{
- const queue_t::entry_t &e = m_queue.pop();
- m_time = e.exec_time();
- e.object()->update_devs();
+ const queue_t::entry_t e(m_queue.pop());
+ m_time = e.m_exec_time;
+ e.m_object->update_devs();
add_to_stat(m_perf_out_processed, 1);
}
- if (m_queue.is_empty())
+ if (m_queue.empty())
m_time = m_stop;
} else {
- logic_net_t &mc_net = m_mainclock->m_Q.net().as_logic();
+ logic_net_t &mc_net = m_mainclock->m_Q.net();
const netlist_time inc = m_mainclock->m_inc;
netlist_time mc_time(mc_net.time());
while (m_time < m_stop)
{
- if (m_queue.is_not_empty())
+ if (!m_queue.empty())
{
- while (m_queue.top().exec_time() > mc_time)
+ while (m_queue.top().m_exec_time > mc_time)
{
m_time = mc_time;
mc_time += inc;
@@ -365,8 +365,8 @@ ATTR_HOT void netlist_t::process_queue(const netlist_time &delta)
}
const queue_t::entry_t &e = m_queue.pop();
- m_time = e.exec_time();
- e.object()->update_devs();
+ m_time = e.m_exec_time;
+ e.m_object->update_devs();
} else {
m_time = mc_time;
@@ -386,13 +386,15 @@ void netlist_t::print_stats() const
{
#if (NL_KEEP_STATISTICS)
{
- for (std::size_t i = 0; i < m_devices.size(); i++)
+ for (auto & entry : m_devices)
{
- core_device_t *entry = m_devices[i].get();
- printf("Device %20s : %12d %12d %15ld\n", entry->name().cstr(), entry->stat_call_count, entry->stat_update_count, (long int) entry->stat_total_time / (entry->stat_update_count + 1));
+ log().verbose("Device {1:20} : {2:12} {3:12} {4:15}", entry->name(),
+ entry->stat_call_count, entry->stat_update_count,
+ (long int) entry->stat_total_time / (entry->stat_update_count + 1));
}
- printf("Queue Pushes %15d\n", queue().m_prof_call);
- printf("Queue Moves %15d\n", queue().m_prof_sortmove);
+
+ log().verbose("Queue Pushes {1:15}", queue().m_prof_call);
+ log().verbose("Queue Moves {1:15}", queue().m_prof_sortmove);
}
#endif
}
@@ -422,7 +424,7 @@ template class param_template_t<pstring, param_t::MODEL>;
// core_device_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD core_device_t::core_device_t(netlist_t &owner, const pstring &name)
+core_device_t::core_device_t(netlist_t &owner, const pstring &name)
: object_t(owner, name, DEVICE), logic_family_t()
#if (NL_KEEP_STATISTICS)
, stat_total_time(0)
@@ -434,7 +436,7 @@ ATTR_COLD core_device_t::core_device_t(netlist_t &owner, const pstring &name)
set_logic_family(family_TTL());
}
-ATTR_COLD core_device_t::core_device_t(core_device_t &owner, const pstring &name)
+core_device_t::core_device_t(core_device_t &owner, const pstring &name)
: object_t(owner.netlist(), owner.name() + "." + name, DEVICE)
, logic_family_t()
#if (NL_KEEP_STATISTICS)
@@ -449,15 +451,12 @@ ATTR_COLD core_device_t::core_device_t(core_device_t &owner, const pstring &name
owner.netlist().m_devices.push_back(plib::owned_ptr<core_device_t>(this, false));
}
-ATTR_COLD core_device_t::~core_device_t()
+core_device_t::~core_device_t()
{
}
-ATTR_COLD void core_device_t::set_delegate_pointer()
+void core_device_t::set_delegate_pointer()
{
-#if (NL_KEEP_STATISTICS)
- netlist().m_started_devices.push_back(this);
-#endif
#if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF)
void (core_device_t::* pFunc)() = &core_device_t::update;
m_static_update = pFunc;
@@ -469,14 +468,14 @@ ATTR_COLD void core_device_t::set_delegate_pointer()
#endif
}
-ATTR_COLD void core_device_t::stop_dev()
+void core_device_t::stop_dev()
{
#if (NL_KEEP_STATISTICS)
#endif
//stop();
}
-ATTR_HOT netlist_sig_t core_device_t::INPLOGIC_PASSIVE(logic_input_t &inp)
+netlist_sig_t core_device_t::INPLOGIC_PASSIVE(logic_input_t &inp)
{
if (inp.state() != logic_t::STATE_INP_PASSIVE)
return inp.Q();
@@ -499,23 +498,23 @@ device_t::~device_t()
//log().debug("~net_device_t\n");
}
-ATTR_COLD setup_t &device_t::setup()
+setup_t &device_t::setup()
{
return netlist().setup();
}
-ATTR_COLD void device_t::register_subalias(const pstring &name, core_terminal_t &term)
+void device_t::register_subalias(const pstring &name, core_terminal_t &term)
{
pstring alias = this->name() + "." + name;
// everything already fully qualified
setup().register_alias_nofqn(alias, term.name());
- if (term.isType(terminal_t::INPUT) || term.isType(terminal_t::TERMINAL))
+ if (term.is_type(terminal_t::INPUT) || term.is_type(terminal_t::TERMINAL))
m_terminals.push_back(alias);
}
-ATTR_COLD void device_t::register_subalias(const pstring &name, const pstring &aliased)
+void device_t::register_subalias(const pstring &name, const pstring &aliased)
{
pstring alias = this->name() + "." + name;
pstring aliased_fqn = this->name() + "." + aliased;
@@ -528,17 +527,12 @@ ATTR_COLD void device_t::register_subalias(const pstring &name, const pstring &a
// m_terminals.add(name);
}
-ATTR_COLD void device_t::register_p(const pstring &name, object_t &obj)
-{
- setup().register_object(obj);
-}
-
-ATTR_COLD void device_t::connect_late(core_terminal_t &t1, core_terminal_t &t2)
+void device_t::connect_late(core_terminal_t &t1, core_terminal_t &t2)
{
setup().register_link_fqn(t1.name(), t2.name());
}
-ATTR_COLD void device_t::connect_late(const pstring &t1, const pstring &t2)
+void device_t::connect_late(const pstring &t1, const pstring &t2)
{
setup().register_link_fqn(name() + "." + t1, name() + "." + t2);
}
@@ -546,7 +540,7 @@ ATTR_COLD void device_t::connect_late(const pstring &t1, const pstring &t2)
/* FIXME: this is only used by solver code since matrix solvers are started in
* post_start.
*/
-ATTR_COLD void device_t::connect_post_start(core_terminal_t &t1, core_terminal_t &t2)
+void device_t::connect_post_start(core_terminal_t &t1, core_terminal_t &t2)
{
if (!setup().connect(t1, t2))
netlist().log().fatal("Error connecting {1} to {2}\n", t1.name(), t2.name());
@@ -578,14 +572,14 @@ struct do_nothing_deleter{
};
-ATTR_COLD net_t::net_t(netlist_t &nl, const pstring &aname, core_terminal_t *mr)
+net_t::net_t(netlist_t &nl, const pstring &aname, core_terminal_t *mr)
: object_t(nl, aname, NET)
, m_new_Q(0)
, m_cur_Q (0)
- , m_railterminal(nullptr)
- , m_time(netlist_time::zero)
+ , m_time(netlist_time::zero())
, m_active(0)
, m_in_queue(2)
+ , m_railterminal(nullptr)
, m_cur_Analog(0.0)
{
m_railterminal = mr;
@@ -602,21 +596,21 @@ ATTR_COLD net_t::net_t(netlist_t &nl, const pstring &aname, core_terminal_t *mr)
save(NLNAME(m_new_Q));
}
-ATTR_COLD net_t::~net_t()
+net_t::~net_t()
{
netlist().remove_save_items(this);
}
-ATTR_HOT void net_t::inc_active(core_terminal_t &term)
+void net_t::inc_active(core_terminal_t &term)
{
m_active++;
- m_list_active.insert(term);
+ m_list_active.push_front(&term);
nl_assert(m_active <= num_cons());
if (m_active == 1)
{
if (netlist().use_deactivate())
{
- railterminal().device().inc_active();
+ railterminal().device().do_inc_active();
//m_cur_Q = m_new_Q;
}
if (m_in_queue == 0)
@@ -637,64 +631,59 @@ ATTR_HOT void net_t::inc_active(core_terminal_t &term)
}
}
-ATTR_HOT void net_t::dec_active(core_terminal_t &term)
+void net_t::dec_active(core_terminal_t &term)
{
- m_active--;
+ --m_active;
nl_assert(m_active >= 0);
- m_list_active.remove(term);
+ m_list_active.remove(&term);
if (m_active == 0 && netlist().use_deactivate())
- railterminal().device().dec_active();
+ railterminal().device().do_dec_active();
}
-ATTR_COLD void net_t::rebuild_list()
+void net_t::rebuild_list()
{
/* rebuild m_list */
unsigned cnt = 0;
m_list_active.clear();
- for (core_terminal_t *term : m_core_terms)
+ for (auto & term : m_core_terms)
if (term->state() != logic_t::STATE_INP_PASSIVE)
{
- m_list_active.add(*term);
+ m_list_active.push_back(term);
cnt++;
}
m_active = cnt;
}
-ATTR_HOT /* inline */ void net_t::update_devs()
+void net_t::update_devs()
{
//assert(m_num_cons != 0);
nl_assert(this->isRailNet());
- const int masks[4] = { 1, 5, 3, 1 };
- const int mask = masks[ (m_cur_Q << 1) | m_new_Q ];
+ static const unsigned masks[4] =
+ {
+ 0,
+ core_terminal_t::STATE_INP_LH | core_terminal_t::STATE_INP_ACTIVE,
+ core_terminal_t::STATE_INP_HL | core_terminal_t::STATE_INP_ACTIVE,
+ 0
+ };
+
+ const unsigned mask = masks[ m_cur_Q * 2 + m_new_Q ];
m_in_queue = 2; /* mark as taken ... */
m_cur_Q = m_new_Q;
-#if 1
- for (core_terminal_t *p = m_list_active.first(); p != nullptr; p = p->next())
+ for (auto & p : m_list_active)
{
- inc_stat(p->device().stat_call_count);
- if ((p->state() & mask) != 0)
- p->device().update_dev();
+ inc_stat(p.device().stat_call_count);
+ if ((p.state() & mask) != 0)
+ p.device().update_dev();
}
-#else
- for (auto p = &m_list_active.m_head; *p != nullptr; )
- {
- auto pn = &((*p)->m_next);
- inc_stat(p->device().stat_call_count);
- if (((*p)->state() & mask) != 0)
- (*p)->device().update_dev();
- p = pn;
- }
-
-#endif
}
-ATTR_COLD void net_t::reset()
+void net_t::reset()
{
- m_time = netlist_time::zero;
+ m_time = netlist_time::zero();
m_active = 0;
m_in_queue = 2;
@@ -706,17 +695,17 @@ ATTR_COLD void net_t::reset()
m_list_active.clear();
for (core_terminal_t *ct : m_core_terms)
- m_list_active.add(*ct);
+ m_list_active.push_back(ct);
for (core_terminal_t *ct : m_core_terms)
- ct->do_reset();
+ ct->reset();
for (core_terminal_t *ct : m_core_terms)
if (ct->state() != logic_t::STATE_INP_PASSIVE)
m_active++;
}
-ATTR_COLD void net_t::register_con(core_terminal_t &terminal)
+void net_t::register_con(core_terminal_t &terminal)
{
terminal.set_net(this);
@@ -726,7 +715,7 @@ ATTR_COLD void net_t::register_con(core_terminal_t &terminal)
m_active++;
}
-ATTR_COLD void net_t::move_connections(net_t *dest_net)
+void net_t::move_connections(net_t *dest_net)
{
for (core_terminal_t *ct : m_core_terms)
dest_net->register_con(*ct);
@@ -734,7 +723,7 @@ ATTR_COLD void net_t::move_connections(net_t *dest_net)
m_active = 0;
}
-ATTR_COLD void net_t::merge_net(net_t *othernet)
+void net_t::merge_net(net_t *othernet)
{
netlist().log().debug("merging nets ...\n");
if (othernet == nullptr)
@@ -765,33 +754,23 @@ ATTR_COLD void net_t::merge_net(net_t *othernet)
// logic_net_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD logic_net_t::logic_net_t(netlist_t &nl, const pstring &aname, core_terminal_t *mr)
+logic_net_t::logic_net_t(netlist_t &nl, const pstring &aname, core_terminal_t *mr)
: net_t(nl, aname, mr)
{
}
-ATTR_COLD void logic_net_t::reset()
-{
- net_t::reset();
-}
-
// ----------------------------------------------------------------------------------------
// analog_net_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD analog_net_t::analog_net_t(netlist_t &nl, const pstring &aname, core_terminal_t *mr)
+analog_net_t::analog_net_t(netlist_t &nl, const pstring &aname, core_terminal_t *mr)
: net_t(nl, aname, mr)
, m_solver(nullptr)
{
}
-ATTR_COLD void analog_net_t::reset()
-{
- net_t::reset();
-}
-
-ATTR_COLD bool analog_net_t::already_processed(plib::pvector_t<list_t> &groups)
+bool analog_net_t::already_processed(plib::pvector_t<list_t> &groups)
{
if (isRailNet())
return true;
@@ -803,7 +782,7 @@ ATTR_COLD bool analog_net_t::already_processed(plib::pvector_t<list_t> &groups)
return false;
}
-ATTR_COLD void analog_net_t::process_net(plib::pvector_t<list_t> &groups)
+void analog_net_t::process_net(plib::pvector_t<list_t> &groups)
{
if (num_cons() == 0)
return;
@@ -811,7 +790,7 @@ ATTR_COLD void analog_net_t::process_net(plib::pvector_t<list_t> &groups)
groups.back().push_back(this);
for (core_terminal_t *p : m_core_terms)
{
- if (p->isType(terminal_t::TERMINAL))
+ if (p->is_type(terminal_t::TERMINAL))
{
terminal_t *pt = static_cast<terminal_t *>(p);
analog_net_t *other_net = &pt->m_otherterm->net();
@@ -826,21 +805,29 @@ ATTR_COLD void analog_net_t::process_net(plib::pvector_t<list_t> &groups)
// core_terminal_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD core_terminal_t::core_terminal_t(core_device_t &dev, const pstring &aname, const type_t atype)
+core_terminal_t::core_terminal_t(core_device_t &dev, const pstring &aname, const type_t atype)
: device_object_t(dev, dev.name() + "." + aname, atype)
-, plinkedlist_element_t()
+, plib::linkedlist_t<core_terminal_t>::element_t()
, m_net(nullptr)
, m_state(STATE_NONEX)
{
save(NLNAME(m_state));
}
-ATTR_COLD void core_terminal_t::set_net(net_t::ptr_t anet)
+void core_terminal_t::reset()
+{
+ if (is_type(OUTPUT))
+ set_state(STATE_OUT);
+ else
+ set_state(STATE_INP_ACTIVE);
+}
+
+void core_terminal_t::set_net(net_t::ptr_t anet)
{
m_net = anet;
}
-ATTR_COLD void core_terminal_t::clear_net()
+ void core_terminal_t::clear_net()
{
m_net = nullptr;
}
@@ -850,43 +837,34 @@ ATTR_COLD void core_terminal_t::clear_net()
// terminal_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD terminal_t::terminal_t(core_device_t &dev, const pstring &aname)
+terminal_t::terminal_t(core_device_t &dev, const pstring &aname)
: analog_t(dev, aname, TERMINAL)
, m_otherterm(nullptr)
, m_Idr1(nullptr)
, m_go1(nullptr)
, m_gt1(nullptr)
{
- netlist().setup().register_object(*this);
+ netlist().setup().register_term(*this);
save(NLNAME(m_Idr1));
save(NLNAME(m_go1));
save(NLNAME(m_gt1));
}
-ATTR_HOT void terminal_t::schedule_solve()
+void terminal_t::schedule_solve()
{
// FIXME: Remove this after we found a way to remove *ALL* twoterms connected to railnets only.
if (net().solver() != nullptr)
net().solver()->update_forced();
}
-ATTR_HOT void terminal_t::schedule_after(const netlist_time &after)
+void terminal_t::schedule_after(const netlist_time &after)
{
// FIXME: Remove this after we found a way to remove *ALL* twoterms connected to railnets only.
if (net().solver() != nullptr)
net().solver()->update_after(after);
}
-ATTR_COLD void terminal_t::reset()
-{
- set_state(STATE_INP_ACTIVE);
- set_ptr(m_Idr1, 0.0);
- set_ptr(m_go1, netlist().gmin());
- set_ptr(m_gt1, netlist().gmin());
-}
-
-
// ----------------------------------------------------------------------------------------
// net_input_t
// ----------------------------------------------------------------------------------------
@@ -899,48 +877,48 @@ ATTR_COLD void terminal_t::reset()
// logic_output_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD logic_output_t::logic_output_t(core_device_t &dev, const pstring &aname)
+logic_output_t::logic_output_t(core_device_t &dev, const pstring &aname)
: logic_t(dev, aname, OUTPUT)
, m_my_net(dev.netlist(), name() + ".net", this)
{
set_state(STATE_OUT);
this->set_net(&m_my_net);
set_logic_family(dev.logic_family());
- netlist().setup().register_object(*this);
+ netlist().setup().register_term(*this);
}
-ATTR_COLD void logic_output_t::initial(const netlist_sig_t val)
+void logic_output_t::initial(const netlist_sig_t val)
{
- net().as_logic().initial(val);
+ net().initial(val);
}
// ----------------------------------------------------------------------------------------
// analog_input_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD analog_input_t::analog_input_t(core_device_t &dev, const pstring &aname)
+analog_input_t::analog_input_t(core_device_t &dev, const pstring &aname)
: analog_t(dev, aname, INPUT)
{
set_state(STATE_INP_ACTIVE);
- netlist().setup().register_object(*this);
+ netlist().setup().register_term(*this);
}
// ----------------------------------------------------------------------------------------
// analog_output_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD analog_output_t::analog_output_t(core_device_t &dev, const pstring &aname)
- : analog_t(dev, aname, OUTPUT), m_proxied_net(nullptr)
+analog_output_t::analog_output_t(core_device_t &dev, const pstring &aname)
+ : analog_t(dev, aname, OUTPUT)
, m_my_net(dev.netlist(), name() + ".net", this)
{
this->set_net(&m_my_net);
set_state(STATE_OUT);
net().m_cur_Analog = NL_FCONST(0.0);
- netlist().setup().register_object(*this);
+ netlist().setup().register_term(*this);
}
-ATTR_COLD void analog_output_t::initial(const nl_double val)
+void analog_output_t::initial(const nl_double val)
{
net().m_cur_Analog = val;
}
@@ -949,25 +927,25 @@ ATTR_COLD void analog_output_t::initial(const nl_double val)
// logic_input_t
// -----------------------------------------------------------------------------
-ATTR_COLD logic_input_t::logic_input_t(core_device_t &dev, const pstring &aname)
+logic_input_t::logic_input_t(core_device_t &dev, const pstring &aname)
: logic_t(dev, aname, INPUT)
{
set_state(STATE_INP_ACTIVE);
set_logic_family(dev.logic_family());
- netlist().setup().register_object(*this);
+ netlist().setup().register_term(*this);
}
// ----------------------------------------------------------------------------------------
// param_t & friends
// ----------------------------------------------------------------------------------------
-ATTR_COLD param_t::param_t(const param_type_t atype, device_t &device, const pstring &name)
+param_t::param_t(const param_type_t atype, device_t &device, const pstring &name)
: device_object_t(device, name, PARAM)
, m_param_type(atype)
{
}
-ATTR_COLD const pstring param_model_t::model_type()
+const pstring param_model_t::model_type()
{
if (m_map.size() == 0)
netlist().setup().model_parse(this->Value(), m_map);
@@ -975,14 +953,14 @@ ATTR_COLD const pstring param_model_t::model_type()
}
-ATTR_COLD const pstring param_model_t::model_value_str(const pstring &entity)
+const pstring param_model_t::model_value_str(const pstring &entity)
{
if (m_map.size() == 0)
netlist().setup().model_parse(this->Value(), m_map);
return netlist().setup().model_value_str(m_map, entity);
}
-ATTR_COLD nl_double param_model_t::model_value(const pstring &entity)
+nl_double param_model_t::model_value(const pstring &entity)
{
if (m_map.size() == 0)
netlist().setup().model_parse(this->Value(), m_map);
@@ -1000,7 +978,7 @@ namespace netlist
// mainclock
// ----------------------------------------------------------------------------------------
- ATTR_HOT /* inline */ void NETLIB_NAME(mainclock)::mc_update(logic_net_t &net)
+ void NETLIB_NAME(mainclock)::mc_update(logic_net_t &net)
{
net.toggle_new_Q();
net.update_devs();