From b5507272ecd8f989e9432313e33cdcdedcefde9d Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Mon, 30 Jun 2008 11:28:12 +0200 Subject: [PATCH] Add a sheet with example high and low level code. --- Progress presentation/Presentation.tex | 55 +++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/Progress presentation/Presentation.tex b/Progress presentation/Presentation.tex index c329ae5..b68f296 100755 --- a/Progress presentation/Presentation.tex +++ b/Progress presentation/Presentation.tex @@ -20,6 +20,9 @@ \usepackage{multimedia} \usepackage{subfigure} \usepackage{booktabs} +% Can use a tiny fontsize +\usepackage{fancyvrb} + %For handouts, use the following two lines: %\usepackage{pgfpages} %\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm] @@ -92,7 +95,57 @@ \end{itemize} \end{itemize} \end{frame} - + + \begin{frame}[containsverbatim] + \begin{columns} + \begin{column}{0.5\textwidth} + Low level + \begin{Verbatim}[fontsize=\tiny] +mem input; +mem output; +word factor; + +void run(void) { + factor = from_int(2); + input = alloc_mem(P0M0); + output = alloc_mem(P0M1); + set_base(input, 0); + set_offset(input, 0); + set_base(output, -1); + set_offset(output, -1); + + next_cycle(); + word in = read_mem(input); + word out = p0o0(imul(ra1(in), rc1(factor))) + add_offset(input, 1); + add_offset(output, 1); + init_loop(LC1, 8); + do { + write_mem(output, out); + in = read_mem(input); + out = p0m0(imul(ra1(in), rc1(factor))) + add_offset(input, 1); + add_offset(output, 1); + } while(loop_next(LC1)); + + write_mem(output, out); +\end{Verbatim} + \end{column} + \begin{column}{0.5\textwidth} + High level + \begin{Verbatim}[fontsize=\tiny] +P0M0 int input[10]; +P0M1 int output[10]; + +void run(void) { + for (int i=0; i<10; ++i) + output[i] = input[i] * 2; +} + \end{Verbatim} + \end{column} + \end{columns} + \end{frame} + \begin{frame}{What is Montium IR?} \begin{itemize} \item Status: Initial version -- 2.30.2