From 89135e34402f3cd58892a028db8e75198e3f8ae2 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Tue, 30 Jun 2020 22:54:28 +0100 Subject: Add algorithm --- algorithm.tex | 184 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 147 insertions(+), 37 deletions(-) (limited to 'algorithm.tex') diff --git a/algorithm.tex b/algorithm.tex index 31bf6bb..1b84009 100644 --- a/algorithm.tex +++ b/algorithm.tex @@ -33,23 +33,163 @@ Existing HLS compilers usually use LLVM IR as an intermediate representation whe %%TODO: Maybe add why LTL and the other smaller languages are not that well suited +\subsection{Example} + \begin{figure} \centering - \begin{minipage}{0.5\linewidth} + \begin{subfigure}[b]{0.4\linewidth} \begin{minted}{c} int main() { - int x[5] = {1, 2, 3, 4, 5}; - int sum = 0; - for (int i = 0; i < 5; i++) + int x[3] = {1, 2, 3}; + int sum = 0, incr = 1; + for (int i = 0; i < 3; i=i+incr) sum += x[i]; return sum; } \end{minted} - \end{minipage} - \caption{Accumulator example C code.}\label{fig:accumulator_c} + \caption{Accumulator C code.}\label{fig:accumulator_c} + \end{subfigure}% + \begin{subfigure}[b]{0.6\linewidth} +\begin{minted}[fontsize=\footnotesize]{c} +main() { + 19: x9 = 1 + 18: int32[stack(0)] = x9 + 17: x8 = 2 + 16: int32[stack(4)] = x8 + 15: x7 = 3 + 14: int32[stack(8)] = x7 + 13: x3 = 0 + 12: x2 = 1 + 11: x1 = 0 + 10: nop + 9: if (x1