annotate TaskManager/kernel/schedule/SchedTask.cc @ 2069:26aa08c9a1de draft default tip

cuda example fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 12 Feb 2017 10:04:55 +0900
parents f7969d7f5605
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1943
f82bb7393c4d fix debug function
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 1907
diff changeset
1 //#define DEBUG
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
2 #include <stdlib.h>
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
3 #include <string.h>
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
4 #include "SchedTask.h"
695
29bd0882272a TaskArray on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 688
diff changeset
5 #include "SysFunc.h"
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
6 #include "SchedTaskList.h"
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
7 #include "SchedNop2Ready.h"
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
8 #include "DmaManager.h"
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
9 #include "error.h"
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
10 #include "TaskManager.h"
466
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
11 #include <stdarg.h>
1701
4a3b3ec582f2 profile of each task
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1698
diff changeset
12 #include "gettime.h"
688
77c89477daa8 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
13
2031
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 2030
diff changeset
14 extern TaskObject task_list[MAX_TASK_OBJECT];
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
15
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
16 SchedTask::SchedTask()
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
17 {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
18 list = NULL;
1464
3f2230d79eba TaskList no compile errors
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1463
diff changeset
19 atask = NULL;
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
20 readbuf = NULL;
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
21 writebuf = NULL;
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
22 scheduler = NULL;
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
23 cur_index = 0;
1475
eee4f68409dd bound default malloc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1474
diff changeset
24 // din[0] = dout[0] = 0;
466
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
25 this->stdout_ = stdout;
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
26 this->stderr_ = stderr;
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
27 this->stdin_ = stdin;
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
28 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
29
403
e2f29e912d0b clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
30 SchedTask::~SchedTask()
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
31 {
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
32 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
33
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
34 void
1464
3f2230d79eba TaskList no compile errors
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1463
diff changeset
35 SchedTask::init(TaskListPtr _list, TaskPtr _task, Scheduler* sc, int tag)
1758
141174033f1a fix to keep list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1757
diff changeset
36 {
141174033f1a fix to keep list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1757
diff changeset
37 // do not modify these, all shared among read/exec/write pipeline
141174033f1a fix to keep list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1757
diff changeset
38 list = _list;
1463
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
39 atask = _task;
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
40 scheduler = sc;
972
Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents: 970
diff changeset
41 this->tag = tag;
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
42
800
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
43 // scheduler->mainMem_wait(); // これはなんで?
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
44 manager = sc->manager;
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1175
diff changeset
45 connector = sc->connector;
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
46
1467
d585a7614cd5 look like working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1466
diff changeset
47 inListData.bound = din;
1463
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
48 inListData.size = 0;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
49 inListData.length = 0;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
50 inListData.element = 0;
1467
d585a7614cd5 look like working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1466
diff changeset
51 outListData.bound = dout;
1463
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
52 outListData.size = 0;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
53 outListData.length = 0;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
54 outListData.element = 0;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
55
2031
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 2030
diff changeset
56 cur_index = _task;
1463
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
57 this->tag = tag;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
58
888
b6c45005a3bc call savedTask->write() in TaskArray finish.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 871
diff changeset
59 if (list)
1606
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1585
diff changeset
60 waiter = (memaddr) list->waiter;
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
61 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
62
502
fdc3e30de9d3 Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
63 void
fdc3e30de9d3 Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
64 SchedTask::read()
fdc3e30de9d3 Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
65 {
1943
f82bb7393c4d fix debug function
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 1907
diff changeset
66 __debug(this->scheduler, "[SchedTask:%s]\n", __FUNCTION__);
538
5641d121818e code_load in read()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 502
diff changeset
67
5641d121818e code_load in read()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 502
diff changeset
68 // object creation をSchedTask生成時にやらないので、
5641d121818e code_load in read()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 502
diff changeset
69 // exec の直前のread で十分に間に合う
1464
3f2230d79eba TaskList no compile errors
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1463
diff changeset
70 loadSchedTask(scheduler, atask->command);
713
97adb3fe85c6 remove SIMPLE_TASK conditional
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 708
diff changeset
71
634
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
72 // 読むデータが一つもなければ無視
1463
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
73 if (atask->inData_count == 0) return;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
74
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
75 inListData.length = atask->inData_count;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
76 inListData.size = atask->inData_total_size();
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
77 inListData.element = atask->inData(0);
1475
eee4f68409dd bound default malloc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1474
diff changeset
78 if (inListData.length>DefaultBoundSize)
1810
b0bd89171162 Minor fix
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1809
diff changeset
79 inListData.bound = (long*)manager->allocate(inListData.length*sizeof(int));
634
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
80 // load Input Data
1463
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
81 // inListData.print();
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
82 readbuf = connector->dma_loadList(scheduler, &inListData, (DMA_READ + this->tag));
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
83 connector->bound(&inListData);
502
fdc3e30de9d3 Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
84 }
fdc3e30de9d3 Renew Task addInData (not yet worked).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 501
diff changeset
85
1099
3b3b535baa51 add resize wbuff example.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 1015
diff changeset
86 void
3b3b535baa51 add resize wbuff example.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 1015
diff changeset
87 SchedTask::setup_outputData()
3b3b535baa51 add resize wbuff example.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 1015
diff changeset
88 {
1463
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
89 // allocate write buffer
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
90 outListData.length = atask->outData_count;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
91 outListData.size = atask->outData_total_size();
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
92 // atask->outData_offset += cur_index + 1 ; // to avoid compiler bug
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
93 outListData.element = atask->outData(0);
1467
d585a7614cd5 look like working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1466
diff changeset
94 // if (outListData.bound!=dout) free(outListData.bound);
1475
eee4f68409dd bound default malloc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1474
diff changeset
95 if (outListData.length>DefaultBoundSize)
1810
b0bd89171162 Minor fix
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1809
diff changeset
96 outListData.bound = (long*)manager->allocate(outListData.length*sizeof(int));
1463
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
97 connector->bound(&outListData);
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
98 writebuf = connector->get_writebuf(scheduler, (memaddr)outListData.element[0].addr, outListData.size);
1099
3b3b535baa51 add resize wbuff example.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 1015
diff changeset
99 }
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
100
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
101 void
403
e2f29e912d0b clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
102 SchedTask::exec()
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
103 {
2031
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 2030
diff changeset
104 task_list[atask->command].wait(scheduler,atask->command);
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 2030
diff changeset
105 TaskObjectRun run = task_list[atask->command].run;
1464
3f2230d79eba TaskList no compile errors
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1463
diff changeset
106 if (atask->outData_count > 0) {
3f2230d79eba TaskList no compile errors
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1463
diff changeset
107 setup_outputData(); // we need write buffer before run()
699
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 698
diff changeset
108 }
1464
3f2230d79eba TaskList no compile errors
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1463
diff changeset
109 connector->dma_wait((DMA_READ + this->tag));
1467
d585a7614cd5 look like working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1466
diff changeset
110 void *read = get_input(readbuf, 0); void *write = get_output(writebuf, 0);
1585
90c0ad32655f init dim
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1582
diff changeset
111 // set param (if exist dim )
1717
5d68a55d5561 fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1701
diff changeset
112 list->task_start_time = gettime();
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
113 (*connector->start_dmawait_profile)(&connector->start_time);
1580
806b4658ced6 add multi dimension
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1522
diff changeset
114 if (list->dim) {
1581
8ee897303cd0 fix multi_dimention
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1580
diff changeset
115 multi_dimension(list, read, write,run);
1580
806b4658ced6 add multi dimension
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1522
diff changeset
116 } else {
806b4658ced6 add multi dimension
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1522
diff changeset
117 run(this, read,write);
806b4658ced6 add multi dimension
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1522
diff changeset
118 }
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
119 (*connector->end_dmawait_profile)(&connector->global_busy_time,&connector->start_time,&connector->stop_time);
1717
5d68a55d5561 fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1701
diff changeset
120 list->task_end_time = gettime();
2031
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 2030
diff changeset
121 __debug(this->scheduler,"cpuid %ld %s\t0x%p time %lld\n",scheduler->id,(char *)(task_list[atask->command].name),(void*)list, list->task_end_time-list->task_start_time);
1414
94ac6d8e73aa fix free inifite loop
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1413
diff changeset
122 connector->free_(readbuf);
1464
3f2230d79eba TaskList no compile errors
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1463
diff changeset
123 // User 側で作る方法が必要...
547
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
124 // 書き込む領域がなければ無視
1463
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
125 if (atask->outData_count > 0) {
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
126 // outListData.print();
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
127 connector->dma_storeList(&outListData, writebuf, DMA_WRITE);
635
c56f6847fb87 SimpleTask worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 634
diff changeset
128 }
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
129 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
130
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
131 void
1581
8ee897303cd0 fix multi_dimention
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1580
diff changeset
132 SchedTask::multi_dimension(TaskListPtr list, void* read, void* write,TaskObjectRun run) {
1672
32bc4ea3557f set_param in multi-dimension destroy shared TaskList. make dimension parammeter x,y,z in SchedTask.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1671
diff changeset
133 long min = scheduler->min_cpu();
32bc4ea3557f set_param in multi-dimension destroy shared TaskList. make dimension parammeter x,y,z in SchedTask.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1671
diff changeset
134 long max = scheduler->max_cpu();
32bc4ea3557f set_param in multi-dimension destroy shared TaskList. make dimension parammeter x,y,z in SchedTask.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1671
diff changeset
135 long id = scheduler->id;
32bc4ea3557f set_param in multi-dimension destroy shared TaskList. make dimension parammeter x,y,z in SchedTask.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1671
diff changeset
136 long lx = list->x;
32bc4ea3557f set_param in multi-dimension destroy shared TaskList. make dimension parammeter x,y,z in SchedTask.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1671
diff changeset
137 long ly = list->y;
32bc4ea3557f set_param in multi-dimension destroy shared TaskList. make dimension parammeter x,y,z in SchedTask.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1671
diff changeset
138 long lz = list->z;
1671
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1622
diff changeset
139
1672
32bc4ea3557f set_param in multi-dimension destroy shared TaskList. make dimension parammeter x,y,z in SchedTask.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1671
diff changeset
140 x=y=z=0;
1752
537707f376c8 fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1718
diff changeset
141
1672
32bc4ea3557f set_param in multi-dimension destroy shared TaskList. make dimension parammeter x,y,z in SchedTask.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1671
diff changeset
142 long cpu=min;
1582
046695c73cb0 add min_cpu(), max_cpu() (Who implements these?)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1581
diff changeset
143 for (;;cpu++) {
1671
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1622
diff changeset
144 if (cpu>max) cpu = min;
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1622
diff changeset
145 if (cpu==id) {
1581
8ee897303cd0 fix multi_dimention
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1580
diff changeset
146 run(this, read,write);
8ee897303cd0 fix multi_dimention
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1580
diff changeset
147 }
1671
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1622
diff changeset
148 if (++x>=lx) {
1581
8ee897303cd0 fix multi_dimention
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1580
diff changeset
149 x=0;
1671
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1622
diff changeset
150 if (++y>=ly) {
1581
8ee897303cd0 fix multi_dimention
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1580
diff changeset
151 y=0;
1671
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1622
diff changeset
152 if (++z>=lz) {
1581
8ee897303cd0 fix multi_dimention
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1580
diff changeset
153 break;
8ee897303cd0 fix multi_dimention
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1580
diff changeset
154 }
8ee897303cd0 fix multi_dimention
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1580
diff changeset
155 }
8ee897303cd0 fix multi_dimention
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1580
diff changeset
156 }
1580
806b4658ced6 add multi dimension
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1522
diff changeset
157 }
806b4658ced6 add multi dimension
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1522
diff changeset
158 }
806b4658ced6 add multi dimension
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1522
diff changeset
159
806b4658ced6 add multi dimension
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1522
diff changeset
160 void
403
e2f29e912d0b clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
161 SchedTask::write()
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
162 {
1943
f82bb7393c4d fix debug function
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 1907
diff changeset
163 __debug(this->scheduler, "[SchedTask:%s]\n", __FUNCTION__);
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
164
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1175
diff changeset
165 connector->dma_wait(DMA_WRITE);
1414
94ac6d8e73aa fix free inifite loop
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1413
diff changeset
166 connector->free_(writebuf);
1467
d585a7614cd5 look like working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1466
diff changeset
167 if (inListData.bound != din) free(inListData.bound);
d585a7614cd5 look like working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1466
diff changeset
168 if (outListData.bound != dout) free(outListData.bound);
1463
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
169 if ((cur_index->next() >= list->last()) )
1522
027d99ecb50e run example/many_task
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1475
diff changeset
170 connector->mail_write(waiter);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
171 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
172
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
173 SchedTaskBase*
403
e2f29e912d0b clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
174 SchedTask::next(Scheduler *scheduler, SchedTaskBase *p)
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
175 {
1758
141174033f1a fix to keep list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1757
diff changeset
176 TaskList *nextList = list; // do not modify list
1943
f82bb7393c4d fix debug function
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents: 1907
diff changeset
177 __debug(this->scheduler, "[SchedTask:%s]\n", __FUNCTION__);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
178
1467
d585a7614cd5 look like working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1466
diff changeset
179 if (cur_index == 0) { // 最初の一つ
d585a7614cd5 look like working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1466
diff changeset
180 SchedTask *nextSched = new SchedTask();
1758
141174033f1a fix to keep list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1757
diff changeset
181 nextSched->init(nextList, &nextList->tasks[0], scheduler, this->tag^1);
1522
027d99ecb50e run example/many_task
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1475
diff changeset
182 return nextSched;
1467
d585a7614cd5 look like working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1466
diff changeset
183 }
1580
806b4658ced6 add multi dimension
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1522
diff changeset
184 TaskPtr nextTask = cur_index->next(); // ここで一個一個のtaskを取ってきてる
1467
d585a7614cd5 look like working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1466
diff changeset
185 if (nextTask < list->last()) {
1522
027d99ecb50e run example/many_task
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1475
diff changeset
186 // Task List が残っているので、次を準備
027d99ecb50e run example/many_task
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1475
diff changeset
187
027d99ecb50e run example/many_task
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1475
diff changeset
188 TaskPtr nextTask = cur_index->next();
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
189
1464
3f2230d79eba TaskList no compile errors
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1463
diff changeset
190 SchedTask *nextSched = new SchedTask();
1522
027d99ecb50e run example/many_task
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1475
diff changeset
191 nextSched->init(list, nextTask, scheduler, this->tag^1);
027d99ecb50e run example/many_task
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1475
diff changeset
192 return nextSched;
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
193 } else {
1758
141174033f1a fix to keep list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1757
diff changeset
194 nextList = list->next;
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
195 if (nextList == 0) {
1522
027d99ecb50e run example/many_task
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1475
diff changeset
196 // もう何もする必要がない
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
197 return new SchedNop2Ready(scheduler);
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
198 } else {
1522
027d99ecb50e run example/many_task
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1475
diff changeset
199 // 新しいリストに取り掛かる
027d99ecb50e run example/many_task
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1475
diff changeset
200 int dma_tag_switch = 0;
1758
141174033f1a fix to keep list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1757
diff changeset
201 return new SchedTaskList((memaddr)nextList, scheduler, dma_tag_switch);
567
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 547
diff changeset
202 }
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
203 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
204 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
205
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
206
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
207 int
403
e2f29e912d0b clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
208 SchedTask::get_cpuid()
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
209 {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
210 return scheduler->id;
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
211 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
212
708
d41c62201b1e cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
213 void SchedTask::free_(void *p) {
d41c62201b1e cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
214 scheduler->free_(p);
d41c62201b1e cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
215 }
d41c62201b1e cleean up SchedTasks.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 706
diff changeset
216
945
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
217 /**
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
218 * SimpleTask has one parameter , one input, one output
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
219 */
698
72b2da99e875 no compile error for Task Array
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 695
diff changeset
220
1463
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
221 /**
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
222 * task->add_inData で与えられた順番に対応する index (0〜n-1) で、
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
223 * buffer から対応するデータを返す。
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
224 */
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
225 void*
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
226 SchedTask::get_input(void *buff, int index)
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
227 {
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
228 return (void*)((char*)readbuf + inListData.bound[index]);
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
229 }
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
230
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
231 /**
1809
138e7edff3ae fix bound int size
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1771
diff changeset
232 * get_input(index) の元の空間のアドレスを返す
1463
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
233 */
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
234 memaddr
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
235 SchedTask::get_inputAddr(int index)
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
236 {
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
237 #ifdef __CERIUM_CELL__
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
238 return (memaddr)inListData.element[index].addr;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
239 #else
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
240 return inListData.element[index].addr;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
241 #endif
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
242 }
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
243
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
244 /**
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
245 * get_input(index) のサイズを返す
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
246 */
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
247 int
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
248 SchedTask::get_inputSize(int index)
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
249 {
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
250 return inListData.element[index].size;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
251 }
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
252
1474
b158873485f6 fix simple task
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1467
diff changeset
253 int
b158873485f6 fix simple task
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1467
diff changeset
254 SchedTask::read_size()
b158873485f6 fix simple task
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1467
diff changeset
255 {
b158873485f6 fix simple task
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1467
diff changeset
256 return get_inputSize(0);
b158873485f6 fix simple task
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1467
diff changeset
257 }
b158873485f6 fix simple task
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1467
diff changeset
258
1463
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
259 /**
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
260 * write buffer の領域を返す。
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
261 */
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
262 void*
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
263 SchedTask::get_output(void *buff, int index)
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
264 {
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
265 return (void*)((char *)writebuf + outListData.bound[index]);
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
266 }
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
267
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
268 /**
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
269 * get_output(index) のアドレスを返す
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
270 */
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
271 memaddr
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
272 SchedTask::get_outputAddr(int index)
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
273 {
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
274 #ifdef __CERIUM_CELL__
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
275 return (memaddr)outListData.element[index].addr;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
276 #else
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
277 return outListData.element[index].addr;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
278 #endif
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
279 }
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
280
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
281 /**
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
282 * get_output(index) のサイズを返す
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
283 */
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
284 int
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
285 SchedTask::get_outputSize(int index)
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
286 {
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
287 return outListData.element[index].size;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
288 }
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
289
1474
b158873485f6 fix simple task
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1467
diff changeset
290 int
b158873485f6 fix simple task
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1467
diff changeset
291 SchedTask::write_size()
b158873485f6 fix simple task
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1467
diff changeset
292 {
b158873485f6 fix simple task
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1467
diff changeset
293 return get_outputSize(0);
b158873485f6 fix simple task
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1467
diff changeset
294 }
b158873485f6 fix simple task
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1467
diff changeset
295
b158873485f6 fix simple task
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1467
diff changeset
296
1463
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
297 void
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
298 SchedTask::set_outputSize(int index, int size)
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
299 {
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
300 outListData.element[index].size = size;
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
301 }
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
302
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
303 memaddr
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
304 SchedTask::get_param(int index)
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
305 {
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
306 return *atask->param(index);
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
307 }
f7e497c8e8a3 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
308
698
72b2da99e875 no compile error for Task Array
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 695
diff changeset
309
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
310
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
311 void*
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
312 SchedTask::global_alloc(int id, int size) {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
313 return scheduler->global_alloc(id, size);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
314 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
315
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
316 void*
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
317 SchedTask::global_get(int id) {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
318 return scheduler->global_get(id);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
319 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
320
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
321 void
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
322 SchedTask::global_set(int id, void *addr) {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
323 scheduler->global_set(id, addr);
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
324 }
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
325
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
326 void
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
327 SchedTask::global_free(int id) {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
328 scheduler->global_free(id);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
329 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
330
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
331 MemList*
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
332 SchedTask::createMemList(int size, int count) {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
333 return scheduler->createMemList(size, count);
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
334 }
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 356
diff changeset
335
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
336 void
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
337 SchedTask::mainMem_alloc(int id, int size) {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
338 scheduler->mainMem_alloc(id, size);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
339 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
340
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
341 void
403
e2f29e912d0b clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 395
diff changeset
342 SchedTask::mainMem_wait() {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
343 scheduler->mainMem_wait();
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
344 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
345
631
30dd8a3deb4a Cell 64 bit tried, but not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 625
diff changeset
346 memaddr
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
347 SchedTask::mainMem_get(int id) {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
348 return scheduler->mainMem_get(id);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
349 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
350
467
839e34d0cc3c fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 466
diff changeset
351
1418
ff721740df6b DMA fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1417
diff changeset
352 void *
625
94d82f2c842f 64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
353 SchedTask::dma_load(void *buf, memaddr addr, uint32 size, uint32 mask) {
1418
ff721740df6b DMA fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1417
diff changeset
354 return connector->dma_load1(buf, addr, size, mask); // direct DMA API (should be purged )
ff721740df6b DMA fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1417
diff changeset
355 }
ff721740df6b DMA fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1417
diff changeset
356
ff721740df6b DMA fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1417
diff changeset
357 void *
ff721740df6b DMA fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1417
diff changeset
358 SchedTask::get_load_buf(uint32 size) {
ff721740df6b DMA fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1417
diff changeset
359 return connector->get_writebuf(scheduler, 0, size); // direct DMA API (should be purged )
ff721740df6b DMA fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1417
diff changeset
360 }
ff721740df6b DMA fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1417
diff changeset
361
ff721740df6b DMA fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1417
diff changeset
362 void
ff721740df6b DMA fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1417
diff changeset
363 SchedTask::free_load_buf(void *buf) {
ff721740df6b DMA fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1417
diff changeset
364 return connector->free_(buf); // direct DMA API (should be purged )
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
365 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
366
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
367 void
625
94d82f2c842f 64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
368 SchedTask::dma_store(void *buf,memaddr addr, uint32 size, uint32 mask) {
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1175
diff changeset
369 connector->dma_store(buf, addr, size, mask);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
370 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
371
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
372 void
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
373 SchedTask::dma_wait(uint32 mask) {
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1175
diff changeset
374 connector->dma_wait(mask);
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
375 }
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
376
334
7bc5cbc5fe04 [in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents: 321
diff changeset
377 void
7bc5cbc5fe04 [in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents: 321
diff changeset
378 SchedTask::show_dma_wait() {
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1175
diff changeset
379 connector->show_dma_wait(scheduler, scheduler->id);
334
7bc5cbc5fe04 [in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents: 321
diff changeset
380 }
7bc5cbc5fe04 [in test_render] push L key , call show_dma_wait, but incomplete.
e065746@localhost.localdomain
parents: 321
diff changeset
381
1124
c43f49400c22 add mail profile
yutaka@localhost.localdomain
parents: 1099
diff changeset
382
674
07351a5a51c9 fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 672
diff changeset
383 long
07351a5a51c9 fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 672
diff changeset
384 SchedTask::get_random() {
07351a5a51c9 fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 672
diff changeset
385 return scheduler->get_random();
07351a5a51c9 fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 672
diff changeset
386 }
07351a5a51c9 fix many task example (sort).
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 672
diff changeset
387
672
27fec8c70c9c add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
388 void
27fec8c70c9c add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
389 SchedTask::start_profile() {
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1175
diff changeset
390 connector->start_profile();
672
27fec8c70c9c add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
391 }
27fec8c70c9c add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 643
diff changeset
392
387
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
393 MemorySegment * SchedTask::get_segment(memaddr addr, MemList *m) {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
394 return scheduler->get_segment(addr,m);
387
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
395 }
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
396
1173
cce350bed940 add MemIterator. (no test)
Yutaka_Kinjyo
parents: 1156
diff changeset
397 MemorySegment * SchedTask::get_free_segment(memaddr addr, MemList *m) {
cce350bed940 add MemIterator. (no test)
Yutaka_Kinjyo
parents: 1156
diff changeset
398 return scheduler->get_free_segment(addr,m);
cce350bed940 add MemIterator. (no test)
Yutaka_Kinjyo
parents: 1156
diff changeset
399 }
cce350bed940 add MemIterator. (no test)
Yutaka_Kinjyo
parents: 1156
diff changeset
400
1175
d7486d6a5e37 minor change
Yutaka_Kinjyo
parents: 1173
diff changeset
401 void SchedTask::overwrite_segment(MemorySegment *s, memaddr addr) {
d7486d6a5e37 minor change
Yutaka_Kinjyo
parents: 1173
diff changeset
402 return scheduler->overwrite_segment(s,addr);
d7486d6a5e37 minor change
Yutaka_Kinjyo
parents: 1173
diff changeset
403 }
d7486d6a5e37 minor change
Yutaka_Kinjyo
parents: 1173
diff changeset
404
1173
cce350bed940 add MemIterator. (no test)
Yutaka_Kinjyo
parents: 1156
diff changeset
405
387
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
406 void SchedTask::put_segment(MemorySegment *s) {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
407 scheduler->put_segment(s);
387
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
408 }
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
409
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
410 void SchedTask::wait_segment(MemorySegment *s) {
483
5f4ffff2c2aa renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 468
diff changeset
411 scheduler->wait_segment(s);
387
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
412 }
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
413
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
414
634
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
415 HTaskPtr
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
416 SchedTask::create_task(int cmd)
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
417 {
897
6bd218d3f643 add return address in SimpleTask for debugging.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 895
diff changeset
418 return manager->create_task(cmd, __builtin_return_address(0));
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
419 }
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
420
1522
027d99ecb50e run example/many_task
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1475
diff changeset
421 HTaskPtr
634
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
422 SchedTask::create_task(int cmd, memaddr r, long rs, memaddr w, long ws)
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
423 {
897
6bd218d3f643 add return address in SimpleTask for debugging.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 895
diff changeset
424 return manager->create_task(cmd,r,rs,w,ws, __builtin_return_address(0));
800
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
425 }
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
426
801
eb6add789a24 global id
yutaka@localhost.localdomain
parents: 777
diff changeset
427 HTaskPtr
eb6add789a24 global id
yutaka@localhost.localdomain
parents: 777
diff changeset
428 SchedTask::create_task_array(int id, int num_task, int num_param, int num_inData, int num_outData)
eb6add789a24 global id
yutaka@localhost.localdomain
parents: 777
diff changeset
429 {
1606
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1585
diff changeset
430 return manager->create_task_array(id, num_task, num_param, num_inData, num_outData, __builtin_return_address(0));
801
eb6add789a24 global id
yutaka@localhost.localdomain
parents: 777
diff changeset
431 }
eb6add789a24 global id
yutaka@localhost.localdomain
parents: 777
diff changeset
432
941
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 917
diff changeset
433 void SchedTask::free_htask(HTask *p) {
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 917
diff changeset
434 #if !defined(__SPU__)
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 917
diff changeset
435 manager->free_htask(p);
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 917
diff changeset
436 #endif
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 917
diff changeset
437 }
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 917
diff changeset
438
634
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 631
diff changeset
439
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
440 void SchedTask::set_task_depend(HTaskPtr master, HTaskPtr slave)
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
441 {
800
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
442 manager->set_task_depend(master, slave);
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
443 }
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
444
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
445 void SchedTask::spawn_task(HTaskPtr t)
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
446 {
800
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
447 manager->spawn_task(t);
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
448 }
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
449
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
450 void SchedTask::set_task_cpu(HTaskPtr t, CPU_TYPE cpu)
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
451 {
800
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
452 manager->set_task_cpu(t, cpu);
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
453 }
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
454
1522
027d99ecb50e run example/many_task
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1475
diff changeset
455 void* SchedTask::allocate(int size)
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
456 {
800
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
457 return manager->allocate(size) ;
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
458 }
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
459
1522
027d99ecb50e run example/many_task
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1475
diff changeset
460 void* SchedTask::allocate(int size,int align)
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
461 {
800
54f0180cea0f run16 word count ( not yet worked. )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 777
diff changeset
462 return manager->allocate(size,align) ;
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
463 }
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
464
833
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
465 void SchedTask::polling()
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
466 {
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
467 manager->polling();
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
468 }
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
469
1522
027d99ecb50e run example/many_task
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1475
diff changeset
470 Scheduler* SchedTask::get_scheduler()
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
471 {
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
472 return scheduler;
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
473 }
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
474
466
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
475 /* system call */
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
476
1522
027d99ecb50e run example/many_task
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1475
diff changeset
477 int
466
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
478 SchedTask::printf(const char * format, ...)
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
479 {
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
480 va_list ap;
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
481 va_start(ap,format);
743
55ccf5f6d9af continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 736
diff changeset
482 int ret= scheduler->vprintf0(format, ap);
466
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
483 va_end(ap);
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
484 return ret;
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
485 }
c73aff02db67 prohibit global variable in Task....
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 464
diff changeset
486
387
b6fce69839b5 no compile error but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
487
308
b85b920628e2 remove SchedTaskImpl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 302
diff changeset
488 /* end */