MessageBuffer.cc (10301:44839e8febbd) MessageBuffer.cc (10348:c91b23c72d5e)
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;

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

25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <cassert>
30
31#include "base/cprintf.hh"
32#include "base/misc.hh"
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;

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

25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <cassert>
30
31#include "base/cprintf.hh"
32#include "base/misc.hh"
33#include "base/random.hh"
33#include "base/stl_helpers.hh"
34#include "debug/RubyQueue.hh"
35#include "mem/ruby/network/MessageBuffer.hh"
36#include "mem/ruby/system/System.hh"
37
38using namespace std;
39using m5::stl_helpers::operator<<;
40

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

128 return msg_ptr;
129}
130
131// FIXME - move me somewhere else
132Cycles
133random_time()
134{
135 Cycles time(1);
34#include "base/stl_helpers.hh"
35#include "debug/RubyQueue.hh"
36#include "mem/ruby/network/MessageBuffer.hh"
37#include "mem/ruby/system/System.hh"
38
39using namespace std;
40using m5::stl_helpers::operator<<;
41

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

129 return msg_ptr;
130}
131
132// FIXME - move me somewhere else
133Cycles
134random_time()
135{
136 Cycles time(1);
136 time += Cycles(random() & 0x3); // [0...3]
137 if ((random() & 0x7) == 0) { // 1 in 8 chance
138 time += Cycles(100 + (random() % 0xf)); // 100 + [1...15]
137 time += Cycles(random_mt.random(0, 3)); // [0...3]
138 if (random_mt.random(0, 7) == 0) { // 1 in 8 chance
139 time += Cycles(100 + random_mt.random(1, 15)); // 100 + [1...15]
139 }
140 return time;
141}
142
143void
144MessageBuffer::enqueue(MsgPtr message, Cycles delta)
145{
146 m_msg_counter++;

--- 276 unchanged lines hidden ---
140 }
141 return time;
142}
143
144void
145MessageBuffer::enqueue(MsgPtr message, Cycles delta)
146{
147 m_msg_counter++;

--- 276 unchanged lines hidden ---