Added == operator to netlist_time

This commit is contained in:
couriersud 2016-05-21 12:58:12 +02:00
parent fdf63818de
commit ee5b02ebfb
2 changed files with 13 additions and 1 deletions

View File

@ -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
}
// ----------------------------------------------------------------------------------------

View File

@ -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)