annotate TaskManager/Fifo/FifoDmaManager.cc @ 1717:5d68a55d5561 draft

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