MessageBuffer.hh (11732:e15e445c21a6) MessageBuffer.hh (11779:25dd0fd23474)
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;

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

132 //! Consumer to signal a wakeup(), can be NULL
133 Consumer* m_consumer;
134 std::vector<MsgPtr> m_prio_heap;
135
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
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;

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

132 //! Consumer to signal a wakeup(), can be NULL
133 Consumer* m_consumer;
134 std::vector<MsgPtr> m_prio_heap;
135
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
144 * in the m_stall_msg_map. Messages are held there until the receiver
145 * requests they be reanalyzed, at which point they are moved back to
146 * m_prio_heap.
147 *
148 * NOTE: The stall map holds messages in the order in which they were
149 * initially received, and when a line is unblocked, the messages are
150 * moved back to the m_prio_heap in the same order. This prevents starving
151 * older requests with younger ones.
152 */
140 StallMsgMapType m_stall_msg_map;
141
153 StallMsgMapType m_stall_msg_map;
154
155 /**
156 * Current size of the stall map.
157 * Track the number of messages held in stall map lists. This is used to
158 * ensure that if the buffer is finite-sized, it blocks further requests
159 * when the m_prio_heap and m_stall_msg_map contain m_max_size messages.
160 */
161 int m_stall_map_size;
162
163 /**
164 * The maximum capacity. For finite-sized buffers, m_max_size stores a
165 * number greater than 0 to indicate the maximum allowed number of messages
166 * in the buffer at any time. To get infinitely-sized buffers, set buffer
167 * size: m_max_size = 0
168 */
142 const unsigned int m_max_size;
169 const unsigned int m_max_size;
170
143 Tick m_time_last_time_size_checked;
144 unsigned int m_size_last_time_size_checked;
145
146 // variables used so enqueues appear to happen immediately, while
147 // pop happen the next cycle
148 Tick m_time_last_time_enqueue;
149 Tick m_time_last_time_pop;
150 Tick m_last_arrival_time;

--- 26 unchanged lines hidden ---
171 Tick m_time_last_time_size_checked;
172 unsigned int m_size_last_time_size_checked;
173
174 // variables used so enqueues appear to happen immediately, while
175 // pop happen the next cycle
176 Tick m_time_last_time_enqueue;
177 Tick m_time_last_time_pop;
178 Tick m_last_arrival_time;

--- 26 unchanged lines hidden ---