MessageBuffer.hh (11796:315e133f45df) MessageBuffer.hh (11797:f61fbb7ceb88)
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 88 unchanged lines hidden (view full) ---

97 const MsgPtr &peekMsgPtr() const { return m_prio_heap.front(); }
98
99 void enqueue(MsgPtr message, Tick curTime, Tick delta);
100
101 //! Updates the delay cycles of the message at the head of the queue,
102 //! removes it from the queue and returns its total delay.
103 Tick dequeue(Tick current_time, bool decrement_messages = true);
104
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 88 unchanged lines hidden (view full) ---

97 const MsgPtr &peekMsgPtr() const { return m_prio_heap.front(); }
98
99 void enqueue(MsgPtr message, Tick curTime, Tick delta);
100
101 //! Updates the delay cycles of the message at the head of the queue,
102 //! removes it from the queue and returns its total delay.
103 Tick dequeue(Tick current_time, bool decrement_messages = true);
104
105 void registerDequeueCallback(std::function<void()> callback);
106 void unregisterDequeueCallback();
107
105 void recycle(Tick current_time, Tick recycle_latency);
106 bool isEmpty() const { return m_prio_heap.size() == 0; }
107 bool isStallMapEmpty() { return m_stall_msg_map.size() == 0; }
108 unsigned int getStallMapSize() { return m_stall_msg_map.size(); }
109
110 unsigned int getSize(Tick curTime);
111
112 void clear();

--- 15 unchanged lines hidden (view full) ---

128 void reanalyzeList(std::list<MsgPtr> &, Tick);
129
130 private:
131 // Data Members (m_ prefix)
132 //! Consumer to signal a wakeup(), can be NULL
133 Consumer* m_consumer;
134 std::vector<MsgPtr> m_prio_heap;
135
108 void recycle(Tick current_time, Tick recycle_latency);
109 bool isEmpty() const { return m_prio_heap.size() == 0; }
110 bool isStallMapEmpty() { return m_stall_msg_map.size() == 0; }
111 unsigned int getStallMapSize() { return m_stall_msg_map.size(); }
112
113 unsigned int getSize(Tick curTime);
114
115 void clear();

--- 15 unchanged lines hidden (view full) ---

131 void reanalyzeList(std::list<MsgPtr> &, Tick);
132
133 private:
134 // Data Members (m_ prefix)
135 //! Consumer to signal a wakeup(), can be NULL
136 Consumer* m_consumer;
137 std::vector<MsgPtr> m_prio_heap;
138
139 std::function<void()> m_dequeue_callback;
140
136 // use a std::map for the stalled messages as this container is
137 // sorted and ensures a well-defined iteration order
138 typedef std::map<Addr, std::list<MsgPtr> > StallMsgMapType;
139
140 /**
141 * A map from line addresses to lists of stalled messages for that line.
142 * If this buffer allows the receiver to stall messages, on a stall
143 * request, the stalled message is removed from the m_prio_heap and placed

--- 66 unchanged lines hidden ---
141 // use a std::map for the stalled messages as this container is
142 // sorted and ensures a well-defined iteration order
143 typedef std::map<Addr, std::list<MsgPtr> > StallMsgMapType;
144
145 /**
146 * A map from line addresses to lists of stalled messages for that line.
147 * If this buffer allows the receiver to stall messages, on a stall
148 * request, the stalled message is removed from the m_prio_heap and placed

--- 66 unchanged lines hidden ---