From cb7782f78d337527d8ea3d593645fc67cca54d23 Mon Sep 17 00:00:00 2001 From: Nilay Vaish Date: Sun, 10 Feb 2013 21:43:17 -0600 Subject: ruby: enable multiple clock domains This patch allows ruby to have multiple clock domains. As I understand with this patch, controllers can have different frequencies. The entire network needs to run at a single frequency. The idea is that with in an object, time is treated in terms of cycles. But the messages that are passed from one entity to another should contain the time in Ticks. As of now, this is only true for the message buffers, but not for the links in the network. As I understand the code, all the entities in different networks (simple, garnet-fixed, garnet-flexible) should be clocked at the same frequency. Another problem is that the directory controller has to operate at the same frequency as the ruby system. This is because the memory controller does not make use of the Message Buffer, and instead implements a buffer of its own. So, it has no idea of the frequency at which the directory controller is operating and uses ruby system's frequency for scheduling events. --- src/mem/ruby/network/simple/Switch.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/mem/ruby/network/simple/Switch.cc') diff --git a/src/mem/ruby/network/simple/Switch.cc b/src/mem/ruby/network/simple/Switch.cc index 76d37c321..d951ea38d 100644 --- a/src/mem/ruby/network/simple/Switch.cc +++ b/src/mem/ruby/network/simple/Switch.cc @@ -67,7 +67,11 @@ Switch::init() void Switch::addInPort(const vector& in) { - m_perfect_switch_ptr->addInPort(in, this); + m_perfect_switch_ptr->addInPort(in); + + for (int i = 0; i < in.size(); i++) { + in[i]->setReceiver(this); + } } void @@ -83,21 +87,27 @@ Switch::addOutPort(const vector& out, // Create one buffer per vnet (these are intermediaryQueues) vector intermediateBuffers; for (int i = 0; i < out.size(); i++) { + out[i]->setSender(this); + MessageBuffer* buffer_ptr = new MessageBuffer; // Make these queues ordered buffer_ptr->setOrdering(true); if (m_network_ptr->getBufferSize() > 0) { buffer_ptr->resize(m_network_ptr->getBufferSize()); } + intermediateBuffers.push_back(buffer_ptr); m_buffers_to_free.push_back(buffer_ptr); + + buffer_ptr->setSender(this); + buffer_ptr->setReceiver(this); } // Hook the queues to the PerfectSwitch m_perfect_switch_ptr->addOutPort(intermediateBuffers, routing_table_entry); // Hook the queues to the Throttle - throttle_ptr->addLinks(intermediateBuffers, out, this); + throttle_ptr->addLinks(intermediateBuffers, out); } void -- cgit v1.2.3