summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author couriersud <couriersud@arcor.de>2016-05-21 12:58:12 +0200
committer couriersud <couriersud@arcor.de>2016-05-21 13:31:18 +0200
commitee5b02ebfbfdc8ccaadaff0f69c33e9a8364ebcb (patch)
tree6e7059f551f19f1420e6f7080e4968f0593fc1d0 /src
parentfdf63818ded94b364616feb528031dd5423d8282 (diff)
Added == operator to netlist_time
Diffstat (limited to 'src')
-rw-r--r--src/lib/netlist/devices/nld_system.cpp8
-rw-r--r--src/lib/netlist/nl_time.h6
2 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/netlist/devices/nld_system.cpp b/src/lib/netlist/devices/nld_system.cpp
index 430446cbf50..bde6c43206e 100644
--- a/src/lib/netlist/devices/nld_system.cpp
+++ b/src/lib/netlist/devices/nld_system.cpp
@@ -43,7 +43,8 @@ NETLIB_RESET(extclock)
NETLIB_UPDATE(extclock)
{
- if (m_cnt != 0)
+#if 0
+ if (m_off == netlist_time::zero)
{
OUTLOGIC(m_Q, (m_cnt & 1) ^ 1, m_inc[m_cnt]);
m_cnt = (m_cnt + 1) % m_size;
@@ -54,6 +55,11 @@ NETLIB_UPDATE(extclock)
m_cnt = 1;
m_off = netlist_time::zero;
}
+#else
+ OUTLOGIC(m_Q, (m_cnt & 1) ^ 1, m_inc[m_cnt] + m_off);
+ m_cnt = (m_cnt + 1) % m_size;
+ m_off = netlist_time::zero;
+#endif
}
// ----------------------------------------------------------------------------------------
diff --git a/src/lib/netlist/nl_time.h b/src/lib/netlist/nl_time.h
index d6d886e98f6..fed3bc48cb1 100644
--- a/src/lib/netlist/nl_time.h
+++ b/src/lib/netlist/nl_time.h
@@ -56,6 +56,7 @@ namespace netlist
ATTR_HOT friend bool operator>=(const netlist_time &left, const netlist_time &right);
ATTR_HOT friend bool operator<=(const netlist_time &left, const netlist_time &right);
ATTR_HOT friend bool operator!=(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend bool operator==(const netlist_time &left, const netlist_time &right);
ATTR_HOT const netlist_time &operator=(const netlist_time &right) { m_time = right.m_time; return *this; }
@@ -129,6 +130,11 @@ namespace netlist
return (left.m_time != right.m_time);
}
+ ATTR_HOT inline bool operator==(const netlist_time &left, const netlist_time &right)
+ {
+ return (left.m_time == right.m_time);
+ }
+
}
template<> ATTR_COLD inline void pstate_manager_t::save_item(netlist::netlist_time &nlt, const void *owner, const pstring &stname)