Esempio n. 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_COLS_IN_CHIP + me.col;
    me.corenum = me.row * e_group_config.group_cols + 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);

	// Init the ports
	init_input_port(&X);
	init_input_port(&Y);

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

	// Set the global actor pointer
	actors.scaleCol = (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] = 1;

	return;


}
Esempio n. 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_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;
}
Esempio n. 3
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;
Esempio n. 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;
	// corenum 12 is empty because of our structure
// hence this core gets num 13 but it should be 12
	me.corenum--;

	// 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);

	Mailbox.pSignedBuffer = Mailbox.pBase + offsetof(mbox_t, signed_buffer[0]);
	Mailbox.pSignedBufferSize = Mailbox.pBase + offsetof(mbox_t, signed_buffer_size);


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

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

	me.count = 0;

	// Init the global variables
	clip.count = -1;
	clip.coreID = me.coreID;

	// Init the ports
	//init_input_port(&SIGNED);
	init_input_port(&I);
	//init_output_port(&O);

	// Set the port pointers of the actor struct
	//clip.SIGNED = &SIGNED;
	clip.I = (me.coreID << 20) | (int) &I;
	//clip.O = &O;

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

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

}
Esempio n. 5
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;
}