diff options
Diffstat (limited to 'src/mem/ruby/system/MemoryNode.hh')
-rw-r--r-- | src/mem/ruby/system/MemoryNode.hh | 99 |
1 files changed, 45 insertions, 54 deletions
diff --git a/src/mem/ruby/system/MemoryNode.hh b/src/mem/ruby/system/MemoryNode.hh index 2c2b987ae..10648b715 100644 --- a/src/mem/ruby/system/MemoryNode.hh +++ b/src/mem/ruby/system/MemoryNode.hh @@ -35,68 +35,59 @@ * message is enqueued to be sent back to the directory. */ -#ifndef MEMORYNODE_H -#define MEMORYNODE_H +#ifndef __MEM_RUBY_SYSTEM_MEMORYNODE_HH__ +#define __MEM_RUBY_SYSTEM_MEMORYNODE_HH__ #include <iostream> +#include "mem/protocol/MemoryRequestType.hh" #include "mem/ruby/common/Global.hh" #include "mem/ruby/slicc_interface/Message.hh" -#include "mem/protocol/MemoryRequestType.hh" - -class MemoryNode { - -public: - // Constructors - -// old one: - MemoryNode(const Time& time, int counter, const MsgPtr& msgptr, const physical_address_t addr, const bool is_mem_read) { - m_time = time; - m_msg_counter = counter; - m_msgptr = msgptr; - m_addr = addr; - m_is_mem_read = is_mem_read; - m_is_dirty_wb = !is_mem_read; - } - -// new one: - MemoryNode(const Time& time, const MsgPtr& msgptr, const physical_address_t addr, const bool is_mem_read, const bool is_dirty_wb) { - m_time = time; - m_msg_counter = 0; - m_msgptr = msgptr; - m_addr = addr; - m_is_mem_read = is_mem_read; - m_is_dirty_wb = is_dirty_wb; - } - // Destructor - ~MemoryNode() {}; - - // Public Methods - void print(std::ostream& out) const; - - // Data Members (m_ prefix) (all public -- this is really more a struct) - - Time m_time; - int m_msg_counter; - MsgPtr m_msgptr; - physical_address_t m_addr; - bool m_is_mem_read; - bool m_is_dirty_wb; +class MemoryNode +{ + public: + // old constructor + MemoryNode(const Time& time, int counter, const MsgPtr& msgptr, + const physical_address_t addr, const bool is_mem_read) + { + m_time = time; + m_msg_counter = counter; + m_msgptr = msgptr; + m_addr = addr; + m_is_mem_read = is_mem_read; + m_is_dirty_wb = !is_mem_read; + } + + // new constructor + MemoryNode(const Time& time, const MsgPtr& msgptr, + const physical_address_t addr, const bool is_mem_read, + const bool is_dirty_wb) + { + m_time = time; + m_msg_counter = 0; + m_msgptr = msgptr; + m_addr = addr; + m_is_mem_read = is_mem_read; + m_is_dirty_wb = is_dirty_wb; + } + + void print(std::ostream& out) const; + + Time m_time; + int m_msg_counter; + MsgPtr m_msgptr; + physical_address_t m_addr; + bool m_is_mem_read; + bool m_is_dirty_wb; }; -// Output operator declaration -std::ostream& operator<<(std::ostream& out, const MemoryNode& obj); - -// ******************* Definitions ******************* - -// Output operator definition -extern inline -std::ostream& operator<<(std::ostream& out, const MemoryNode& obj) +inline std::ostream& +operator<<(std::ostream& out, const MemoryNode& obj) { - obj.print(out); - out << std::flush; - return out; + obj.print(out); + out << std::flush; + return out; } -#endif //MEMORYNODE_H +#endif // __MEM_RUBY_SYSTEM_MEMORYNODE_HH__ |