MessageBuffer.hh (11779:25dd0fd23474) MessageBuffer.hh (11796:315e133f45df)
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;

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

95 const Message* peek() const;
96
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.
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;

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

95 const Message* peek() const;
96
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);
103 Tick dequeue(Tick current_time, bool decrement_messages = true);
104
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

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

184 // slots available
185 uint64_t m_msg_counter;
186 int m_priority_rank;
187 const bool m_strict_fifo;
188 const bool m_randomization;
189
190 int m_input_link_id;
191 int m_vnet_id;
104
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

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

184 // slots available
185 uint64_t m_msg_counter;
186 int m_priority_rank;
187 const bool m_strict_fifo;
188 const bool m_randomization;
189
190 int m_input_link_id;
191 int m_vnet_id;
192
193 Stats::Average m_buf_msgs;
194 Stats::Average m_stall_time;
195 Stats::Scalar m_stall_count;
196 Stats::Formula m_occupancy;
192};
193
194Tick random_time();
195
196inline std::ostream&
197operator<<(std::ostream& out, const MessageBuffer& obj)
198{
199 obj.print(out);
200 out << std::flush;
201 return out;
202}
203
204#endif // __MEM_RUBY_BUFFERS_MESSAGEBUFFER_HH__
197};
198
199Tick random_time();
200
201inline std::ostream&
202operator<<(std::ostream& out, const MessageBuffer& obj)
203{
204 obj.print(out);
205 out << std::flush;
206 return out;
207}
208
209#endif // __MEM_RUBY_BUFFERS_MESSAGEBUFFER_HH__