annotate Slide/prosym.html @ 30:33222880db79

update
author mir3636
date Sun, 21 Jan 2018 00:05:37 +0900
parents da3022f9122e
children 7e2ceefcef54
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
1 <!DOCTYPE html>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
2 <html>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
3 <head>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
4 <meta http-equiv="content-type" content="text/html;charset=utf-8">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
5 <title>Code Gear と Data Gear を持つ Gears OS の設計</title>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
6
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
7 <meta name="generator" content="Slide Show (S9) v2.5.0 on Ruby 2.4.0 (2016-12-24) [x86_64-darwin16]">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
8 <meta name="author" content="Mitsuki Miyagi, Shinji Kono" >
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
9
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
10 <!-- style sheet links -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
11 <link rel="stylesheet" href="s6/themes/projection.css" media="screen,projection">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
12 <link rel="stylesheet" href="s6/themes/screen.css" media="screen">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
13 <link rel="stylesheet" href="s6/themes/print.css" media="print">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
14 <link rel="stylesheet" href="s6/themes/blank.css" media="screen,projection">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
15
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
16 <!-- JS -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
17 <script src="s6/js/jquery-1.11.3.min.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
18 <script src="s6/js/jquery.slideshow.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
19 <script src="s6/js/jquery.slideshow.counter.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
20 <script src="s6/js/jquery.slideshow.controls.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
21 <script src="s6/js/jquery.slideshow.footer.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
22 <script src="s6/js/jquery.slideshow.autoplay.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
23
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
24 <!-- prettify -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
25 <link rel="stylesheet" href="scripts/prettify.css">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
26 <script src="scripts/prettify.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
27
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
28 <script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
29 $(document).ready( function() {
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
30 Slideshow.init();
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
31
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
32 $('code').each(function(_, el) {
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
33 if (!el.classList.contains('noprettyprint')) {
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
34 el.classList.add('prettyprint');
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
35 }
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
36 });
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
37 prettyPrint();
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
38 } );
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
39
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
40
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
41 </script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
42
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
43 <!-- Better Browser Banner for Microsoft Internet Explorer (IE) -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
44 <!--[if IE]>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
45 <script src="s6/js/jquery.microsoft.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
46 <![endif]-->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
47
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
48
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
49
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
50 </head>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
51 <body>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
52
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
53 <div class="layout">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
54 <div id="header"></div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
55 <div id="footer">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
56 <div align="right">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
57 <img src="s6/images/logo.svg" width="200px">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
58 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
59 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
60 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
61
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
62 <div class="presentation">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
63
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
64 <div class='slide cover'>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
65 <table width="90%" height="90%" border="0" align="center">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
66 <tr>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
67 <td>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
68 <div align="center">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
69 <h1><font color="#808db5">Code Gear と Data Gear を持つ Gears OS の設計</font></h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
70 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
71 </td>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
72 </tr>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
73 <tr>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
74 <td>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
75 <div align="left">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
76 Mitsuki Miyagi, Shinji Kono
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
77 琉球大学
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
78 <hr style="color:#ffcc00;background-color:#ffcc00;text-align:left;border:none;width:100%;height:0.2em;">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
79 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
80 </td>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
81 </tr>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
82 </table>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
83 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
84
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
85 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
86 <!-- === begin markdown block ===
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
87
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
88 generated by markdown/1.2.0 on Ruby 2.4.0 (2016-12-24) [x86_64-darwin16]
30
mir3636
parents: 27
diff changeset
89 on 2018-01-21 00:05:29 +0900 with Markdown engine kramdown (1.13.2)
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
90 using options {}
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
91 -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
92
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
93 <!-- _S9SLIDE_ -->
21
mir3636
parents: 17
diff changeset
94 <h1 id="section">研究目的</h1>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
95
17
mir3636
parents: 16
diff changeset
96 <ul>
21
mir3636
parents: 17
diff changeset
97 <li>現代の OS では拡張性と信頼性を両立させることが要求されている。
mir3636
parents: 17
diff changeset
98 <!--信頼性 信頼性を保証するには従来のテストとデバッグでは不十分-->
mir3636
parents: 17
diff changeset
99 <!--信頼性を保証するには証明とモデル検査を用いる方法がある--></li>
mir3636
parents: 17
diff changeset
100 <li>信頼性をノーマルレベルの計算に対して保証し、拡張性をメタレベルの計算で実現することを目標に Gears OS を設計中である。</li>
mir3636
parents: 17
diff changeset
101 <li>ノーマルレベルの計算とメタレベルの計算を切り離して記述するために Code Gear と Data Gear という単位を用いている。</li>
mir3636
parents: 17
diff changeset
102 <li>Gears OS は Continuation based C(CbC) によってアプリケーションと OS そのものを記述する。</li>
27
mir3636
parents: 25
diff changeset
103 <li>本研究では、CbC を用いた Gears OS の実装を示す。</li>
17
mir3636
parents: 16
diff changeset
104 </ul>
mir3636
parents: 16
diff changeset
105
mir3636
parents: 16
diff changeset
106 <!--
mir3636
parents: 16
diff changeset
107 # OS の拡張性と信頼性の両立
mir3636
parents: 16
diff changeset
108
23
mir3636
parents: 21
diff changeset
109 - さまざまなコンピュータの信頼性の基本はメモリなどの資源管理を行う OS である。
mir3636
parents: 21
diff changeset
110 - 時代とともに進歩するハードウェア、サービスに対応して OS 自体が拡張される必要がある。
mir3636
parents: 21
diff changeset
111 - その信頼性を保証するには、従来の テストとデバッグでは不十分であり、テストしきれない部分が残ってしまう。
mir3636
parents: 21
diff changeset
112 - これに対処するため には、証明を用いる方法とプログラムの可能な実行をすべて数え上げるモデル検査を用いる方法がある。
mir3636
parents: 21
diff changeset
113 - 検証は一度ですむものではなく、アプリケーションやサービス、デバイスが新しくなることに検証をやり直す必要がある。
mir3636
parents: 21
diff changeset
114 - このため信頼性と拡張性を両立させることが重要である。
17
mir3636
parents: 16
diff changeset
115 -->
21
mir3636
parents: 17
diff changeset
116 <!--
mir3636
parents: 17
diff changeset
117 # 目次?
mir3636
parents: 17
diff changeset
118 -->
23
mir3636
parents: 21
diff changeset
119
mir3636
parents: 21
diff changeset
120
mir3636
parents: 21
diff changeset
121 </div>
mir3636
parents: 21
diff changeset
122 <div class='slide '>
mir3636
parents: 21
diff changeset
123 <!-- _S9SLIDE_ -->
27
mir3636
parents: 25
diff changeset
124 <h1 id="section-1">メタ計算</h1>
23
mir3636
parents: 21
diff changeset
125 <ul>
mir3636
parents: 21
diff changeset
126 <li>プログラムを記述する際、ノーマルレベルの処理の他に、メモリ管理やスレッド管理、CPU や GPU の資源管理等、記述しなければならない処理が存在する。これらの計算をメタ計算と呼ぶ。</li>
mir3636
parents: 21
diff changeset
127 <li>メタ計算はノーマルレベルの計算から切り離して記述したい。</li>
mir3636
parents: 21
diff changeset
128 <li>そのためには処理を細かく分割する必要があるが、関数やクラスなどの単位は容易に分割できない。</li>
mir3636
parents: 21
diff changeset
129 <li>そこで当研究室ではメタ計算を柔軟に記述するためのプログラミング言語の単位として Code Gear、Data Gear という単位を提案している。</li>
mir3636
parents: 21
diff changeset
130 </ul>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
131
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
132
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
133 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
134 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
135 <!-- _S9SLIDE_ -->
21
mir3636
parents: 17
diff changeset
136 <h1 id="continuation-based-c-cbc">Continuation based C (CbC)</h1>
mir3636
parents: 17
diff changeset
137 <ul>
mir3636
parents: 17
diff changeset
138 <li>Continuation based C (CbC) はこの Code Gear 単位を用いたプログラミング言語として開発している。</li>
mir3636
parents: 17
diff changeset
139 <li>Code Gear は 関数呼び出し時の環境を使わずに次の Code Gear へと goto 文によって遷移する。</li>
mir3636
parents: 17
diff changeset
140 <li>この goto 文による遷移を軽量継続と呼ぶ。</li>
mir3636
parents: 17
diff changeset
141 <li>CbC は軽量継続を持ち、C と互換性のある言語である。</li>
mir3636
parents: 17
diff changeset
142 </ul>
mir3636
parents: 17
diff changeset
143
mir3636
parents: 17
diff changeset
144
mir3636
parents: 17
diff changeset
145 </div>
mir3636
parents: 17
diff changeset
146 <div class='slide '>
mir3636
parents: 17
diff changeset
147 <!-- _S9SLIDE_ -->
mir3636
parents: 17
diff changeset
148 <h1 id="cbc-">CbC のコード例</h1>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
149 <ul lang="Code_Gear">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
150 <li>CbC では Code Gear は __code という型を持つ関数の構文で定義される。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
151 <li>Code Gear は戻り値を持たないので、関数とは異なり return 文は存在しない。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
152 <li>goto の後に Code Gear 名と引数を並べて、次の Code Gear の遷移を記述する。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
153 <li>この goto の行き先を継続と呼び、このときの a+b が次の Code Gear への出力となる。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
154 </ul>
27
mir3636
parents: 25
diff changeset
155 <pre><code>__code cg0(int a, int b){
mir3636
parents: 25
diff changeset
156 goto cg1(a+b);
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
157 }
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
158
27
mir3636
parents: 25
diff changeset
159 __code cg1(int c){
mir3636
parents: 25
diff changeset
160 goto cg2(c);
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
161 }
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
162 </code></pre>
21
mir3636
parents: 17
diff changeset
163
mir3636
parents: 17
diff changeset
164
mir3636
parents: 17
diff changeset
165 </div>
mir3636
parents: 17
diff changeset
166 <div class='slide '>
mir3636
parents: 17
diff changeset
167 <!-- _S9SLIDE_ -->
mir3636
parents: 17
diff changeset
168 <h1 id="gears-os">Gears OS</h1>
mir3636
parents: 17
diff changeset
169 <ul>
mir3636
parents: 17
diff changeset
170 <li>Gears OS は Code Gear とデータの単位である Data Gear を用いて開発されており、CbC で記述されている。</li>
mir3636
parents: 17
diff changeset
171 <li>並列実行するための Task を、実行する Code Gear 、実行に必要な Input Data Gear 、Output Data Gear の組で表現する。</li>
mir3636
parents: 17
diff changeset
172 <li>Input/Output Data Gear の依存関係が解決された Code Gear を並列実行する。</li>
mir3636
parents: 17
diff changeset
173 </ul>
mir3636
parents: 17
diff changeset
174
27
mir3636
parents: 25
diff changeset
175 <div style="text-align: center;">
mir3636
parents: 25
diff changeset
176  <img src="./fig/normal.pdf" alt="MetaGear" width="600" />
mir3636
parents: 25
diff changeset
177 </div>
mir3636
parents: 25
diff changeset
178
21
mir3636
parents: 17
diff changeset
179
mir3636
parents: 17
diff changeset
180 </div>
mir3636
parents: 17
diff changeset
181 <div class='slide '>
mir3636
parents: 17
diff changeset
182 <!-- _S9SLIDE_ -->
mir3636
parents: 17
diff changeset
183 <h1 id="data-gear">Data Gear</h1>
mir3636
parents: 17
diff changeset
184 <ul>
mir3636
parents: 17
diff changeset
185 <li>Data Gear は データの単位であり、int や文字列などの Primitive Type を持っている。</li>
mir3636
parents: 17
diff changeset
186 <li>Code Gear は任意の数の Input Data Gear を参照して処理を行い、Output Data Gear を出力し処理を終える。</li>
27
mir3636
parents: 25
diff changeset
187 <li>Code Gear は接続された Data Gear 以外には参照を行わない。</li>
21
mir3636
parents: 17
diff changeset
188 </ul>
mir3636
parents: 17
diff changeset
189
mir3636
parents: 17
diff changeset
190
mir3636
parents: 17
diff changeset
191 </div>
mir3636
parents: 17
diff changeset
192 <div class='slide '>
mir3636
parents: 17
diff changeset
193 <!-- _S9SLIDE_ -->
mir3636
parents: 17
diff changeset
194 <h1 id="gears-">Gears でのメタ計算</h1>
mir3636
parents: 17
diff changeset
195 <ul>
mir3636
parents: 17
diff changeset
196 <li>Gears OS ではメタ計算を Meta Code Gear、Meta Data Gear で表現する。</li>
mir3636
parents: 17
diff changeset
197 <li>Meta Code Gear はノーマルレベルの Code Gear の直後に遷移され、メタ計算を実行する。</li>
mir3636
parents: 17
diff changeset
198 <li>Meta Code Gear で OS の機能であるメモリ管理やスレッド管理を行う。</li>
mir3636
parents: 17
diff changeset
199 </ul>
mir3636
parents: 17
diff changeset
200
mir3636
parents: 17
diff changeset
201 <div style="text-align: center;">
27
mir3636
parents: 25
diff changeset
202  <img src="./fig/meta.pdf" alt="MetaGear" width="600" />
21
mir3636
parents: 17
diff changeset
203 </div>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
204
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
205
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
206 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
207 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
208 <!-- _S9SLIDE_ -->
27
mir3636
parents: 25
diff changeset
209 <h1 id="gears--1">Gears でのメタ計算</h1>
mir3636
parents: 25
diff changeset
210
mir3636
parents: 25
diff changeset
211
mir3636
parents: 25
diff changeset
212 </div>
mir3636
parents: 25
diff changeset
213 <div class='slide '>
mir3636
parents: 25
diff changeset
214 <!-- _S9SLIDE_ -->
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
215 <h1 id="gears-os-">Gears OS の構成</h1>
23
mir3636
parents: 21
diff changeset
216 <ul>
mir3636
parents: 21
diff changeset
217 <li>Gears OS は以下の要素で構成される。
mir3636
parents: 21
diff changeset
218 <ul>
30
mir3636
parents: 27
diff changeset
219 <li>Context
mir3636
parents: 27
diff changeset
220 <ul>
mir3636
parents: 27
diff changeset
221 <li>使用されるCode/Data Gear のリストを持っておりTaskでもある。</li>
mir3636
parents: 27
diff changeset
222 </ul>
mir3636
parents: 27
diff changeset
223 </li>
mir3636
parents: 27
diff changeset
224 <li>TaskQueue
mir3636
parents: 27
diff changeset
225 <ul>
mir3636
parents: 27
diff changeset
226 <li>Task のリストを扱う</li>
mir3636
parents: 27
diff changeset
227 </ul>
mir3636
parents: 27
diff changeset
228 </li>
mir3636
parents: 27
diff changeset
229 <li>TaskManager
mir3636
parents: 27
diff changeset
230 <ul>
mir3636
parents: 27
diff changeset
231 <li>Task の依存関係の解決、作成や停止を行います。</li>
mir3636
parents: 27
diff changeset
232 </ul>
mir3636
parents: 27
diff changeset
233 </li>
mir3636
parents: 27
diff changeset
234 <li>Worker
mir3636
parents: 27
diff changeset
235 <ul>
mir3636
parents: 27
diff changeset
236 <li>Task の実行を行う</li>
mir3636
parents: 27
diff changeset
237 </ul>
mir3636
parents: 27
diff changeset
238 </li>
23
mir3636
parents: 21
diff changeset
239 </ul>
mir3636
parents: 21
diff changeset
240 </li>
mir3636
parents: 21
diff changeset
241 </ul>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
242
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
243
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
244 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
245 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
246 <!-- _S9SLIDE_ -->
23
mir3636
parents: 21
diff changeset
247 <h1 id="gears-os--1">Gears OS の構成図</h1>
mir3636
parents: 21
diff changeset
248
mir3636
parents: 21
diff changeset
249 <div style="text-align: center;">
24
mir3636
parents: 23
diff changeset
250  <img src="./fig/gears_structure.pdf" alt="gears_structure" width="900" />
23
mir3636
parents: 21
diff changeset
251 </div>
mir3636
parents: 21
diff changeset
252
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
253
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
254 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
255 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
256 <!-- _S9SLIDE_ -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
257 <h1 id="context">Context</h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
258 <ul>
23
mir3636
parents: 21
diff changeset
259 <li>Context とは使用される Code Gear と Data Gear を全て格納した Meta Data Gear である。</li>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
260 <li>Gears OSは必要なCode Gear、Data Gearに参照したい場合、このContext を通す必要がある。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
261 </ul>
24
mir3636
parents: 23
diff changeset
262 <div style="text-align: center;">
mir3636
parents: 23
diff changeset
263  <img src="./fig/Gearef.pdf" alt="gearef" width="900" />
mir3636
parents: 23
diff changeset
264 </div>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
265
24
mir3636
parents: 23
diff changeset
266
mir3636
parents: 23
diff changeset
267 </div>
mir3636
parents: 23
diff changeset
268 <div class='slide '>
mir3636
parents: 23
diff changeset
269 <!-- _S9SLIDE_ -->
mir3636
parents: 23
diff changeset
270 <h1 id="context-">context の定義</h1>
mir3636
parents: 23
diff changeset
271
mir3636
parents: 23
diff changeset
272 <pre lang="contexr"><code>/* context define */
mir3636
parents: 23
diff changeset
273 struct Context {
27
mir3636
parents: 25
diff changeset
274 int codeNum; //実行可能な Code Gear の数
24
mir3636
parents: 23
diff changeset
275 __code (**code) (struct Context*); //実行可能な code Gear のリスト
mir3636
parents: 23
diff changeset
276 void* heapStart; //Data Gear の Allocate用のヒープ
mir3636
parents: 23
diff changeset
277 void* heap;
mir3636
parents: 23
diff changeset
278 long heapLimit;
mir3636
parents: 23
diff changeset
279 int dataNum; //Data Gear の数
mir3636
parents: 23
diff changeset
280 union Data **data; //Data Gear のリスト
mir3636
parents: 23
diff changeset
281 };
mir3636
parents: 23
diff changeset
282 </code></pre>
mir3636
parents: 23
diff changeset
283
27
mir3636
parents: 25
diff changeset
284
mir3636
parents: 25
diff changeset
285 </div>
mir3636
parents: 25
diff changeset
286 <div class='slide '>
mir3636
parents: 25
diff changeset
287 <!-- _S9SLIDE_ -->
mir3636
parents: 25
diff changeset
288 <h1 id="context-1">Context</h1>
mir3636
parents: 25
diff changeset
289 <ul>
mir3636
parents: 25
diff changeset
290 <li>Code/Data Gear の名前は enum で定義される。</li>
mir3636
parents: 25
diff changeset
291 <li>Code/Data Gear の名前とポインタの対応は enum を使って行われる。</li>
mir3636
parents: 25
diff changeset
292 </ul>
mir3636
parents: 25
diff changeset
293
mir3636
parents: 25
diff changeset
294 <pre lang="code"><code>enum Code {
mir3636
parents: 25
diff changeset
295 C_cg1,
mir3636
parents: 25
diff changeset
296 C_cg2,
mir3636
parents: 25
diff changeset
297 };
mir3636
parents: 25
diff changeset
298 </code></pre>
mir3636
parents: 25
diff changeset
299
mir3636
parents: 25
diff changeset
300 <pre lang="data"><code>enum Data {
mir3636
parents: 25
diff changeset
301 D_dg1,
mir3636
parents: 25
diff changeset
302 D_dg2,
mir3636
parents: 25
diff changeset
303 };
mir3636
parents: 25
diff changeset
304 </code></pre>
mir3636
parents: 25
diff changeset
305
24
mir3636
parents: 23
diff changeset
306 <!--
mir3636
parents: 23
diff changeset
307 # CbC による Gears OS 記述の問題点
mir3636
parents: 23
diff changeset
308 - Gears OS を CbC で実装する上でメタ計算の記述が煩雑であることがわかった。
mir3636
parents: 23
diff changeset
309 - 本研究ではこれらのメタ計算を自動生成することにより Gears OS を記述する上においてより良い構文をユーザーに提供することにした。
mir3636
parents: 23
diff changeset
310 - そのためのプロトタイプとして perl スクリプトを作成した。
mir3636
parents: 23
diff changeset
311 -->
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
312
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
313
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
314 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
315 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
316 <!-- _S9SLIDE_ -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
317 <h1 id="interface">Interface</h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
318 <ul>
23
mir3636
parents: 21
diff changeset
319 <li>Code Gear と Data Gear は Interface と呼ばれるまとまりとして記述される。</li>
mir3636
parents: 21
diff changeset
320 <li>Interface は使用される Data Gear の定義と、それに対する Code Gear の集合である。</li>
mir3636
parents: 21
diff changeset
321 <li>Interface の操作に対応する Code Gear の引数は Interface に定義されている Data Gear を通して行われる。</li>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
322 </ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
323
27
mir3636
parents: 25
diff changeset
324
mir3636
parents: 25
diff changeset
325 </div>
mir3636
parents: 25
diff changeset
326 <div class='slide '>
mir3636
parents: 25
diff changeset
327 <!-- _S9SLIDE_ -->
mir3636
parents: 25
diff changeset
328 <h1 lang="interface" id="interface-">Interface のコード</h1>
mir3636
parents: 25
diff changeset
329 <pre><code>typedef struct Stack&lt;Type, Impl&gt;{
23
mir3636
parents: 21
diff changeset
330 union Data* stack;
mir3636
parents: 21
diff changeset
331 union Data* data;
mir3636
parents: 21
diff changeset
332 union Data* data1;
mir3636
parents: 21
diff changeset
333 __code whenEmpty(...);
mir3636
parents: 21
diff changeset
334 __code clear(Impl* stack,__code next(...));
mir3636
parents: 21
diff changeset
335 __code push(Impl* stack,Type* data, __code next(...));
mir3636
parents: 21
diff changeset
336 __code pop(Impl* stack, __code next(Type* data, ...));
mir3636
parents: 21
diff changeset
337 __code pop2(Impl* stack, __code next(Type* data, Type* data1, ...));
mir3636
parents: 21
diff changeset
338 __code isEmpty(Impl* stack, __code next(...), __code whenEmpty(...));
mir3636
parents: 21
diff changeset
339 __code get(Impl* stack, __code next(Type* data, ...));
mir3636
parents: 21
diff changeset
340 __code get2(Impl* stack, __code next(Type* data, Type* data1, ...));
mir3636
parents: 21
diff changeset
341 __code next(...);
mir3636
parents: 21
diff changeset
342 } Stack;
mir3636
parents: 21
diff changeset
343 </code></pre>
mir3636
parents: 21
diff changeset
344
mir3636
parents: 21
diff changeset
345
mir3636
parents: 21
diff changeset
346 </div>
mir3636
parents: 21
diff changeset
347 <div class='slide '>
mir3636
parents: 21
diff changeset
348 <!-- _S9SLIDE_ -->
27
mir3636
parents: 25
diff changeset
349 <h1 id="interface--1">Interface の実装例</h1>
23
mir3636
parents: 21
diff changeset
350
27
mir3636
parents: 25
diff changeset
351 <pre lang="impl"><code>Stack* createSingleLinkedStack(struct Context* context) {
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
352 struct Stack* stack = new Stack();
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
353 struct SingleLinkedStack* singleLinkedStack = new SingleLinkedStack();
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
354 stack-&gt;stack = (union Data*)singleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
355 singleLinkedStack-&gt;top = NULL;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
356 stack-&gt;push = C_pushSingleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
357 stack-&gt;pop = C_popSingleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
358 stack-&gt;pop2 = C_pop2SingleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
359 stack-&gt;get = C_getSingleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
360 stack-&gt;get2 = C_get2SingleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
361 stack-&gt;isEmpty = C_isEmptySingleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
362 stack-&gt;clear = C_clearSingleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
363 return stack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
364 }
30
mir3636
parents: 27
diff changeset
365 </code></pre>
24
mir3636
parents: 23
diff changeset
366
30
mir3636
parents: 27
diff changeset
367
mir3636
parents: 27
diff changeset
368 </div>
mir3636
parents: 27
diff changeset
369 <div class='slide '>
mir3636
parents: 27
diff changeset
370 <!-- _S9SLIDE_ -->
mir3636
parents: 27
diff changeset
371 <h1 id="interface--2">Interface の実装例</h1>
mir3636
parents: 27
diff changeset
372
mir3636
parents: 27
diff changeset
373 <pre lang="impl"><code>__code pushSingleLinkedStack(struct SingleLinkedStack* stack,
mir3636
parents: 27
diff changeset
374 union Data* data, __code next(...)) {
24
mir3636
parents: 23
diff changeset
375 Element* element = new Element();
mir3636
parents: 23
diff changeset
376 element-&gt;next = stack-&gt;top;
mir3636
parents: 23
diff changeset
377 element-&gt;data = data;
mir3636
parents: 23
diff changeset
378 stack-&gt;top = element;
mir3636
parents: 23
diff changeset
379 goto next(...);
mir3636
parents: 23
diff changeset
380 }
mir3636
parents: 23
diff changeset
381
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
382 </code></pre>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
383 <!--
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
384
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
385 <div style="text-align: center;">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
386  <img src="./images/multiComponent.pdf" alt="message" width="600">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
387 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
388
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
389 -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
390
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
391
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
392 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
393 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
394 <!-- _S9SLIDE_ -->
24
mir3636
parents: 23
diff changeset
395 <h1 id="stub-code-gear">stub Code Gear</h1>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
396
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
397 <ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
398 <li>Code Gear が必要とする Data Gear を取り出す際に Context を通す必要がある。</li>
24
mir3636
parents: 23
diff changeset
399 <li>しかし、Meta Data Gear である Context をノーマルレベルの Code Gear から直接アクセスするのはよろしくない。</li>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
400 <li>そこで Context から必要なデータを取り出して Code Gear に接続する、メタレベルの stub Code Gear を定義し、これを介して間接的に必要な Data Gear にアクセスする。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
401 </ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
402
30
mir3636
parents: 27
diff changeset
403
mir3636
parents: 27
diff changeset
404 </div>
mir3636
parents: 27
diff changeset
405 <div class='slide '>
mir3636
parents: 27
diff changeset
406 <!-- _S9SLIDE_ -->
mir3636
parents: 27
diff changeset
407 <h1 lang="stub" id="stub-code-gear-">stub Code Gear の例</h1>
mir3636
parents: 27
diff changeset
408 <pre><code>__code clearSingleLinkedStack(struct Context *context,
mir3636
parents: 27
diff changeset
409 struct SingleLinkedStack* stack,enum Code next) {
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
410 stack-&gt;top = NULL;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
411 goto meta(context, next);
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
412 }
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
413
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
414 __code clearSingleLinkedStack_stub(struct Context* context) {
30
mir3636
parents: 27
diff changeset
415 SingleLinkedStack* stack =
mir3636
parents: 27
diff changeset
416 (SingleLinkedStack*)GearImpl(context, Stack, stack);
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
417 enum Code next = Gearef(context, Stack)-&gt;next;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
418 goto clearSingleLinkedStack(context, stack, next);
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
419 }
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
420 </code></pre>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
421
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
422
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
423 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
424 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
425 <!-- _S9SLIDE_ -->
24
mir3636
parents: 23
diff changeset
426 <h1 id="contextstub-code-gear-">Context、stub Code Gear の自動生成</h1>
mir3636
parents: 23
diff changeset
427 <ul>
mir3636
parents: 23
diff changeset
428 <li>Gears OS ではノーマルレベルの計算の他に Context や stub などのメタ計算を記述する必要がある。</li>
mir3636
parents: 23
diff changeset
429 <li>現在の CbC で Gears OS を記述すると、このメタ計算の記述も行わなくてはならず、これには多くの労力を要する。</li>
mir3636
parents: 23
diff changeset
430 <li>この記述を助けるために Context を生成する generate_context と stub Code Gear を生成する generate_stub を perl スクリプトで作成した。</li>
mir3636
parents: 23
diff changeset
431 </ul>
25
mir3636
parents: 24
diff changeset
432 <div style="text-align: center;">
mir3636
parents: 24
diff changeset
433  <img src="./fig/generate_context.pdf" alt="generate_context" width="900" />
mir3636
parents: 24
diff changeset
434 </div>
24
mir3636
parents: 23
diff changeset
435
mir3636
parents: 23
diff changeset
436
mir3636
parents: 23
diff changeset
437 </div>
mir3636
parents: 23
diff changeset
438 <div class='slide '>
mir3636
parents: 23
diff changeset
439 <!-- _S9SLIDE_ -->
30
mir3636
parents: 27
diff changeset
440 <h1 id="stub-code-gear--1">stub Code Gear の生成</h1>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
441 <ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
442 <li>stub Code Gear は Code Gear 間の継続に挟まれ、Code Gear が必要な Data Gear を Context から取り出す処理を行うものである。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
443 <li>stub Code Gear は Code Gear 毎に記述する必要があり、そのCode Gear の引数を見て取り出す Data Gear を選択する。</li>
25
mir3636
parents: 24
diff changeset
444 <li>generate_stub は指定された cbc ファイルの __code で記述された Code Gear を取得。</li>
mir3636
parents: 24
diff changeset
445 <li>Code Gear の引数と interface を照らし合わせ、Gearef または GearImpl を決定する。</li>
mir3636
parents: 24
diff changeset
446 <li>cbc ファイルの Code Gear から、生成した stub Code Gear を加えたファイルを生成する。</li>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
447 </ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
448
30
mir3636
parents: 27
diff changeset
449
mir3636
parents: 27
diff changeset
450 </div>
mir3636
parents: 27
diff changeset
451 <div class='slide '>
mir3636
parents: 27
diff changeset
452 <!-- _S9SLIDE_ -->
mir3636
parents: 27
diff changeset
453 <h1 id="stub-code-gear-1">生成された stub Code Gear</h1>
mir3636
parents: 27
diff changeset
454
mir3636
parents: 27
diff changeset
455 <pre lang="stub"><code>__code clearSingleLinkedStack(struct Context *context,
mir3636
parents: 27
diff changeset
456 struct SingleLinkedStack* stack,enum Code next) {
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
457 stack-&gt;top = NULL;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
458 goto meta(context, next);
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
459 }
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
460
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
461 __code clearSingleLinkedStack_stub(struct Context* context) {
30
mir3636
parents: 27
diff changeset
462 SingleLinkedStack* stack =
mir3636
parents: 27
diff changeset
463 (SingleLinkedStack*)GearImpl(context, Stack, stack);
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
464 enum Code next = Gearef(context, Stack)-&gt;next;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
465 goto clearSingleLinkedStack(context, stack, next);
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
466 }
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
467 </code></pre>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
468
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
469
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
470 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
471 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
472 <!-- _S9SLIDE_ -->
24
mir3636
parents: 23
diff changeset
473 <h1 id="context--1">Context の生成</h1>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
474
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
475 <ul>
25
mir3636
parents: 24
diff changeset
476 <li>generate_context は context.h から Data Gear、generate_stub から生成されたファイルから Code Gear を取得し、以下を生成する。
mir3636
parents: 24
diff changeset
477 <ul>
27
mir3636
parents: 25
diff changeset
478 <li>Code/Data Gear を enum で定義した enumCode.h、enumData.h</li>
25
mir3636
parents: 24
diff changeset
479 <li>取得した Code/Data Gear から Context の生成を行う target-context</li>
27
mir3636
parents: 25
diff changeset
480 <li>Context を生成する際の Data Gear の Allocation を行う dataGearInit.c</li>
25
mir3636
parents: 24
diff changeset
481 </ul>
mir3636
parents: 24
diff changeset
482 </li>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
483 </ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
484
25
mir3636
parents: 24
diff changeset
485 <div style="text-align: center;">
30
mir3636
parents: 27
diff changeset
486  <img src="./fig/generate_context3.pdf" alt="generate_context3" width="500" />
25
mir3636
parents: 24
diff changeset
487 </div>
mir3636
parents: 24
diff changeset
488
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
489
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
490 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
491 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
492 <!-- _S9SLIDE_ -->
25
mir3636
parents: 24
diff changeset
493 <h1 id="section-2">今後の課題</h1>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
494 <ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
495 <li>本研究では interface の記述、CbC ファイルから Gears OS の記述に必要な Context と stub の生成を行う perl スクリプトの生成を行なった。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
496 <li>これにより Gears OS のコードの煩雑さは改善され、ユーザーは Context への接続を意識する必要がなくなった。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
497 <li>今後の課題は Code Gear からメタ計算を行う meta Code Gear を生成できるようにし、ユーザーがメタレベルの処理を意識せずにコードを記述できるようにする。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
498 <li>また、今回 perl スクリプトによって Context や stub の生成を行なったが、LLVM/clang 上で実装しコンパイラで直接 CbC を実行できるようにすることを目的とする。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
499 </ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
500
21
mir3636
parents: 17
diff changeset
501 <p><a href="プロシン発表時間 セッション7 1/21 10:40 - 12:00"></a></p>
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
502 <!-- === end markdown block === -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
503 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
504
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
505
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
506 </div><!-- presentation -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
507 </body>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
508 </html>