More simplification.

This commit is contained in:
couriersud 2016-06-03 00:00:56 +02:00
parent 96be861b16
commit 61110b72c1
3 changed files with 6 additions and 27 deletions

View File

@ -19,7 +19,7 @@ namespace netlist
{ {
#if (NL_USE_MEMPOOL) #if (NL_USE_MEMPOOL)
static plib::pmempool p(65536, 16); static plib::mempool p(65536, 8);
void * object_t::operator new (size_t size) void * object_t::operator new (size_t size)
{ {
@ -146,7 +146,7 @@ void queue_t::on_post_load()
net_t *n = netlist().find_net(m_names[i].m_buf); net_t *n = netlist().find_net(m_names[i].m_buf);
//log().debug("Got {1} ==> {2}\n", qtemp[i].m_name, n)); //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())); //log().debug("schedule time {1} ({2})\n", n->time().as_double(), netlist_time::from_raw(m_times[i]).as_double()));
this->push({ netlist_time::from_raw(m_times[i]), n }); this->push(netlist_time::from_raw(m_times[i]), n);
} }
} }

View File

@ -1341,7 +1341,7 @@ protected:
ATTR_HOT inline void netlist_t::push_to_queue(net_t &out, const netlist_time &attime) NOEXCEPT ATTR_HOT inline void netlist_t::push_to_queue(net_t &out, const netlist_time &attime) NOEXCEPT
{ {
m_queue.push({ attime, &out }); m_queue.push(attime, &out);
} }
ATTR_HOT inline void netlist_t::remove_from_queue(net_t &out) ATTR_HOT inline void netlist_t::remove_from_queue(net_t &out)
@ -1349,30 +1349,10 @@ protected:
m_queue.remove(&out); m_queue.remove(&out);
} }
#if 1
ATTR_HOT inline void core_device_t::OUTLOGIC(logic_output_t &out, const netlist_sig_t val, const netlist_time &delay) NOEXCEPT ATTR_HOT inline void core_device_t::OUTLOGIC(logic_output_t &out, const netlist_sig_t val, const netlist_time &delay) NOEXCEPT
{ {
out.set_Q(val, delay); out.set_Q(val, delay);
} }
#else
ATTR_HOT inline void core_device_t::OUTLOGIC(logic_output_t &out, const netlist_sig_t val, const netlist_time &delay) NOEXCEPT
{
logic_net_t &net = out.m_my_net;
if (val != net.m_new_Q)
{
net.m_new_Q = val;
if (!net.is_queued() && (net.num_cons() > 0))
{
net.m_time = netlist().time() + delay;
net.m_in_queue = (net.m_active > 0); /* queued ? */
if (net.m_in_queue)
{
netlist().push_to_queue(net, net.m_time);
}
}
}
}
#endif
} }

View File

@ -46,13 +46,12 @@ namespace netlist
ATTR_HOT std::size_t capacity() const { return m_list.size(); } ATTR_HOT std::size_t capacity() const { return m_list.size(); }
ATTR_HOT bool empty() const { return (m_end == &m_list[1]); } ATTR_HOT bool empty() const { return (m_end == &m_list[1]); }
ATTR_HOT void push(const entry_t e) NOEXCEPT ATTR_HOT void push(const Time t, Element o) NOEXCEPT
{ {
#if HAS_OPENMP && USE_OPENMP #if HAS_OPENMP && USE_OPENMP
/* Lock */ /* Lock */
while (m_lock.exchange(1)) { } while (m_lock.exchange(1)) { }
#endif #endif
const Time t = e.m_exec_time;
entry_t * i = m_end++; entry_t * i = m_end++;
for (; t > (i - 1)->m_exec_time; --i) for (; t > (i - 1)->m_exec_time; --i)
{ {
@ -60,7 +59,7 @@ namespace netlist
//i--; //i--;
inc_stat(m_prof_sortmove); inc_stat(m_prof_sortmove);
} }
*i = e; *i = { t, o };
inc_stat(m_prof_call); inc_stat(m_prof_call);
#if HAS_OPENMP && USE_OPENMP #if HAS_OPENMP && USE_OPENMP
m_lock = 0; m_lock = 0;
@ -85,7 +84,7 @@ namespace netlist
while (i < m_end) while (i < m_end)
{ {
*i = *(i+1); *i = *(i+1);
i++; ++i;
} }
#if HAS_OPENMP && USE_OPENMP #if HAS_OPENMP && USE_OPENMP
m_lock = 0; m_lock = 0;