Message.hh (10893:f567e80c0714) | Message.hh (10895:287285860dd6) |
---|---|
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; --- 20 unchanged lines hidden (view full) --- 29#ifndef __MEM_RUBY_SLICC_INTERFACE_MESSAGE_HH__ 30#define __MEM_RUBY_SLICC_INTERFACE_MESSAGE_HH__ 31 32#include <iostream> 33#include <memory> 34#include <stack> 35 36#include "mem/packet.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; --- 20 unchanged lines hidden (view full) --- 29#ifndef __MEM_RUBY_SLICC_INTERFACE_MESSAGE_HH__ 30#define __MEM_RUBY_SLICC_INTERFACE_MESSAGE_HH__ 31 32#include <iostream> 33#include <memory> 34#include <stack> 35 36#include "mem/packet.hh" |
37#include "mem/protocol/MessageSizeType.hh" 38#include "mem/ruby/common/NetDest.hh" |
|
37 38class Message; 39typedef std::shared_ptr<Message> MsgPtr; 40 41class Message 42{ 43 public: 44 Message(Tick curTime) --- 8 unchanged lines hidden (view full) --- 53 m_DelayedTicks(other.m_DelayedTicks), 54 m_msg_counter(other.m_msg_counter) 55 { } 56 57 virtual ~Message() { } 58 59 virtual MsgPtr clone() const = 0; 60 virtual void print(std::ostream& out) const = 0; | 39 40class Message; 41typedef std::shared_ptr<Message> MsgPtr; 42 43class Message 44{ 45 public: 46 Message(Tick curTime) --- 8 unchanged lines hidden (view full) --- 55 m_DelayedTicks(other.m_DelayedTicks), 56 m_msg_counter(other.m_msg_counter) 57 { } 58 59 virtual ~Message() { } 60 61 virtual MsgPtr clone() const = 0; 62 virtual void print(std::ostream& out) const = 0; |
61 virtual void setIncomingLink(int) {} 62 virtual void setVnet(int) {} | |
63 | 63 |
64 virtual const MessageSizeType& getMessageSize() const 65 { panic("MessageSizeType() called on wrong message!"); } 66 virtual MessageSizeType& getMessageSize() 67 { panic("MessageSizeType() called on wrong message!"); } 68 |
|
64 /** 65 * The two functions below are used for reading / writing the message 66 * functionally. The methods return true if the address in the packet 67 * matches the address / address range in the message. Each message 68 * class that can be potentially searched for the address needs to 69 * implement these methods. 70 */ 71 virtual bool functionalRead(Packet *pkt) = 0; --- 10 unchanged lines hidden (view full) --- 82 83 void setLastEnqueueTime(const Tick& time) { m_LastEnqueueTime = time; } 84 const Tick getLastEnqueueTime() const {return m_LastEnqueueTime;} 85 86 const Tick& getTime() const { return m_time; } 87 void setMsgCounter(uint64_t c) { m_msg_counter = c; } 88 uint64_t getMsgCounter() const { return m_msg_counter; } 89 | 69 /** 70 * The two functions below are used for reading / writing the message 71 * functionally. The methods return true if the address in the packet 72 * matches the address / address range in the message. Each message 73 * class that can be potentially searched for the address needs to 74 * implement these methods. 75 */ 76 virtual bool functionalRead(Packet *pkt) = 0; --- 10 unchanged lines hidden (view full) --- 87 88 void setLastEnqueueTime(const Tick& time) { m_LastEnqueueTime = time; } 89 const Tick getLastEnqueueTime() const {return m_LastEnqueueTime;} 90 91 const Tick& getTime() const { return m_time; } 92 void setMsgCounter(uint64_t c) { m_msg_counter = c; } 93 uint64_t getMsgCounter() const { return m_msg_counter; } 94 |
95 // Functions related to network traversal 96 virtual const NetDest& getDestination() const 97 { panic("getDestination() called on wrong message!"); } 98 virtual NetDest& getDestination() 99 { panic("getDestination() called on wrong message!"); } 100 101 int getIncomingLink() const { return incoming_link; } 102 void setIncomingLink(int link) { incoming_link = link; } 103 int getVnet() const { return vnet; } 104 void setVnet(int net) { vnet = net; } 105 |
|
90 private: 91 const Tick m_time; 92 Tick m_LastEnqueueTime; // my last enqueue time 93 Tick m_DelayedTicks; // my delayed cycles 94 uint64_t m_msg_counter; // FIXME, should this be a 64-bit value? | 106 private: 107 const Tick m_time; 108 Tick m_LastEnqueueTime; // my last enqueue time 109 Tick m_DelayedTicks; // my delayed cycles 110 uint64_t m_msg_counter; // FIXME, should this be a 64-bit value? |
111 112 // Variables for required network traversal 113 int incoming_link; 114 int vnet; |
|
95}; 96 97inline bool 98operator>(const MsgPtr &lhs, const MsgPtr &rhs) 99{ 100 const Message *l = lhs.get(); 101 const Message *r = rhs.get(); 102 --- 16 unchanged lines hidden --- | 115}; 116 117inline bool 118operator>(const MsgPtr &lhs, const MsgPtr &rhs) 119{ 120 const Message *l = lhs.get(); 121 const Message *r = rhs.get(); 122 --- 16 unchanged lines hidden --- |