summaryrefslogtreecommitdiff
path: root/src/mem/ruby/buffers
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-04-12 08:35:49 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-04-12 08:35:49 -0400
commitc9634d9b38e5d58a8b68af5f26c257886d791518 (patch)
treec3687d14ad34bfc6bbb21999f7c85921dd26bd31 /src/mem/ruby/buffers
parent15ca4f2fc7c81bb3ade68cbff7d58bd01aa00d33 (diff)
downloadgem5-c9634d9b38e5d58a8b68af5f26c257886d791518.tar.xz
Ruby: Ensure order-dependent iteration uses an ordered map
This patch fixes a bug in Ruby that caused non-deterministic simulation when changing the underlying hash map implementation. The reason is order-dependent behaviour in combination with iteration over the hash map contents. The two locations where a sorted container is assumed are now changed to make use of a std::map instead of the unordered hash map. With this change, the stats changes slightly and the follow-on changeset will update the relevant statistics.
Diffstat (limited to 'src/mem/ruby/buffers')
-rw-r--r--src/mem/ruby/buffers/MessageBuffer.hh4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mem/ruby/buffers/MessageBuffer.hh b/src/mem/ruby/buffers/MessageBuffer.hh
index dc9fb1a9e..0000aef16 100644
--- a/src/mem/ruby/buffers/MessageBuffer.hh
+++ b/src/mem/ruby/buffers/MessageBuffer.hh
@@ -162,7 +162,9 @@ class MessageBuffer
Consumer* m_consumer_ptr; // Consumer to signal a wakeup(), can be NULL
std::vector<MessageBufferNode> m_prio_heap;
- typedef m5::hash_map< Address, std::list<MsgPtr> > StallMsgMapType;
+ // use a std::map for the stalled messages as this container is
+ // sorted and ensures a well-defined iteration order
+ typedef std::map< Address, std::list<MsgPtr> > StallMsgMapType;
typedef std::vector<MsgPtr>::iterator MsgListIter;
StallMsgMapType m_stall_msg_map;