macsim/src/noc/pnbe1.c
// initialize the best effort paternoster interconnection simulator
initialize the best effort paternoster interconnection simulator
initialize the best effort paternoster interconnection simulator
void pnbe1_init(node_t *node){
    node->noc_send_flit         = pnbe1_send_flit;
    node->noc_recv_flit         = pnbe1_recv_flit;
		node->noc_sender_ready      = pnbe1_sender_ready;
		node->noc_probe_rank        = pnbe1_probe_rank;
		node->noc_probe_any         = pnbe1_probe_any;
		node->noc_route_one_cycle   = pnbe1_route_one_cycle;
		pnbe1_context_t *context = malloc(sizeof(pnbe1_context_t));
		if(context == NULL){
			fatal("Malloc failed to allocate memory.\n");
		}
		node->noc_context = context;
		pnbe1_context_t *pnode = ((pnbe1_context_t *)node->noc_context); 
		pnode->out_east.flit = NULL;
		pnode->out_north.flit = NULL;
		pnode->in_west.flit = NULL;
		pnode->in_south.flit = NULL;
		pnode->in_core.flit = NULL;
		pnode->sentNorth = false;
		pnode->sentEast = false;
		pnode->signalSouth = false;
		pnode->signalWest = false;
		pnode->isSignaledEast = false;
		pnode->isSignaledNorth = false;
		pnode->h_timers = malloc(conf_noc_width * sizeof(uint_fast16_t));
		if(pnode->h_timers == NULL)
			fatal("Malloc failed to allocate memory.\n");
		uint_fast16_t size;
		for(size = 0; size < conf_noc_width; size ++){
			pnode->h_timers[size] = 0;
		}
		size = conf_noc_width - 1;
		buffer_init(&pnode->injectionQueue, size);
		size = 8;
		buffer_init(&pnode->corner_buffer, size);
		size = conf_noc_width;
		buffer_init(&pnode->core_buffer, 128);
}
void pnbe1_init ( node_t * node ) { node -> noc_send_flit = pnbe1_send_flit ; node -> noc_recv_flit = pnbe1_recv_flit ; node -> noc_sender_ready = pnbe1_sender_ready ; node -> noc_probe_rank = pnbe1_probe_rank ; node -> noc_probe_any = pnbe1_probe_any ; node -> noc_route_one_cycle = pnbe1_route_one_cycle ; pnbe1_context_t * context = malloc ( sizeof ( pnbe1_context_t ) ) ; if ( context == NULL ) { fatal ( " \n " ) ; } node -> noc_context = context ; pnbe1_context_t * pnode = ( ( pnbe1_context_t * ) node -> noc_context ) ; pnode -> out_east . flit = NULL ; pnode -> out_north . flit = NULL ; pnode -> in_west . flit = NULL ; pnode -> in_south . flit = NULL ; pnode -> in_core . flit = NULL ; pnode -> sentNorth = false ; pnode -> sentEast = false ; pnode -> signalSouth = false ; pnode -> signalWest = false ; pnode -> isSignaledEast = false ; pnode -> isSignaledNorth = false ; pnode -> h_timers = malloc ( conf_noc_width * sizeof ( uint_fast16_t ) ) ; if ( pnode -> h_timers == NULL ) fatal ( " \n " ) ; uint_fast16_t size ; for ( size = 0 ; size < conf_noc_width ; size ++ ) { pnode -> h_timers [ size ] = 0 ; } size = conf_noc_width - 1 ; buffer_init ( & pnode -> injectionQueue , size ) ; size = 8 ; buffer_init ( & pnode -> corner_buffer , size ) ; size = conf_noc_width ; buffer_init ( & pnode -> core_buffer , 128 ) ; }
initialize the best effort paternoster interconnection simulator
initialize the best effort paternoster interconnection simulator
// Override functions // add NoC specific fields to the node //readability // initialize the added variables // set injectionQueue size // set corner_buffer size // set core-buffer size