Mercurial > hg > Members > kono > Cerium
changeset 9:964b3b27846d
*** empty log message ***
author | gongo |
---|---|
date | Wed, 06 Feb 2008 18:31:30 +0900 |
parents | b02b69ebb89a |
children | 7aa4c006e4be |
files | TaskManager/Fifo/FifoTaskManagerImpl.cc TaskManager/Test/Sum/main.cpp TaskManager/kernel/spe/SpeTask.cc |
diffstat | 3 files changed, 20 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Fifo/FifoTaskManagerImpl.cc Wed Feb 06 13:41:15 2008 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc Wed Feb 06 18:31:30 2008 +0900 @@ -18,9 +18,8 @@ FifoTaskManagerImpl::set_task(void) { // ここ...直すかな - FifoTaskInfo *info = (FifoTaskInfo*)taskInfo; - TaskListPtr list = info->machineTaskList; - TaskQueuePtr queue = info->activeTaskQueue; + TaskListPtr list = taskInfo->machineTaskList[0]; + TaskQueuePtr queue = taskInfo->activeTaskQueue; TaskQueuePtr d; HTaskPtr htask; TaskPtr task; @@ -45,10 +44,10 @@ task->in_size = htask->in_size; task->self = htask; - info->free_taskQueue(d); + taskInfo->free_taskQueue(d); } - info->activeTaskQueue = NULL; + taskInfo->activeTaskQueue = NULL; return list; }
--- a/TaskManager/Test/Sum/main.cpp Wed Feb 06 13:41:15 2008 +0900 +++ b/TaskManager/Test/Sum/main.cpp Wed Feb 06 18:31:30 2008 +0900 @@ -1,7 +1,6 @@ #include <stdio.h> #include <string.h> #include "TaskManager.h" -#include "ppe_prof.h" #define MAX 1024 @@ -23,8 +22,6 @@ HTaskPtr *task = new HTaskPtr[div]; HTaskPtr last; - unsigned int ts, te; - manager = new TaskManager(1); manager->init(); @@ -65,20 +62,14 @@ manager->run_task(last); #endif - StartProf(ts); manager->run(); - StopProf(te, ts); - PrintProf(te); printf("manager : %d\n", out[0]); - StartProf(ts); out[0] = 0; for (i = 0; i < MAX; i++) { out[0] += i; } - StopProf(te, ts); - PrintProf(te); printf("for : %d\n", out[0]);
--- a/TaskManager/kernel/spe/SpeTask.cc Wed Feb 06 13:41:15 2008 +0900 +++ b/TaskManager/kernel/spe/SpeTask.cc Wed Feb 06 18:31:30 2008 +0900 @@ -91,9 +91,11 @@ } -SpeTask::SpeTask(TaskListPtr _list, void *rbuf, void *wbuf, DmaManager* cn) +SpeTask::SpeTask(TaskListPtr _list, TaskPtr _task, void *rbuf, void *wbuf, + DmaManager* cn) { list = _list; + task = _task; readbuf = rbuf; writebuf = wbuf; connector = cn; @@ -104,7 +106,7 @@ { __debug("SpeTask::read()"); - task = &list->tasks[--list->length]; + //task = &list->tasks[--list->length]; connector->dma_load(readbuf, task->in_addr, task->in_size, DMA_READ); } @@ -150,10 +152,19 @@ if (list->next == 0) { return new SpeNop2Ready(connector); } else { - return new SpeTaskList((unsigned int)list->next, m->get_curListBuf(), connector); + return new SpeTaskList((unsigned int)list->next, + m->get_curListBuf(), connector); } } else { - return new SpeTask(list, m->get_curReadBuf(), - m->get_curWriteBuf(), connector); + //return new SpeTask(list, m->get_curReadBuf(), + //m->get_curWriteBuf(), connector); + + // 本当は、ここで task->command に対応する、 + // SpeTask を継承する class を作ればいい。。。はず + return TaskFactory( + + return new SpeTask(list, &list->tasks[--list->length], + m->get_curReadBuf(), m->get_curWriteBuf(), + connector); } }