diff options
Diffstat (limited to 'src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc')
-rw-r--r-- | src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc index 7384cc6a7..47ded231c 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc @@ -106,20 +106,23 @@ NetworkInterface_d::addOutPort(NetworkLink_d *out_link, } void -NetworkInterface_d::addNode(map<int, MessageBuffer *>& in, - map<int, MessageBuffer *>& out) +NetworkInterface_d::addNode(vector<MessageBuffer *>& in, + vector<MessageBuffer *>& out) { inNode_ptr = in; outNode_ptr = out; for (auto& it : in) { - // the protocol injects messages into the NI - it.second->setConsumer(this); - it.second->setReceiver(this); + if (it != nullptr) { + it->setConsumer(this); + it->setReceiver(this); + } } for (auto& it : out) { - it.second->setSender(this); + if (it != nullptr) { + it->setSender(this); + } } } @@ -223,9 +226,11 @@ NetworkInterface_d::wakeup() // Checking for messages coming from the protocol // can pick up a message/cycle for each virtual net - for (auto it = inNode_ptr.begin(); it != inNode_ptr.end(); ++it) { - int vnet = (*it).first; - MessageBuffer *b = (*it).second; + for (int vnet = 0; vnet < inNode_ptr.size(); ++vnet) { + MessageBuffer *b = inNode_ptr[vnet]; + if (b == nullptr) { + continue; + } while (b->isReady()) { // Is there a message waiting msg_ptr = b->peekMsgPtr(); @@ -355,9 +360,11 @@ void NetworkInterface_d::checkReschedule() { for (const auto& it : inNode_ptr) { - MessageBuffer *b = it.second; + if (it == nullptr) { + continue; + } - while (b->isReady()) { // Is there a message waiting + while (it->isReady()) { // Is there a message waiting scheduleEvent(Cycles(1)); return; } |