macsim/src/noc/manhattan.c
// Send a flit to a core
Send a flit to a core
Send a flit to a core
bool manhattan_send_flit(node_t *node, rank_t dest, flit_t flit)
{
    DEBUG("S %lu->%lu [%lx]\n", node->rank, dest, flit);
    long int dx = labs(X_FROM_RANK(node->rank) - X_FROM_RANK(dest));
    long int dy = labs(Y_FROM_RANK(node->rank) - Y_FROM_RANK(dest));
    cycle_t latency = CONF_CYCLES_PER_HOP*(dx+dy);
    assert (latency>0 && "Same source and dest node");
    flit_container2_t fc;
    fc.src = node->rank;
    fc.dest = latency; 
    fc.flit = flit;
    manhattan_context_t *dest_context = nodes[dest]->noc_context;
    if (!fc_enqueue(&dest_context->intransit, fc))
        fatal("Out of memory");
    return 1;
}
bool manhattan_send_flit ( node_t * node , rank_t dest , flit_t flit ) { DEBUG ( " \n " , node -> rank , dest , flit ) ; long int dx = labs ( X_FROM_RANK ( node -> rank ) - X_FROM_RANK ( dest ) ) ; long int dy = labs ( Y_FROM_RANK ( node -> rank ) - Y_FROM_RANK ( dest ) ) ; cycle_t latency = CONF_CYCLES_PER_HOP * ( dx + dy ) ; assert ( latency > 0 && " " ) ; flit_container2_t fc ; fc . src = node -> rank ; fc . dest = latency ; fc . flit = flit ; manhattan_context_t * dest_context = nodes [ dest ] -> noc_context ; if ( ! fc_enqueue ( & dest_context -> intransit , fc ) ) fatal ( " " ) ; return 1 ; }
Send a flit to a core
Send a flit to a core
// misuse dest for latency counting