macsim/macsim-seq.c
// compute average latency of one injection rate and return true injection rate
compute average latency of one injection rate and return true injection rate
compute average latency of one injection rate and return true injection rate
double print_one_point(double injrate, double *latency)
{
    cycle_t i;
    rank_t r;
    noc_destroy_all(nodes, conf_max_rank);
    for (r=0; r<conf_max_rank; r++) {
        core_finish_context(nodes[r]);
    }
    core_init_all(nodes, conf_max_rank);
    noc_init_all(nodes, conf_noc_type, conf_noc_width, conf_noc_height);
    conf_inj_rate = injrate; 
    conf_inj_prob = llrint(0x1.0p64 * injrate);
    for (i = 0; i < conf_eval_cycles; i++) simulation_step();
    cycle_t count=0;
    cycle_t total=0;
    for (r=0; r<conf_max_rank; r++) {
        count += nodes[r]->core.traffic.stat_flit_count;
        total += nodes[r]->core.traffic.stat_total_latency;
    }
    double real_injrate = (double)count / (double)(conf_eval_cycles*conf_max_rank);
    *latency = (double)total / (double)count;
    core_printf(0, "%.7f %.7f %7.1f %lu %lu\n",
        injrate, real_injrate, *latency, count, total);
    return real_injrate;
}
double print_one_point ( double injrate , double * latency ) { cycle_t i ; rank_t r ; noc_destroy_all ( nodes , conf_max_rank ) ; for ( r = 0 ; r < conf_max_rank ; r ++ ) { core_finish_context ( nodes [ r ] ) ; } core_init_all ( nodes , conf_max_rank ) ; noc_init_all ( nodes , conf_noc_type , conf_noc_width , conf_noc_height ) ; conf_inj_rate = injrate ; conf_inj_prob = llrint ( 0x1.0p64 * injrate ) ; for ( i = 0 ; i < conf_eval_cycles ; i ++ ) simulation_step ( ) ; cycle_t count = 0 ; cycle_t total = 0 ; for ( r = 0 ; r < conf_max_rank ; r ++ ) { count += nodes [ r ] -> core . traffic . stat_flit_count ; total += nodes [ r ] -> core . traffic . stat_total_latency ; } double real_injrate = ( double ) count / ( double ) ( conf_eval_cycles * conf_max_rank ) ; * latency = ( double ) total / ( double ) count ; core_printf ( 0 , " \n " , injrate , real_injrate , * latency , count , total ) ; return real_injrate ; }
compute average latency of one injection rate and return true injection rate
compute average latency of one injection rate and return true injection rate
// superflous