src/mem/ruby/network/garnet/NetworkInterface.cc
// Wakeup the NI in the next cycle if there are waiting
// messages in the protocol buffer, or waiting flits in the
// output VC buffer.
// Also check if we have to reschedule because of a clock period
// difference.
Wakeup the NI in the next cycle if there are waiting
messages in the protocol buffer, or waiting flits in the
output VC buffer.
Also check if we have to reschedule because of a clock period
difference.
Wakeup the NI in the next cycle if there are waiting messages in the protocol buffer or waiting flits in the output VC buffer . Also check if we have to reschedule because of a clock period difference .
void
NetworkInterface::checkReschedule()
{
    for (const auto& it : inNode_ptr) {
        if (it == nullptr) {
            continue;
        }
        while (it->isReady(clockEdge())) { 
            scheduleEvent(Cycles(1));
            return;
        }
    }
    for (auto& ni_out_vc : niOutVcs) {
        if (ni_out_vc.isReady(clockEdge(Cycles(1)))) {
            scheduleEvent(Cycles(1));
            return;
        }
    }
    for (auto &iPort : inPorts) {
        NetworkLink *inNetLink = iPort->inNetLink();
        if (inNetLink->isReady(curTick())) {
            scheduleEvent(Cycles(1));
            return;
        }
    }
    for (auto &oPort : outPorts) {
        CreditLink *inCreditLink = oPort->inCreditLink();
        if (inCreditLink->isReady(curTick())) {
            scheduleEvent(Cycles(1));
            return;
        }
    }
}
void NetworkInterface :: checkReschedule ( ) { for ( const auto & it : inNode_ptr ) { if ( it == nullptr ) { continue ; } while ( it -> isReady ( clockEdge ( ) ) ) { scheduleEvent ( Cycles ( 1 ) ) ; return ; } } for ( auto & ni_out_vc : niOutVcs ) { if ( ni_out_vc . isReady ( clockEdge ( Cycles ( 1 ) ) ) ) { scheduleEvent ( Cycles ( 1 ) ) ; return ; } } for ( auto & iPort : inPorts ) { NetworkLink * inNetLink = iPort -> inNetLink ( ) ; if ( inNetLink -> isReady ( curTick ( ) ) ) { scheduleEvent ( Cycles ( 1 ) ) ; return ; } } for ( auto & oPort : outPorts ) { CreditLink * inCreditLink = oPort -> inCreditLink ( ) ; if ( inCreditLink -> isReady ( curTick ( ) ) ) { scheduleEvent ( Cycles ( 1 ) ) ; return ; } } }
Wakeup the NI in the next cycle if there are waiting
messages in the protocol buffer, or waiting flits in the
output VC buffer.
Wakeup the NI in the next cycle if there are waiting messages in the protocol buffer or waiting flits in the output VC buffer .
// Is there a message waiting // Check if any input links have flits to be popped. // This can happen if the links are operating at // a higher frequency.