remove debug printfs
This commit is contained in:
parent
09931d918d
commit
47deea941a
3 changed files with 32 additions and 39 deletions
|
@ -228,7 +228,7 @@ int icc_halt(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#define ROUNDS 10000
|
||||
#define ROUNDS 1000
|
||||
#define CORE_A 0 // sender
|
||||
#define CORE_B 1 // receiver
|
||||
|
||||
|
@ -255,7 +255,7 @@ int icc_irq_ping()
|
|||
|
||||
static inline void icc_mail_check_tag(iRCCE_MAIL_HEADER* mail) {
|
||||
char* recv_buffer;
|
||||
|
||||
static int count = 0;
|
||||
switch( mail->tag ) {
|
||||
case iRCCE_ANYLENGTH:
|
||||
recv_buffer = (char*)kmalloc( mail->size );
|
||||
|
@ -264,6 +264,8 @@ static inline void icc_mail_check_tag(iRCCE_MAIL_HEADER* mail) {
|
|||
break;
|
||||
|
||||
case PING_REQ:
|
||||
// kprintf( "%d ", count );
|
||||
count++;
|
||||
iRCCE_mail_send(0, PING_RESP, 0, NULL, mail->source);
|
||||
break;
|
||||
|
||||
|
@ -298,16 +300,19 @@ int icc_mail_ping( void )
|
|||
if( my_ue == CORE_A ) {
|
||||
/* send ping request */
|
||||
iRCCE_mail_send(0, PING_REQ, 0, NULL, CORE_B);
|
||||
|
||||
|
||||
/* wait for response */
|
||||
do {
|
||||
res = iRCCE_mail_check(CORE_B);
|
||||
} while( res != iRCCE_SUCCESS );
|
||||
|
||||
recv_header = NULL;
|
||||
/* release mail */
|
||||
do {
|
||||
if( recv_header ) iRCCE_mail_release(&recv_header);
|
||||
res = iRCCE_mail_recv(&recv_header);
|
||||
if( res == iRCCE_SUCCESS ) {
|
||||
if( recv_header->source == CORE_B )
|
||||
break;
|
||||
iRCCE_mail_release(&recv_header);
|
||||
}
|
||||
} while( 1 );
|
||||
} while( (recv_header->source != CORE_B)
|
||||
&& (recv_header->tag == PING_RESP) );
|
||||
|
||||
/* release mail */
|
||||
iRCCE_mail_release(&recv_header);
|
||||
|
@ -316,13 +321,11 @@ int icc_mail_ping( void )
|
|||
else {
|
||||
/* wait for request */
|
||||
do {
|
||||
res = iRCCE_mail_recv(&recv_header);
|
||||
if( res == iRCCE_SUCCESS ) {
|
||||
if( recv_header->tag == PING_REQ )
|
||||
break;
|
||||
iRCCE_mail_release(&recv_header);
|
||||
}
|
||||
} while( 1 );
|
||||
res = iRCCE_mail_check(CORE_A);
|
||||
} while( res != iRCCE_SUCCESS );
|
||||
|
||||
res = iRCCE_mail_recv(&recv_header);
|
||||
if( (res == iRCCE_SUCCESS) && (recv_header->tag = PING_REQ) );
|
||||
|
||||
/* send response */
|
||||
iRCCE_mail_send(0, PING_RESP, 0, NULL, recv_header->source);
|
||||
|
@ -358,28 +361,27 @@ int icc_mail_ping_irq( void )
|
|||
if( my_ue != CORE_A ) return 0;
|
||||
uint32_t flags;
|
||||
uint64_t timer = 0;
|
||||
int rem_rank = CORE_B;
|
||||
int i;
|
||||
int res;
|
||||
iRCCE_MAIL_HEADER* recv_header = NULL;
|
||||
|
||||
kprintf( "Hello from mail_ping_irq ... \n" );
|
||||
kprintf( "my_rank = %d\n", my_ue );
|
||||
kprintf( "rem_rank = %d\n", rem_rank );
|
||||
kprintf( "rem_rank = %d\n", CORE_B );
|
||||
kprintf( "rounds = %d\n", ROUNDS );
|
||||
|
||||
// disable interrupts
|
||||
flags = irq_nested_disable();
|
||||
for( i=0; i<ROUNDS+1; ++i ) {
|
||||
/* send ping request */
|
||||
iRCCE_mail_send(0, PING_REQ, 0, NULL, rem_rank);
|
||||
iRCCE_mail_send(0, PING_REQ, 0, NULL, CORE_B);
|
||||
|
||||
/* send interrupt */
|
||||
icc_send_gic_irq(rem_rank);
|
||||
icc_send_gic_irq(CORE_B);
|
||||
|
||||
/* wait for response */
|
||||
do {
|
||||
res = iRCCE_mail_check(rem_rank);
|
||||
res = iRCCE_mail_check(CORE_B);
|
||||
} while( res != iRCCE_SUCCESS );
|
||||
|
||||
recv_header = NULL;
|
||||
|
@ -387,7 +389,7 @@ int icc_mail_ping_irq( void )
|
|||
do {
|
||||
if( recv_header ) iRCCE_mail_release(&recv_header);
|
||||
res = iRCCE_mail_recv(&recv_header);
|
||||
} while( (recv_header->source != rem_rank)
|
||||
} while( (recv_header->source != CORE_B)
|
||||
&& (recv_header->tag == PING_RESP) );
|
||||
|
||||
|
||||
|
@ -418,7 +420,7 @@ int icc_mail_noise() {
|
|||
iRCCE_MAIL_HEADER* recv_mail = NULL;
|
||||
|
||||
// leave function if not participating
|
||||
if( (my_ue == CORE_A) /*|| (my_ue == CORE_B) */) {
|
||||
if( (my_ue == CORE_A) /*(my_ue == CORE_B)*/ ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -432,22 +434,19 @@ int icc_mail_noise() {
|
|||
|
||||
/* recv mails */
|
||||
iRCCE_mail_check(iRCCE_MAILBOX_ALL);
|
||||
|
||||
|
||||
/* send noise mail */
|
||||
iRCCE_mail_send(0, 100, 0, NULL, j);
|
||||
res = iRCCE_mail_recv(&recv_mail);
|
||||
if( res == iRCCE_SUCCESS ) {
|
||||
icc_mail_check_tag(recv_mail);
|
||||
iRCCE_mail_release(&recv_mail);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* read some mails */
|
||||
for( res = iRCCE_mail_recv(&recv_mail), j=0; (res == iRCCE_SUCCESS) && (j<48); res = iRCCE_mail_recv(&recv_mail), ++j ) {
|
||||
icc_mail_check_tag(recv_mail);
|
||||
iRCCE_mail_release(&recv_mail);
|
||||
}
|
||||
|
||||
kprintf( "x " );
|
||||
|
||||
}
|
||||
|
||||
|
@ -463,7 +462,7 @@ int icc_mail_noise() {
|
|||
void icc_mail_check(int irq)
|
||||
{
|
||||
iRCCE_MAIL_HEADER* header = NULL;
|
||||
int source, i, res;
|
||||
int source, res;
|
||||
volatile uint64_t* irq_status_reg = NULL;
|
||||
volatile uint64_t* irq_reset_reg = NULL;
|
||||
uint64_t irq_status = 0;
|
||||
|
@ -473,7 +472,6 @@ void icc_mail_check(int irq)
|
|||
flags = irq_nested_disable();
|
||||
|
||||
if( irq == 1 ) {
|
||||
kprintf( "got rem irq" );
|
||||
/* read status register */
|
||||
irq_status_reg = (volatile uint64_t*)(FPGA_BASE + IRQ_STATUS + my_ue*8);
|
||||
irq_status = *irq_status_reg;
|
||||
|
|
|
@ -217,14 +217,10 @@ static void list_root(void) {
|
|||
|
||||
int initd(void* arg)
|
||||
{
|
||||
kprintf("i1");
|
||||
network_init();
|
||||
kprintf("i2");
|
||||
list_root();
|
||||
kprintf("i3");
|
||||
test_init();
|
||||
kprintf("i4");
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,6 @@ int main(void)
|
|||
kprintf("Kernel starts at %p and ends at %p\n", &kernel_start, &kernel_end);
|
||||
system_calibration();
|
||||
|
||||
kprintf("main3");
|
||||
kprintf("Processor frequency: %u MHz\n", get_cpu_frequency());
|
||||
kprintf("Total memory: %u MBytes\n", atomic_int32_read(&total_pages)/((1024*1024)/PAGE_SIZE));
|
||||
kprintf("Current allocated memory: %u KBytes\n", atomic_int32_read(&total_allocated_pages)*(PAGE_SIZE/1024));
|
||||
|
|
Loading…
Add table
Reference in a new issue