macsim/src/noc/pnbe0.c
// basically an extension of send_packet since a flit is a packet
basically an extension of send_packet since a flit is a packet
basically an extension of send_packet since a flit is a packet
bool pnbe0_send_flit(node_t *node, rank_t dest, flit_t flit)
{
    pnbe0_context_t *pnode = ((pnbe0_context_t *)node->noc_context); 
    if(pnode->paternoster_in_core.flit == NULL){
        pnode->paternoster_in_core.flit = msgdeque(&pnode->injectionQueue);
    }
    if(pnode->injectionQueue.slots == 0) return false;
    flit_container_t *fc = malloc(sizeof(flit_container_t));
    fc->src = node->rank;
    fc->dest = dest;
    memcpy(fc->payload, &flit, FLIT_LEN);
    msgenque(&pnode->injectionQueue, fc);
    info(log_intercon,"Node %lu queues flit for %lu in cycle: %ld \n",
        node->rank, dest, node->cycle);
    return true;
}
bool pnbe0_send_flit ( node_t * node , rank_t dest , flit_t flit ) { pnbe0_context_t * pnode = ( ( pnbe0_context_t * ) node -> noc_context ) ; if ( pnode -> paternoster_in_core . flit == NULL ) { pnode -> paternoster_in_core . flit = msgdeque ( & pnode -> injectionQueue ) ; } if ( pnode -> injectionQueue . slots == 0 ) return false ; flit_container_t * fc = malloc ( sizeof ( flit_container_t ) ) ; fc -> src = node -> rank ; fc -> dest = dest ; memcpy ( fc -> payload , & flit , FLIT_LEN ) ; msgenque ( & pnode -> injectionQueue , fc ) ; info ( log_intercon , " \n " , node -> rank , dest , node -> cycle ) ; return true ; }
basically an extension of send_packet since a flit is a packet
basically an extension of send_packet since a flit is a packet
//readability // this is necessary since core and NoC may run at different speeds // flit couln't be sent yet, injection queue is still full