still testing remote interrupt

This commit is contained in:
Simon Pickartz 2011-08-01 14:24:46 -07:00
parent f344f65769
commit 3275d8cc17
7 changed files with 61 additions and 31 deletions

View file

@ -56,6 +56,7 @@ int icc_halt(void);
int icc_send_irq(int ue);
void icc_mail_check(void);
int icc_mail_ping(void);
int icc_irq_ping(void);
int icc_mail_ping_irq(void);
int icc_mail_noise(void);

View file

@ -34,6 +34,7 @@
#include <asm/isrs.h>
#include <asm/apic.h>
#define FPGA_BASE 0xf9000000
/*
* These are our own ISRs that point to our special IRQ handler
* instead of the regular 'fault_handler' function
@ -236,8 +237,18 @@ void irq_handler(struct state *s)
// at first, we check our work queues
if( s->int_no == 124 ) {
check_workqueues();
kprintf( "hello from rem_interrupt\n" );
}
int status_reg1 = FPGA_BASE + 0x0D008;
int cont1 = *((int*)status_reg1);
int comp = 1;
int core_num = -1;
if( cont1 & comp ) {
kprintf( "Interrupt from core 1\n" );
}
check_workqueues();
// }
/*
* Find out if we have a custom handler to run for this
* IRQ and then finally, run it

View file

@ -81,7 +81,7 @@ void timer_wait(unsigned int ticks)
uint64_t eticks = timer_ticks + ticks;
while (timer_ticks < eticks) {
//check_workqueues();
// check_workqueues();
// recheck break condition
if (timer_ticks >= eticks)

View file

@ -350,6 +350,9 @@ int iRCCE_mail_send(
RC_cache_invalidate();
}
/* disable interrupts */
flags = irq_nested_disable();
// check if mailbox is closed
RCCE_acquire_lock( dest );
RC_cache_invalidate();
@ -373,19 +376,17 @@ int iRCCE_mail_send(
iRCCE_memcpy_put( (void*)iRCCE_mailbox_send[dest],
(void*)&header, RCCE_LINE_SIZE );
/* disable interrupts */
flags = irq_nested_disable();
// set senders flag
RC_cache_invalidate();
iRCCE_mailbox_send[dest]->sent = RCCE_FLAG_SET;
*(int *)RCCE_fool_write_combine_buffer = 1;
RC_cache_invalidate();
RCCE_release_lock( dest );
/* enable interrupts */
irq_nested_enable(flags);
RCCE_release_lock( dest );
return iRCCE_SUCCESS;
}

View file

@ -195,9 +195,33 @@ int icc_halt(void)
return 0;
}
#define ROUNDS 300000
#define ROUNDS 100000
#define CORE_A 1 // sender
#define CORE_B 9 // receiver
#define CORE_B 4 // receiver
int icc_send_spec_irq(int core_num) {
int addr = FPGA_BASE+0x0D608;
int tmp;
tmp=ReadConfigReg(addr);
kprintf( "tmp = %x\n", tmp );
tmp |= 1;
kprintf( "tmp = %x\n", tmp );
SetConfigReg(addr, tmp);
return 0;
}
int icc_irq_ping()
{
if( my_ue != 0 ) return -1;
icc_send_spec_irq(1);
icc_send_irq(1);
kprintf( "sending irq to 1!\n");
return 0;
}
static inline void icc_mail_check_tag(iRCCE_MAIL_HEADER* mail) {
char* recv_buffer;
@ -236,14 +260,6 @@ int icc_mail_ping( void )
kprintf( "rounds = %d\n", ROUNDS );
/* wait 10 sec */
timer = rdtsc();
while( (rdtsc() - timer) < 533e8 ) {
kprintf( "waiting ...\n" );
}
kprintf( "waited ..\n" );
// disable interrupts
flags = irq_nested_disable();
@ -276,7 +292,7 @@ int icc_mail_ping( void )
break;
iRCCE_mail_release(&recv_header);
}
} while( (!recv_header));
} while( 1 );
/* send response */
iRCCE_mail_send(0, PING_RESP, 0, NULL, recv_header->source);
@ -330,6 +346,9 @@ int icc_mail_ping_irq( void )
iRCCE_mail_send(0, PING_REQ, 0, NULL, rem_rank);
/* send interrupt */
NOP8;
NOP8;
NOP8;
icc_send_irq(rem_rank);
/* wait for response */
@ -376,7 +395,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;
}
@ -387,14 +406,14 @@ int icc_mail_noise() {
for( j=0; j<num_ranks; ++j ) {
if( (j == CORE_A) || (j == CORE_B) )
continue;
iRCCE_mail_send(0, 100, 1, NULL, j);
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 */
@ -402,13 +421,10 @@ int icc_mail_noise() {
icc_mail_check_tag(recv_mail);
iRCCE_mail_release(&recv_mail);
}
// irq_nested_enable(flags);
// NOP8;
// NOP8;
}
return 0;
}

View file

@ -140,13 +140,13 @@ int sys_execve(const char* fname, char** argv, char** env);
static inline void check_workqueues(void)
{
uint32_t flags = irq_nested_disable();
// uint32_t flags = irq_nested_disable();
#ifdef CONFIG_ROCKCREEK
icc_mail_check();
#endif
irq_nested_enable(flags);
// irq_nested_enable(flags);
}
#ifdef __cplusplus

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_irq();
// icc_mail_ping();
// icc_mail_ping_irq();
icc_irq_ping();
icc_halt();
return 0;
@ -138,7 +139,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);