changeset 1015:80b18af207c2

debug mail timing.
author yutaka@localhost.localdomain
date Fri, 05 Nov 2010 22:25:33 +0900
parents 44b2c4cb539d
children e4e96ab3044d
files Renderer/Engine/Makefile.def TaskManager/Cell/SpeThreads.cc TaskManager/Cell/spe/CellDmaManager.cc TaskManager/Makefile.def TaskManager/kernel/schedule/SchedNop2Ready.cc TaskManager/kernel/schedule/SchedNop2Ready.h TaskManager/kernel/schedule/SchedTask.cc TaskManager/kernel/schedule/Scheduler.cc example/dependency_task/Makefile.def example/dependency_task/spe/Exec.cc
diffstat 10 files changed, 26 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/Makefile.def	Thu Oct 28 17:40:13 2010 +0900
+++ b/Renderer/Engine/Makefile.def	Fri Nov 05 22:25:33 2010 +0900
@@ -5,7 +5,7 @@
 ABIBIT = 32 
 ABI = -m$(ABIBIT)
 CC      = g++
-OPT	= -g #-O9 -DSPE_CREATE_POLYGON_CHECK -DSPE_CREATE_POLYGON=1
+OPT	= -g -O9 #-DSPE_CREATE_POLYGON_CHECK -DSPE_CREATE_POLYGON=1
 CFLAGS  = -Wall $(ABI) $(OPT)  #  -DDEBUG
 
 INCLUDE = -I$(CERIUM)/include/TaskManager -I.
--- a/TaskManager/Cell/SpeThreads.cc	Thu Oct 28 17:40:13 2010 +0900
+++ b/TaskManager/Cell/SpeThreads.cc	Fri Nov 05 22:25:33 2010 +0900
@@ -127,7 +127,7 @@
  *  does not work.
  */
     if (spe_out_mbox_status(spe_ctx[speid]) >= 1) {    
-	return spe_out_mbox_read(spe_ctx[speid], (unsigned int*)ret, count*(sizeof(memaddr)/sizeof(int)));   
+      return spe_out_mbox_read(spe_ctx[speid], (unsigned int*)ret, count*(sizeof(memaddr)/sizeof(int)));   
     } else {
 	return 0;            
     }
--- a/TaskManager/Cell/spe/CellDmaManager.cc	Thu Oct 28 17:40:13 2010 +0900
+++ b/TaskManager/Cell/spe/CellDmaManager.cc	Fri Nov 05 22:25:33 2010 +0900
@@ -95,9 +95,6 @@
           spu_write_out_mbox((uint32)data);
       } else {
 	  MailQueuePtr mail = mail_queue->poll();
-	  if (0 == mail->data) {
-	    printf("hoge\n");
-	  }
 	  spu_write_out_mbox((uint32)mail->data);
 	  mail_queue->free_(mail);
 	  mail = mail_queue->create();
@@ -120,7 +117,7 @@
 
     while (!mail_queue->empty()) {
       MailQueuePtr mail = mail_queue->poll();
-      spu_write_out_mbox((uint32)mail->data);
+      spu_write_out_mbox((uint32)mail->data);      
       mail_queue->free_(mail);
     }
 
--- a/TaskManager/Makefile.def	Thu Oct 28 17:40:13 2010 +0900
+++ b/TaskManager/Makefile.def	Fri Nov 05 22:25:33 2010 +0900
@@ -29,7 +29,7 @@
 
 ABIBIT = 32
 
-OPT = -g -O9 #-DMAIL_QUEUE
+OPT = -g -O9 -DMAIL_QUEUE
 # -DEARLY_TOUCH
 # -g -DTASK_LIST_MAIL -O9
 
--- a/TaskManager/kernel/schedule/SchedNop2Ready.cc	Thu Oct 28 17:40:13 2010 +0900
+++ b/TaskManager/kernel/schedule/SchedNop2Ready.cc	Fri Nov 05 22:25:33 2010 +0900
@@ -16,8 +16,8 @@
 
 }
 
-SchedTaskBase*
-SchedNop2Ready::next(Scheduler *scheduler,SchedTaskBase *p)
+void
+SchedNop2Ready::write(void)
 {
     __debug("[SchedNop2Ready:%s]\n", __FUNCTION__);
 
@@ -26,5 +26,16 @@
 #else
     scheduler->mail_write((memaddr)MY_SPE_STATUS_READY);
 #endif
-    return new SchedMail();
+
+
 }
+
+SchedTaskBase*
+SchedNop2Ready::next(Scheduler *scheduler,SchedTaskBase *p)
+{
+    __debug("[SchedNop2Ready:%s]\n", __FUNCTION__);
+
+
+    return new SchedNop();
+    
+}
--- a/TaskManager/kernel/schedule/SchedNop2Ready.h	Thu Oct 28 17:40:13 2010 +0900
+++ b/TaskManager/kernel/schedule/SchedNop2Ready.h	Fri Nov 05 22:25:33 2010 +0900
@@ -20,11 +20,12 @@
 
     /* functions */
     void exec(void);
+    void write(void);
     SchedTaskBase* next(Scheduler *, SchedTaskBase *);
 
 #if DEBUG
     void read(void)  { __debug("[SchedNop2Ready:%s]\n", __FUNCTION__); }
-    void write(void) { __debug("[SchedNop2Ready:%s]\n", __FUNCTION__); }
+    //void write(void) { __debug("[SchedNop2Ready:%s]\n", __FUNCTION__); }
 #endif
 };
 
--- a/TaskManager/kernel/schedule/SchedTask.cc	Thu Oct 28 17:40:13 2010 +0900
+++ b/TaskManager/kernel/schedule/SchedTask.cc	Fri Nov 05 22:25:33 2010 +0900
@@ -129,6 +129,7 @@
 	// Task List が残っているので、次を準備
 
 	TaskPtr nextTask = &list->tasks[cur_index];
+	
         SchedTask *nextSched = new SchedTask();
 	nextSched->init(list, nextTask, cur_index+1, scheduler, this->tag^1);
 	// この時点で、TaskList は down load が済んでないことがある
@@ -149,6 +150,7 @@
         memaddr nextList = (memaddr)list->next;
         if (nextList == 0) {
 	    // もう何もする必要がない
+	    
             return new SchedNop2Ready(scheduler);
         } else {
 	    // 新しいリストに取り掛かる
--- a/TaskManager/kernel/schedule/Scheduler.cc	Thu Oct 28 17:40:13 2010 +0900
+++ b/TaskManager/kernel/schedule/Scheduler.cc	Fri Nov 05 22:25:33 2010 +0900
@@ -75,14 +75,15 @@
     // main loop
     do {
 
-	task3->write();
 	task1->read();
       	task2->exec();
+	task3->write();
 
 	delete task3; 
 
         task3 = task2;
         task2 = task1;
+	//SchedMailの場合、Mailの待ちが入る
 	task1 = task1->next(this, 0);
 
     } while (task1);
--- a/example/dependency_task/Makefile.def	Thu Oct 28 17:40:13 2010 +0900
+++ b/example/dependency_task/Makefile.def	Fri Nov 05 22:25:33 2010 +0900
@@ -10,7 +10,7 @@
 ABIBIT=32
 
 CC      = g++ -m$(ABIBIT)
-CFLAGS  = -g -Wall -O9
+CFLAGS  = -g -Wall #-O9
 
 INCLUDE = -I${CERIUM}/include/TaskManager -I. -I..
 LIBS = -L${CERIUM}/TaskManager
--- a/example/dependency_task/spe/Exec.cc	Thu Oct 28 17:40:13 2010 +0900
+++ b/example/dependency_task/spe/Exec.cc	Fri Nov 05 22:25:33 2010 +0900
@@ -8,6 +8,7 @@
 static int
 run(SchedTask *s, void *rbuf, void *wbuf)
 {
+
     int *idata = (int*)s->get_input(rbuf, 0);
     int *odata = (int*)s->get_output(wbuf, 0);
     int length = (long)s->get_param(0);