annotate TaskManager/Fifo/FifoDmaManager.cc @ 2050:26dd777ba95d draft

add User API
author Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
date Thu, 28 Jan 2016 15:43:36 +0900
parents 5238ca826d6e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #include <stdio.h>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #include <stdlib.h>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3 #include <string.h>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
4 #include "FifoDmaManager.h"
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
5 #include "Scheduler.h"
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
6 #include "TaskManagerImpl.h"
1400
3152bb4429da add gettime
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1371
diff changeset
7 #include "gettime.h"
1888
5238ca826d6e clean up DMA
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1809
diff changeset
8 #include "MailManager.h"
5238ca826d6e clean up DMA
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1809
diff changeset
9
5238ca826d6e clean up DMA
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1809
diff changeset
10 void
5238ca826d6e clean up DMA
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1809
diff changeset
11 FifoDmaManager::init()
5238ca826d6e clean up DMA
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1809
diff changeset
12 {
5238ca826d6e clean up DMA
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1809
diff changeset
13 mail_queue1 = new MailManager();
5238ca826d6e clean up DMA
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1809
diff changeset
14 mail_queue2 = new MailManager();
5238ca826d6e clean up DMA
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1809
diff changeset
15 }
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
16
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
17 void *
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
18 FifoDmaManager::dma_load(Scheduler *s, memaddr addr, uint32 size, uint32 mask)
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
19 {
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
20 void *buf = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
21 if (size == 0) return buf;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
22
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
23 unsigned long long wait = 0;
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
24 (*this->start_dmawait_profile)(&start_time);
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
25
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
26 buf = s->manager->allocate(size);
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
27 memcpy(buf, (void*)addr, size);
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
28
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
29 (*this->end_dmawait_profile)(&wait,&start_time,&stop_time);
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
30 global_load_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
31 dma_load_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
32
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
33 return buf;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
34 }
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
35
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
36 void *
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
37 FifoDmaManager::dma_load1(void *buf, memaddr addr, uint32 size, uint32 mask)
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
38 {
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
39 if (size == 0) return buf;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
40
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
41 unsigned long long wait = 0;
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
42 (*this->start_dmawait_profile)(&start_time);
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
43
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
44 memcpy(buf, (void*)addr, size);
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
45
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
46 (*this->end_dmawait_profile)(&wait,&start_time,&stop_time);
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
47 global_load_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
48 dma_load_time += wait;
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
49 return buf;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
50 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
51
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
52
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
53 void *
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
54 FifoDmaManager::get_writebuf(Scheduler *s,memaddr addr, uint32 size)
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
55 {
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
56 void *b = s->manager->allocate(size);
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
57 return b;
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
58 }
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
59
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
60 void *
603
57ec231bc8ac long -> memaddr (64 or 32)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 602
diff changeset
61 FifoDmaManager::dma_store(void *buf, memaddr addr, uint32 size, uint32 mask)
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
62 {
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
63 if (size == 0) return buf;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
64
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
65 unsigned long long wait = 0;
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
66 (*this->start_dmawait_profile)(&start_time);
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
67
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
68 memcpy((void*)addr, buf, size);
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
69
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
70 (*this->end_dmawait_profile)(&wait,&start_time,&stop_time);
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
71 global_store_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
72 dma_store_time += wait;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
73
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
74 return buf;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
75 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
76
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
77 /**
321
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
78 * mask で設定した DMA 転送の完了を待つ
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
79 */
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
80 void
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
81 FifoDmaManager::dma_wait(uint32 mask)
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
82 {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
83 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
84
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
85
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
86 void *
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
87 FifoDmaManager::dma_loadList(Scheduler *s, ListDataPtr list, uint32 mask)
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
88 {
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
89 unsigned long long wait = 0;
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
90 (*this->start_dmawait_profile)(&start_time);
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
91
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
92 int list_size = list->length;
602
92b0d490e839 64bit mode try... not worked.
e075740@nw0740.st.ie.u-ryukyu.ac.jp
parents: 321
diff changeset
93 long bound;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
94
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
95 void *buff = s->manager->allocate(list->size);
602
92b0d490e839 64bit mode try... not worked.
e075740@nw0740.st.ie.u-ryukyu.ac.jp
parents: 321
diff changeset
96 bound = (long)(buff);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
97
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
98 for (int i = 0; i < list_size; i++) {
1401
2187bd10f16d remove mail_write_queue
sugi
parents: 1400
diff changeset
99 ListElementPtr elm = &list->element[i];
2187bd10f16d remove mail_write_queue
sugi
parents: 1400
diff changeset
100 memcpy((void*)bound, (void*)elm->addr, elm->size);
2187bd10f16d remove mail_write_queue
sugi
parents: 1400
diff changeset
101 bound += elm->size;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
102 }
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
103
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
104 (*this->end_dmawait_profile)(&wait,&start_time,&stop_time);
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
105 global_load_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
106 dma_loadList_time += wait;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
107
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
108 return buff;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
109 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
110
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
111 void
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
112 FifoDmaManager::dma_storeList(ListDataPtr list, void *buff, uint32 mask)
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
113 {
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
114 unsigned long long wait = 0;
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
115 (*this->start_dmawait_profile)(&start_time);
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
116
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
117 int list_size = list->length;
603
57ec231bc8ac long -> memaddr (64 or 32)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 602
diff changeset
118 memaddr bound;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
119
603
57ec231bc8ac long -> memaddr (64 or 32)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 602
diff changeset
120 bound = (memaddr)(buff);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
121
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
122 for (int i = 0; i < list_size; i++) {
1401
2187bd10f16d remove mail_write_queue
sugi
parents: 1400
diff changeset
123 ListElementPtr elm = &list->element[i];
2187bd10f16d remove mail_write_queue
sugi
parents: 1400
diff changeset
124 memcpy((void*)elm->addr, (void*)bound, elm->size);
2187bd10f16d remove mail_write_queue
sugi
parents: 1400
diff changeset
125 bound += elm->size;
1111
c9d0683c9b39 add non screen mode.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 647
diff changeset
126 }
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
127
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
128 (*this->end_dmawait_profile)(&wait,&start_time,&stop_time);
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
129 global_store_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
130 dma_storeList_time += wait;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
131 }
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
132
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
133 void
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
134 FifoDmaManager::mail_write(memaddr data)
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
135 {
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
136 unsigned long long wait = 0;
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
137 (*this->start_dmawait_profile)(&start_time);
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
138
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
139 mail_queue1->send(data);
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
140
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
141 (*this->end_dmawait_profile)(&wait,&start_time,&stop_time);
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
142 global_mail_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
143 mail_write_time += wait;
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
144 }
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
145
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
146 void
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
147 FifoDmaManager::mail_write_finish_list(memaddr data)
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
148 {
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
149 unsigned long long wait = 0;
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
150 (*this->start_dmawait_profile)(&start_time);
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
151
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
152 mail_queue1->send(data);
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
153
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
154 (*this->end_dmawait_profile)(&wait,&start_time,&stop_time);
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
155 global_mail_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
156 mail_write_time += wait;
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
157 }
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
158
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
159 memaddr
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
160 FifoDmaManager::mail_read()
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
161 {
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
162 unsigned long long wait = 0;
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
163 (*this->start_dmawait_profile)(&start_time);
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
164
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
165 memaddr data;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
166 data = mail_queue2->recv();
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
167
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
168 (*this->end_dmawait_profile)(&wait,&start_time,&stop_time);
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
169 global_mail_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
170 mail_read_time += wait;
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
171
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
172 return data;
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
173 }
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
174
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
175 memaddr
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
176 FifoDmaManager::task_list_mail_read()
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
177 {
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
178 unsigned long long wait = 0;
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
179 (*this->start_dmawait_profile)(&start_time);
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
180
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
181 memaddr data;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
182 data = mail_queue2->recv();
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
183
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
184 (*this->end_dmawait_profile)(&wait,&start_time,&stop_time);
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
185 global_mail_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
186 mail_read_time += wait;
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
187
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
188 return data;
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
189 }
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
190
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
191 void
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
192 FifoDmaManager::mail_write_from_host(memaddr data)
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
193 {
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
194 unsigned long long wait = 0;
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
195 (*this->start_dmawait_profile)(&start_time);
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
196
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
197 mail_queue2->send(data);
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
198
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
199 (*this->end_dmawait_profile)(&wait,&start_time,&stop_time);
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
200 global_mail_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
201 mail_write_from_host_time += wait;
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
202 }
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
203
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
204 memaddr
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
205 FifoDmaManager::mail_read_from_host()
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
206 {
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
207 unsigned long long wait = 0;
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
208 (*this->start_dmawait_profile)(&start_time);
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
209
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
210 memaddr data;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
211 data = mail_queue1->recv();
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
212
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
213 (*this->end_dmawait_profile)(&wait,&start_time,&stop_time);
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
214 global_mail_time += wait;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
215 mail_read_from_host_time += wait;
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
216
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
217 return data;
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
218 }
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
219
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
220 int
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
221 FifoDmaManager::has_mail_from_host()
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
222 {
1461
bde20cca45ae remove schedrun
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1417
diff changeset
223 return mail_queue1->count();
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
224 }
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
225
1698
7673e2ad2623 fix profile
kkb
parents: 1461
diff changeset
226 void
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
227 do_start_dmawait_profile(unsigned long long *start)
1698
7673e2ad2623 fix profile
kkb
parents: 1461
diff changeset
228 {
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
229 *start = gettime();
1698
7673e2ad2623 fix profile
kkb
parents: 1461
diff changeset
230 }
7673e2ad2623 fix profile
kkb
parents: 1461
diff changeset
231
7673e2ad2623 fix profile
kkb
parents: 1461
diff changeset
232 void
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
233 do_end_dmawait_profile(unsigned long long *counter,unsigned long long *start,unsigned long long *stop)
1698
7673e2ad2623 fix profile
kkb
parents: 1461
diff changeset
234 {
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
235 *stop = gettime();
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
236 *counter += *stop - *start;
1698
7673e2ad2623 fix profile
kkb
parents: 1461
diff changeset
237 }
7673e2ad2623 fix profile
kkb
parents: 1461
diff changeset
238
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
239 void null_start_dmawait_profile(unsigned long long *start) {}
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
240 void null_end_dmawait_profile(unsigned long long *counter,unsigned long long *start,unsigned long long *stop) {}
1698
7673e2ad2623 fix profile
kkb
parents: 1461
diff changeset
241
1371
66ae94572433 add mail_time in profiler
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1369
diff changeset
242 void
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
243 FifoDmaManager::start_profile()
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
244 {
1698
7673e2ad2623 fix profile
kkb
parents: 1461
diff changeset
245 global_start_time = gettime();
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
246 global_busy_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
247 global_load_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
248 global_store_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
249 global_mail_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
250 dma_load_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
251 dma_store_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
252 dma_loadList_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
253 dma_storeList_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
254 mail_read_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
255 mail_write_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
256 mail_read_from_host_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
257 mail_write_from_host_time = 0;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
258
1698
7673e2ad2623 fix profile
kkb
parents: 1461
diff changeset
259 start_dmawait_profile = &do_start_dmawait_profile;
7673e2ad2623 fix profile
kkb
parents: 1461
diff changeset
260 end_dmawait_profile = &do_end_dmawait_profile;
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
261 (*this->start_dmawait_profile)(&start_time);
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
262 }
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
263
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
264 void
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
265 FifoDmaManager::stop_profile()
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
266 {
1698
7673e2ad2623 fix profile
kkb
parents: 1461
diff changeset
267 start_dmawait_profile = &null_start_dmawait_profile;
7673e2ad2623 fix profile
kkb
parents: 1461
diff changeset
268 end_dmawait_profile = &null_end_dmawait_profile;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
269 }
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
270
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
271 void
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
272 FifoDmaManager::show_dma_wait(Scheduler *s, int cpu)
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
273 {
1698
7673e2ad2623 fix profile
kkb
parents: 1461
diff changeset
274 unsigned long long all_time = gettime() - global_start_time;
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
275
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
276 double busy = ((double)global_busy_time)/((double)all_time)*100.0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
277 double load = ((double)global_load_time)/((double)all_time)*100.0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
278 double store = ((double)global_store_time)/((double)all_time)*100.0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
279 double mail = ((double)global_mail_time)/((double)all_time)*100.0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
280 double read = ((double)mail_read_time)/((double)all_time)*100.0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
281 double write = ((double)mail_write_time)/((double)all_time)*100.0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
282 double read_from_host = ((double)mail_read_from_host_time)/((double)all_time)*100.0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
283 double write_from_host = ((double)mail_write_from_host_time)/((double)all_time)*100.0;
1309
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
284
6941385ba022 add -p option
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1301
diff changeset
285
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
286 s->printf("cpu%d:\n busy_time = %lld(%.3g%%)\n"
1718
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
287 " load_time = %lld(%.3g%%), "
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
288 " store_time = %lld(%.3g%%), "
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
289 " mail_time = %lld(%.3g%%) \n"
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
290 " mail_read_time = %lld(%.3g%%), "
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
291 " mail_write_time = %lld(%.3g%%)\n"
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
292 " mail_read_from_host_time = %lld(%.3g%%), "
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
293 " mail_write_from_host_time = %lld(%.3g%%)\n"
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
294 " all_time = %lld\n"
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
295 ,cpu, global_busy_time, busy,
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
296 global_load_time, load,
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
297 global_store_time, store,
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
298 global_mail_time, mail,
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
299 mail_read_time, read,
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
300 mail_write_time, write,
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
301 mail_read_from_host_time, read_from_host,
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
302 mail_write_from_host_time, write_from_host,
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
303 all_time);
93f051a51d9e fix profile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1717
diff changeset
304
1417
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
305 global_busy_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
306 global_load_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
307 global_store_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
308 global_mail_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
309 dma_load_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
310 dma_store_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
311 dma_loadList_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
312 dma_storeList_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
313 mail_read_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
314 mail_write_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
315 mail_read_from_host_time = 0;
70f461442b0f null DMA clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1416
diff changeset
316 mail_write_from_host_time = 0;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
317 }
643
2a611e8d8788 minor fix.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 640
diff changeset
318
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
319 uint32
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
320 FifoDmaManager::get_tag()
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
321 {
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
322 static int tag = 16;
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
323 tag ++;
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
324 tag &= 0x0f;
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
325 return tag+16;
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
326 }
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
327
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
328 /**
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
329 * DMA buffer offset in rbuf
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
330 */
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
331 void
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
332 FifoDmaManager::bound(ListData *list)
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
333 {
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
334 ListElement *elm = list->element;
1809
138e7edff3ae fix bound int size
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1718
diff changeset
335 long *bound = list->bound;
1213
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
336 int offset=0;
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
337 for(int i=0;i<list->length;i++) {
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
338 bound[i] = offset;
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
339 offset += elm[i].size;
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
340 }
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
341 }
a49c02dffe6f DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1111
diff changeset
342
643
2a611e8d8788 minor fix.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 640
diff changeset
343 /* end */