summaryrefslogtreecommitdiff
path: root/src/mem/ruby/slicc_interface/AbstractController.hh
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2013-03-22 15:53:23 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2013-03-22 15:53:23 -0500
commiteccc86e8095995d49326a9fffc3a1088b97b03fc (patch)
tree1621ce6ec3a78f90a653628ba3d8b9108fc3d814 /src/mem/ruby/slicc_interface/AbstractController.hh
parent5aa43e130acec02bc616008a8758cf5096025c19 (diff)
downloadgem5-eccc86e8095995d49326a9fffc3a1088b97b03fc.tar.xz
ruby: connect two controllers using only message buffers
This patch modifies ruby so that two controllers can be connected to each other with only message buffers in between. Before this patch, all the controllers had to be connected to the network for them to communicate with each other. With this patch, one can have protocols where a controller is not connected to the network, but communicates with another controller through a message buffer.
Diffstat (limited to 'src/mem/ruby/slicc_interface/AbstractController.hh')
-rw-r--r--src/mem/ruby/slicc_interface/AbstractController.hh16
1 files changed, 16 insertions, 0 deletions
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;