Add a sheet with example high and low level code.
[matthijs/projects/internship.git] / Progress presentation / Presentation.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 %For handouts, use the following two lines:
27 %\usepackage{pgfpages}
28 %\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm]
29
30
31 \title
32 {MontiumC Transforming}
33
34 \author {Matthijs Kooijman}
35
36 \institute[Recore Systems and University of Twente]
37 {
38   \inst{}%
39   Recore Systems
40   \and
41   \inst{}%
42   Faculty of Electrical Engineering, Mathematics and Computer Science\\
43   University of Twente
44   }
45   
46 \begin{document}
47
48 \begin{frame}
49         \titlepage
50 \end{frame}
51
52 \begin{frame}{Contents}
53   \tableofcontents
54 \end{frame}
55
56 \section{Introduction}
57   \subsection{Montium Tile Processor}
58   \subsection{MontiumC}
59   \subsection{LLVM}
60   \subsection{Compile process}
61
62 \section{Tasks}
63
64   \subsection{Original tasks}
65     \begin{frame}{Original tasks}
66       \begin{itemize}
67         \item Select LLVM transformations
68         \item Improve and add transformations
69         \item Provide debugging information
70       \end{itemize}
71     \end{frame}
72
73   \subsection{Extra tasks}
74     \begin{frame}{Extra tasks}
75       \begin{itemize}
76         \item What is MontiumC?
77         \item What is Montium IR?
78       \end{itemize}
79     \end{frame}
80
81     \begin{frame}{What is MontiumC?}
82       \begin{itemize}
83       \item Status: Specification is ongoing
84       \item Challenges:
85         \begin{itemize}
86           \item Clang is nontransparent
87           \note[item]{Clang --- A lot of special cases}
88           \item C is complex
89           \note[item]{Complex C --- A lot of corner cases}
90           \item C is limited
91           \note[item]{Limited C --- Need to use annotations, limited amount of types}
92           \item Assembly vs. High level
93           \note[item]{Tradeoffs -- Code size vs compiler complexity, clarity
94           vs control, clarity vs determinism}
95         \end{itemize}
96       \end{itemize}
97     \end{frame}
98
99     \begin{frame}[containsverbatim]
100       \begin{columns}
101         \begin{column}{0.5\textwidth}
102           Low level
103           \begin{Verbatim}[fontsize=\tiny]
104 mem input;
105 mem output;
106 word factor;
107
108 void run(void) {
109   factor = from_int(2);
110   input  = alloc_mem(P0M0);
111   output = alloc_mem(P0M1);
112   set_base(input, 0);
113   set_offset(input, 0);
114   set_base(output, -1);
115   set_offset(output, -1);
116
117   next_cycle();
118   word in = read_mem(input);
119   word out = p0o0(imul(ra1(in), rc1(factor)))
120   add_offset(input, 1);
121   add_offset(output, 1);
122   init_loop(LC1, 8);
123   do {
124     write_mem(output, out);
125     in = read_mem(input);
126     out = p0m0(imul(ra1(in), rc1(factor)))
127     add_offset(input, 1);
128     add_offset(output, 1);
129   } while(loop_next(LC1));
130
131   write_mem(output, out);
132 \end{Verbatim}
133         \end{column}
134         \begin{column}{0.5\textwidth}
135           High level
136           \begin{Verbatim}[fontsize=\tiny]
137 P0M0 int input[10];
138 P0M1 int output[10];
139
140 void run(void) {
141   for (int i=0; i<10; ++i)
142     output[i] = input[i] * 2;
143 }
144           \end{Verbatim}
145         \end{column}
146       \end{columns}
147     \end{frame}
148
149     \begin{frame}{What is Montium IR?}
150       \begin{itemize}
151         \item Status: Initial version
152         \item Challenges:
153         \begin{itemize}
154           \item Fast moving target
155           \item Corner cases
156           \note[item]{Corner case --- global constants}
157           \item Hardware dependencies
158           \note[item]{Hardware --- Limited number of conditionals possible}
159         \end{itemize}
160       \end{itemize}
161     \end{frame}
162
163     \begin{frame}{Selecting LLVM transformations}
164       \begin{itemize}
165         \item Status: Done
166         \item Challenges:
167         \begin{itemize}
168           \item LLVM Passes assume a lot
169           \note[item]{Assumptions --- Immediates are not free}
170           \item Montium has specific constraints
171           \note[item]{Constraint --- Implicit cycle boundaries and ordering}
172         \end{itemize}
173       \end{itemize}
174     \end{frame}
175
176     \begin{frame}{Improving / adding transformations}
177       \begin{itemize}
178         \item Status: Ongoing
179         \item Challenges:
180         \begin{itemize}
181           \item Staying generic
182           \note[item]{Generic --- LLVM maintained passes are a lot easier}
183           \item New LLVM features
184           \note[item]{Features --- Multiple return values, inlining and
185           annotation attributes}
186         \end{itemize}
187       \end{itemize}
188     \end{frame}
189
190     \begin{frame}{Debugging information}
191       \begin{itemize}
192         \item Status: Not started
193         \item Challenges:
194         \begin{itemize}
195           \item Not much LLVM support yet
196           \note[item]{LLVM support --- New in clang/backend, no support in
197           transformations yet.}
198           \item Transformations
199           \note[item]{Transformations --- Global arguments, argument addition,
200           removal, etc.}
201         \end{itemize}
202       \end{itemize}
203     \end{frame}
204
205     \begin{frame}{Reconfigurable binaries}
206       \begin{itemize}
207         \item Status: Recently started
208         \item Challenges:
209         \begin{itemize}
210           \item Tracking variables
211           \note[item]{Tracking --- Through all steps of the process}
212           \item Loss of optimizations
213           \note[item]{Optimizations --- Hard to encode constraints}
214           \item Mostly a backend problem
215         \end{itemize}
216       \end{itemize}
217     \end{frame}
218
219 \section{Work process}
220   \begin{frame}{Recore}
221     \begin{itemize}
222       \item Fast communication
223       \note[item]{Communication --- Mixed teams, easy to "listen in".}
224       \item Constructive brainstorming
225       \note[item]{Brainstorming --- Evaluating different ideas and approaches.}
226     \end{itemize}
227   \end{frame}
228
229   \begin{frame}{LLVM}
230     \begin{itemize}
231       \item Large community
232       \note[item]{Community --- Companies involved, a lot of full time
233       developers.}
234       \item Great support
235       \note[item]{Support --- mailing list, bug reports solved within 1/2 days.}
236       \item Slightly conflicting goals
237       \note[item]{Goals --- LLVM aims mainly at "regular" architectures.}
238     \end{itemize}
239   \end{frame}
240
241 \section{Conclusions}
242
243 \end{document}