add icc_mail_noise to generate noise on the other cores

This commit is contained in:
Simon Pickartz 2011-07-04 12:27:28 +02:00
parent c0fe176945
commit 439c56292e
3 changed files with 33 additions and 2 deletions

View file

@ -57,6 +57,7 @@ int icc_send_irq(int ue);
void icc_mail_check(void);
int icc_mail_ping(void);
int icc_mail_ping_irq(void);
int icc_mail_noise(void);
#endif

View file

@ -271,11 +271,15 @@ int icc_mail_ping( void )
return 0;
}
#define CORE_A 0
#define CORE_B 1
#define NOISE_ROUDNS 1000000
int icc_mail_ping_irq( void )
{
/* return if not core 0 */
if( my_ue ) return 0;
if( my_ue != CORE_A ) return 0;
uint32_t flags;
uint64_t timer = 0;
@ -326,6 +330,31 @@ int icc_mail_ping_irq( void )
return 0;
}
int icc_mail_noise() {
int i, j;
int num_ranks = RCCE_num_ues();
iRCCE_MAIL_HEADER* recv_mail = NULL;
// leave function if not participating
if( (my_ue == 0) || (my_ue == 1) ) {
return -1;
}
for( i=0; i<NOISE_ROUDNS; ++i ) {
for( j=0; j<num_ranks; ++j ) {
if ( (j == CORE_A) || (j == CORE_B) ) continue;
iRCCE_mail_send(0, my_ue*rounds+j, 0, NULL, j);
iRCCE_mail_recv(&recv_mail);
if( recv_mail ) iRCCE_mail_release(&recv_mail);
}
}
iRCCE_mailbox_close(iRCCE_MAILBOX_ALL);
return 0;
}
void icc_mail_check(void)
{
iRCCE_MAIL_HEADER* header = NULL;

View file

@ -88,8 +88,9 @@ static int STDCALL foo(void* arg)
#ifdef CONFIG_ROCKCREEK
int STDCALL mail_ping(void* arg) {
icc_mail_ping();
//icc_mail_ping();
icc_mail_ping_irq();
icc_mail_noise(); // generate noise in the mesh
icc_halt();
return 0;