fix noise production
This commit is contained in:
parent
17b104d11c
commit
b3ee8f1a07
4 changed files with 26 additions and 23 deletions
|
@ -128,7 +128,7 @@ int svm_access_request(size_t addr)
|
|||
icc_send_irq(remote_rank);
|
||||
|
||||
/* check for incoming messages */
|
||||
icc_mail_check();
|
||||
icc_mail_check(0);
|
||||
|
||||
while (page_owner[pageid] != my_ue) {
|
||||
NOP4;
|
||||
|
|
|
@ -410,12 +410,12 @@ int iRCCE_mail_send(
|
|||
// if dest mailbox is full, check for incoming mail
|
||||
RC_cache_invalidate();
|
||||
while( iRCCE_mailbox_send[dest]->sent ) {
|
||||
// iRCCE_mailbox_check();
|
||||
iRCCE_mailbox_check();
|
||||
RC_cache_invalidate();
|
||||
}
|
||||
|
||||
/* disable interrupts */
|
||||
flags = irq_nested_disable();
|
||||
// flags = irq_nested_disable();
|
||||
|
||||
// check if mailbox is closed
|
||||
RCCE_acquire_lock( dest );
|
||||
|
@ -451,7 +451,7 @@ int iRCCE_mail_send(
|
|||
RCCE_release_lock( dest );
|
||||
|
||||
/* enable interrupts */
|
||||
irq_nested_enable(flags);
|
||||
// irq_nested_enable(flags);
|
||||
|
||||
return iRCCE_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ int icc_halt(void)
|
|||
|
||||
#define ROUNDS 10000
|
||||
#define CORE_A 0 // sender
|
||||
#define CORE_B 1 // receiver
|
||||
#define CORE_B 4 // receiver
|
||||
|
||||
|
||||
int icc_send_gic_irq(int core_num) {
|
||||
|
@ -268,7 +268,7 @@ static inline void icc_mail_check_tag(iRCCE_MAIL_HEADER* mail) {
|
|||
static int count = 0;
|
||||
|
||||
if( !mail ) return;
|
||||
|
||||
|
||||
switch( mail->tag ) {
|
||||
case iRCCE_ANYLENGTH:
|
||||
recv_buffer = (char*)kmalloc( mail->size );
|
||||
|
@ -277,13 +277,12 @@ static inline void icc_mail_check_tag(iRCCE_MAIL_HEADER* mail) {
|
|||
break;
|
||||
|
||||
case PING_REQ:
|
||||
// kprintf( "PING_REQ" );
|
||||
// count++;
|
||||
iRCCE_mail_send(0, PING_RESP, 0, NULL, mail->source);
|
||||
break;
|
||||
|
||||
case NOISE:
|
||||
// kprintf( "XXX " );
|
||||
kprintf( "XXX " );
|
||||
default:
|
||||
// kprintf( "icc_mail_check_tag: uknown tag id %d\n", mail->tag );
|
||||
break;
|
||||
|
@ -429,43 +428,45 @@ int icc_mail_noise() {
|
|||
int num_ranks = RCCE_num_ues();
|
||||
iRCCE_MAIL_HEADER* recv_mail = NULL;
|
||||
int flags;
|
||||
/*
|
||||
|
||||
// leave function if not participating
|
||||
if( (my_ue == CORE_A) || (my_ue == CORE_B) || (my_ue > 25) ) {
|
||||
if( (my_ue == CORE_A) || (my_ue == CORE_B) ) {
|
||||
kprintf( "mail_noise: leaving" );
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
if( !((my_ue == CORE_A) || (my_ue == CORE_B) ) ) {
|
||||
kprintf( "mail_noise: leaving" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
kprintf( "Hello from icc_mail_noise: my_ue = %d\n", my_ue );
|
||||
kprintf( "num_ues = %d\n", num_ranks );
|
||||
int count = 0;
|
||||
for( i=0; i<100000 ;++i ) {
|
||||
for( ;; ) {
|
||||
kprintf( "SEND NOISE - " );
|
||||
/* send a mail to each UE */
|
||||
for( j=0; j<num_ranks; ++j ) {
|
||||
if( !((j == CORE_A) || (j == CORE_B)) )
|
||||
if( (j == CORE_A) /*|| (j == CORE_B) */)
|
||||
continue;
|
||||
|
||||
|
||||
/* send noise mail */
|
||||
iRCCE_mail_send(0, NOISE, 1, NULL, j);
|
||||
iRCCE_mail_send(0, NOISE, 0, NULL, j);
|
||||
#ifdef _IRQ_NOISE_
|
||||
icc_send_gic_irq(j);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef _IRQ_NOISE_
|
||||
iRCCE_mail_check(iRCCE_MAILBOX_ALL);
|
||||
#endif
|
||||
/* read some mails */
|
||||
flags = irq_nested_disable;
|
||||
|
||||
iRCCE_mail_check(iRCCE_MAILBOX_ALL);
|
||||
|
||||
while( iRCCE_mail_recv(&recv_mail) == iRCCE_SUCCESS ) {
|
||||
icc_mail_check_tag(recv_mail);
|
||||
iRCCE_mail_release(&recv_mail);
|
||||
}
|
||||
|
||||
irq_nested_enable(flags);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -511,6 +512,7 @@ void icc_mail_check(int irq)
|
|||
irq_reset_reg = (volatile uint64_t*)(FPGA_BASE + IRQ_RESET + my_ue*8);
|
||||
*irq_reset_reg = irq_reset;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
iRCCE_mail_check(iRCCE_MAILBOX_ALL);
|
||||
|
@ -521,10 +523,11 @@ void icc_mail_check(int irq)
|
|||
icc_mail_check_tag(header);
|
||||
iRCCE_mail_release( &header );
|
||||
}
|
||||
|
||||
|
||||
/* enable interrupts */
|
||||
irq_nested_enable(flags);
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -416,7 +416,7 @@ int test_init(void)
|
|||
//create_kernel_task(NULL, producer, NULL);
|
||||
//create_kernel_task(NULL, consumer, NULL);
|
||||
create_kernel_task(NULL, mail_ping, NULL);
|
||||
// create_kernel_task(NULL, mail_noise, NULL);
|
||||
create_kernel_task(NULL, mail_noise, NULL);
|
||||
//create_user_task(NULL, "/bin/hello", argv);
|
||||
//create_user_task(NULL, "/bin/tests", argv);
|
||||
//create_user_task(NULL, "/bin/jacobi", argv);
|
||||
|
|
Loading…
Add table
Reference in a new issue