summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/devices/nld_system.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/netlist/devices/nld_system.cpp')
-rw-r--r--src/lib/netlist/devices/nld_system.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/netlist/devices/nld_system.cpp b/src/lib/netlist/devices/nld_system.cpp
index b692b60506a..e3369e514e5 100644
--- a/src/lib/netlist/devices/nld_system.cpp
+++ b/src/lib/netlist/devices/nld_system.cpp
@@ -24,12 +24,12 @@ namespace netlist
NETLIB_UPDATE_PARAM(clock)
{
- m_inc = netlist_time::from_hz(m_freq.Value()*2);
+ m_inc = netlist_time::from_double(1.0 / (m_freq() * 2.0));
}
NETLIB_UPDATE(clock)
{
- OUTLOGIC(m_Q, !INPLOGIC(m_feedback), m_inc );
+ m_Q.push(!m_feedback(), m_inc);
}
// ----------------------------------------------------------------------------------------
@@ -39,13 +39,13 @@ namespace netlist
NETLIB_RESET(extclock)
{
m_cnt = 0;
- m_off = netlist_time::from_double(m_offset.Value());
+ m_off = netlist_time::from_double(m_offset());
//m_Q.initial(0);
}
NETLIB_UPDATE(extclock)
{
- OUTLOGIC(m_Q, (m_cnt & 1) ^ 1, m_inc[m_cnt] + m_off);
+ m_Q.push((m_cnt & 1) ^ 1, m_inc[m_cnt] + m_off);
m_cnt = (m_cnt + 1) % m_size;
m_off = netlist_time::zero();
}
@@ -61,7 +61,7 @@ namespace netlist
NETLIB_UPDATE(logic_input)
{
- OUTLOGIC(m_Q, m_IN.Value() & 1, netlist_time::from_nsec(1));
+ m_Q.push(m_IN() & 1, netlist_time::from_nsec(1));
}
NETLIB_UPDATE_PARAM(logic_input)
@@ -79,7 +79,7 @@ namespace netlist
NETLIB_UPDATE(analog_input)
{
- OUTANALOG(m_Q, m_IN.Value());
+ m_Q.push(m_IN());
}
NETLIB_UPDATE_PARAM(analog_input)
@@ -101,7 +101,7 @@ namespace netlist
NETLIB_UPDATE(d_to_a_proxy)
{
- const int state = INPLOGIC(m_I);
+ const int state = static_cast<int>(m_I());
if (state != m_last_state)
{
m_last_state = state;
@@ -126,11 +126,11 @@ namespace netlist
NETLIB_UPDATE(res_sw)
{
- const int state = INPLOGIC(m_I);
+ const netlist_sig_t state = m_I();
if (state != m_last_state)
{
m_last_state = state;
- const nl_double R = state ? m_RON.Value() : m_ROFF.Value();
+ const nl_double R = state ? m_RON() : m_ROFF();
// We only need to update the net first if this is a time stepping net
if ((0)) // m_R->m_P.net().as_analog().solver()->is_timestep())
@@ -163,8 +163,8 @@ namespace netlist
//OUTANALOG(m_Q, val);
nl_double stack[20];
unsigned ptr = 0;
- unsigned e = m_precompiled.size();
- for (unsigned i = 0; i<e; i++)
+ std::size_t e = m_precompiled.size();
+ for (std::size_t i = 0; i<e; i++)
{
rpn_inst &rc = m_precompiled[i];
switch (rc.m_cmd)
@@ -186,14 +186,14 @@ namespace netlist
stack[ptr-1] = stack[ptr-1] / stack[ptr];
break;
case PUSH_INPUT:
- stack[ptr++] = INPANALOG((*m_I[(int) rc.m_param]));
+ stack[ptr++] = (*m_I[static_cast<unsigned>(rc.m_param)])();
break;
case PUSH_CONST:
stack[ptr++] = rc.m_param;
break;
}
}
- OUTANALOG(m_Q, stack[ptr-1]);
+ m_Q.push(stack[ptr-1]);
}