include $(TOPDIR)/Makefile.include
RGCCFLAGS += -O2
-RGCCFLAGS += -DTASK -DMULTICORE -DRAW
+RGCCFLAGS += -DTASK -DMULTICORE -DRAW -DY1
SIM-CYCLES = 10000
ATTRIBUTES += HWIC
TILE_PATTERN = 4x1
-#INCLUDES += -I.
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 raw_dataCache.o mem.o
+ taskdefs.o methods.o mem.o raw_dataCache.o raw_interrupt.o
# this is for a multi-tile test
include $(COMMONDIR)/Makefile.all
include $(TOPDIR)/Makefile.include
RGCCFLAGS += -O2
-RGCCFLAGS += -DTASK -DMULTICORE -DRAW
+RGCCFLAGS += -DTASK -DMULTICORE -DRAW -DY2
SIM-CYCLES = 10000
ATTRIBUTES += HWIC
TILE_PATTERN = 4x2
-#INCLUDES += -I.
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 raw_dataCache.o mem.o
+ GenericHashtable.o SimpleHash.o ObjectHash.o socket.o checkpoint.o\
+ taskdefs.o methods.o mem.o raw_dataCache.o raw_interrupt.o
# this is for a multi-tile test
include $(COMMONDIR)/Makefile.all
include $(TOPDIR)/Makefile.include
RGCCFLAGS += -O2
-RGCCFLAGS += -DTASK -DMULTICORE -DRAW
+RGCCFLAGS += -DTASK -DMULTICORE -DRAW -DY4
SIM-CYCLES = 10000
ATTRIBUTES += HWIC
TILE_PATTERN = 4x4
-#INCLUDES += -I.
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 raw_dataCache.o mem.o
+ taskdefs.o methods.o mem.o raw_dataCache.o raw_interrupt.o
# this is for a multi-tile test
include $(COMMONDIR)/Makefile.all
include $(TOPDIR)/Makefile.include
RGCCFLAGS += -O2
-RGCCFLAGS += -DTASK -DMULTICORE -DRAW -DINTERRUPT
+RGCCFLAGS += -DTASK -DMULTICORE -DRAW -DINTERRUPT -DY1
SIM-CYCLES = 10000
ATTRIBUTES += HWIC
TILE_PATTERN = 4x1
-#INCLUDES += -I.
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 raw_dataCache.o mem.o
+ taskdefs.o methods.o mem.o raw_dataCache.o raw_interrupt.o
# this is for a multi-tile test
include $(COMMONDIR)/Makefile.all
include $(TOPDIR)/Makefile.include
RGCCFLAGS += -O2
-RGCCFLAGS += -DTASK -DMULTICORE -DRAW -DINTERRUPT
+RGCCFLAGS += -DTASK -DMULTICORE -DRAW -DINTERRUPT -DY2
SIM-CYCLES = 10000
ATTRIBUTES += HWIC
TILE_PATTERN = 4x2
-#INCLUDES += -I.
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 raw_dataCache.o mem.o
+ taskdefs.o methods.o mem.o raw_dataCache.o raw_interrupt.o
# this is for a multi-tile test
include $(COMMONDIR)/Makefile.all
include $(TOPDIR)/Makefile.include
RGCCFLAGS += -O2
-RGCCFLAGS += -DTASK -DMULTICORE -DRAW -DINTERRUPT
+RGCCFLAGS += -DTASK -DMULTICORE -DRAW -DINTERRUPT -DY4
SIM-CYCLES = 10000
ATTRIBUTES += HWIC
TILE_PATTERN = 4x4
-#INCLUDES += -I.
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 raw_dataCache.o mem.o
+ taskdefs.o methods.o mem.o raw_dataCache.o raw_interrupt.o
# this is for a multi-tile test
include $(COMMONDIR)/Makefile.all
--- /dev/null
+#include "mem.h"
+
+#ifdef RAW
+#include "runtime.h"
+#include <raw.h>
+
+/*void * m_calloc(int m, int size) {
+ void * p = malloc(m*size);
+ int i = 0;
+ for(i = 0; i < size; ++i) {
+ *(char *)(p+i) = 0;
+ }
+ return p;
+}*/
+
+void * mycalloc(int m, int size) {
+ void * p = NULL;
+ int isize = 2*kCacheLineSize-4+(size-1)&(~kCacheLineMask);
+ raw_test_pass(0xdd00);
+#ifdef INTERRUPT
+ // shut down interrupt
+ raw_user_interrupts_off();
+#endif
+ p = calloc(m, isize);
+ //p = m_calloc(m, isize);
+ raw_test_pass_reg(p);
+ raw_test_pass_reg((kCacheLineSize+((int)p-1)&(~kCacheLineMask)));
+#ifdef INTERRUPT
+ // re-open interruption
+ raw_user_interrupts_on();
+#endif
+ return (void *)(kCacheLineSize+((int)p-1)&(~kCacheLineMask));
+}
+
+void * mycalloc_i(int m, int size) {
+ void * p = NULL;
+ int isize = 2*kCacheLineSize-4+(size-1)&(~kCacheLineMask);
+ raw_test_pass(0xdd00);
+ p = calloc(m, isize);
+ //p = m_calloc(m, isize);
+ raw_test_pass_reg(p);
+ raw_test_pass_reg((kCacheLineSize+((int)p-1)&(~kCacheLineMask)));
+ return (void *)(kCacheLineSize+((int)p-1)&(~kCacheLineMask));
+}
+
+void myfree(void * ptr) {
+ return;
+}
+
+#endif
#ifdef RAW
#include <raw.h>
#include <raw_compiler_defs.h>
-#include <libints.h>
+//#include <libints.h>
#elif defined THREADSIMULATE
// use POSIX message queue
// for each core, its message queue named as
#ifdef INTERRUPT
if (corenum < NUMCORES) {
// set up interrupts
- setup_interrupts();
- start_gdn_avail_ints(recvMsg);
+ setup_ints();
+ //setup_interrupts();
+ //start_gdn_avail_ints(recvMsg);
raw_user_interrupts_on();
raw_test_pass(0xee04);
}
--- /dev/null
+.text
+.global flushAddr
+.global invalidateAddr
+.global flushCacheline
+
+
+flushAddr:
+# arguments come in on $4 and $5
+# $4 has the address
+# $5 has the length, eventually
+
+ afl $4, 0
+ jr $31
+
+
+invalidateAddr:
+# arguments come in on $4 and $5
+# $4 has the address
+# $5 has the length, eventually
+
+ ainv $4, 0
+ jr $31
+
+
+flushCacheline:
+# arguments come in on $4
+# $4 has the base tag address
+
+ tagfl $4
+ jr $31
+
--- /dev/null
+#include <raw_asm.h>
+
+ .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
+
+ # 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
+
+ .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:
+ sw $2,-8($sp)
+# la $2,gdn_avail_handler
+# jr $2
+ jal recvMsg
+vec_event_counters:
+ empty_vec 0x2306
+