WireBuffer.hh (10441:5377550e1e15) WireBuffer.hh (10893:f567e80c0714)
1/*
2 * Copyright (c) 2010 Advanced Micro Devices, Inc.
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;

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

32#ifndef __MEM_RUBY_STRUCTURES_WIREBUFFER_HH__
33#define __MEM_RUBY_STRUCTURES_WIREBUFFER_HH__
34
35#include <iostream>
36#include <string>
37#include <vector>
38
39#include "mem/ruby/common/Consumer.hh"
1/*
2 * Copyright (c) 2010 Advanced Micro Devices, Inc.
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;

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

32#ifndef __MEM_RUBY_STRUCTURES_WIREBUFFER_HH__
33#define __MEM_RUBY_STRUCTURES_WIREBUFFER_HH__
34
35#include <iostream>
36#include <string>
37#include <vector>
38
39#include "mem/ruby/common/Consumer.hh"
40#include "mem/ruby/network/MessageBufferNode.hh"
40#include "mem/ruby/slicc_interface/Message.hh"
41#include "params/RubyWireBuffer.hh"
42#include "sim/sim_object.hh"
43
44//////////////////////////////////////////////////////////////////////////////
45// This object was written to literally mimic a Wire in Ruby, in the sense
46// that there is no way for messages to get reordered en route on the WireBuffer.
47// With Message Buffers, even if randomization is off and ordered is on,
48// messages can arrive in different orders than they were sent because of

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

70 }
71 Consumer* getConsumer() { return m_consumer_ptr; };
72 void setDescription(const std::string& name) { m_description = name; };
73 std::string getDescription() { return m_description; };
74
75 void enqueue(MsgPtr message, Cycles latency);
76 void dequeue();
77 const Message* peek();
41#include "params/RubyWireBuffer.hh"
42#include "sim/sim_object.hh"
43
44//////////////////////////////////////////////////////////////////////////////
45// This object was written to literally mimic a Wire in Ruby, in the sense
46// that there is no way for messages to get reordered en route on the WireBuffer.
47// With Message Buffers, even if randomization is off and ordered is on,
48// messages can arrive in different orders than they were sent because of

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

70 }
71 Consumer* getConsumer() { return m_consumer_ptr; };
72 void setDescription(const std::string& name) { m_description = name; };
73 std::string getDescription() { return m_description; };
74
75 void enqueue(MsgPtr message, Cycles latency);
76 void dequeue();
77 const Message* peek();
78 MessageBufferNode peekNode();
79 void recycle();
80 bool isReady();
81 bool areNSlotsAvailable(int n) { return true; }; // infinite queue length
82
83 void print(std::ostream& out) const;
84 uint64_t m_msg_counter;
85
86 private:
87 // Private copy constructor and assignment operator
88 WireBuffer (const WireBuffer& obj);
89 WireBuffer& operator=(const WireBuffer& obj);
90
91 // data members
92 Consumer* m_consumer_ptr; // Consumer to signal a wakeup()
93 std::string m_description;
94
95 // queues where memory requests live
78 void recycle();
79 bool isReady();
80 bool areNSlotsAvailable(int n) { return true; }; // infinite queue length
81
82 void print(std::ostream& out) const;
83 uint64_t m_msg_counter;
84
85 private:
86 // Private copy constructor and assignment operator
87 WireBuffer (const WireBuffer& obj);
88 WireBuffer& operator=(const WireBuffer& obj);
89
90 // data members
91 Consumer* m_consumer_ptr; // Consumer to signal a wakeup()
92 std::string m_description;
93
94 // queues where memory requests live
96 std::vector<MessageBufferNode> m_message_queue;
95 std::vector<MsgPtr> m_message_queue;
97
98};
99
100std::ostream& operator<<(std::ostream& out, const WireBuffer& obj);
101
102#endif // __MEM_RUBY_STRUCTURES_WireBuffer_HH__
96
97};
98
99std::ostream& operator<<(std::ostream& out, const WireBuffer& obj);
100
101#endif // __MEM_RUBY_STRUCTURES_WireBuffer_HH__