diff options
Diffstat (limited to 'src/mem/ruby')
-rw-r--r-- | src/mem/ruby/slicc_interface/AbstractController.cc | 7 | ||||
-rw-r--r-- | src/mem/ruby/slicc_interface/AbstractController.hh | 16 | ||||
-rw-r--r-- | src/mem/ruby/slicc_interface/Controller.py | 4 |
3 files changed, 26 insertions, 1 deletions
diff --git a/src/mem/ruby/slicc_interface/AbstractController.cc b/src/mem/ruby/slicc_interface/AbstractController.cc index 9a0ee2b2b..1615f8c1d 100644 --- a/src/mem/ruby/slicc_interface/AbstractController.cc +++ b/src/mem/ruby/slicc_interface/AbstractController.cc @@ -79,3 +79,10 @@ AbstractController::profileMsgDelay(uint32_t virtualNetwork, Cycles delay) m_delayHistogram.add(delay); m_delayVCHistogram[virtualNetwork].add(delay); } + +void +AbstractController::connectWithPeer(AbstractController *c) +{ + getQueuesFromPeer(c); + c->getQueuesFromPeer(this); +} diff --git a/src/mem/ruby/slicc_interface/AbstractController.hh b/src/mem/ruby/slicc_interface/AbstractController.hh index ba0c4b683..81ef3c52b 100644 --- a/src/mem/ruby/slicc_interface/AbstractController.hh +++ b/src/mem/ruby/slicc_interface/AbstractController.hh @@ -97,12 +97,25 @@ class AbstractController : public ClockedObject, public Consumer Histogram& getDelayVCHist(uint32_t index) { return m_delayVCHistogram[index]; } + MessageBuffer *getPeerQueue(uint32_t pid) + { + std::map<uint32_t, MessageBuffer *>::iterator it = + peerQueueMap.find(pid); + assert(it != peerQueueMap.end()); + return (*it).second; + } + protected: //! Profiles original cache requests including PUTs void profileRequest(const std::string &request); //! Profiles the delay associated with messages. void profileMsgDelay(uint32_t virtualNetwork, Cycles delay); + //! Function for connecting peer controllers + void connectWithPeer(AbstractController *); + virtual void getQueuesFromPeer(AbstractController *) + { fatal("getQueuesFromPeer() should be called only if implemented!"); } + protected: int m_transitions_per_cycle; int m_buffer_size; @@ -120,6 +133,9 @@ class AbstractController : public ClockedObject, public Consumer int m_cur_in_port_rank; int m_number_of_TBEs; + //! Map from physical network number to the Message Buffer. + std::map<uint32_t, MessageBuffer*> peerQueueMap; + //! Counter for the number of cycles when the transitions carried out //! were equal to the maximum allowed uint64_t m_fully_busy_cycles; diff --git a/src/mem/ruby/slicc_interface/Controller.py b/src/mem/ruby/slicc_interface/Controller.py index 5c2fd9b71..f8242322e 100644 --- a/src/mem/ruby/slicc_interface/Controller.py +++ b/src/mem/ruby/slicc_interface/Controller.py @@ -42,4 +42,6 @@ class RubyController(ClockedObject): buffer_size = Param.Int(0, "max buffer size 0 means infinite") recycle_latency = Param.Cycles(10, "") number_of_TBEs = Param.Int(256, "") - ruby_system = Param.RubySystem(""); + ruby_system = Param.RubySystem("") + + peer = Param.RubyController(NULL, "") |