//int newRate = tint;
//int newRate = (j+1)%2+1;
int newRate = 1;
+ //int newRate = 10;
/*do {
tint = r.nextInt()%100;
} while(tint <= 0);
OBJECT_FILES_COMMON = multicoretask.o multicoreruntime.o Queue.o file.o math.o object.o \
GenericHashtable.o SimpleHash.o ObjectHash.o socket.o checkpoint.o\
- taskdefs.o methods.o mem.o raw_dataCache.o raw_interrupt.o
+ taskdefs.o methods.o mem.o raw_dataCache.o raw_interrupt2.o
# this is for a multi-tile test
include $(COMMONDIR)/Makefile.all
OBJECT_FILES_COMMON = multicoretask.o multicoreruntime.o Queue.o file.o math.o object.o \
GenericHashtable.o SimpleHash.o ObjectHash.o socket.o checkpoint.o\
- taskdefs.o methods.o mem.o raw_dataCache.o raw_interrupt.o
+ taskdefs.o methods.o mem.o raw_dataCache.o raw_interrupt4.o
# this is for a multi-tile test
include $(COMMONDIR)/Makefile.all
OBJECT_FILES_COMMON = multicoretask.o multicoreruntime.o Queue.o file.o math.o object.o \
GenericHashtable.o SimpleHash.o ObjectHash.o socket.o checkpoint.o\
- taskdefs.o methods.o mem.o raw_dataCache.o raw_interrupt.o
+ taskdefs.o methods.o mem.o raw_dataCache.o raw_interrupt2.o
# this is for a multi-tile test
include $(COMMONDIR)/Makefile.all
OBJECT_FILES_COMMON = multicoretask.o multicoreruntime.o Queue.o file.o math.o object.o \
GenericHashtable.o SimpleHash.o ObjectHash.o socket.o checkpoint.o\
- taskdefs.o methods.o mem.o raw_dataCache.o raw_interrupt.o
+ taskdefs.o methods.o mem.o raw_dataCache.o raw_interrupt4.o
# this is for a multi-tile test
include $(COMMONDIR)/Makefile.all
#ifdef RAW
void recvMsg() {
- raw_test_pass(0xefee);
- raw_user_interrupts_off();
- raw_test_pass(0xef00);
+ //raw_test_pass(0xefee);
+ //raw_user_interrupts_off();
+ //raw_test_pass(0xef00);
receiveObject();
- raw_test_pass(0xefff);
- raw_user_interrupts_on();
- raw_test_pass(0xefef);
+ //raw_test_pass(0xefff);
+ //raw_user_interrupts_on();
+ //raw_test_pass(0xefef);
}
void begin() {
#endif
raw_test_pass(0xee0e);
}
+ raw_test_pass(0xee0f);
if(!tocontinue) {
// check if stop
if(STARTUPCORE == corenum) {
if(isfirst) {
- raw_test_pass(0xee0f);
+ raw_test_pass(0xee10);
isfirst = false;
}
#ifdef INTERRUPT
}
if(0 == sumsendobj) {
// terminate
- raw_test_pass(0xee10);
+ raw_test_pass(0xee11);
raw_test_done(1); // All done.
}
}
#endif
} else {
if(!sendStall) {
- raw_test_pass(0xee11);
+ raw_test_pass(0xee12);
if(isfirst) {
// wait for some time
int halt = 10000;
- raw_test_pass(0xee12);
+ raw_test_pass(0xee13);
while(halt--){}
isfirst = false;
- raw_test_pass(0xee13);
+ raw_test_pass(0xee14);
} else {
// send StallMsg to startup core
- raw_test_pass(0xee14);
+ raw_test_pass(0xee15);
sendStall = transStallMsg(STARTUPCORE);
isfirst = true;
}
} else {
isfirst = true;
- raw_test_pass(0xee15);
+ raw_test_pass(0xee16);
}
}
}
}
return -1;
}
+msg:
raw_test_pass(0xcccc);
while((gdn_input_avail() != 0) && (msgdataindex < msglength)) {
msgdata[msgdataindex] = gdn_receive();
//msgdataindex = 0;
msglength = 30;
raw_test_pass(0xe886);
+ if(gdn_input_avail() != 0) {
+ goto msg;
+ }
return type;
} else {
// not a whole msg
// require locks for this parameter
getwritelock(parameter);
grount = 0;
+ raw_user_interrupts_off();
while(!lockflag) {
-#ifndef INTERRUPT
+//#ifndef INTERRUPT
receiveObject();
-#endif
+//#endif
}
#ifndef INTERRUPT
if(reside) {
#ifndef INTERRUPT
reside = false;
#endif
+ raw_user_interrupts_on();
if(grount == 0) {
raw_test_pass(0xe994);
#ifdef RAW
raw_test_pass(0xe995);
#endif
+ // release grabbed locks
+ for(j = 0; j < i; ++j) {
+ releasewritelock(taskpointerarray[j+OFFSET]);
+ }
+ releasewritelock(parameter);
RUNFREE(currtpd->parameterArray);
RUNFREE(currtpd);
goto newtask;
}
}
}
+#ifdef RAW
+ raw_test_pass(0xe999);
+#endif
}
/* This function processes an objects tags */
#include <raw_asm.h>
- .text
+.text
.align 2
.globl setup_ints
.ent setup_ints
setup_ints:
- # run main program
- # set up switch
-# mtsri SW_FREEZE, 1
-# la $8, __sw_main
-# mtsr SW_PC, $8
-# nop
-# mtsri SW_FREEZE, 0
-
# set up dynamic network
uintoff
intoff
# set gdn_cfg
-# la $8, ((XSIZE-1)<<27)|((YSIZE-1)<<22)|(XOFF<<17)|(YOFF<<12)|(LOG_XSIZE<<9)
xor $8,$8,$8
-#ifdef Y1
aui $8,$8,(3<<11)|(0 <<6)|(0 <<1)
ori $8, (0 <<12)|(2<<9)
-#elif defined Y2
- aui $8,$8,(3<<11)|(1 <<6)|(0 <<1)
- ori $8, (0 <<12)|(2<<9)
-#elif defined Y4
- aui $8,$8,(3<<11)|(3 <<6)|(0 <<1)
- ori $8, (0 <<12)|(2<<9)
-#else
- aui $8,$8,(3<<11)|(3 <<6)|(0 <<1)
- ori $8, (0 <<12)|(2<<9)
-#endif
mtsr GDN_CFG,$8
# mtsr PASS,$8
inton
uinton
-
+ jr $31
.end setup_ints
-
.macro empty_vec fail_code
mtsri FAIL, \fail_code
1: b 1b
vec_timer:
empty_vec 0x2304
vec_gdn_avail:
- sw $2,-8($sp)
-# la $2,gdn_avail_handler
-# jr $2
- jal recvMsg
+ mtsri PASS, 0xef00
+ uintoff
+
+ addiu $sp,$sp,-64
+ sw $31,0x3c($sp)
+ sw $30,0x38($sp)
+ sw $23,0x34($sp)
+ sw $22,0x30($sp)
+ sw $21,0x2c($sp)
+ sw $20,0x28($sp)
+ sw $19,0x24($sp)
+ sw $18,0x20($sp)
+ sw $17,0x1c($sp)
+ sw $16,0x18($sp)
+ sw $7,0x14($sp)
+ sw $6,0x10($sp)
+ sw $5,0xc($sp)
+ sw $4,0x8($sp)
+ sw $3,0x4($sp)
+ sw $2,0x0($sp)
+
+ jal receiveObject
+
+ lw $31,0x3c($sp)
+ lw $30,0x38($sp)
+ lw $23,0x34($sp)
+ lw $22,0x30($sp)
+ lw $21,0x2c($sp)
+ lw $20,0x28($sp)
+ lw $19,0x24($sp)
+ lw $18,0x20($sp)
+ lw $17,0x1c($sp)
+ lw $16,0x18($sp)
+ lw $7,0x14($sp)
+ lw $6,0x10($sp)
+ lw $5,0xc($sp)
+ lw $4,0x8($sp)
+ lw $3,0x4($sp)
+ lw $2,0x0($sp)
+ addiu $sp,$sp,64
+
+ mtsri PASS, 0xefff
+ dret
vec_event_counters:
empty_vec 0x2306
-
--- /dev/null
+#include <raw_asm.h>
+
+ .text
+ .align 2
+ .globl setup_ints
+ .ent setup_ints
+setup_ints:
+ # set up dynamic network
+ uintoff
+ intoff
+
+ # set gdn_cfg
+ xor $8,$8,$8
+ aui $8,$8,(3<<11)|(1 <<6)|(0 <<1)
+ ori $8, (0 <<12)|(2<<9)
+ mtsr GDN_CFG,$8
+# mtsr PASS,$8
+
+ # set exception vector
+ la $3, interrupt_table
+# mtsri PASS, 0xaaa
+# mtsr PASS, $3
+ mtsr EX_BASE_ADDR, $3
+
+ # set EX_MASK
+ mfsr $8,EX_MASK
+ ori $8,$8,0x20 # 1 << kVEC_GDN_AVAIL
+ mtsr EX_MASK,$8
+
+ inton
+ uinton
+ jr $31
+ .end setup_ints
+
+.macro empty_vec fail_code
+ mtsri FAIL, \fail_code
+1: b 1b
+ nop
+ nop
+.endm
+
+interrupt_table:
+
+vec_gdn_refill:
+ empty_vec 0x2300
+vec_gdn_complete:
+ empty_vec 0x2301
+vec_trace:
+ empty_vec 0x2302
+vec_extern:
+ empty_vec 0x2303
+vec_timer:
+ empty_vec 0x2304
+vec_gdn_avail:
+ mtsri PASS, 0xef00
+ uintoff
+
+ addiu $sp,$sp,-64
+ sw $31,0x3c($sp)
+ sw $30,0x38($sp)
+ sw $23,0x34($sp)
+ sw $22,0x30($sp)
+ sw $21,0x2c($sp)
+ sw $20,0x28($sp)
+ sw $19,0x24($sp)
+ sw $18,0x20($sp)
+ sw $17,0x1c($sp)
+ sw $16,0x18($sp)
+ sw $7,0x14($sp)
+ sw $6,0x10($sp)
+ sw $5,0xc($sp)
+ sw $4,0x8($sp)
+ sw $3,0x4($sp)
+ sw $2,0x0($sp)
+
+ jal receiveObject
+
+ lw $31,0x3c($sp)
+ lw $30,0x38($sp)
+ lw $23,0x34($sp)
+ lw $22,0x30($sp)
+ lw $21,0x2c($sp)
+ lw $20,0x28($sp)
+ lw $19,0x24($sp)
+ lw $18,0x20($sp)
+ lw $17,0x1c($sp)
+ lw $16,0x18($sp)
+ lw $7,0x14($sp)
+ lw $6,0x10($sp)
+ lw $5,0xc($sp)
+ lw $4,0x8($sp)
+ lw $3,0x4($sp)
+ lw $2,0x0($sp)
+ addiu $sp,$sp,64
+
+ mtsri PASS, 0xefff
+ dret
+vec_event_counters:
+ empty_vec 0x2306
+
--- /dev/null
+#include <raw_asm.h>
+
+ .text
+ .align 2
+ .globl setup_ints
+ .ent setup_ints
+setup_ints:
+ # set up dynamic network
+ uintoff
+ intoff
+
+ # set gdn_cfg
+ xor $8,$8,$8
+ aui $8,$8,(3<<11)|(3 <<6)|(0 <<1)
+ ori $8, (0 <<12)|(2<<9)
+ mtsr GDN_CFG,$8
+# mtsr PASS,$8
+
+ # set exception vector
+ la $3, interrupt_table
+# mtsri PASS, 0xaaa
+# mtsr PASS, $3
+ mtsr EX_BASE_ADDR, $3
+
+ # set EX_MASK
+ mfsr $8,EX_MASK
+ ori $8,$8,0x20 # 1 << kVEC_GDN_AVAIL
+ mtsr EX_MASK,$8
+
+ inton
+ uinton
+ jr $31
+ .end setup_ints
+
+.macro empty_vec fail_code
+ mtsri FAIL, \fail_code
+1: b 1b
+ nop
+ nop
+.endm
+
+interrupt_table:
+
+vec_gdn_refill:
+ empty_vec 0x2300
+vec_gdn_complete:
+ empty_vec 0x2301
+vec_trace:
+ empty_vec 0x2302
+vec_extern:
+ empty_vec 0x2303
+vec_timer:
+ empty_vec 0x2304
+vec_gdn_avail:
+ mtsri PASS, 0xef00
+ uintoff
+
+ addiu $sp,$sp,-64
+ sw $31,0x3c($sp)
+ sw $30,0x38($sp)
+ sw $23,0x34($sp)
+ sw $22,0x30($sp)
+ sw $21,0x2c($sp)
+ sw $20,0x28($sp)
+ sw $19,0x24($sp)
+ sw $18,0x20($sp)
+ sw $17,0x1c($sp)
+ sw $16,0x18($sp)
+ sw $7,0x14($sp)
+ sw $6,0x10($sp)
+ sw $5,0xc($sp)
+ sw $4,0x8($sp)
+ sw $3,0x4($sp)
+ sw $2,0x0($sp)
+
+ jal receiveObject
+
+ lw $31,0x3c($sp)
+ lw $30,0x38($sp)
+ lw $23,0x34($sp)
+ lw $22,0x30($sp)
+ lw $21,0x2c($sp)
+ lw $20,0x28($sp)
+ lw $19,0x24($sp)
+ lw $18,0x20($sp)
+ lw $17,0x1c($sp)
+ lw $16,0x18($sp)
+ lw $7,0x14($sp)
+ lw $6,0x10($sp)
+ lw $5,0xc($sp)
+ lw $4,0x8($sp)
+ lw $3,0x4($sp)
+ lw $2,0x0($sp)
+ addiu $sp,$sp,64
+
+ mtsri PASS, 0xefff
+ dret
+vec_event_counters:
+ empty_vec 0x2306
+