Пример #1
0
void init()
{
	// Init core enumerations
	me.coreID  = e_get_coreid();
	e_coords_from_coreid(me.coreID, &me.row, &me.col);
	//me.row     = me.row - E_FIRST_CORE_ROW;
	//me.col     = me.col - E_FIRST_CORE_COL;
    me.corenum = me.row * e_group_config.group_cols + me.col;
	//me.corenum = me.row * E_COLS_IN_CHIP + me.col;
	//me.coreIDn = me.coreID;
	//e_neighbor_id((e_coreid_t *) &me.coreIDn, E_NEXT_CORE, E_CHIP_WRAP);

	// Initialize the mailbox shared buffer pointers
	Mailbox.pBase = (void *)  MAILBOX_ADDRESS;
	Mailbox.pGo = Mailbox.pBase + offsetof(mbox_t, go[0]);
	Mailbox.pReady = Mailbox.pBase + offsetof(mbox_t, ready[0]);
	Mailbox.pClocks = Mailbox.pBase + offsetof(mbox_t, clocks);

#if 0
	Mailbox.pOutputBuffer = Mailbox.pBase + offsetof(mbox_t, output_buffer[0]);
	Mailbox.pOutputReady = Mailbox.pBase + offsetof(mbox_t, output_ready);
#endif

	Mailbox.pTimer0 = Mailbox.pBase + offsetof(mbox_t, timer0);
	Mailbox.pTimer1 = Mailbox.pBase + offsetof(mbox_t, timer1);

	// Init the ports
	init_input_port(&X);

	// Set the port pointer, the address must be global
	scale.X = (me.coreID << 20) | (int) &X;

#ifdef FULL
	init_output_port(&Y);
	scale.Y = (me.coreID << 20) | (int) &Y;
#endif

	scale.coreID = me.coreID;

	// Set the global actor pointer(don't forget to use global address)
	actors.scale = (me.coreID << 20) | (int) &scale;
	

	me.count = 0;

	// Coefficients
	W0[0] = 2048;	W0[1] = 2676;	W0[2] = 2841;	W0[3] = 1609;
	
	W1[0] = 2048;	W1[1] = 1108;	W1[2] = 565;	W1[3] = 2408;

	ww0 = W0[0];
	ww1 = 2048;

	index0 = 0;

	// Init the host-accelerator sync signals
	Mailbox.pReady[me.corenum] = &me.mystate;
	
	return;
}
Пример #2
0
void init(){

	// Init core enumerations
	me.coreID  = e_get_coreid();
	e_coords_from_coreid(me.coreID, &me.row, &me.col);
	me.row     = me.row - E_FIRST_CORE_ROW;
	me.col     = me.col - E_FIRST_CORE_COL;
	me.corenum = me.row * E_COLS_IN_CHIP + me.col;

	// Initialize the mailbox shared buffer pointers
	Mailbox.pBase = (void *)  MAILBOX_ADDRESS;
	Mailbox.pGo = Mailbox.pBase + offsetof(mbox_t, go[0]);
	Mailbox.pReady = Mailbox.pBase + offsetof(mbox_t, ready[0]);
	Mailbox.pClocks = Mailbox.pBase + offsetof(mbox_t, clocks);

#if 0	
	// ## For debugging ##
Mailbox.pOutputBuffer = Mailbox.pBase + offsetof(mbox_t, output_buffer[0]);
Mailbox.pOutputReady = Mailbox.pBase + offsetof(mbox_t, output_ready);
#endif
	Mailbox.pTimer0 = Mailbox.pBase + offsetof(mbox_t, timer0);
	Mailbox.pTimer1 = Mailbox.pBase + offsetof(mbox_t, timer1);

	me.count = 0;
	
	// Init the ports
	init_input_port(&X);
	init_output_port(&Y);


// Set the port pointers of the actor struct
	final.X = (me.coreID << 20) | (int) &X;
Пример #3
0
void init()
{
    unsigned next_row, next_col;
	// Init core enumerations
	me.coreID  = e_get_coreid();
	e_coords_from_coreid(me.coreID, &me.row, &me.col);
    me.corenum = me.row * e_group_config.group_cols + me.col;
	//e_neighbor_id(E_NEXT_CORE, E_GROUP_WRAP, &next_row, &next_col);
	//me.coreIDn = next_row * e_group_config.group_cols + next_col;
	////e_neighbor_id(E_NEXT_CORE, E_GROUP_WRAP, (e_coreid_t *) &me.coreIDn);

	// Initialize the mailbox shared buffer pointers
	Mailbox.pBase = (void *) MAILBOX_ADDRESS;//(void*) SHARED_DRAM;
	Mailbox.pGo = Mailbox.pBase + offsetof(mbox_t, go[0]);
	Mailbox.pReady = Mailbox.pBase + offsetof(mbox_t, ready[0]);
	Mailbox.pClocks = Mailbox.pBase + offsetof(mbox_t, clocks);
	Mailbox.pInBuffer = Mailbox.pBase + offsetof(mbox_t, in_buffer[0]);
	Mailbox.pInBufferSize = Mailbox.pBase + offsetof(mbox_t, in_buffer_size);
	Mailbox.pConnectActors = Mailbox.pBase + offsetof(mbox_t, connectActors);
#if 0
	// Debug 
Mailbox.pOutputReady = Mailbox.pBase + offsetof(mbox_t, output_ready);
Mailbox.pOutputBuffer = Mailbox.pBase + offsetof(mbox_t, output_buffer);
#endif

	Mailbox.pTimer0 = Mailbox.pBase + offsetof(mbox_t, timer0);
	Mailbox.pTimer1 = Mailbox.pBase + offsetof(mbox_t, timer1);

	// initialize the port
	init_output_port(&Y);

	// Set the port pointer
	rowSort.Y = (me.coreID << 20) | (int) &Y;

	rowSort.coreID = me.coreID;

	// Set the global actor pointer
	actors.rowSort = (me.coreID << 20) | (int) &rowSort;

        // Init the host-accelerator sync signals
        Mailbox.pReady[me.corenum] = &me.mystate;

	return;
}
Пример #4
0
void init(){

	// Init core enumerations
	me.coreID  = e_get_coreid();
	e_coords_from_coreid(me.coreID, &me.row, &me.col);
	me.row     = me.row - E_FIRST_CORE_ROW;
	me.col     = me.col - E_FIRST_CORE_COL;
	me.corenum = me.row * E_COLS_IN_CHIP + me.col;

	// Initialize the mailbox shared buffer pointers
	Mailbox.pBase = (void *)  MAILBOX_ADDRESS;
	Mailbox.pGo = Mailbox.pBase + offsetof(mbox_t, go[0]);
	Mailbox.pReady = Mailbox.pBase + offsetof(mbox_t, ready[0]);
	Mailbox.pClocks = Mailbox.pBase + offsetof(mbox_t, clocks);

#if 0
	// ## For debugging ##
	Mailbox.pOutputBuffer = Mailbox.pBase + offsetof(mbox_t, output_buffer[0]);
	Mailbox.pOutputReady = Mailbox.pBase + offsetof(mbox_t, output_ready);
#endif

	Mailbox.pTimer0 = Mailbox.pBase + offsetof(mbox_t, timer0);
	Mailbox.pTimer1 = Mailbox.pBase + offsetof(mbox_t, timer1);

	me.count = 0;
	
	// Init the ports
	init_input_port(&X);
	init_output_port(&Y);

	// Set the port pointers of the actor struct
	shuffle.X = (me.coreID << 20) | (int) &X;
	shuffle.Y = (me.coreID << 20) | (int) &Y;

	shuffle.coreID = me.coreID;

	// Set the global actor pointer
	actors.shuffleRow = (me.coreID << 20) | (int) &shuffle;

	// Init the host-accelerator sync signals
	// Let the host know that we are ready (for sync)
	Mailbox.pGo[me.corenum] = 0;	
	Mailbox.pReady[me.corenum] = me.corenum;
}