From 4095af5fd600dcd497aae67ab5471de75601d052 Mon Sep 17 00:00:00 2001 From: Joel Hestness Date: Sun, 23 Sep 2012 13:57:08 -0500 Subject: RubyPort and Sequencer: Fix draining Fix the drain functionality of the RubyPort to only call drain on child ports during a system-wide drain process, instead of calling each time that a ruby_hit_callback is executed. This fixes the issue of the RubyPort ports being reawakened during the drain simulation, possibly with work they didn't previously have to complete. If they have new work, they may call process on the drain event that they had not registered work for, causing an assertion failure when completing the drain event. Also, in RubyPort, set the drainEvent to NULL when there are no events to be drained. If not set to NULL, the drain loop can result in stale drainEvents used. --- src/mem/ruby/system/Sequencer.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mem/ruby/system/Sequencer.cc') diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc index 854d360ac..9b6ef35cd 100644 --- a/src/mem/ruby/system/Sequencer.cc +++ b/src/mem/ruby/system/Sequencer.cc @@ -85,6 +85,8 @@ Sequencer::~Sequencer() void Sequencer::wakeup() { + assert(getState() != SimObject::Draining); + // Check for deadlock of any of the requests Time current_time = g_system_ptr->getTime(); @@ -207,7 +209,7 @@ Sequencer::insertRequest(PacketPtr pkt, RubyRequestType request_type) (m_writeRequestTable.size() + m_readRequestTable.size())); // See if we should schedule a deadlock check - if (deadlockCheckEvent.scheduled() == false) { + if (!deadlockCheckEvent.scheduled() && getState() != SimObject::Draining) { schedule(deadlockCheckEvent, g_system_ptr->clockPeriod() * m_deadlock_threshold + curTick()); } -- cgit v1.2.3