# HG changeset patch # User admin@mcbk.cr.ie.u-ryukyu.ac.jp # Date 1243578853 -32400 # Node ID ae6aa53faf70c44872da6150c53ed226553cba01 # Parent e1d24c9514086a0f91831121498c65892f7e0457 hey diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Cell/spe/CellDmaManager.cc --- a/TaskManager/Cell/spe/CellDmaManager.cc Fri May 29 13:43:52 2009 +0900 +++ b/TaskManager/Cell/spe/CellDmaManager.cc Fri May 29 15:34:13 2009 +0900 @@ -38,11 +38,33 @@ * @param[in] mask Tag for Wait DMA process */ void +CellDmaManager::start_dmawait_profile() +{ + wait_time = readch(SPU_RdDec); + global_busy_time += busy_time - wait_time; + writech(SPU_WrDec, 0xffffffff); +} + +void +CellDmaManager::end_dmawait_profile() +{ + wait_time = readch(SPU_RdDec); + global_wait_time += 0xffffffff - wait_time; + busy_time = wait_time; +} + +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 diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Cell/spe/CellDmaManager.cc~ --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Cell/spe/CellDmaManager.cc~ Fri May 29 15:34:13 2009 +0900 @@ -0,0 +1,73 @@ +#include +#include +#include "CellDmaManager.h" + +/** + * DMA Load + * + * @param[in] buf Buffer of Load Data + * @param[in] addr Address of Load Data at Main Memory + * @param[in] size Size of Load Data + * @param[in] mask DMA tag +*/ +void +CellDmaManager::dma_load(void *buf, uint32 addr, uint32 size, uint32 mask) +{ + if (size == 0) return ; + mfc_get((volatile void *)buf, addr, size, mask, 0, 0); +} + +/** + * DMA Store + * + * @param[in] buf Buffer of Store Data at SPE + * @param[in] addr Address of Store Data at Main Memory + * @param[in] size Size of Store Data + * @param[in] mask DMA tag +*/ +void +CellDmaManager::dma_store(void *buf, uint32 addr, uint32 size, uint32 mask) +{ + if (size == 0) return ; + mfc_put((volatile void *)buf, addr, size, mask, 0, 0); +} + +/** + * DMA Wait + * + * @param[in] mask Tag for Wait DMA process + */ +void +CellDmaManager::dma_wait(uint32 mask) +{ + mfc_write_tag_mask(1 << mask); + mfc_write_tag_update_all(); + mfc_read_tag_status(); +} + +void +CellDmaManager::mail_write(uint32 data) +{ + spu_write_out_mbox(data); +} + +unsigned int +CellDmaManager::mail_read(void) +{ + unsigned int mail = spu_read_in_mbox(); + return mail; +} + +void +CellDmaManager::dma_loadList(ListDataPtr list, void *buff, uint32 mask) +{ + mfc_getl(buff, 0, list->element, sizeof(mfc_list_element_t)*list->length, + mask, 0, 0); +} + +void +CellDmaManager::dma_storeList(ListDataPtr list, void *buff, uint32 mask) +{ + mfc_putl(buff, 0, list->element, sizeof(mfc_list_element_t)*list->length, + mask, 0, 0); +} diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Fifo/FifoDmaManager.o Binary file TaskManager/Fifo/FifoDmaManager.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Fifo/FifoTaskManagerImpl.o Binary file TaskManager/Fifo/FifoTaskManagerImpl.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Fifo/MainScheduler.o Binary file TaskManager/Fifo/MainScheduler.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/Button.o Binary file TaskManager/Test/test_render/Button.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/Camera.o Binary file TaskManager/Test/test_render/Camera.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/Joystick.o Binary file TaskManager/Test/test_render/Joystick.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/Keyboard.o Binary file TaskManager/Test/test_render/Keyboard.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/Pad.o Binary file TaskManager/Test/test_render/Pad.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/SGList.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/SGList.cpp Fri May 29 15:34:13 2009 +0900 @@ -0,0 +1,5 @@ +#include "SGList.h" + +const char *sglist_table[SGLIST_LENGTH] = { + "Ball", "LongCube", "Venus000", "Venus001", "Venus002", "Venus008", "Venus003", "Venus007", "Venus006", "Venus004", "Venus005", "Venus009", "Cube", "BigCube", "Plane", "SmallCube", "Diry", "Dirz", "Dirx", "IEBOSS", "IEJIKI", "IETAMA", "MCUBE_BACK", "MCUBE", "BIGMCUBE", "CUBE", "PANEL_1024", "PANEL_2048", "PANEL_512", "BACK", "BULEBULLET", "E_PLANE", "IDLE", "Sphere", "BigSphere", "Earth", "Moon" +}; diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/SGList.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/SGList.h Fri May 29 15:34:13 2009 +0900 @@ -0,0 +1,83 @@ +#ifndef INCLUDED_SGLIST +#define INCLUDED_SGLIST + +/* ../xml_file/Ball.xml */ +#define Ball 0 + +/* ../xml_file/LongCube.xml */ +#define LongCube 1 + +/* ../xml_file/Venus.xml */ +#define Venus000 2 +#define Venus001 3 +#define Venus002 4 +#define Venus008 5 +#define Venus003 6 +#define Venus007 7 +#define Venus006 8 +#define Venus004 9 +#define Venus005 10 +#define Venus009 11 + +/* ../xml_file/cube.xml */ +#define Cube 12 + +/* ../xml_file/cube_big.xml */ +#define BigCube 13 + +/* ../xml_file/cube_split.xml */ +#define Plane 14 +#define SmallCube 15 + +/* ../xml_file/direction.xml */ +#define Diry 16 +#define Dirz 17 +#define Dirx 18 + +/* ../xml_file/ieboss.xml */ +#define IEBOSS 19 + +/* ../xml_file/iejiki.xml */ +#define IEJIKI 20 + +/* ../xml_file/ietama.xml */ +#define IETAMA 21 + +/* ../xml_file/mcube.xml */ +#define MCUBE_BACK 22 +#define MCUBE 23 +#define BIGMCUBE 24 +#define CUBE 25 + +/* ../xml_file/panel_1024.xml */ +#define PANEL_1024 26 + +/* ../xml_file/panel_2048.xml */ +#define PANEL_2048 27 + +/* ../xml_file/panel_512.xml */ +#define PANEL_512 28 + +/* ../xml_file/player.xml */ +#define BACK 29 +#define BULEBULLET 30 +#define E_PLANE 31 +#define IDLE 32 + +/* ../xml_file/sphere.xml */ +#define Sphere 33 + +/* ../xml_file/sphere_big.xml */ +#define BigSphere 34 + +/* ../xml_file/universe.xml */ +#define Earth 35 +#define Moon 36 + +/* Number of Scene */ +#define SGLIST_LENGTH 37 + +/* Scene Table */ +extern const char *sglist_table[SGLIST_LENGTH]; + +#endif diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/SGList.o Binary file TaskManager/Test/test_render/SGList.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/SceneGraph.o Binary file TaskManager/Test/test_render/SceneGraph.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/SceneGraphIterator.o Binary file TaskManager/Test/test_render/SceneGraphIterator.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/SceneGraphRoot.o Binary file TaskManager/Test/test_render/SceneGraphRoot.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/SpanC.o Binary file TaskManager/Test/test_render/SpanC.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/TextureHash.o Binary file TaskManager/Test/test_render/TextureHash.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/ball_bound.o Binary file TaskManager/Test/test_render/ball_bound.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/base64_de.o Binary file TaskManager/Test/test_render/base64_de.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/bullet_action.o Binary file TaskManager/Test/test_render/bullet_action.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/camera_action.o Binary file TaskManager/Test/test_render/camera_action.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/cube_action.o Binary file TaskManager/Test/test_render/cube_action.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/direction.o Binary file TaskManager/Test/test_render/direction.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/enemy_action.o Binary file TaskManager/Test/test_render/enemy_action.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/hit_judge.o Binary file TaskManager/Test/test_render/hit_judge.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/ieshoot.o Binary file TaskManager/Test/test_render/ieshoot.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/init_position.o Binary file TaskManager/Test/test_render/init_position.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/long_cube.o Binary file TaskManager/Test/test_render/long_cube.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/main.o Binary file TaskManager/Test/test_render/main.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/node.o Binary file TaskManager/Test/test_render/node.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/panel.o Binary file TaskManager/Test/test_render/panel.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/player_action.o Binary file TaskManager/Test/test_render/player_action.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/polygon.o Binary file TaskManager/Test/test_render/polygon.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/post.o Binary file TaskManager/Test/test_render/post.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/sys.o Binary file TaskManager/Test/test_render/sys.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/task/CreatePolygon.o Binary file TaskManager/Test/test_render/task/CreatePolygon.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/task/CreatePolygonFromSceneGraph.o Binary file TaskManager/Test/test_render/task/CreatePolygonFromSceneGraph.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/task/CreateSpan.o Binary file TaskManager/Test/test_render/task/CreateSpan.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/task/DrawBack.o Binary file TaskManager/Test/test_render/task/DrawBack.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/task/DrawSpan.o Binary file TaskManager/Test/test_render/task/DrawSpan.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/task/DrawSpanRenew.o Binary file TaskManager/Test/test_render/task/DrawSpanRenew.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/task/Load_Texture.o Binary file TaskManager/Test/test_render/task/Load_Texture.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/task/Set_Texture.o Binary file TaskManager/Test/test_render/task/Set_Texture.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/task/TileHash.o Binary file TaskManager/Test/test_render/task/TileHash.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/task/create_sgp.o Binary file TaskManager/Test/test_render/task/create_sgp.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/task/dummy.o Binary file TaskManager/Test/test_render/task/dummy.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/task/task_init.o Binary file TaskManager/Test/test_render/task/task_init.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/task/update_sgp.o Binary file TaskManager/Test/test_render/task/update_sgp.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/test_nogl Binary file TaskManager/Test/test_render/test_nogl has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/texture.o Binary file TaskManager/Test/test_render/texture.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/triangle.o Binary file TaskManager/Test/test_render/triangle.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/universe.o Binary file TaskManager/Test/test_render/universe.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/untitled.o Binary file TaskManager/Test/test_render/untitled.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/vacuum.o Binary file TaskManager/Test/test_render/vacuum.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/vertex.o Binary file TaskManager/Test/test_render/vertex.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/viewer.o Binary file TaskManager/Test/test_render/viewer.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/viewerFB.o Binary file TaskManager/Test/test_render/viewerFB.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/viewerSDL.o Binary file TaskManager/Test/test_render/viewerSDL.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/viewer_types.o Binary file TaskManager/Test/test_render/viewer_types.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/Test/test_render/xml.o Binary file TaskManager/Test/test_render/xml.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/main.o Binary file TaskManager/kernel/main.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/ppe/BufferManager.o Binary file TaskManager/kernel/ppe/BufferManager.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/ppe/DmaBuffer.o Binary file TaskManager/kernel/ppe/DmaBuffer.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/ppe/HTask.o Binary file TaskManager/kernel/ppe/HTask.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/ppe/HTaskInfo.o Binary file TaskManager/kernel/ppe/HTaskInfo.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/ppe/MailManager.o Binary file TaskManager/kernel/ppe/MailManager.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/ppe/Random.o Binary file TaskManager/kernel/ppe/Random.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/ppe/SymTable.o Binary file TaskManager/kernel/ppe/SymTable.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/ppe/Task.o Binary file TaskManager/kernel/ppe/Task.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/ppe/TaskList.o Binary file TaskManager/kernel/ppe/TaskList.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/ppe/TaskListInfo.o Binary file TaskManager/kernel/ppe/TaskListInfo.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/ppe/TaskManager.o Binary file TaskManager/kernel/ppe/TaskManager.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/ppe/TaskManagerImpl.o Binary file TaskManager/kernel/ppe/TaskManagerImpl.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/ppe/TaskQueue.o Binary file TaskManager/kernel/ppe/TaskQueue.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/ppe/TaskQueueInfo.o Binary file TaskManager/kernel/ppe/TaskQueueInfo.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/schedule/SchedExit.o Binary file TaskManager/kernel/schedule/SchedExit.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/schedule/SchedMail.o Binary file TaskManager/kernel/schedule/SchedMail.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/schedule/SchedNop.o Binary file TaskManager/kernel/schedule/SchedNop.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/schedule/SchedNop2Ready.o Binary file TaskManager/kernel/schedule/SchedNop2Ready.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/schedule/SchedTask.o Binary file TaskManager/kernel/schedule/SchedTask.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/schedule/SchedTaskList.o Binary file TaskManager/kernel/schedule/SchedTaskList.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/schedule/Scheduler.o Binary file TaskManager/kernel/schedule/Scheduler.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/schedule/TaskGroup.o Binary file TaskManager/kernel/schedule/TaskGroup.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/sys_task/Finish.o Binary file TaskManager/kernel/sys_task/Finish.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/sys_task/Start.o Binary file TaskManager/kernel/sys_task/Start.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/kernel/sys_task/systask_register.o Binary file TaskManager/kernel/sys_task/systask_register.o has changed diff -r e1d24c951408 -r ae6aa53faf70 TaskManager/libFifoManager.a Binary file TaskManager/libFifoManager.a has changed diff -r e1d24c951408 -r ae6aa53faf70 include/TaskManager/CellDmaManager.h --- a/include/TaskManager/CellDmaManager.h Fri May 29 13:43:52 2009 +0900 +++ b/include/TaskManager/CellDmaManager.h Fri May 29 15:34:13 2009 +0900 @@ -11,6 +11,8 @@ #include +#define SPU_PROFILE 1 + class CellDmaManager : public DmaManager { public: BASE_NEW_DELETE(CellDmaManager); @@ -21,11 +23,15 @@ } DmaList, *DmaListPtr; /* variables */ + unsigned int wait_time, busy_time; + unsigned long long global_busy_time = 0, global_wait_time = 0; /* 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); diff -r e1d24c951408 -r ae6aa53faf70 include/TaskManager/CellDmaManager.h~ --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/TaskManager/CellDmaManager.h~ Fri May 29 15:34:13 2009 +0900 @@ -0,0 +1,36 @@ +#ifndef INCLUDED_CELL_DMA_MANAGER +#define INCLUDED_CELL_DMA_MANAGER + +#ifndef INCLUDED_BASE_H_ +# include "base.h" +#endif + +#ifndef INCLUDED_DMA_MANAGER +# include "DmaManager.h" +#endif + +#include + +class CellDmaManager : public DmaManager { +public: + BASE_NEW_DELETE(CellDmaManager); + + typedef struct dma_list { + uint32 addr; + uint32 size; + } 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 mail_write(uint32 data); + uint32 mail_read(void); + void dma_loadList(ListDataPtr list, void *buff, uint32 mask); + void dma_storeList(ListDataPtr, void *buff, uint32 mask); +}; + +#endif