6a710abf95e759fce6d447bcf68e5f8e5ff0bc2d
[matthijs/projects/internship.git] / Presentations / Progress.tex
1 \documentclass[hyperref={pdfpagelabels=false}]{beamer}
2
3 %\setbeameroption{show notes}
4
5 \mode<presentation>
6 {
7   %\useinnertheme{echt}
8   %\useinnertheme{proef}
9   \usetheme{recore}
10   \setbeamercovered{transparent}
11 %\setbeamertemplate{footline}[frame number]
12 }
13
14 \usepackage[english]{babel}
15 \usepackage[latin1]{inputenc}
16 \usepackage{times}
17 \usepackage[T1]{fontenc}
18 \usepackage{acronym}
19 \usepackage{tikz}
20 \usepackage{multimedia}
21 \usepackage{subfigure}
22 \usepackage{booktabs}
23 % Can use a tiny fontsize
24 \usepackage{fancyvrb}
25
26
27 %\usepackage{pgfpages}
28 %\pgfpagesuselayout{4 on 1}[a4paper,border shrink=5mm]
29
30 %For handouts, use the following two lines:
31 %\usepackage{pgfpages}
32 %\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm]
33
34
35 \title
36 {MontiumC Transforming}
37
38 \author {Matthijs Kooijman}
39
40 \institute[Recore Systems and University of Twente]
41 {
42   \inst{}%
43   Recore Systems
44   \and
45   \inst{}%
46   Faculty of Electrical Engineering, Mathematics and Computer Science\\
47   University of Twente
48   }
49   
50 \begin{document}
51
52 \begin{frame}
53         \titlepage
54 \end{frame}
55
56 \begin{frame}{Contents}
57   \tableofcontents
58 \end{frame}
59
60 \section{Introduction}
61   \begin{frame}{Montium Tile Processor}
62     \begin{itemize}
63       \item Explicitely parallel processor
64       \item Multilevel reconfiguration
65       \item Separate memory addressing units
66       \item Data oriented, limited control flow
67       \item Redesign on the way
68     \end{itemize}
69   \end{frame}
70
71   \begin{frame}{MontiumC}
72     \begin{itemize}
73       \item Subset of C
74       \item Operations on data using MontiumC API
75       \item Compilable by gcc (as C++)
76       \item Under constant improvement
77     \end{itemize}
78   \end{frame}
79
80   \begin{frame}{Low Level Virtual Machine (LLVM)}
81     \begin{itemize}
82       \item Compiler framework.
83       \item Provides:
84       \begin{itemize}
85         \item C Frontend
86         \item Intermediate representation (LLVM IR)
87         \item Transformation passes
88         \item Native codegenerators
89         \item JIT compilation
90       \end{itemize}
91       \item Very modular
92     \end{itemize}
93   \end{frame}
94
95   \begin{frame}{Compiling MontiumC}
96     \pgfdeclareimage[width=\textwidth]{Compiling}{images/Compiling}
97     \pgfuseimage{Compiling}
98     \begin{itemize}
99       \item Focus: montiumccfe and transformations
100     \end{itemize}
101   \end{frame}
102
103 \section{Tasks}
104
105   \subsection{Original tasks}
106     \begin{frame}{Original tasks}
107       \begin{itemize}
108         \item Select LLVM transformations
109         \item Improve and add transformations
110         \item Provide debugging information
111       \end{itemize}
112     \end{frame}
113
114   \subsection{Extra tasks}
115     \begin{frame}{Extra tasks}
116       \begin{itemize}
117         \item What is MontiumC?
118         \item What is Montium IR?
119         \item Reconfigurable binaries
120       \end{itemize}
121     \end{frame}
122
123     \begin{frame}{What is MontiumC?}
124       \note{Two angles: What do we want, and what do we support.}
125       \begin{itemize}
126       \item Status: Specification is ongoing
127       \item Challenges:
128         \begin{itemize}
129           \item Clang is nontransparent
130           \note[item]{Clang --- A lot of special cases}
131           \item C is complex
132           \note[item]{Complex C --- A lot of corner cases}
133           \item C is limited
134           \note[item]{Limited C --- Need to use annotations, limited amount of types}
135           \item Assembly vs. High level
136           \note[item]{Tradeoffs -- Code size vs compiler complexity, clarity
137           vs control, clarity vs determinism}
138         \end{itemize}
139       \end{itemize}
140     \end{frame}
141
142     \begin{frame}[containsverbatim]
143       \begin{columns}
144         \begin{column}{0.5\textwidth}
145           Low level
146           \begin{Verbatim}[fontsize=\tiny]
147 mem input;
148 mem output;
149 word factor;
150
151 void run(void) {
152   factor = from_int(2);
153   input  = alloc_mem(P0M0);
154   output = alloc_mem(P0M1);
155   set_base(input, 0);
156   set_offset(input, 0);
157   set_base(output, -1);
158   set_offset(output, -1);
159
160   next_cycle();
161   word in = read_mem(input);
162   word out = p0o0(imul(ra1(in), rc1(factor)))
163   add_offset(input, 1);
164   add_offset(output, 1);
165   init_loop(LC1, 8);
166   do {
167     write_mem(output, out);
168     in = read_mem(input);
169     out = p0m0(imul(ra1(in), rc1(factor)))
170     add_offset(input, 1);
171     add_offset(output, 1);
172   } while(loop_next(LC1));
173
174   write_mem(output, out);
175 \end{Verbatim}
176         \end{column}
177         \begin{column}{0.5\textwidth}
178           High level
179           \begin{Verbatim}[fontsize=\tiny]
180 P0M0 int input[10];
181 P0M1 int output[10];
182
183 void run(void) {
184   for (int i=0; i<10; ++i)
185     output[i] = input[i] * 2;
186 }
187           \end{Verbatim}
188         \end{column}
189       \end{columns}
190     \end{frame}
191     \note{} % Empty filler note page
192
193     \begin{frame}{What is Montium IR?}
194       \begin{itemize}
195         \item Status: Initial version
196         \item Challenges:
197         \begin{itemize}
198           \item Backend is a fast moving target
199           \item Corner cases
200           \note[item]{Corner case --- global constants}
201           \item Hardware dependencies
202           \note[item]{Hardware --- Limited number of conditionals possible}
203         \end{itemize}
204       \end{itemize}
205     \end{frame}
206
207     \begin{frame}{Selecting LLVM transformations}
208       \begin{itemize}
209         \item Status: Done
210         \item Challenges:
211         \begin{itemize}
212           \item LLVM Passes assume a lot
213           \note[item]{Assumptions --- Immediates are not free}
214           \item Montium has specific constraints
215           \note[item]{Constraint --- Implicit cycle boundaries and ordering}
216         \end{itemize}
217       \end{itemize}
218     \end{frame}
219
220     \begin{frame}{Improving / adding transformations}
221       \begin{itemize}
222         \item Status: Ongoing
223         \item Challenges:
224         \begin{itemize}
225           \item Staying generic
226           \note[item]{Generic --- LLVM maintained passes are a lot easier}
227           \item New LLVM features
228           \note[item]{Features --- Multiple return values, inlining and
229           annotation attributes}
230         \end{itemize}
231       \end{itemize}
232     \end{frame}
233
234     \begin{frame}{Debugging information}
235       \begin{itemize}
236         \item Status: Not started
237         \item Challenges:
238         \begin{itemize}
239           \item Not much LLVM support yet
240           \note[item]{LLVM support --- New in clang/backend, no support in
241           transformations yet.}
242           \item Transformations
243           \note[item]{Transformations --- Global arguments, argument addition,
244           removal, etc.}
245         \end{itemize}
246       \end{itemize}
247     \end{frame}
248
249     \begin{frame}{Reconfigurable binaries}
250       \begin{itemize}
251         \item Status: Recently started
252         \item Challenges:
253         \begin{itemize}
254           \item Tracking variables
255           \note[item]{Tracking --- Through all steps of the process}
256           \item Loss of optimizations
257           \note[item]{Optimizations --- Hard to encode constraints}
258           \item Mostly a backend problem
259         \end{itemize}
260       \end{itemize}
261     \end{frame}
262
263 \section{Work process}
264   \begin{frame}{Working at Recore}
265     \begin{itemize}
266       \item Smart people
267       \item Fast communication
268       \note[item]{Communication --- Mixed teams, easy to "listen in".}
269       \item Constructive brainstorming
270       \note[item]{Brainstorming --- Evaluating different ideas and approaches.}
271     \end{itemize}
272   \end{frame}
273
274   \begin{frame}{Working with LLVM}
275     \begin{itemize}
276       \item Large community
277       \note[item]{Community --- Companies involved, a lot of full time
278       developers.}
279       \item Great support
280       \note[item]{Support --- mailing list, bug reports solved within 1/2 days.}
281       \item Slightly conflicting goals
282       \note[item]{Goals --- LLVM aims mainly at "regular" architectures.}
283     \end{itemize}
284   \end{frame}
285
286 \section{Conclusions}
287   \begin{frame}{Conclusions}
288     \begin{itemize}
289       \item LLVM is very suitable
290       \item Defining the problem is harder than solving it
291       \item Three months is short!
292     \end{itemize}
293   \end{frame}
294
295 \end{document}