Mercurial > hg > Members > kono > Cerium
comparison example/mainMem/spe/Hello.cc @ 312:57530cb7f7d1
memMain tester
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 08 Jun 2009 23:19:11 +0900 |
parents | |
children | c9f8cfcdc5c2 |
comparison
equal
deleted
inserted
replaced
311:b09784a9cb09 | 312:57530cb7f7d1 |
---|---|
1 #include <stdio.h> | |
2 #include "Hello.h" | |
3 #include "Func.h" | |
4 | |
5 /* これは必須 */ | |
6 SchedDefineTask(Hello); | |
7 | |
8 #define PP_STORE 3 | |
9 #define SIZE (4096*sizeof(int)) | |
10 | |
11 int | |
12 Hello::run(void *rbuf, void *wbuf) | |
13 { | |
14 int task_id = get_param(0); | |
15 int *ptr = smanager->allocate(SIZE); | |
16 | |
17 smanager->mainMem_alloc(0, sizeof(PolygonPack)); | |
18 | |
19 int i; | |
20 for(i=0;i<4096;i++) { | |
21 ptr[i] = i; | |
22 } | |
23 | |
24 smanager->mainMem_wait(); | |
25 void *next = (void *)smanager->mainMem_get(0); | |
26 | |
27 smanager->dma_wait(PP_STORE); | |
28 smanager->dma_store(ptr, (uint32)next, | |
29 SIZE, PP_STORE); | |
30 | |
31 | |
32 printf("[%d] Main Mem %0x len %d\n", task_id, (int*)next,SIZE); | |
33 | |
34 return 0; | |
35 } |