Mercurial > hg > Members > kono > Cerium
changeset 270:bbc2375153d7
merge 252
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 04 Jun 2009 00:03:49 +0900 |
parents | f0e800bb9dcc (current diff) 61e70bcce35b (diff) |
children | f872cc000fe0 |
files | TaskManager/ChangeLog TaskManager/kernel/main.cc include/TaskManager/Task.h |
diffstat | 37 files changed, 840 insertions(+), 1980 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TAGS Thu Jun 04 00:03:49 2009 +0900 @@ -0,0 +1,344 @@ + +Renderer/Cell/Engine.h,22 +class CellEngine 1,0 + +Renderer/Cell/SceneGraph2PolygonTask.h,34 +class SceneGraph2PolygonTask 1,0 + +Renderer/DataPack/DataPackEngine.h,26 +class DataPackEngine 1,0 + +Renderer/Simple/SimpleEngine.h,24 +class SimpleEngine 1,0 + +TaskManager/Cell/CellBufferManager.cc,30 +CellBufferManager::init(6,94 + +TaskManager/Cell/CellHTaskInfo.cc,33 +CellHTaskInfo::extend_pool(6,71 + +TaskManager/Cell/CellTaskListInfo.cc,61 +#define NEXT_ADDR(5,70 +CellTaskListInfo::extend_pool(9,147 + +TaskManager/Cell/CellTaskManagerImpl.cc,388 +CellTaskManagerImpl::~CellTaskManagerImpl(10,188 +CellTaskManagerImpl::init(26,497 +CellTaskManagerImpl::append_activeTask(52,1213 +int cur_anySpeid 67,1612 +CellTaskManagerImpl::set_runTaskList(77,1822 +CellTaskManagerImpl::run(143,3358 +CellTaskManagerImpl::mail_check(177,4277 +CellTaskManagerImpl::send_taskList(258,6705 +CellTaskManagerImpl::allocate(274,7038 +create_impl(287,7242 + +TaskManager/Cell/PpeScheduler.cc,29 +PpeScheduler::allocate(6,73 + +TaskManager/Cell/SpeThreads.cc,258 +SpeThreads::SpeThreads(5,64 +SpeThreads::~SpeThreads(7,115 +SpeThreads::spe_thread_run(32,579 +SpeThreads::frontend_thread_run(65,1738 +SpeThreads::init(79,2028 +SpeThreads::get_mail(120,2877 +SpeThreads::check_mail(127,3073 +SpeThreads::send_mail(151,3716 + +TaskManager/kernel/main.cc,109 +defaultTMend(11,193 +TaskManager *manager;manager13,216 +static char help_str[help_str14,238 +main(20,374 + +include/TaskManager/BufferManager.h,104 +#define INCLUDED_BUFFER_MANAGER2,32 +class BufferManager 20,316 +private:BufferManager::private51,965 + +include/TaskManager/CellBufferManager.h,141 +#define INCLUDED_CELL_BUFFER_MANAGER2,37 +class CellBufferManager 12,197 + CellBufferManager(CellBufferManager::CellBufferManager14,254 + +include/TaskManager/CellDmaManager.h,219 +#define INCLUDED_CELL_DMA_MANAGER2,34 +#define SPU_PROFILE 14,209 +class CellDmaManager 16,232 + typedef struct dma_list CellDmaManager::dma_list20,321 + } DmaList, *DmaListPtr;CellDmaManager::DmaListPtr23,379 + +include/TaskManager/CellHTaskInfo.h,65 +#define INCLUDED_CELL_HTASK_INFO2,33 +class CellHTaskInfo 8,128 + +include/TaskManager/CellScheduler.h,65 +#define INCLUDED_CELL_SCHEDULER2,32 +class CellScheduler 12,178 + +include/TaskManager/CellTaskInfo.h,64 +#define INCLUDED_CELL_TASK_INFO2,32 +class CellTaskInfo 12,177 + +include/TaskManager/CellTaskListInfo.h,72 +#define INCLUDED_CELL_TASK_LIST_INFO2,37 +class CellTaskListInfo 8,143 + +include/TaskManager/CellTaskManagerImpl.h,212 +#define INCLUDED_CELL_TASK_MANAGER_IMPL2,40 +class CellTaskManagerImpl 16,301 + CellTaskManagerImpl(CellTaskManagerImpl::CellTaskManagerImpl19,384 +#undef Cerium_malloc47,1009 +#define Cerium_malloc(50,1038 + +include/TaskManager/DmaBuffer.h,56 +#define INCLUDED_DMA_BUFFER2,28 +class DmaBuffer 8,110 + +include/TaskManager/DmaManager.h,681 +#define INCLUDED_DMA_MANAGER2,29 +enum dma_tag 16,224 + DMA_READ 17,239 + DMA_WRITE 18,259 + DMA_READ_IN_LIST 19,279 + DMA_READ_OUT_LIST 20,307 + DMA_READ_TASKLIST 21,335 +class DmaManager 24,367 + virtual ~DmaManager(DmaManager::~DmaManager26,394 + virtual void dma_load(DmaManager::dma_load31,491 + virtual void dma_store(DmaManager::dma_store32,570 + virtual void dma_wait(DmaManager::dma_wait33,649 + virtual void mail_write(DmaManager::mail_write36,736 + virtual uint32 mail_read(DmaManager::mail_read37,780 + virtual void dma_loadList(DmaManager::dma_loadList40,869 + virtual void dma_storeList(DmaManager::dma_storeList41,940 + +include/TaskManager/HTask.h,105 +#define INCLUDED_HTASK2,23 +class HTask 22,296 +#define wait_for 39,743 +typedef HTask* HTaskPtr;42,775 + +include/TaskManager/HTaskInfo.h,91 +#define INCLUDED_HTASK_INFO2,28 +class HTaskInfo 8,109 +private:HTaskInfo::private28,477 + +include/TaskManager/ListData.h,235 +#define INCLUDED_LIST_DATA2,27 +#define MAX_LIST_DMA_SIZE 8,108 +class ListElement 10,137 +typedef ListElement* ListElementPtr;18,241 +class ListData 20,279 + void clear(ListData::clear30,584 +typedef ListData* ListDataPtr;36,641 + +include/TaskManager/MailManager.h,139 +#define INCLUDED_MAIL_MANAGER2,30 +typedef struct mail_queue 4,61 +} MailQueue, *MailQueuePtr;MailQueuePtr7,141 +class MailManager 9,170 + +include/TaskManager/MainScheduler.h,122 +#define INCLUDED_MAIN_SCHEDULER2,32 +class MainScheduler 12,190 + ~MainScheduler(MainScheduler::~MainScheduler14,239 + +include/TaskManager/PpeScheduler.h,62 +#define INCLUDED_PPE_SCHEDULER2,31 +class PpeScheduler 8,132 + +include/TaskManager/Random.h,92 +#define INCLUDED_RANDOM2,24 +class Random 4,49 +typedef Random *RandomPtr;RandomPtr13,171 + +include/TaskManager/SchedExit.h,57 +#define INCLUDED_SCHED_EXIT2,28 +class SchedExit 16,240 + +include/TaskManager/SchedMail.h,173 +#define INCLUDED_SCHED_MAIL2,28 +class SchedMail 18,260 + void read(SchedMail::read33,555 + void exec(SchedMail::exec34,623 + void write(SchedMail::write35,691 + +include/TaskManager/SchedNop.h,55 +#define INCLUDED_SCHED_NOP2,27 +class SchedNop 18,258 + +include/TaskManager/SchedNop2Ready.h,155 +#define INCLUDED_SCHED_NOP2READY2,33 +class SchedNop2Ready 22,329 + void read(SchedNop2Ready::read37,625 + void write(SchedNop2Ready::write38,698 + +include/TaskManager/SchedTask.h,1596 +#define INCLUDED_SCHED_TASK2,28 +class SchedTask 25,361 + virtual int run(SchedTask::run90,2190 + class STaskManager SchedTask::STaskManager146,3708 + STaskManager(SchedTask::STaskManager::STaskManager148,3745 + int get_cpuid(SchedTask::STaskManager::get_cpuid156,3850 + void* get_input(SchedTask::STaskManager::get_input160,3910 + void* get_output(SchedTask::STaskManager::get_output164,3999 + uint32 get_inputAddr(SchedTask::STaskManager::get_inputAddr168,4091 + uint32 get_outputAddr(SchedTask::STaskManager::get_outputAddr172,4171 + uint32 get_inputSize(SchedTask::STaskManager::get_inputSize176,4253 + uint32 get_outputSize(SchedTask::STaskManager::get_outputSize180,4333 + int get_param(SchedTask::STaskManager::get_param184,4415 + TaskPtr create_task(SchedTask::STaskManager::create_task188,4484 + void wait_task(SchedTask::STaskManager::wait_task192,4557 + void* global_alloc(SchedTask::STaskManager::global_alloc196,4631 + void* global_get(SchedTask::STaskManager::global_get200,4718 + void global_free(SchedTask::STaskManager::global_free204,4785 + void mainMem_alloc(SchedTask::STaskManager::mainMem_alloc208,4846 + void mainMem_wait(SchedTask::STaskManager::mainMem_wait212,4927 + void* mainMem_get(SchedTask::STaskManager::mainMem_get216,4986 + void *allocate(SchedTask::STaskManager::allocate220,5055 + void dma_load(SchedTask::STaskManager::dma_load224,5122 + void dma_store(SchedTask::STaskManager::dma_store228,5238 + void dma_wait(SchedTask::STaskManager::dma_wait232,5355 +const int SCHED_TASK_NORMAL 240,5456 +const int SCHED_TASK_RENEW 241,5489 + +include/TaskManager/SchedTaskBase.h,448 +#define INCLUDED_SCHED_TASK_BASE2,33 +class SchedTaskBase 14,198 + SchedTaskBase(SchedTaskBase::SchedTaskBase17,250 + virtual ~SchedTaskBase(SchedTaskBase::~SchedTaskBase18,277 + virtual void load(SchedTaskBase::load23,378 + virtual void read(SchedTaskBase::read24,410 + virtual void exec(SchedTaskBase::exec25,442 + virtual void write(SchedTaskBase::write26,474 + virtual SchedTaskBase* next(SchedTaskBase::next29,527 + +include/TaskManager/SchedTaskList.h,230 +#define INCLUDED_SCHED_TASKLIST2,32 +class SchedTaskList 18,268 + void exec(SchedTaskList::exec39,709 + void write(SchedTaskList::write40,781 +const int SCHED_TASKLIST_NORMAL 45,865 +const int SCHED_TASKLIST_RENEW 46,902 + +include/TaskManager/Scheduler.h,667 +#define INCLUDED_SCHEDULER2,27 +#define MAX_USER_TASK 36,549 +#define MAX_SYSTEM_TASK 37,574 +#define MAX_TASK_OBJECT 38,600 +#define MAX_GLOBAL_AREA 39,656 +#define MAX_MAINMEM_AREA 40,683 +class Scheduler 46,772 + typedef SchedTask* (*TaskObject)Scheduler::TaskObject113,2567 + virtual void init_impl(Scheduler::init_impl125,2802 + virtual void *allocate(Scheduler::allocate152,3685 + virtual void mainMem_alloc(Scheduler::mainMem_alloc154,3741 + virtual void mainMem_wait(Scheduler::mainMem_wait155,3794 +#define SchedConstructor(172,4323 +#define SchedDefineTask(176,4418 +#define SchedExternTask(182,4547 +#define SchedRegisterTask(186,4643 + +include/TaskManager/SpeThreads.h,131 +#define INCLUDED_SPE_THREADS2,29 +#define SPE_ELF 7,102 +typedef struct arg 9,130 +} thread_arg_t;12,193 +class SpeThreads 14,210 + +include/TaskManager/SymTable.h,244 +#define INCLUDED_SYMTABLE2,26 +#define SYM_MAX_SIZE 4,53 +class SymTable 6,78 + typedef int (*FuncObject)SymTable::FuncObject10,125 + typedef struct sym_table SymTable::sym_table12,172 + } SymTb, *SymTbPtr;SymTable::SymTbPtr15,238 + +include/TaskManager/Task.h,158 +#define INCLUDED_TASK2,22 +#define MAX_PARAMS 16,209 +class Task 18,231 +#define add_inData(37,741 +#define add_outData(39,824 +typedef Task* TaskPtr;43,913 + +include/TaskManager/TaskGroup.h,140 +#define INCLUDED_TASK_GROUP2,28 +class TaskGroup 12,171 + TaskGroup(TaskGroup::TaskGroup14,197 +typedef TaskGroup* TaskGroupPtr;39,746 + +include/TaskManager/TaskList.h,122 +#define INCLUDED_TASKLIST2,26 +#define TASK_MAX_SIZE 13,197 +class TaskList 15,223 +typedef TaskList* TaskListPtr;27,466 + +include/TaskManager/TaskListInfo.h,102 +#define INCLUDED_TASK_LIST_INFO2,32 +class TaskListInfo 12,175 +private:TaskListInfo::private33,630 + +include/TaskManager/TaskManager.h,61 +#define INCLUDED_TASK_MANAGER2,30 +class TaskManager 12,189 + +include/TaskManager/TaskManagerImpl.h,141 +#define INCLUDED_TASK_MANAGER_IMPL2,35 +class TaskManagerImpl 16,264 + virtual ~TaskManagerImpl(TaskManagerImpl::~TaskManagerImpl20,352 + +include/TaskManager/TaskQueue.h,97 +#define INCLUDED_TASK_QUEUE2,28 +class TaskQueue 14,180 +typedef TaskQueue* TaskQueuePtr;26,384 + +include/TaskManager/TaskQueueInfo.h,65 +#define INCLUDED_TASK_QUEUE_INFO2,33 +class TaskQueueInfo 8,128 + +include/TaskManager/base.h,65 +# define BASE_NEW_DELETE(8,79 +# define BASE_NEW_DELETE(23,795 + +include/TaskManager/error.h,169 +# define __debug(3,34 +# define __debug(7,132 +# define __debug_ppe(12,202 +# define __debug_ppe(16,312 +# define __debug_spe(21,386 +# define __debug_ppe(25,496 + +include/TaskManager/types.h,794 +#define INCLUDED_TYPES2,23 +typedef uint32_t uint32;6,68 +typedef uint64_t uint64;7,93 +#define SPE_ALIGNMENT 9,119 +#define SPE_ALIGNMENT_FULL 10,144 +#define SPE_ALIGN 11,175 +#define SPE_ALIGN_FULL 12,233 +#define ROUND_UP_ALIGN(13,300 +#define DEFAULT_ALIGNMENT 15,398 +#define DMA_MAX_SIZE 18,486 +#define round_up16(20,514 +#define round_up128(21,567 + MY_SPE_NOP 27,710 + MY_SPE_COMMAND_EXIT,28,730 + MY_SPE_COMMAND_GO,29,755 + MY_SPE_STATUS_BUSY,32,793 + MY_SPE_STATUS_READY,33,817 + MY_SPE_COMMAND_MALLOC,34,842 +#define MAX_USE_SPE_NUM 37,873 + CPU_PPE 40,915 + CPU_SPE 41,943 + SPE_ANY 42,960 + SPE_ANY = CPU_SPE,42,960 + SPE_0 43,983 + SPE_1 44,998 + SPE_2 45,1013 + SPE_3 46,1028 + SPE_4 47,1043 + SPE_5 48,1058 +} CPU_TYPE;49,1073
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Thu Jun 04 00:03:49 2009 +0900 @@ -180,14 +180,11 @@ ppeManager->mail_check(mail_list, &waitTaskQueue); do { - int data; - + unsigned int data; // SPE Scheduler からの mail check - for (int id = 0; id < machineNum; id++) { - while (1) { - data = speThreads->get_mail(id); - if (data < 0) break; + for (int id = 0; id < machineNum; id++) { + while (speThreads->check_mail(id, 1, &data)) { /** * MY_SPE_STATUS_READY: SPE が持ってた Task 全て終了 @@ -209,16 +206,23 @@ * info[0] = alloc_id; (CellScheduler::mainMem_alloc 参照) * info[1] = alloc_addr; */ - unsigned int alloc_info[2]; + unsigned int alloc_info[3]; int alloc_size; + int command; - // ださい - while ((alloc_info[0] = speThreads->get_mail(id)) < 0); - while ((alloc_size = speThreads->get_mail(id)) < 0); + speThreads->get_mail(id, 2, alloc_info); + command = alloc_info[0]; + alloc_size = alloc_info[1]; + alloc_info[1] = (unsigned int)allocate(alloc_size); + /* + * allocate された領域は今の SPE buffer にリンクとして接続する + * ここでは TaskList を allocate(new) して登録してやろうか + */ - speThreads->send_mail(id, alloc_info, 2); + speThreads->add_output_tasklist(command, &alloc_info[1], alloc_size); + speThreads->send_mail(id, 2, alloc_info); } else if (data > MY_SPE_NOP) { __debug_ppe("[PPE] recv from [SPE %d] : 0x%x\n", id, data); check_task_finish((HTaskPtr)data); @@ -269,7 +273,7 @@ bufferManager->clear_taskList(speTaskList_bg[id]); - speThreads->send_mail(id, (unsigned int *)&speTaskList[id], 1); + speThreads->send_mail(id, 1, (unsigned int *)&speTaskList[id]); flag_sendTaskList[id] = 0; } @@ -280,7 +284,8 @@ void *buff; posix_memalign(&buff, DEFAULT_ALIGNMENT, size); - + + // bzero はコストが高いのでやりたくない bzero(buff, size); return buff;
--- a/TaskManager/Cell/SpeThreads.cc Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Cell/SpeThreads.cc Thu Jun 04 00:03:49 2009 +0900 @@ -10,7 +10,7 @@ int ret; for (int i = 0; i < spe_num; i++) { - send_mail(i, &mail, 1); + send_mail(i, 1, &mail); } for (int i = 0; i < spe_num; i++) { @@ -107,6 +107,7 @@ } } + /** * SPE からのメールを受信する。 * @@ -116,12 +117,20 @@ * if ([ret] < 0) no data read */ int -SpeThreads::get_mail(int speid) +SpeThreads::get_mail(int speid, int count, unsigned int* ret) +{ + while(spe_out_mbox_status(spe_ctx[speid]) < count); + return spe_out_mbox_read(spe_ctx[speid], ret, count); +} + +int +SpeThreads::check_mail(int speid, int count, unsigned int* ret) { - unsigned int ret = (unsigned int)(-1); - - spe_out_mbox_read(spe_ctx[speid], &ret, 1); - return ret; + if (spe_out_mbox_status(spe_ctx[speid]) >= count) { + return spe_out_mbox_read(spe_ctx[speid], ret, count); + } else { + return 0; + } } /** @@ -139,8 +148,19 @@ * @param [num] The number of messages */ void -SpeThreads::send_mail(int speid, unsigned int *data, int num) +SpeThreads::send_mail(int speid, int num, unsigned int *data) +{ + spe_in_mbox_write(spe_ctx[speid], data, num, SPE_MBOX_ALL_BLOCKING); +} + +void +SpeThreads::add_output_tasklist(int command, void *buff, int alloc_size) { - while (spe_in_mbox_status(spe_ctx[speid]) < num); - spe_in_mbox_write(spe_ctx[speid], data, num, SPE_MBOX_ANY_NONBLOCKING); + /* + * output TaskList が無ければ新しく作る + * あれば TaskList に allocate した Task を追加 + * command に対応した Task の初期化を実行する + * SPE に data が書き出し終わった後に PPE 側で初期化 + */ + }
--- a/TaskManager/Cell/spe/CellDmaManager.cc Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Cell/spe/CellDmaManager.cc Thu Jun 04 00:03:49 2009 +0900 @@ -2,6 +2,9 @@ #include <stdlib.h> #include "CellDmaManager.h" +unsigned int CellDmaManager::wait_time, CellDmaManager::busy_time; +unsigned long long CellDmaManager::global_busy_time, CellDmaManager::global_wait_time; + /** * DMA Load * @@ -38,12 +41,42 @@ * @param[in] mask Tag for Wait DMA process */ +static void +CellDmaManager::start_dmawait_profile() +{ + wait_time = spu_readch(SPU_RdDec); + // global 紊違 + global_busy_time += busy_time - wait_time; + spu_writech(SPU_WrDec, 0xffffffff); +} + +static void +CellDmaManager::end_dmawait_profile() +{ + wait_time = spu_readch(SPU_RdDec); + // global 紊違 + global_wait_time += 0xffffffff - wait_time; + busy_time = wait_time; +} + +// с潟ppu眼 Task +void +CellDmaManager::print_wait() +{ +} + void CellDmaManager::dma_wait(uint32 mask) { +#ifdef SPU_PROFILE + start_dmawait_profile(); +#endif mfc_write_tag_mask(1 << mask); mfc_write_tag_update_all(); mfc_read_tag_status(); +#ifdef SPU_PROFILE + end_dmawait_profile(); +#endif } void
--- a/TaskManager/Cell/spe/SchedMail.cc Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Cell/spe/SchedMail.cc Thu Jun 04 00:03:49 2009 +0900 @@ -13,12 +13,17 @@ { delete p; + // dma wait + scheduler->start_dmawait_profile(); params_addr = scheduler->mail_read(); + scheduler->end_dmawait_profile(); __debug("[SchedMail:%s]\n", __FUNCTION__); - if ((int)params_addr == MY_SPE_COMMAND_EXIT) { - return new SchedExit(); + if ((int)params_addr == MY_SPE_COMMAND_EXIT) { + // ppu 眼 spu 絎茵倶茵腓榊 Task + // counter global + return new SchedExit(m); } else { return new SchedTaskList(params_addr, m); }
--- a/TaskManager/Cell/spe/main.cc Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Cell/spe/main.cc Thu Jun 04 00:03:49 2009 +0900 @@ -11,9 +11,9 @@ { CellScheduler *manager; - const unsigned ls_size = (unsigned)&argc; - unsigned code_size = (unsigned)&_end; - unsigned heap_size = ls_size - code_size; + //const unsigned ls_size = (unsigned)&argc; + //unsigned code_size = (unsigned)&_end; + //unsigned heap_size = ls_size - code_size; __debug(" ls_size:%10d bytes\n", ls_size); __debug("code_size:%10d bytes\n", code_size);
--- a/TaskManager/ChangeLog Tue Jun 02 21:53:22 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1888 +0,0 @@ -2009-02-13 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * kernel/ppe/Random.cc (reset): fix - urandom -> random 茯c - gettimeofday() с seed 羆 - -2009-02-12 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * add: kernel/ppe/Random.cc - 箙掩亥鴻 - 蚊若若銀戎сc - 筝綽 /dev/random seed 罕障 - -2009-02-04 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * kernel/ppe/TaskManager.cc (TaskManager::allocate): rename - malloc -> allocate - - * kernel/main.cc (main): fix - cerium_main 若吟сTMmain 障 - <c SDLmain cс - 障 TaskManager main cerium_* c緇絋紊 - - * kernel/ppe/TaskManager.cc (TaskManager::set_TMend): add - cerium_main cerium_end c - c荐TaskManager main c羌 - 腟篋罎ャс<ャ - 井謙絎Task post_func с - с若吟違腟篋若違∽違荐絎с - -2009-01-20 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * Cell/spe/SchedTask.cc (SchedTask::get_cpuid): add - printf 井 CPU cャс - - PPE = 0 - SPE = 0spu_num-1; - - PPE 0 篁ュ医若SPE 茴 - -1 若c純絅純障 - - User Task с篁ヤ罕篏睡障 - - int cpuid = smanager->get_cpuid(); - - - * Cell/SpeThreads.cc (SpeThreads::spe_thread_run): fix - SPE_EXIT 冴罩e幻腟篋 - 若с<祉若吾荀障(篆冴荀障c) - 茵腓冴 - - * kernel/ppe/MailManager.cc (MailManager::destroy): fix - ♂若c for() c - TaskQueueInfo.cc с腟絮 while() 眼 - - * kernel/ppe/TaskManager.cc (TaskManager::~TaskManager): add - kernel/main.cc - - delete manager; - - TaskManagerImpl::~TaskManagerImpl 若喝冴 - c ~TaskManager <c祉 - -2009-01-05 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * all : fix - Scheduler::curIndex_taskList ゃ - SchedTask 罕紊眼(SchedTask::__cur_index) - 篌眼SchedTask::__init__() cur_index ャ罕紊 - -2008-12-24 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * kernel/schedule/SchedTask.cc (SchedTask::ex_init_renew) - (SchedTask::ex_init_normal): add - (SchedTask::__init__): fix - - init с ex_init 篏帥罕 - 潟潟鴻帥ф検綣違 __init__() 羝<罕 - 潟潟鴻帥綣違膓帥<∴Κ鴻吾 - cャс - - 箴. - class Hoge : public SchedTask { - Hoge(int i) : Task(i) {} - }; - - с篁障с Scheduler.h SchedConstructor c吾 - 劫ャт罕綵≪ - с箴 - - SchedTask -> Hoge -> Fuge c Fuge c帥鴻 - 篏筝障障 SchedTask 綣井検障с - cс潟潟鴻水 - __init__() 綣違羝<罕障 - - (SchedTask::__set_renewFlag): add - - сPPEх(normal)SPE х(renew) - ゅ茵ex_xxx 荐絎 - - (SchedTask::get_inputSize, SchedTask::get_outputSize): add - - ≪鴻泣ゃ冴鴻 - - -2008-12-23 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * Cell/spe/SchedTask.cc (SchedTask::get_outputAddr) - (SchedTask::get_inputAddr): add - - in/out 若帥≪鴻鴻 - -2008-12-22 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * Cell/spe/SchedTask.cc (SchedTask::__init__, SchedTask::read) - (SchedTask::exec, SchedTask::write): fix - (SchedTask::ex_read_normal, SchedTask::ex_read_renew) - (SchedTask::ex_exec_normal, SchedTask::ex_exec_renew) - (SchedTask::ex_write_normal, SchedTask::ex_write_renew): add - - SPE х帥鴻PPE х - - - add->inData - : PPE DMA or SPE 障鞘戎 - - PPE 帥鴻腟篋ャ - : 帥鴻緇ゅ荀鴻с - - 障с - 帥鴻帥鴻ゆ - - __flag_renewTask ? 0 = PPE х : 1 = SPE х - - 紊違сゃ - 篁障с - - if (__flag_renewTask) { - } else { - } - - ccс篋с - __init__() с∽違ゃ潟帥 - - ex_xxxx_normal: PPE х帥鴻絲障 - ex_xxxx_renew: SPE х帥鴻絲障 - - ャif <сc帥 - 篁 ex_write_xxx 吾read/exec с - 冴с篏c - - -2008-12-19 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * Cell/spe/CellDmaManager.cc (CellDmaManager::dma_wait) - (CellDmaManager::mail_write, CellDmaManager::mail_read): fix - writechreadch ∽違wrap (c荐鴻сk鐚)∽違紊眼 - cc純激 wrap - - 箴: - - before - spu_readch(SPU_RdInMspu_readch(SPU_RdInMbox); - - after - spu_read_in_mbox(void); - -2008-11-05 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * add: Task с API - Task 紊с API 篁障ч manager->create_task с - 帥鴻с吾с->∽違若喝冴 - c荅宴cс篁障篁SchedTask.h - 鴻 - - STaskManager - - c若吟ゃ潟鴻帥潟鴻с - - smanager - - API≪祉鴻障 - 篁障с __scheduler->dma_load cс - smanager 障 - с篏帥 API 筝荀с蚊若 wiki鴻 - - - get_input, get_output, get_param - - create_task, wait_task - - global_alloc, global_get, global_free - - mainMem_alloc, mainMem_wait, mainMem_get - - dma_load, dma_store, dma_wait - - allocate - - 篏帥鴻菴純障 - 篁筝紊眼障障荐菴違ус - 腱肢障c - - - * kernel/schedule/SchedTask.cc: - ∽違紜障若с - -2008-11-01 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * add: kernel/main.cc - main loop 若吟吾с - ゃ眼 main() 吾鋋障 - 若九眼с main() 篁c cerium_main() - 吾障綣違 main() 障丈検с - - Cerium 罔羣激с潟-cpu 篁障 - 蚊若若若cс-width -height - 罔羣сゃc荅宴с緇ュ茖 - 罔羣激с潟уcゃ≪祉鴻号 - manager->cpu manager->width 絎鐚 - - * add: Cell/PpeScheduler.cc - MainScheduler 障鞘戎 - PPE 帥鴻 mainMem_alloc х∈篆≪ゃ<潟 - SPE т戎篏茖с鴻若 - - Scheduler->allocate poxis_memalign т戎 - - * move: kernel/schedule/FifoDmaManager.cc, MainScheduler.cc - kernel Fifo 若吾с括 Fifo/ 腱糸 - - -2008-10-21 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * kernel/ppe/TaskManagerImpl.cc (TaskManagerImpl::systask_init): fix - 筝菴違鴻 SysTask_Finish regist - - (TaskManagerImpl::spawn_task): - - SysTask_Finish 絲障帥鴻 spawn 潟 - wait_for 緇ゃ - - * add: kernel/systask/ - 箙贋遺 - - 違帥鴻 SPE с - PPE уc帥鴻<障障違膣c - 篁障с若吟帥鴻緇帥鴻c吾 - 障<с羝菴遵 - - system task cゃ若сspawn 帥鴻緇 - SysTask_Finish 篏cс< task_finish 篏k - -2008-08-10 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * thinking: add_update() ? - 憜帥鴻 input/output с - с箴 - - - ュ若 : PolygoPpack - - 阪若 : SpanPack - - cсャ帥鴻 - - - ュ若 : SceneGraphPack (贋医) - - 阪若 : SceneGraphPack (贋医) - - cゃ障 Update - 篁≪鴻 add_inData, add_outData 荐絎 - 帥鴻 memcpy(wbuf, rbuf, sizeof(SceneGraphPack) - 障с - - in/out update 綽荀鐚 - -2008-08-08 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * add: ../include/TaskManager/base.h - 絽吾 new/delete сRTTI 箴紊 - -fno-exceptions -fno-rtti 潟潟ゃ激с潟 - 鴻coperator new/delete 若若ゃ - 筝荳 malloc/free 筝< - 激с潟鴻腟潟若泣ゃ冴羝 - SPE 翫7080KB羝障篏帥< - ゃ若с筝綽orz - (-O2 -O9) 罩≪障SPE 筝с - FIFO 若吾с潟馹SPE - 篁c罩≪障贋 Scheduler::run() - - task3->write(); - - task1~3障сnew(紊)с - 若喝冴 SPE 篏腟篋障茗 - - 筝綽篆坂 new/delete base.h 絎臂c - 絽吾 API 帥base.h - BASE_NEW_DELETE 帥сk - <ゃс憜 SPE т戎c障 - c祉 - - ゃ眼≪若九眼с馹с - с篁 - - ゃ(libspemanager.a)<(-O0) - 若九(SchedTask膓帥ゃ)≦馹 (-O9) - - сc吾絎с違倶ソ - ゃ若 C++ (ry - - -2008-08-07 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * change: mainMem_set -> mainMem_wait - allocate 緇ゃ wait - 若吟篏帥сwait 鴻c - -2008-08-05 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * add: mainMem_alloc, mainMem_set, mainMem_get - SPE <ゃ潟<≪絲障 allocate с - SceneGraph腟罕c - PPE сcу茖障 - - 羌 - - 1 帥鴻筝mainMem(id,size) 絎茵篋с - <ゃ潟<≪絲障 allocate 潟潟肴 - - 1.1 Scheduler PPE 絲障 - - commmand (MY_SPE_COMMAND_MALLOC) - - id (PPE祉c潟潟綽荀) - - size - mailbox ч - - 1.2 腆坂帥鴻с緇с(NULL ャ障) - 罩g∈菴篋 mail с read - - 2. PPE с篆< mail MY_SPE_COMMAND_MALLOC c - 罨<ャ mail id size с read 茵 - size allocate allocate 絎篋 - - id - - allocate ≪ - SPE mail ч - - 3. SPE Scheduler сSchedTaskList::read с - 筝ゅ TaskList 筝у茵 mainMem_alloc 違 - PPE <若緇ゃmainMem_set() с - - 4. create_task 帥鴻 mainMem_get(id) - allocate <ゃ潟<≪≪鴻緇 - - 腟罕絎茖с<鴻若 - 箴蕁 Game_project/student/master/gongo/MainMemMalloc 障 - README 吾障 - - * memo: The number of available entries of Inbound/Outbound Mailbox - Outbound (SPE -> PPE) mailbox若帥ャ寂違 - - /* SPE 違筝 */ - #include <spu_mfcio.h> - spu_stat_out_mbox(void); - - ц帥鴻篋堺ャ - - --- 荐菴遺 --- - printf("Available capacity of SPU Outbound Mailbox\n"); - printf(" %d\n", spu_stat_out_mbox()); - - --- 絎茵腟 -- - Available capacity of SPU Outbound Mailbox - 1 - - Inbound (PPE -> SPE) mailbox 若帥ャ寂違 - - /* PPE 違筝 */ - #include <libspe2.h> - spe_in_mbox_status(spe_context_ptr_t); - - ц帥鴻障 - - --- 荐菴遺 --- - printf("the number of available entries = %d\n", - spe_in_mbox_status(spe_ctx)); - - --- 絎茵腟 --- - the number of available entries = 4 - - Outbound 絨若 - In/Out 宴ャ若 MAX 翫羝障 wait - 障у襲帥絎c - - * fix: <ゃ紊 (*.cpp -> *.cc) - 眼荐с - - cvs <ゃ紊号膂≦篋(鐚) - - 1. cvs rm hoge.cpp; cvs add hoge.cc - 2. 吾贋・紊 mv hoge.cpp,v hoge.cc,v - - c 2 с障 - Attic (ゃ<ゃ吾c鐚) - 茵違tag update <障 - -2008-07-22 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * tag: open-campus-2008 - 罨<篋Cell/spe 篁ヤ潟若泣ゃ冴羝 - new/delete 羔 malloc/free х輝筝篋 - placement_new c篏帥違潟潟鴻帥若鴻 - new 祉泣ゃ阪ц辱 - placement_delete cу靘医轡茵 - 障頫 80KB 祉羝鴻 - - * Cell/spe/Scheduler.cpp (Scheduler::dma_load): ≪鴻2 - __scheduler->dma_store c若帥 - 薤藕帥ゃ若с茯帥鴻 - ≪鴻泣ゃ冴茯帥鴻 - ccゃ若сゃ printf 帥茵腓冴 - Connector::dma_store z祉 - - Scheduler::dma_store(void *buf, uint32 addr, uint32 size, uint32 mask) - { - <<< - connector->dma_load(buf, addr, size, mask); - ======== - connector->dma_store(buf, addr, size, mask); - >>> - } - - store load 若с筝茘違c - Scheduler::dma_load 潟 dma_store 緇 - 筝 connector->dma_load 紊cc - 筝鴻5,6莢祉HAHAHA - - * Cell/spe/SchedTask.cpp (SchedTask::exec): ≪鴻1 - Test/test_render с - SpanPack 若帥紕 - 障с罩e幻馹< - ゃ若с茯帥鴻 - printf 違鋇茘 - printf чcсc - DMA 絎篋 SchedTask::run 鐚 - 違c< wait 祉祉 - - <<< - ============ - __scheduler->dma_wait(DMA_READ); - >>> - - wait 綽 wait 綽 - -2008-07-16 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * memo: if 羔2 鐚 memcpy - Renew Task сinListData,outListData 違 allocate - 篏帥cсSchedTask c絎茵翫 - - __scheduler->dma_load(__inListData, (uint32)__task->inData, - sizeof(ListData), DMA_READ_IN_LIST); - __scheduler->dma_load(__outListData, (uint32)__task->outData, - sizeof(ListData), DMA_READ_OUT_LIST); - - 篁c - - memcpy(__inListData, __task->inData, sizeof(ListData)); - memcpy(__outListData, __task->outData, sizeof(ListData)); - free(__task->inData); - free(__task->outData); - - - - __inListData = __task->inData; - __outListData = __task->outData; - (__task->inData __task->outData Destructor free ) - - c障 - memcpy с筝号с - Destructor if 篏帥c free() с(帥鴻 Renew ) - ссc<荅帥 - - /** - * memcpy() free() version - */ - void - test_cpy(int flag, int *src) - { - if (flag) { - memcpy(data, src, sizeof(int)*length); - free(src); - } - } - - /** - * сф宴c緇 free() version - */ - void - test_nocpy(int flag, int *src) - { - if (flag) { - data = src; - } - - // SchedTask::~SchedTask() - // c - if (flag) { - free(data); - } - } - - - ∽違10000若障 - src allocate ∽違紊сc絎茵障障 - flag 1 or 0 膵違菴с - - - 絎茵腟 (1) - :no copy - SPE time by SPU Decrementer: 0.035500 - :copy - SPE time by SPU Decrementer: 0.057500 - - memcpy 祉с - flag c 1 帥障 - - - 絎茵腟 (2) - :no copy - SPE time by SPU Decrementer: 0.055250 - :copy - SPE time by SPU Decrementer: 0.053389 - - 篁綺 copy 祉筝茘違 - с障c 1 c障 - flag == 1 祉絨с - no_copy version сc祉 - - 障с絎茵腟 (1) 医сtest_nocpy 紊帥 - - void - test_nocpy(int flag, int *src) - { - if (flag) { - data = src; - } - - free((void*)(flag*(int)data)); - } - - c鴻障с膣 free(flag*data) - invalid operands of types 'int' and 'int*' to binary 'operator*'c - 冴сc鴻ч障 - с絎茵腟с - - - 絎茵腟 (3) - :no copy - SPE time by SPU Decrementer: 0.040375 - :copy - SPE time by SPU Decrementer: 0.059500 - - c若c鴻箙膊 - branch <鐚 spe if 絲丈浦若 - 箴蕁c醇с祉祉 if 篏帥c - - -2008-07-10 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * fix: TaskGroup->group - 篁障 slist cゃ劫鴻罕篏鐚 - 篏帥c障cTaskQueue 篏帥障 - ゃсc - RenewTask static_alloc 絎茖 - ゃ篏帥障c吾帥 - 祉荐菴育<ф茵cc若c - - у障ゃ若c slist - slist 篏帥cゃ篏帥c絅眼<ゃ泣ゃ冴違 - - -rwxr-xr-x 1 gongo gongo 120672 2008-07-10 14:29 spe-main* - -rwxr-xr-x 1 gongo gongo 180368 2008-07-10 13:40 spe-main.bak* - - .bak slist 篏帥c筝ゃ篏帥cversionс - 障 60k cc - SPE LS 絎拷 256k c≪ - ゃ潟ゃ潟障c潟若紜若 - - SPU C/C++ 荐茯≦宍сC++ ゃSPUс篏帥 - c吾ャ帥臀c - SPU 腱紙眼篋冴泣ゃ冴紜荀т戎c - ccヨ篋冴絮 - -2008-07-09 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * fix: TaskGroup с task 宴 - 筝 (眼 (1)) - TaskGroup->group よ膣 int фc - TaskGroup cur_id ゃ潟<潟c - 荀膣障ゃ障TaskGroup->group ウ絲 - Task сゃ帥鴻 - сslist 篏帥潟cс - - сSchedTask ゃRenewTaskList 茹f障帥ゃ潟違 - RenewTaskList 筝緇帥鴻 delete 障 - c≪鴻茴c - TaskGroup->group 荀膣 TaskPtr с障 - 鴻TaskGroup 括cс違c - - * memo: if 羔 - - #ifdef FREE_TEST - free((ListDataPtr)(__flag_renewTask*(int)(__inListData))); - free((ListDataPtr)(__flag_renewTask*(int)(__outListData))); - free((TaskListPtr)(__flag_renewTask*(int)(__list))); - #else - if (__flag_renewTask) { - free(__inListData); - free(__outListData); - free(__list); - } - #endif - - сゃ if 羔帥 - PPE眼 main.cc gettimeofday ц羝帥 (10) - - - - if 羔翫 - time: 1.222000 - time: 1.230000 - time: 1.241000 - time: 1.230000 - time: 1.223000 - time: 1.257000 - time: 1.219000 - time: 1.228000 - time: 1.220000 - time: 1.229000 - avarage: 1.2299 - - - if 羔翫 - time: 1.225000 - time: 1.215000 - time: 1.229000 - time: 1.218000 - time: 1.223000 - time: 1.214000 - time: 1.225000 - time: 1.215000 - time: 1.224000 - time: 1.219000 - avarage: 1.2207 - - 障紊(ry鐔(ry - 篏帥鴻障c違紜医c - PPE с SPE 祉ц羝鴻若cc - - -2008-07-08 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * add: Renew Task wait - Renew Task 篁障сゅ緇ゃc - - void SchedTask::wait_task(TaskPtr task); - - c篏c篁紙帥鴻 wait 障 - ゃc - 篏腆肴羝帥祉祉祉障箴蕁祉祉肢違箴蕁鐚(篆冴 - - - * fix: SchedTask 紊医 - 若吟膓帥篏帥 SchedTask 鴻с - 篁障у違 list, task 篏帥c障 - 筝篏帥紊医с - 荐惹篆冴箴蕁吾 task c茴c障 - - run(r, w) - { - ... - - //TaskPtr task; <= 絎h若 - task = create_task(TASK_EXEC); - } - - c潟若吾сScheduler 篏睡 task - 筝吾с違c障c障 - 筝絎hc羂ャ障с - 篁紊医 __task __list 障 - private - - -2008-07-07 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * fix: if <帥 - 筝鴻 if () 紊c吾障絨靘医轡 - SchedTask c帥障箴 - - if (cmd != 0) { - delete taskGroup; - scheduler->mail_write(cmd); - } - - c障cmd c taskGroup->status - cmd 0 с違taskGroup с腥冴c純 - 緇ゃ鴻帥鴻鴻腟篋сtaskGroup delete - mailbox cmd PPE 障(cmd с鴻潟潟) - с障 - - delete (int*)((cmd != 0)*(int)(taskGroup)); - scheduler->mail_write(cmd); - - 眼障 - delete free с NULL 羝<篏(?)c篏 - с馹ゃ障cmd == 0 taskGroup - 茹f障綽荀< NULL delete 羝<с - int* сc鴻障 0 羝< - int delete с若сс - c int* TaskGroupPtr 鐚c篁 - - PPE 眼 mail == 0 NOP ャ障 - ccmd 0 篁 if 吾鏆荀障 - 馹違 SPE -> PPE mailbox queue 激 - NOP 潟潟cqueue 狗綣cc - mail_write 罩≪障若絨綽с - 吾 optimize 篋 - PPE с mail 茯с - 障 queue 障篋< - - - - - - #if 1 // fix - free((void*)(flag_renewTask*(int)(list))); - #else - if (flag_renewTask) { - free(list); - } - #endif - - 腆肴gdb x/20i - branch 巡擦羝c腆肴 - 障 -O9 фc< - - - * add (API): static_alloc, static_get, static_free - SchedTask 荳らс - SPE 筝茲違帥鴻掩篏 - task::run() т戎 - - - void* static_alloc(int id, int size); - @param [id] ID憜 031 障т戎 (Scheduler.h у臂) - @param [size] 泣ゃ - @return allocate ゃ潟帥筝 static_get 菴ゃ - - - void* static_get(int id); - @param [id] static_alloc тc ID - @return ゃ潟 - - - void static_free(int id); - @param [id] 茹f障 ID - - 若 - static_free 若吟篁祉 - static_free 綽 SPE 翫順с鋍綽荀 - - 箴蕁 - cvs: firefly:Game_project/student/master/gongo/Static - - 障 Renew 紊тс - int data 掩帥鴻сゃ潟<潟 - - * TODO: TaskGroup 宴 - 絽吾 Task сtask->self - 腟篋 PPE 潟潟(荳)障 - 帥鴻筝帥鴻(篏綺吾 Renew )с - task->self task 緇c TaskGroup 茵障 - - self ф潟с - (ry - - * memo: - 筝 眼 (1) cゃс - 憜倶 - - scheduler->add_groupTask() 潟 - - group.insert_front(cur_id++); - - 障 - scheduler->remove_groupTask() - - group.remove(--cur_id); - - 障荀帥鴻с - cur_id insert/remove 障 - 帥鴻с帥鴻с - 絎c TaskPtr х∞cс - 筝吾≪鴻茴篋馹сс - 鴻с - - 若障顄с - - * tag: v20080707 - 帥鴻帥鴻篏障 - - [TODO] - SPE 筝ч掩 API - - - static_alloc - - static_get - - static_free - - 祉у茖 - - * add: 帥鴻帥鴻 - 筝綽сс眼 - 篁罕 - - - 憜帥鴻(T1) 筝с帥鴻 (Tc = T2, T3, ...) - - ャT1 腟篋罨∞T1 腟c篋 PPE 篌 - сTc 腟cT1 腟篋 PPE 篌 - - Tc у潟帥鴻(Tcc)Tcc 腟c T1 (ry - - 憜帥鴻鴻絲障 wait_for - 箴 Frame Buffer 吾莨若緇ゅ荀() - 帥鴻罸 wait_for 吾鴻鴻 - - __ 箴蕁 - cvs firefly:Game_project/student/master/gongo/Renew - - 障 - <<箴蕁罨蚊с - - - __ 眼 (1) - - 憜Tc 膊∞罕篏TaskGroup 篏帥c障 - - class TaskGroup { - unsigned int command; // T1 PPE 潟潟 - __gnu_cxx::slist<int> group; // Tc Linked List - - // function - }; - - slist TaskQueue 帥тcc - group.empty() == true ccommand PPE cс - - сslist ゃ若帥 TaskPtr int 宴 - 障(篏)≪鴻茲障с - create_task у TaskPtr 若篏帥ゃc - TaskPtr TaskList c (&list->takss[index] 帥) - сbuff_taskList[2] (Scheduler.cpp ) - 篏帥篋や篏睡с≪鴻茴 - 違 allocate 医馹< (t1)SPE LS 馹 - 篏帥c TaskList free - сfree -> allocate (t2)t1 t2 - ≪鴻茴c綵 TaskPtr 茴 - ≪鴻сTaskGorup - unsigned int cur_id 篏帥篋障 - - 障цф吾 - у堺ャ障c - - ц祉帥鐚с鐚鐚障鐚鐚鐚 - 障cャ眼< - ャャ鴻c羃祉c障 - - c荅障c - 障 unsigned int 祉障 - 篁0 <= cur_id <= 0xffff (65535) 膀蚊若篏帥 - - - __ 眼 (2) - if 紊 - 篁絽吾 Task帥鴻х帥鴻ф障 - 箴 - - - SPE allocate 若帥篏帥с絽 DMA 篏帥 - ≪劫с memcpy 篏帥 - - TaskGroup 筝荐 Tc Tcc 後膓 - - сflag_renewTask 紊違с祉 if ф吾障 - SPE с吾鴻障羂障吾鴻 - 絽吾(ry帥鴻(ryф違ゃ潟鴻帥潟鴻篏c - 障 (SchedTask = 絽吾SchedRenewTask = 帥鴻(ry ) - 若吟弱眼 篋ゃ吾с障 - 帥鴻 SchedRenewTask 帥鴻絽吾 - ゃ眼у鴻 - 紊膓帥c綵鴻腴ゃ鐚 - - -2008-07-03 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * TODO: - - add_param ф検<若帥違紜15違鐚 - - 篁絎茖с - - 1. PPE с帥鴻(T1) - 2. SPE T1 絎茵 - 3. T1 腟c篋 PPE mailbox ч - 宴 T1 荳(PPE х≪) - - с T1 違帥鴻 - 篁 T1 T2, T3, T4 篏 - - - 1. T1 腟c鴻сT1 腟篋潟潟 - 2. T1 сT1 т T2, T3, T4 腟c - 腟篋潟潟 - - 篋ゃ - PPE 眼с T1 茯茘ゅ SPE с - 綽荀荐緇絋罨蚊 - ゃ若т絎茖筝с - - - * tag: v20080703 - - 帥鴻 32 bits <若帥羝< add_param 絎茖(憜3障) - - SPE с帥鴻сc - - * add (API): SPEс create_task - 篁障сSPE с帥鴻篋堺ャ - PPE 帥鴻絎茵с - 筝箴帥c SPE сс障 - 号PPEс - - task = create_task(TASK_EXEC); - task->add_inData(buff, sizeof(Buff)); - task->add_param(data); - - 帥сс - spawn() wait_for() 絎茖障 - SPE х帥鴻紕т絖≫篏 - 腟罕сspawn() 絎茵障 - PPE 潟тc - SPE TaskManager 綽荀c若 - - -2008-06-24 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * add (API): add_param, get_param - DMA ч綽荀c 4 ゃ宴 - 篁障с - - add_inData(param, 0); - - 泣ゃ == 0 32 bit 若帥 - 篏紊(∽違括)с - - add_param(parameter); - - c菴遵障帥鴻眼с - - get_param(index); - - 障index add_param 若喝冴ф浦障障 - - add_param(x); - add_param(y); - add_param(z); - - 帥鴻眼с - - int x = get_param(0); - int z = get_param(2); - - 障 - 篁 parameter 3ゃc障 - 緇祉筝障15遺茖鐚 - 篁SPE с帥鴻若潟吾篏 - c 3 ゃ障堺ユ∞障 - - -2008-06-12 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * Cell/CellTaskManagerImpl.cpp (CellTaskManagerImpl::set_runTaskList): - ≪(ry - - list TASK_MAX_SIZE 莇罨< list next c - 眼障鴻c - 膂≦荐 - - TaskPtr task = &list[list->length++]; - [task ] - - if (list->length > TASK_MAX_SIZE) { - [newList ] - newList = append(newList, topList[speid]); - topList[speid] = newList; - } - - cctoplist[speid] - length = 0 list ャ醇с - сspe TaskList >散 - - 1. taskList[speid]->length >= 1 - 2. speid 罨< TaskList 緇c倶 - - с1 >散茹障TaskList c - 違腟篋≪с - 筝 if &list[list->length++]; c茵сk - -2008-06-10 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * Cell/CellTaskManagerImpl.cpp (CellTaskManagerImpl::set_runTaskList): - ≪鴻障 - list TASK_MAX_SIZE 莇罨< list - next 膵speTaskList_bg[speid] 茯 - <膵c - 膂≦荐帥鴻紊純(ry - - * add (API): set_post - - create_task(id, 0); - - 0 篁≪с - - task->set_post(func) - - 菴遵障func void (*func)(void) с - c綣違 void* 篁 - - - * fix (API): ListDMA API - 帥鴻眼сListDMA ф絎若帥 - - run(rbuf, wbuf) - - // index add_inData add_outData ф絎(-1) - get_input(rbuf, index); - get_input(wbuf, index); - - 菴ゃ void* сmalloc c純c鴻 - 4ゃ篁ヤ若帥翫main - - add_inData(data, 0) - - ≪鴻若帥ゃс泣ゃ冴 0 ф絎k - get_input int сc鴻違鐚 - 箴蕁 - - Game_project/student/master/gongo/arr_cal - - ц違若炊宴c4ゃc障 - - - * tag: v20080610 - - - - ListDMA 絨 - - <fix - - 篏羂 ListDMA API 吾c - - - task->add_inData(addr, size); // input - - task->add_outData(addr, size); // output - - Input/Output 若翠絎純茲違с障 - 荅潟ャ<潟吾鋋絎 - - - addr 16 ゃ≪ゃ<潟茵 - - size 16 ゃ - - c篏>散 - 16 ゃ羣若帥(贋違2,3)筝 - addr 贋・羝<c羈сcсс - 障馹障絨с - - 罨< SPE с帥鴻(莎桁鐚)吾鋋絎 - - * Cell/CellTaskManagerImpl.cpp (CellTaskManagerImpl::set_runTaskList): - if (speid > machineNum) { - speid %= MAX_USE_SPE_NUM; - } - - - - if (speid >= machineNum) { - speid %= machineNum; - } - - < - - * Cell/spe/CellDmaManager.cpp (CellDmaManager::dma_loadList): fix - ListData ListElement - - class ListElement { - public: - int size; - unsigned int addr; - }; - - 若炊spu_mfcio.h c - 筝 List DMA т戎 - - typedef struct mfc_list_element { - uint64_t notify : 1; /** Stall-and-notify bit */ - uint64_t reserved : 16; - uint64_t size : 15; /** Transfer size */ - uint64_t eal : 32; /** Lower word of effective address */ - } mfc_list_element_t; - - сnotify reserved 0 (鴻若篁 - )с腟絮 uint 2 ゃ 8 ゃ 若炊с - 障 mfc_getl mfc_putl с - 篁障с mfc_list_element_t 罕篏 for с<>撮ャ - 障ccゃ若сdma_storeList - - -2008-05-30 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * change (API): TaskManager Memory Allocate - manager->cerium_malloc(&buff, DEFAULT_ALIGNMENT, sizeof(Data)) - - - - buff = (Data*)manager->malloc(sizeof(Data)); - - 紊眼障 - alignment 絎 TaskManager 莨若с障 - 荐菴違 TaskManager.h 吾障 - - void* TaskManager::malloc(int size) { - return m_impl->allocate(DEFAULT_ALIGNMENT, size); - } - -2008-05-29 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * thinking: List DMA (4) - Cell с腆肴篁Cell List DMA >散 - - 1. List 荀膣荵∫泣ゃ冴 16 ゃ違с違 - 2. List 荀膣荵∫若帥≪鴻≪ゃ<潟篆荐(16or128 - - 2≪ Cell 篁罕с障 - 1ャ<潟荀 - - - Cell Broadband Engine ≪若 version 1.01 - - 7.5.3 get list - > 鴻祉泣ゃ冴祉<若帥DMA潟潟翫 - > 8ゃ違с違障鴻祉≪鴻祉<若帥 - > 若鴻若吾8ゃ紜≪ゃ潟違障 - - c吾int 10 (40ゃ) c - 荀篋綣障鴻若鐚 - 筝>散羣域障 - 若帥≪宴若 - - TaskManager::cerium_allocate(void **buff, int align, int size); - - c篏障篏帥鴻ラс posix_memalign 羣 - - 若吟篁祉篋障 - 鴻≪宴若緇筝鴻ャ - 荀膣泣ゃ冴16違с若с - 若吟篁祉障 - - - * Cell/CellTaskManagerImpl.cpp (CellTaskManagerImpl::mail_check): fix - CellTaskManager FifoTaskManager 吾с - ppeManager 紊違фc篏罐ャ茵cс - 筝≧鴻吾с waitTaskQueue - с TaskQueuePtr * ф検 - 掩 - - - waitTaskQueue task append - CellTaskManager->append_waitTask() - - - waitTaskQueue task remove (箴絖羣) - FifoTaskManagerImpl->mail_check() - CellTaskManagerImpl->mail_check() с - - ゃ障waitTaskQueue 掩 mail_check с - CellTaskManagerImpl mail_check - - ppeManager->mail_check(mail_list, &waitTaskQueue) - - waitTaskQueue ф検障 - ppeManager->mail_check waitTaskQueue 雁腟c - 祉c篋 waitTaskQueue 贋違 - - 腴с羂篋冴篆冴眼с蕁障 - 荀ppe spe TaskManagerImpl - waitTaskQueue 掩筝cс - - -2008-05-24 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * thinking: List DMA (3) - 憜絎茖筝Fifo с罔≧ - 馹 Cell 若茵篋ゃ - - - Input/Output 若帥≪ゃ<潟鐚 - ≪ゃ<潟c<с≪鴻 - DMA run() 羝<с - In - Out 紊吾莨若帥х∞ - 若吟若帥鴻 - Cerium_malloc c - 句鴻c - - - 筝若帥絎 - 筝絨∫c箴 - - int data[100]; // ≪ゃ<潟 - - cc data[0]data[49] - data[50] 緇障ч - ゃ &data[0] ≪鴻 16 bytes ≪ゃ<潟 - &data[50] сsizeof(int)*50 = 200 - 16 bytes ≪ゃ<潟с DMA с - 若吟障ц箴 data[32] с - ゃ眼с絨鴻鴻 - ≪鴻cャ若吟荀若帥 - 祉荀c紊茯 - - 若篁≪ゃ<潟紊т紊劫сc帥 - - -2008-05-23 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * Cell/SpeThreads.cpp (SpeThreads::init): 鴻 - 篁障т鴻 - - - spe_context_run 絎茵鴻 (spe_thread_run) - - 筝鴻若喝冴腟篋緇ゃ鴻 (frontend_thread_run) - - 鐚篏潟 - SPE 罸鴻腴> - SPE<若綵鴻荀 - c罕潟тc障篁 mailbox 宴 - Cell/CellTaskManagerImpl::mail_check цc - 鐚鴻篏綽荀障 - ゃ若сfrontend_thread_run с - spe_thread_run 莎桁違k障 - - * Cell/SpeThreads.cpp (SpeThreads::get_mail): if - 篁障с - - if (spe_out_mbox_read(spe_ctx[speid], &ret, 1) < 0) { - return ret; - else - return -1; - - c - - - 若帥茯(ret)菴 - - 若帥<c -1 菴 - - ccspe_out_mbox_read() - 若帥c翫 ret ゃ紊с - - unsigned int ret = (unsigned int)-1; - - 違腟 if < - - spe_out_mbox_read(spe_ctx[speid], &ret, 1); - return ret; - - ф - -2008-05-22 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * thinking: List DMA (2) - MFC List DMA read 翫(絨PPEcreate_task) - read size 羆冴障cх≦馹 - MFC List DMA write 翫帥鴻с - 泣ゃ冴阪у馹 - 篁障сwrite 翫 task->run() 菴ゃ write size - 篏帥篋List DMA write 翫 - - - task->run() write List DMA 罕篏篏c Scheduler - 羝<task->write() сc - - c鐚 с(筝羈)write 泣ゃ冴羆冴障c - write <鋋с - 吾莨若 or 紊cc綽荀 - 緇 SPE (綣桁16KB腆坂c)у小絋 - 茫紊 - - 若cSingle DMA write 馹сc - 若吟write 泣ゃ冴紊帥鴻鐚 - - * thinking: List DMA - - 罕潟篁ヤ - - class Task { - int cmd; - DataListDMA *rlist; - DataListDMA *wlist; - }; - - class DataListDMA { - int length; // 鴻 - unsigned int addr[128]; // ≪ - int size[128]; // ≪鴻緇若帥泣ゃ - }; - - 128 医筝ゃ帥鴻鴻荐泣ゃ冴 - 1KB (= 1024B) c 4*128+4*128 = 1024 障 - ListDMA 篏帥羌 - - 1. Scheduler cmd c Task - 2. Task 潟潟鴻( Task implement ) - task->rlist, task->wlist DMA read (絽吾DMA) - 3. task->read() MFC List DMA List 茯 - - DataListDMA->length ≪Task 筝ャ - 翫2 DMA read с 1KB 茯綽荀< - - - * tag: v20080522 - - PPE 眼帥鴻 SPE 鴻吾с脂 - - PPESPE 眼 TaskManagerImpl 雁荀c - - 若 - 鴻違 - - Game_project/student/master/gongo/hello - - 障DMA 箴蕁障cHAHAHA - List DMA ャ茵障 - - 憜 simple_render 若吾с潟 - PPE 帥鴻∽違若鴻cс障障с障 - List DMA с羂眼眼障 - - * Task 絎臂ゃ - PPE C++ 鴻吾с帥鴻絎臂障 - < API 鴻吾障 - - * <若с罨<帥鴻鴻障с羌紊 - 篁障с FifoTaskManagerImpl mail_check с - - 1. mail_check - 1.1 check_task_finish - 1.1.1 notify_wait_taskQueue - 1.1.1.1 append_activeTask (箴絖羣帥鴻) - 1.2 get_runTaskList - - mail_check 筝хcс - - 1. mail_check - 1.1 check_task_finish - 1.1.1 notify_task_finish - 2. wakeup_waitTask (ゃ障 append_activeTask) - 3. get_runTaskList - - 蚊障 - CellTaskManagerImpl mail_check c - -2008-05-13 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * Cell/CellTaskManagerImpl.cpp (CellTaskManagerImpl::set_task): - // set_task c鐚 - - SPE cゅ絨紊眼 - cur_anySpeid 絎h贋潟<潟 - ゃ潟<潟箙掩違鴻 - SPE_ANY c純篁篋鴻蚊c - SPE_ANY 綵合羂若 - -2008-05-05 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * Cell/CellTaskManagerImpl.cpp (CellTaskManagerImpl::mail_check): - PPE 絎茵帥鴻筝ゃ<篏c - 荀 - - PPE у茵帥鴻 SPE у茵筝帥鴻緇 - - cc - 障篁障 綽帥鴻 PPE and SPE c - PPE or SPE cc<鴻с倶 - 腟篋ゅcc純 - - Hello World с帥鴻 - - 1. "Hello World!!" 茵腓冴帥鴻 (2.) 肴帥鴻 - 2. 茵腓冴帥鴻 - 3. 2 腟c絎茵緇帥鴻(窮 - - (2) SPE у茵 - (2) 腟篋緇 (3) ゅ鐚 - - - - 筝綽眼障 - 羂≧祉cゃ吾鴻с - -2008-03-09 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * memo: pthread_cond_wait - ChangeLog 吾с障<≪ - - 祉 P 篏堺 - - --------------------- - pthread_mutex_lock(&sem->mutex); - - while(sem->value == 0) { // 莖羣< - // >散篁紊違脂蚊茹f障篁 - // 祉鴻莖羣茹f障緇 - pthread_cond_wait(&sem->cond,&sem->mutex); - } - // 莖羣cс腆坂 */ - sem->value--; - // 茹f障 - pthread_mutex_unlock(&sem->mutex); - ---------------------- - - с潟<潟 - pthread_cond_wait сwait unlock - cwhile 紊 lock - т祉鴻 lock с - man 荀c若吾潟<潟吾鐚 - - -2008-03-08 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * memo: mailbox read blocking/non-blocking - spe_out_mbox_read non-blocking API с - busy-wait с - 篁 ppe 眼 Scheduler 祉鐚<若腆肴 - сspe_out_intr_mbox_read blocking API - spe_out_mbox_read 荐菴違篋 - spe_event_handler_register SPE_EVENT_OUT_INTR_MBOX - 脂蚊spe 眼с - - spu_writech(SPU_WrOutMbox, data) - - - - spu_writech(SPU_WrOutIntrMbox, data) - - 篏帥綽荀 - 筝∴ mailbox read 綺茯帥鴻帥 - 障潟若鴻吾若 - cсc< intr 鴻 - 祉腟水 mail 膂≦ - 祉c荅宴 - - * Test/simple_render/task/create_span.cpp (half_triangle): fix - 脂√ span 祉純<с篆罩c - polygon->span 鴻уspan 紊 - Polygon 鴻т信罩c鴻鐚 - - * kernel/ppe/TaskManagerImpl.cpp (TaskManagerImpl::set_task): fix - 菴 TaskList mainTaskList 緇絨障c - cсTaskList с bufferManager->mainTaskList - - * kernel/ppe/BufferManager.cpp (BufferManager::clear_taskList): fix - mainTaskList->length ≪ - mainTaskList->next ≪綽 - 腥冴 TaskList 祉祉祉<鐚 - -2008-03-07 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * bug-fix (Test/simple_render): y綺ф腱糸劫 - (1) с吾莨若 - - y = height - y - - 腱帥 - - 眼潟 y 紜(+)脂≫蚊 - - с祉若c(2)сc筝蚊 - - 蚊若筝 + 鴻 - 違潟亥framebuffer 若鴻сс - 筝 y++ c祉篏若ゃゃc< - - * bug (Test/simple_render): y綺ф腱糸劫 - Viewer::run_draw с緇ャSpanPack 障丈祉号(1) - SPE 羝<8蚊祉号(2)с - y +0.5 腱糸劫 - (1)с筝(2)с筝梧 - span 荀 - x 劫 荵≪馹с draw y 荐膊違 - - 1: polygon.cpp Polygon::draw(SPANPACK); - 2: task/span_pack_draw.cpp run(); - - * Test/simple_render/spe/SpuDraw.cpp: 膓茹f浦 - render_y &= ~7 - - сkс障 - 篁 - - #define YTOP(y) (y & ~7) - - cc障 - -2008-03-05 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * memo: MFC List DMA element 紊у - Cell Broadband Engine Architecture Version 1.02 - - P.55 - The maximum number of elements is 2048. - Each element describes a transfer of up to 16 KB. - - cс筝綺荵∫с狗DMA紊16KB - mfc_list_element_t 2048 障ц┃絎сc - 鴻c若с蚊 MFC List DMA 篏帥 - 2048 医鐚 - - - * Test/simple_render/spe/SpuDraw.cpp: 膓 - cc宴若 - 篁 - - if (render_y < 0) { - int tmpy = render_y%8; - render_y -= tmpy + (tmpy != 0)*8; - } else { - render_y -= (render_y%8); - } - render_y += 1080/2; - - ц純∞若 - c荐膊 span - 祉 - -2008-03-04 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * Test/simple_render/spe/SpuDraw.cpp: 膓 - ゃ鴻羂 - - if (render_y < 0) { - int tmpy = render_y%8; - render_y -= tmpy + (tmpy != 0)*8; - } else { - render_y -= (render_y%8); - } - render_y += 1080/2; - - - - render_y += 1080/2; - render_y -= (render_y%8); - - с鐚c 1080/2 c羂 - - * Test/simple_render/spe/SpuDraw.cpp: render_y 荐膊篆罩 - sp->span[0].y (SpanPack 主 Span y 綺ф) - SpanPack 祉膀蚊筝筝 y 綺ф茯帥鴻 - - c箴 SpanPack ャc Span - y 綺ф 1 ~ 8 - - 1 ----- - -- - -------- - ---- - --------- - 8 -- - - '-' 祉c - 翫y = 1 SpanPack 筝筝堺 綺фc - framebuffer 吾莨若y = 1 吾茵障 - - сsp->span[0].y c堺 y с篆荐若<с - sp->span[i].y ゃ障 y с堺 y 羆 - 綽荀荐膊鴻c障 - - 1 ////////// - <- 吾莨若障 - ////////// - ////////// - - 帥罩cс茯帥鴻帥 - render_y cゆ障 - 篁障с - - render_y = sp->span[0].y; - render_y += 1080/2; - render_y = (render_y/8)*8; - - c sp->span[0].y ゃ鴻 - ゆ - - if (render_y < 0) { - int tmpy = render_y%8; - render_y -= tmpy + (tmpy != 0)*8; - } else { - render_y -= (render_y%8); - } - render_y += 1080/2; - - с障眼 - 絨絅藝若if 紊 - -2008-03-03 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * memo: 腟 - ppe/spe 翫 - 263.444 FPS - - ppe -O9 ф - 317.425 FPS - - spe -O9 ф - 812.539 FPS - - ppe/spe -O9 ф - 1610.58 FPS (鴻 - - - 糸荀 - 障潟潟c - 違鐚鐚c - - -2008-02-28 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * kernel/ppe/BufferManager.cpp: remove_taskQueue_all() - taskQueue create free cc< - queue 莇潟 -> extend_pool -> 莇潟(ry - c膵違菴<≪祉違<潟若激с潟冴 - сctask->wait_me 羔サc - task->wait_i notify(ry уゃ - task->wait_me notify(ry 羝<緇祉cc - cсwait_me 羔∽違篏障 - 羂♂綺紜羂羂 - - -2008-02-17 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * Todo: с - - - * fix: kernel/ppe/HTask.cpp - 篁障сmanager->create_task х帥鴻 - - - dependency 荐絎 - manager->set_task_depend(master, slave) // slave master 緇 - - - 絎茵ャ若吾菴遵 - manager->spawn_task(master); - manager->spawn_task(slave); - - manager 篁c障 - 障с鴻 dependency - c<c<緇ゃcAPI荀 - сTask (HTask ) 筝篋ゃ絲上 - - void set_depend(HTaskPtr) void spawn(void) 菴遵障 - - - Usage - slave->set_depend(master); // slave master 緇 - slave->spawn(); // slave ャ若梧申 - - 腟絮∽違筝с筝 set_task_depend - 若с若九眼鴻障 - -2008-02-16 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * tag: beta3 - <潟違菴遵障鐚c - 障сс荅 Fifo 若吾с潟с - Cell 吾筝筝<腆冴 - - * add: kernel/ppe/DmaBuffer.cpp - <潟亥篏c - cсDMA 吾с(やゃ)с - 茵cссc荅宴障 - 筝<潟違сс - swap_buffer 違k - - -Usage - DmaBuffer *buffer = manager->allocate(sizeof(SceneGraphPack)); - - 篁障сcreate_task in_addr out_addr - DmaBuffer 若吟 malloc/new ゃ - 若冴(seg fault鐚) - 羆純若鴻絎篏帥c罕絖 Test/simple_render - viewer.cpp т戎c障sgp_buff pp_buff cゃ - - 若吟API篏祉祉 - -2008-02-11 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * add: Test/simple_render - chiaki DataPack 篏帥c Cube 茵腓冴違 - 膂≦ DataPack TaskManager scheduler (SpeManager) 羝< - 潟若膵違菴 - 障羂сс - - -2008-02-10 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * tag: beta1 - 倶сс吾鴻鐚 - - - task (荀) 筝 task (絖) с - 罩g∈с 絖task - 荀task 箴絖ャ task ∴ - <腟 - 8ャ Todo 吾篁絎茖с - task task 喝с - 絎 spe 睡腟c絎茖сc - OS c荐絎茖с吾眼鐚 - ∽違 task 荐潟с - c障с若 - - - chiaki simple_render - (菴処) 茹f浦障 - read/write buffer 泣ゃ冴莇潟c≪www - 障莨宴冴筝罧 - - 障 cvs commit chiaki 吾 - DataPack 絲上 simple_render TasKManager 腟粋昭с帥 - cOSc純吾篁 - update_sgp create_pp task 帥 - с障羂c malloc 膤祉 warning - 激帥c障c - TaskManager simple_render - TaskManagerс malloc 膤祉馹 - 障сc違「<c<取 - - -2008-02-08 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * add: kernel/ppe/SymTable.cpp - 篁障 func[] = {add, sum, ...} - cc荐障c - 荅宴 Symbol Table 帥篏 - - // 篌若潟若 - struct sym_table { - char *sym; // 激潟 - void *address; // 激潟腓冴≪ - } sym_table[] = {{"Sum", &Sum} , {"Draw", &draw}}; - - int fd = get_fd("Sum"); - void *addr = get_address(fd); - - table "Sum" "Draw" c篋ゃ激潟脂蚊 - 箴違若(若鐚) "Sum" c激潟≪祉鴻翫 - 障 get_fd "Sum" 絲障file descripter 菴 - 若吟 fd 緇c get_address 緇堺ャ - TaskManager 篏帥鴻 - - // 篆冴篁Draw ∽違篏帥帥鴻 - int fd = manager->open("Draw"); - manager->create_task(fd, size, in, out, func); - manager->open с get_fd 篏帥鴻с - - 障壕篏違с篁cс - - - - 茖莇 - file descripter 茵 - - OS ャ fopen篏帥鴻с鐚 - - - * Todo: task task - 篁障с task 茵篏罐羲膊帥茵 - 膣絎茖羆冴<с - OS 帥鴻筝ャ帥鴻 - 篁鴻違сc - - Test/Sum 違т戎帥鴻 - - - init2 // 莢х吾с障 - 羲膊医ゃ< - - - sum1 - 膀蚊贋 (i i+16 ) 膩 - - - sum2 - sum1 ф茲違膀蚊膩筝ゃ障 - (ex. 茲違 sum1 1->16, 17->32, 33->48 膩荐膊 - sum2 筝3ゃ膩荐膊 - 荀 1->48 膩蚊c違 - - - finish - sum2 ф障cゃ茵腓 - - Sum 違 OS 荐SumOS - SumOS TaskManager (茗 kernel) 莎桁 - init 莎桁init с篋羆冴帥鴻с - init2 finish 篋ゃ帥鴻 create 脂蚊 - init2 finish 箴絖≫ (init2 腟c finish) - init2 筝сsum1 sum2 帥鴻篏 - sum1 sum2 箴絖≫ (sum1 腟c sum2) - - 篁絎茖帥鴻腟篋罨<帥鴻梧 - 障綵箴違帥鴻筝 - 違帥鴻篏翫帥鴻腟篋障с - 絎茵c障 - с障篁manager->create_task 綺 - manager->run ∞莎桁荐潟 - 篏∞∝cscheduler 綵合 - SpeManager (紊) 2綺若喝冴荐潟 - ゃ障帥鴻筝с帥鴻篏綺SpeManager 吾с - new 鐚鐚 - - <帥Cell version spe cc - 紊т紊ゃゃ spe 1ゃ篏帥荐絎c緇絋 - - 荀帥鴻筝с帥鴻篏翫 - -2008-02-07 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * memo: 違潟違紮水 - scheduler task 膊∞ - kernel programing ゃс - example task 蚊綵羆冴 - user programing ゃс - - c荀鴻ц綽荀 - - * memo: OS - OS 莎桁羌 - - - PC 紙ャ - - BIOS 腴> (OpenFirmWare, EFI, BIOS) - - 莎桁ゃ鴻с (綺腮蕁) - - 莎桁ゃ鴻 Boot loader 莎桁 - + BIOS c茯茘с<ゃ激鴻(c鐚) - + <ゃ激鴻 Boot Loader ャc - + grub, grub2, lilo, kboot - - Boot Loader kernel 莎桁 - + 若若翫TCP/IP - 若ゃ(ゃ若泣鐚)ゃc綽荀 - - kernel scheduler 莎桁 - - scheduler (init 若駈) - - init с篋鐚荐絎鴻若 - + linux /etc/rc ゃ init 若 - - login form 莎桁 - - 茖莇 c若 - - login - - shell 若 - + login shell 腆冴 - - 若吟荐絎莎桁鴻鐚絎茵 - - 眼違ゃ - -2008-02-06 Wataru MIYAGUNI <gongo@cr.ie.u-ryukyu.ac.jp> - - * kernel/spe/*.cpp: new placement new - 憜spe kernel 帥鴻帥罸 - new/delete 膵違菴障篁с - 綺眼с - с篋 allocate placement new 篏帥 - new c純 - 箴蕁筝医 new/delete 膵違菴違 - 医placement new 綺罸莠 - - for (int i = 0; i < num; i++) { - - < task = new Task; - < task->init(i); - < task->printID(); - < delete task; - --- - > task = new(buff) Task; // buff = malloc(BUFF_SIZE); - > task->init(id); - > task->printID(id); - } - - placement new сdelete 綽荀< - 筝ф違 allocate 綽荀 - 綺罸莠篁ヤno_new placement new сln_new new/delete - - % ./a.out 10 // 10 - no_new: time: 0.012135(msec) - ln_new: time: 0.003572(msec) - - % ./a.out 100 - no_new: time: 0.022453(msec) - ln_new: time: 0.018989(msec) - - % ./a.out 1000 - no_new: time: 0.115277(msec) - ln_new: time: 0.136335(msec) - - % ./a.out 10000 - no_new: time: 1.056156(msec) - ln_new: time: 1.322709(msec) - - % ./a.out 100000 - no_new: time: 10.622221(msec) - ln_new: time: 13.362414(msec) - - % ./a.out 1000000 - no_new: time: 109.436496(msec) - ln_new: time: 136.956872(msec) - - 10100 莢障∴( - 違紊ゃ祉絨 no_new c - <帥 printID < - - % ./a.out 1000000 - no_new: time: 0.008512(msec) - ln_new: time: 27.100296(msec) - - I/O 綏劻障
--- a/TaskManager/Test/test_render/Makefile.def Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Test/test_render/Makefile.def Thu Jun 04 00:03:49 2009 +0900 @@ -1,6 +1,19 @@ TARGET = test_nogl +<<<<<<< local CERIUM = ../../.. +======= +# include/library path +# ex: macosx +#CERIUM = /Users/gongo/Source/Concurrency/Game_project/Cerium +#CERIUM = /Users/gongo/Source/hg/Cerium + +# ex: linux/ps3 +CERIUM = /home/gongo/Cerium +#CERIUM = /Users/tkaito/hg/Game/Cerium + +#CERIUM = ../../.. +>>>>>>> other CC = g++ CFLAGS = -O9 -g -Wall# -DDEBUG
--- a/TaskManager/Test/test_render/SceneGraph.cpp Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Test/test_render/SceneGraph.cpp Thu Jun 04 00:03:49 2009 +0900 @@ -426,7 +426,7 @@ /* this絖絖絖name絖違ゃ菴 NULL. */ SceneGraphPtr -SceneGraph::searchSceneGraph(char *name) +SceneGraph::searchSceneGraph(const char *name) { SceneGraphPtr tmp; SceneGraphPtr result;
--- a/TaskManager/Test/test_render/SceneGraph.h Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Test/test_render/SceneGraph.h Thu Jun 04 00:03:49 2009 +0900 @@ -70,7 +70,7 @@ SceneGraphPtr addBrother(SceneGraphPtr bro); SceneGraphPtr clone(void); SceneGraphPtr clone(void *buf); - SceneGraphPtr searchSceneGraph(char *name); + SceneGraphPtr searchSceneGraph(const char *name); void set_move_collision(SceneGraphPtr node, move_func new_move, collision_func new_collision); void set_move_collision(move_func new_move, collision_func new_collision);
--- a/TaskManager/Test/test_render/polygon.h Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Test/test_render/polygon.h Thu Jun 04 00:03:49 2009 +0900 @@ -22,8 +22,8 @@ class Polygon { public: long long size; - char *name; - char *parent_name; + const char *name; + const char *parent_name; //float *data; //"vertex" and "normal" and "texture" float *coord_xyz; // vertex coordinate array
--- a/TaskManager/Test/test_render/spe/CreatePolygon.cpp Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Test/test_render/spe/CreatePolygon.cpp Thu Jun 04 00:03:49 2009 +0900 @@ -85,11 +85,12 @@ if (pp->info.size >= MAX_SIZE_TRIANGLE) { PolygonPackPtr next; + // smanager Task 篏0 с PolygonPack->task_id smanager->mainMem_alloc(0, sizeof(PolygonPack)); smanager->mainMem_wait(); next = (PolygonPackPtr)smanager->mainMem_get(0); - pp->next = next; + pp->next = next; // TaskManager 眼с鴻 tmp_pp = pp; pp = send_pp; @@ -101,9 +102,11 @@ pp_addr = next; - smanager->dma_wait(PP_LOAD); + smanager->dma_wait(PP_LOAD); // 紊筝荀 smanager->dma_load(pp, (uint32)pp_addr, sizeof(PolygonPack), PP_LOAD); + // 罨< dma_wait 潟鴻蕭сゃゃ潟ч綽荀 + smanager->dma_wait(PP_LOAD); pp->init();
--- a/TaskManager/Test/test_render/spe/CreateSpan.cpp Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Test/test_render/spe/CreateSpan.cpp Thu Jun 04 00:03:49 2009 +0900 @@ -1,6 +1,7 @@ #include "CreateSpan.h" #include "viewer_types.h" +// DMA channel static const int SPAN_PACK_LOAD = 5; static const int SPAN_PACK_STORE = 6; static const int POLYGON_PACK_LOAD = 7; @@ -294,7 +295,7 @@ smanager->mainMem_wait(); next = (SpanPackPtr)smanager->mainMem_get(0); - spack->next = next; + spack->next = next; // TaskManager с tmp_spack = spack; spack = send_spack; @@ -486,6 +487,7 @@ sizeof(SpanPack), SPAN_PACK_STORE); smanager->dma_wait(SPAN_PACK_STORE); + // smanager allocate free smanager с鴻 free(free_pp); free(free_spack); free(vMid10);
--- a/TaskManager/Test/test_render/spe/DrawSpan.cpp Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Test/test_render/spe/DrawSpan.cpp Thu Jun 04 00:03:49 2009 +0900 @@ -9,23 +9,42 @@ SchedDefineTask(DrawSpan); +<<<<<<< local #define TEX_LOAD1 0 #define TEX_LOAD2 1 #define SPAN_PACK_LOAD 2 #define FB_STORE 3 +======= +<<<<<<< local +static TileHashPtr hash; +======= +<<<<<<< local +static const int hashsize = 263; +>>>>>>> other +<<<<<<< local DrawSpan::~DrawSpan(void) { smanager->dma_wait(FB_STORE); free((void*)((int)linebuf*doneWrite)); } +======= +static TilePtr hash_table[hashsize] = {NULL}; +>>>>>>> other +<<<<<<< local inline vector float spu_re_nrm(vector float a) { vector float unit = (vector float){1.0, 1.0, 1.0, 1.0}; vector float approximation; +======= +unsigned short PRIME[8] = { + 0x002, 0x065, 0x0c7, 0x133, 0x191, 0x1f3, 0x259, 0x2bd, +}; +>>>>>>> other +<<<<<<< local approximation = spu_re(a); return spu_madd(spu_nmsub(approximation, a, unit), approximation, approximation); @@ -44,6 +63,10 @@ return getLocalPositionVec(x, split_screen_w); } +======= +>>>>>>> other +static TileListPtr tileList; +>>>>>>> other /** * 鴻cTEXTURE_SPLIT_PIXEL^2 蚊 @@ -102,6 +125,9 @@ int block = getTexBlock(tx, ty, tw); return tex_addr_top + block*TEXTURE_BLOCK_SIZE; } +======= +static unsigned char *tex; +>>>>>>> other /** * FrameBuffer 吾莨若 rgb @@ -184,7 +210,11 @@ tile->texture_addr = addr; - int index = hash->put(tile->texture_addr, tile); +<<<<<<< local + //int index = hash->put(tile->texture_addr, tile); +======= + hash->put(tile->texture_addr, tile); +>>>>>>> other smanager->dma_load(tile->pixel, (uint32)addr, sizeof(uint32)*TEXTURE_BLOCK_SIZE, tag); } @@ -597,6 +627,26 @@ int tl_tag_flg1 = 0; int tl_tag_flg2 = 1; +<<<<<<< local +======= + float *zRow = (float*)smanager->get_input(1); + int **linebuf = (int**)smanager->allocate(sizeof(int*)*rangey); + + for (int i = 0; i < rangey; i++) { + linebuf[i] = (int*)smanager->get_output(i); +<<<<<<< local + linebuf_init(linebuf[i], rangex, 0xffffffff); +======= +<<<<<<< local + linebuf_init(linebuf[i], rangex, 0xffffff); +======= + //linebuf_init(linebuf[i], rangex, 0x00ff00ff); + linebuf_init(linebuf[i], rangex, 0); +>>>>>>> other +>>>>>>> other + } + +>>>>>>> other do { /** * SpanPack->next 絖翫 @@ -610,6 +660,7 @@ next_spack = NULL; } +<<<<<<< local SpanPtr resume_span = &nop_span; int resume_span_x = 0; @@ -617,6 +668,9 @@ SpanPtr next_span; int next_span_x; +======= + for (int t = spack->info.start; t < spack->info.size; t++) { +>>>>>>> other span = &spack->span[t]; /** @@ -666,5 +720,24 @@ */ free(free_spack); +<<<<<<< local +======= + free(linebuf); +<<<<<<< local +======= + free(zRow); +<<<<<<< local +======= +<<<<<<< local + free(tileList); + free(tilist); + free(next_tilist); +>>>>>>> other +>>>>>>> other + +======= + free(tex); +>>>>>>> other +>>>>>>> other return 0; }
--- a/TaskManager/Test/test_render/spe/DrawSpanRenew.cpp Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Test/test_render/spe/DrawSpanRenew.cpp Thu Jun 04 00:03:49 2009 +0900 @@ -216,7 +216,10 @@ free(zRow); free(args); -FINISH: +<<<<<<< local + //FINISH: +======= +>>>>>>> other /** * linebuf, zRow, args は RenewTask が引き継ぐ */
--- a/TaskManager/Test/test_render/spe/Load_Texture.cpp Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Test/test_render/spe/Load_Texture.cpp Thu Jun 04 00:03:49 2009 +0900 @@ -20,11 +20,11 @@ */ void *hash_tmp = smanager->global_alloc(GLOBAL_TEXTURE_HASH, sizeof(TileHash)); - TileHashPtr hashtable = new(hash_tmp) TileHash; + new(hash_tmp) TileHash; void *tileList_tmp = smanager->global_alloc(GLOBAL_TILE_LIST, sizeof(TileList)); - TileListPtr tileList = new(tileList_tmp) TileList; + new(tileList_tmp) TileList; return 0; }
--- a/TaskManager/Test/test_render/task/CreateSpan.cpp Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Test/test_render/task/CreateSpan.cpp Thu Jun 04 00:03:49 2009 +0900 @@ -128,7 +128,8 @@ /** - * span width,height texture width,height 罸鴻 + * span width Triangle height 絲障 + * texture width,height 罸鴻 * span 祉篏帥 texture 罸羆 * * @param[in] width Width of span @@ -399,7 +400,13 @@ * SIMD 荐菴違綽 */ +<<<<<<< local #endif +======= + //scale = (8 > tex_scale_max) ? tex_scale_max : 8; + + uint32 *tapestry = getTapestry(tex_width, tex_height, scale, tex_addr); +>>>>>>> other } @@ -441,9 +448,18 @@ for (int i = 0; i < pp->info.size; i++) { triPack = &pp->tri[i]; +<<<<<<< local TriangleTexInfoPtr tri_tex_info = &triPack->tex_info; +======= + // ф検吾鴻帥箙с祉祉 + // с緇絋鐚 +>>>>>>> other make_vertex(triPack, &vMin, &vMid, &vMax); +<<<<<<< local +======= + +>>>>>>> other make_vMid10(vMid10, vMin, vMid, vMax); /**
--- a/TaskManager/Test/test_render/task/DrawSpan.cpp Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Test/test_render/task/DrawSpan.cpp Thu Jun 04 00:03:49 2009 +0900 @@ -573,6 +573,7 @@ next_spack = NULL; } +<<<<<<< local SpanPtr resume_span = &nop_span; int resume_span_x = 0; @@ -580,6 +581,9 @@ SpanPtr next_span; int next_span_x; +======= + for (int t = spack->info.start; t < spack->info.size; t++) { +>>>>>>> other span = &spack->span[t]; /**
--- a/TaskManager/Test/test_render/task/update_sgp.cpp Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Test/test_render/task/update_sgp.cpp Thu Jun 04 00:03:49 2009 +0900 @@ -8,6 +8,108 @@ SchedDefineTask(Update_SGP); +<<<<<<< local +======= +typedef void (*moveFunc)(SceneGraphNodePtr, int, int); +typedef void (*collFunc)(SceneGraphNodePtr, int, int); + +static moveFunc moveList[3]; +static collFunc collList[3]; + +static void +move0(SceneGraphNodePtr node, int w, int h) +{ + static float dest_x = 0.3f; + static float dest_y = 0.5f; + + node->angle[1] += 1.0f; + if (node->angle[1] > 360.0f) { + node->angle[1] = 0.0f; + } + + node->obj_pos[0] += dest_x; + if ((int)node->obj_pos[0] > w || (int)node->obj_pos[0] < 0) { + dest_x = -dest_x; + } + + node->obj_pos[1] += dest_y; + if ((int)node->obj_pos[1] > h || (int)node->obj_pos[1] < 0) { + dest_y = -dest_y; + } +} + +static void +move1(SceneGraphNodePtr node, int w, int h) +{ + node->angle[1] += 1.0f; + if (node->angle[1] > 360.0f) { + node->angle[1] = 0.0f; + } + + static float dest_x = 0.5f; + static float dest_y = 1.3f; + + node->obj_pos[0] += dest_x; + if ((int)node->obj_pos[0] > w || (int)node->obj_pos[0] < 0) { + dest_x = -dest_x; + } + + node->obj_pos[1] += dest_y; + if ((int)node->obj_pos[1] > h || (int)node->obj_pos[1] < 0) { + dest_y = -dest_y; + } +} + +static void +move2(SceneGraphNodePtr node, int w, int h) +{ + node->angle[1] += 1.0f; + if (node->angle[1] > 360.0f) { + node->angle[1] = 0.0f; + } + + static float dest_x = 1.0f; + static float dest_y = 0.8f; + + node->obj_pos[0] += dest_x; + if ((int)node->obj_pos[0] > w || (int)node->obj_pos[0] < 0) { + dest_x = -dest_x; + } + + node->obj_pos[1] += dest_y; + if ((int)node->obj_pos[1] > h || (int)node->obj_pos[1] < 0) { + dest_y = -dest_y; + } +} + +static void +move4(SceneGraphNodePtr node, int w, int h) +{ + node->angle[1] += 1.0f; + if (node->angle[1] > 360.0f) { + node->angle[1] = 0.0f; + } +} + + +static void +coll(SceneGraphNodePtr node, int w, int h) +{ +} + +static void +init(void) +{ + moveList[0] = move0; + moveList[1] = move4; + moveList[2] = move2; + + collList[0] = coll; + collList[1] = coll; + collList[2] = coll; +} + +>>>>>>> other int Update_SGP::run(void *rbuf, void *wbuf) {
--- a/TaskManager/Test/test_render/viewer.cpp Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/Test/test_render/viewer.cpp Thu Jun 04 00:03:49 2009 +0900 @@ -177,7 +177,7 @@ } task_next = manager->create_task(TASK_DUMMY); - task_next->set_post(&post2runLoop, NULL); + #if 0 // 茫娯с篁 SceneGraphPack 篏 @@ -192,13 +192,17 @@ for (int i = 0; i < spe_num; i++) { task_tex = manager->create_task(TASK_INIT_TEXTURE); - /* 絨篏帥鴻鐚 */ + /* + * 絨篏帥鴻鐚 + */ task_tex->set_cpu((CPU_TYPE)((int)SPE_0 + i)); task_next->wait_for(task_tex); task_tex->spawn(); } - task_next->spawn(); + task_next->set_post(&post2runLoop, NULL); // set_post(function(this->run_loop()), NULL) + task_next->spawn(); + // TASK_INIT_TEXTURE 腟c DUMMY_TASK Viewer::run_loop() 若 } void @@ -224,7 +228,7 @@ } task_next = manager->create_task(TASK_DUMMY); - task_next->set_post(post2runDraw, NULL); + #if 0 // SceneGraphPack update @@ -292,7 +296,11 @@ } task_create_pp->spawn(); + + // Barrier + task_next->set_post(post2runDraw, NULL); // set_post(function(this->run_draw()), NULL) task_next->spawn(); + // TASK_CREATE_SPAN 腟c DUMMY_TASK Viewer::run_draw() 若 } void @@ -302,7 +310,6 @@ HTaskPtr task_draw; task_next = manager->create_task(TASK_DUMMY); - task_next->set_post(post2runLoop, NULL); ppack->clear(); for (int i = 0; i < spackList_length; i++) { @@ -329,7 +336,9 @@ //break; // Draw Background (憜紂ゃ吟) task_draw = manager->create_task(TASK_DRAW_BACK); +<<<<<<< local task_draw->add_param(0xffffffff); +<<<<<<< local for (int k = 0; k < rangey; k++) { task_draw->add_outData( @@ -343,6 +352,23 @@ //0xFFFFFFFF, (this->width)*sizeof(int)*rangey/sizeof(wchar_t)); break; #endif +======= +======= +<<<<<<< local + task_draw->add_param(0xffffff); +======= + //task_draw->add_param(0x00ffcc55); + task_draw->add_param(0); +//task_draw->add_param(st_rgb); +>>>>>>> other +>>>>>>> other + } + + for (int k = 0; k < rangey; k++) { + task_draw->add_outData( + &pixels[(startx-1)+this->width*(k+starty-1)], + (endx - startx + 1)*sizeof(int)); +>>>>>>> other } task_draw->add_param(startx); @@ -361,7 +387,9 @@ } } + task_next->set_post(post2runLoop, NULL); // set_post(function(this->run_loop()), NULL) task_next->spawn(); + // TASK_DRAW_SPAN 腟c DUMMY_TASK Viewer::run_loop() 若 frames++; }
--- a/TaskManager/kernel/main.cc Tue Jun 02 21:53:22 2009 +0900 +++ b/TaskManager/kernel/main.cc Thu Jun 04 00:03:49 2009 +0900 @@ -12,7 +12,11 @@ defaultTMend(void) {} TaskManager *manager; +<<<<<<< local static std::string help_str = "\n\ +======= +static char help_str[] = "\n\ +>>>>>>> other * Cerium program option *\n\ -chelp Print this message \n\ -cpu Number of CPU (default 1) \n";
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/file_list Thu Jun 04 00:03:49 2009 +0900 @@ -0,0 +1,49 @@ +Renderer/Cell/Engine.h +Renderer/Cell/SceneGraph2PolygonTask.h +Renderer/DataPack/DataPackEngine.h +Renderer/Simple/SimpleEngine.h +TaskManager/Cell/CellBufferManager.cc +TaskManager/Cell/CellHTaskInfo.cc +TaskManager/Cell/CellTaskListInfo.cc +TaskManager/Cell/CellTaskManagerImpl.cc +TaskManager/Cell/PpeScheduler.cc +TaskManager/Cell/SpeThreads.cc +TaskManager/kernel/main.cc +include/TaskManager/BufferManager.h +include/TaskManager/CellBufferManager.h +include/TaskManager/CellDmaManager.h +include/TaskManager/CellHTaskInfo.h +include/TaskManager/CellScheduler.h +include/TaskManager/CellTaskInfo.h +include/TaskManager/CellTaskListInfo.h +include/TaskManager/CellTaskManagerImpl.h +include/TaskManager/DmaBuffer.h +include/TaskManager/DmaManager.h +include/TaskManager/HTask.h +include/TaskManager/HTaskInfo.h +include/TaskManager/ListData.h +include/TaskManager/MailManager.h +include/TaskManager/MainScheduler.h +include/TaskManager/PpeScheduler.h +include/TaskManager/Random.h +include/TaskManager/SchedExit.h +include/TaskManager/SchedMail.h +include/TaskManager/SchedNop.h +include/TaskManager/SchedNop2Ready.h +include/TaskManager/SchedTask.h +include/TaskManager/SchedTaskBase.h +include/TaskManager/SchedTaskList.h +include/TaskManager/Scheduler.h +include/TaskManager/SpeThreads.h +include/TaskManager/SymTable.h +include/TaskManager/Task.h +include/TaskManager/TaskGroup.h +include/TaskManager/TaskList.h +include/TaskManager/TaskListInfo.h +include/TaskManager/TaskManager.h +include/TaskManager/TaskManagerImpl.h +include/TaskManager/TaskQueue.h +include/TaskManager/TaskQueueInfo.h +include/TaskManager/base.h +include/TaskManager/error.h +include/TaskManager/types.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/file_list~ Thu Jun 04 00:03:49 2009 +0900 @@ -0,0 +1,74 @@ +Renderer/Cell/Engine.h +Renderer/Cell/SceneGraph2PolygonTask.h +Renderer/DataPack/DataPackEngine.h +Renderer/Simple/SimpleEngine.h +TaskManager/Cell/CellBufferManager.cc +TaskManager/Cell/CellHTaskInfo.cc +TaskManager/Cell/CellTaskListInfo.cc +TaskManager/Cell/CellTaskManagerImpl.cc +TaskManager/Cell/PpeScheduler.cc +TaskManager/Cell/SpeThreads.cc +TaskManager/Fifo/FifoDmaManager.cc +TaskManager/Fifo/FifoTaskManagerImpl.cc +TaskManager/Fifo/MainScheduler.cc +TaskManager/kernel/main.cc +example/HelloWorld/Func.h +example/HelloWorld/main.cc +example/basic/Func.h +example/basic/main.cc +example/cube/CubeSceneGraph.h +example/cube/CubeTask.h +example/cube/RenderingEngine.h +example/dependency_task/Func.h +example/dependency_task/main.cc +example/many_task/Func.h +example/many_task/main.cc +example/many_task/sort.cc +example/many_task/sort.h +example/many_task/task_init.cc +example/post_function/Func.h +example/post_function/main.cc +example/renew_task/Func.h +example/renew_task/main.cc +example/share_task/Func.h +example/share_task/main.cc +include/TaskManager/BufferManager.h +include/TaskManager/CellBufferManager.h +include/TaskManager/CellDmaManager.h +include/TaskManager/CellHTaskInfo.h +include/TaskManager/CellScheduler.h +include/TaskManager/CellTaskInfo.h +include/TaskManager/CellTaskListInfo.h +include/TaskManager/CellTaskManagerImpl.h +include/TaskManager/DmaBuffer.h +include/TaskManager/DmaManager.h +include/TaskManager/FifoDmaManager.h +include/TaskManager/FifoTaskManagerImpl.h +include/TaskManager/HTask.h +include/TaskManager/HTaskInfo.h +include/TaskManager/ListData.h +include/TaskManager/MailManager.h +include/TaskManager/MainScheduler.h +include/TaskManager/PpeScheduler.h +include/TaskManager/Random.h +include/TaskManager/SchedExit.h +include/TaskManager/SchedMail.h +include/TaskManager/SchedNop.h +include/TaskManager/SchedNop2Ready.h +include/TaskManager/SchedTask.h +include/TaskManager/SchedTaskBase.h +include/TaskManager/SchedTaskList.h +include/TaskManager/Scheduler.h +include/TaskManager/SpeThreads.h +include/TaskManager/SymTable.h +include/TaskManager/Task.h +include/TaskManager/TaskGroup.h +include/TaskManager/TaskList.h +include/TaskManager/TaskListInfo.h +include/TaskManager/TaskManager.h +include/TaskManager/TaskManagerImpl.h +include/TaskManager/TaskQueue.h +include/TaskManager/TaskQueueInfo.h +include/TaskManager/base.h +include/TaskManager/error.h +include/TaskManager/types.h
--- a/include/TaskManager/CellDmaManager.h Tue Jun 02 21:53:22 2009 +0900 +++ b/include/TaskManager/CellDmaManager.h Thu Jun 04 00:03:49 2009 +0900 @@ -11,6 +11,11 @@ #include <spu_mfcio.h> +#define SPU_PROFILE 1 + +extern unsigned int CellDmaManager::wait_time, CellDmaManager::busy_time; +extern unsigned long long CellDmaManager::global_busy_time, CellDmaManager::global_wait_time; + class CellDmaManager : public DmaManager { public: BASE_NEW_DELETE(CellDmaManager); @@ -21,11 +26,14 @@ } DmaList, *DmaListPtr; /* variables */ + /* functions */ void dma_load(void *buf, uint32 addr, uint32 size, uint32 mask); void dma_store(void *buf, uint32 addr, uint32 size, uint32 mask); void dma_wait(uint32 mask) ; + void start_dmawait_profile(); + void end_dmawait_profile(); void mail_write(uint32 data); uint32 mail_read(void);
--- a/include/TaskManager/SchedExit.h Tue Jun 02 21:53:22 2009 +0900 +++ b/include/TaskManager/SchedExit.h Thu Jun 04 00:03:49 2009 +0900 @@ -16,6 +16,10 @@ class SchedExit : public SchedTaskBase { public: BASE_NEW_DELETE(SchedExit); + + SchedExit(Scheduler *m) { + scheduler = m; + } SchedTaskBase* next(Scheduler *, SchedTaskBase *); };
--- a/include/TaskManager/SpeThreads.h Tue Jun 02 21:53:22 2009 +0900 +++ b/include/TaskManager/SpeThreads.h Thu Jun 04 00:03:49 2009 +0900 @@ -19,10 +19,12 @@ /* functions */ void init(void); - int get_mail(int speid); - void send_mail(int speid, unsigned int *data, int num); + int get_mail(int speid, int count, unsigned int* ret); // BLOCKING + int check_mail(int speid, int count, unsigned int* ret); // NONBLOCK + void send_mail(int speid, int num, unsigned int *data); // BLOCKING static void *spe_thread_run(void *arg); static void *frontend_thread_run(void *arg); + void add_output_tasklist(int command, void *buff, int alloc_size); private: /* variables */
--- a/include/TaskManager/Task.h Tue Jun 02 21:53:22 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -#ifndef INCLUDED_TASK -#define INCLUDED_TASK - -#ifndef INCLUDED_BASE_H_ -# include "base.h" -#endif - -#ifndef INCLUDED_TYPES -# include "types.h" -#endif - -#ifndef INCLUDED_LIST_DATA -# include "ListData.h" -#endif - -#define MAX_PARAMS 8 - -class Task { -public: // variables - - BASE_NEW_DELETE(Task); - - int command; // 4 byte - ListDataPtr inData; // 4 byte - ListDataPtr outData; // 4 byte - uint32 self; // 4 byte - - int param_size; // 4 byte - int param[MAX_PARAMS]; // 4*MAX_PARAMS byte - -public: // functions - int add_inData_t(unsigned int addr, int size); - int add_outData_t(unsigned int addr, int size); - int add_data(ListDataPtr list, unsigned int addr, int size); - int add_param(int param); - -#define add_inData(addr, size) \ - add_inData_t((unsigned int)(addr), (size)); -#define add_outData(addr, size) \ - add_outData_t((unsigned int)(addr), (size)); -}; - -typedef Task* TaskPtr; - -#endif
--- a/include/TaskManager/TaskList.h Tue Jun 02 21:53:22 2009 +0900 +++ b/include/TaskManager/TaskList.h Thu Jun 04 00:03:49 2009 +0900 @@ -19,7 +19,8 @@ int length; // 4 byte TaskList *next; // 4 byte Task tasks[TASK_MAX_SIZE]; // 512 - int a[2]; // padding + TaskList *output; // 4 byte + int a[1]; // padding static TaskList* append(TaskList*, TaskList*); };