-
Notifications
You must be signed in to change notification settings - Fork 148
/
main.tex
269 lines (221 loc) · 8.81 KB
/
main.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8 Unicode
% NOTE: This uses /write18 to invoke inkscape through a shell command. This enables
% .svg files to automatically be converted into .pdf files. This may require passing
% -shell-escape to pdflatex when compiling.
% This is a simple template for a LaTeX document using the "article" class.
% See "book", "report", "letter" for other types of document.
\documentclass[11pt]{book} % use larger type; default would be 10pt
\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)
%%% Examples of Article customizations
% These packages are optional, depending whether you want the features they provide.
% See the LaTeX Companion or other references for full information.
%%% PAGE DIMENSIONS
\usepackage{geometry} % to change the page dimensions
% for paper
\geometry{letterpaper, margin=1in}
% for "boxed paper"
%\geometry{letterpaper,showframe,showcrop, margin=1in}
% for ebook
%\geometry{papersize={120mm, 150mm},margin=2mm, nohead}
% \geometry{landscape} % set up the page for landscape
% read geometry.pdf for detailed page layout information
\usepackage[numbers,square]{natbib}
\usepackage{tabularx}
\usepackage{graphicx} % support the \includegraphics command and options
% \usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
%%% PACKAGES
\usepackage{marginnote}
\usepackage{makeidx}
\usepackage{booktabs} % for much better looking tables
\usepackage{array} % for better arrays (eg matrices) in maths
\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
\usepackage{caption} % needed for making listing a figure when breaking across multiple pages
% Code listings
\usepackage[formats]{listings}
\usepackage{tikz}
\usepackage{pythonhighlight}
\usepackage{amssymb}
\usetikzlibrary{arrows,tikzmark,shadows}
%Below would be nice, but it barfs on lstinputlistings containing names with underscores
%\usetikzmarklibrary{listings}
\tikzset{
comment/.style={
draw,
fill=blue!70,
text=white,
rounded corners,
drop shadow,
align=left,
},
}
\usepackage{amsmath}
\usepackage{xspace}
%\usepackage[rgb]{xcolor} Already included by tikz
\usepackage[draft]{pdfcomment}
\usepackage{marginnote}
\usepackage{framed}
% listings doesn't handle tab vs. space indenting very well. The format mechanism isn't terribly
% intelligent, but it seems easier to get consistency from it than trying to get emacs to be consistent about how it indents.
% In some cases, the format mechanism is utterly braindead, however. This seems to happen with firstline= mostly.
% In those cases, you can explicitly specify format=none to get the old formatting.
\lstdefineformat{none}{}
\lstdefineformat{c}{%
\{=\string\newline\indent,%
\}=[;\ ]\newline\noindent\string\newline,%
\}\ =\noindent\string,%
\};=\newline\noindent\string\newline,%
;=[\ ]\string\space}
%\lstset{language=c,columns=spaceflexible,basicstyle=\sffamily,identifierstyle=\sffamily}
%\lstset{language=c,columns=fullflexible,basewidth=1em,basicstyle=\ttfamily\footnotesize,identifierstyle=\ttfamily}
\lstset{
language=c,
format=c,
morekeywords={AP,resource,interface, array\_partition,array\_reshape,array\_map,pipeline, dependence,dataflow,loop_tripcount,unroll,HLS},
morecomment=[l][\color{blue}]{\#pragma\ },
columns=fullflexible,
basewidth=.75em,
tabsize=1,
basicstyle=\sffamily,
identifierstyle=\sffamily}
% These packages are all incorporated in the memoir class to one degree or another...
%%% HEADERS & FOOTERS
\usepackage{fancyhdr} % This should be set AFTER setting up the page geometry
\pagestyle{fancy} % options: empty , plain , fancy
\renewcommand{\chaptermark}[1]{\markboth{\small\uppercase{#1}}{}}
\renewcommand{\sectionmark}[1]{}
%\renewcommand{\headrulewidth}{0pt} % customise the layout...
%\lhead{}\chead{}\rhead{}
%\lfoot{}\cfoot{\thepage}\rfoot{}
\setlength{\headheight}{14pt}
%%% SECTION TITLE APPEARANCE
\usepackage{sectsty}
\allsectionsfont{\sffamily\mdseries\upshape} % (See the fntguide.pdf for font help)
% (This matches ConTeXt defaults)
%%% ToC (table of contents) APPEARANCE
\usepackage[nottoc,notlof,notlot]{tocbibind} % Put the bibliography in the ToC
\usepackage[titles,subfigure]{tocloft} % Alter the style of the Table of Contents
\renewcommand{\cftsecfont}{\rmfamily\mdseries\upshape}
\renewcommand{\cftsecpagefont}{\rmfamily\mdseries\upshape} % No bold!
%%% END Article customizations
%%% The "real" document content comes below...
\usepackage{url}
\usepackage{framed,color}
\usepackage{import}
\usepackage{todonotes}
\usepackage{pdfpages}
\definecolor{shadecolor}{rgb}{.75,.9,.9}
\definecolor{asidecolor}{rgb}{.75,.75,.75}
\definecolor{exercisecolor}{rgb}{.75,.9,.9}
\newcommand{\executeiffilenewer}[3]{%
\ifnum\pdfstrcmp{\pdffilemoddate{#1}}{\pdffilemoddate{#2}}>0%
{\immediate\write18{#3}}\fi%
}
\newcommand{\dexecuteiffilenewer}[3]{%
\immediate\write18{#3}%
}
\newcommand{\includesvg}[1]{%
\executeiffilenewer{#1.svg}{images/#1.pdf}%
{inkscape -z -D --file=#1.svg %
--export-pdf=images/#1.pdf --export-latex}%
\subimport{./images/}{#1.pdf_tex}%
}
\newcommand{\includesvgimg}[1]{%
\executeiffilenewer{#1.svg}{images/#1.pdf}%
{inkscape -z -D --file=#1.svg %
--export-pdf=images/#1.pdf}%
\includegraphics{./images/#1.pdf}%
}
%Enable notes
%\newcommand{\note}[1]{{\color{red}{\textbf{#1}}}}
%Disable nodes
\newcommand{\note}[1]{}
\newcommand{\sym}[1]{\texttt{#1}}
\newcommand{\code}[1]{\texttt{#1}}
\newcommand{\term}[1]{{\color{blue}\textit{#1}}\index{#1}} % FIXME: add an index/glossary here.
\newcommand{\vivado}{Vivado\textsuperscript{\textregistered}}
\newcommand{\VHLS}{Vivado\textsuperscript{\textregistered} HLS\xspace}
\newcommand{\tabspace}{\vspace{1em}}
\newcommand{\stevecomment}[1]{\pdfmargincomment[color=red,icon=Insert,author={steve}]}
\newcommand{\unit}[2]{{\frac{\texttt{#1}}{\texttt{#2}}}}
%\tabspace{}\hrulefill\\
\newenvironment{tabularpad}[1]{\parskip=0pt\par\noindent\begin{minipage}{\textwidth}\parskip=0.5em\hfill\par\hspace{2em}\begin{tabular}{#1}}{\end{tabular}\hfill\par\hfill\end{minipage}}
\newenvironment{padbox}[1]{\parskip=0pt\par\noindent\begin{minipage}{\textwidth}\parskip=0.5em\hfill\par\hspace{2em}\begin{minipage}{#1}}{\end{minipage}\hfill\par\hfill\end{minipage}}
\newlength{\boxwidth}
\newenvironment{coloredbox}[1]{
\def\FrameCommand{\fboxsep=\FrameSep \fboxrule=\FrameRule \fcolorbox{black}{#1}}%
\MakeFramed {\setlength{\boxwidth}{\textwidth}
\addtolength{\boxwidth}{-2\FrameSep}
\addtolength{\boxwidth}{-2\FrameRule}
\setlength{\hsize}{\boxwidth} \FrameRestore}}%
{\endMakeFramed}
\newenvironment{aside}{\begin{coloredbox}{asidecolor}}{\end{coloredbox} }
\newenvironment{exercise}{\begin{coloredbox}{exercisecolor}}{\end{coloredbox} }
%%% add in glossary (terms go into glossary.tex)
%\usepackage[utf8]{inputenc}
\usepackage[toc,acronym]{glossaries}
\makenoidxglossaries
\input{glossary}
\title{Parallel Programming for FPGAs}
\author{Ryan Kastner, Janarbek Matai, and Stephen Neuendorffer\\\note{Notes are enabled}}
%\date{} % Activate to display a given date or no date (if empty),
% otherwise the current date is printed
\makeindex
\begin{document}
%uncomment this to see overfull hbox's
%\overfullrule=1mm
\setlength{\emergencystretch}{5em}
% Settings for \mybox and Mybox
\setlength{\fboxrule}{1pt}
\setlength{\fboxsep}{9pt}
% Additional settings for MyBox
\setlength{\FrameRule}{\fboxrule}
\setlength{\FrameSep}{\fboxsep}
\includepdf{cover}
\newpage\leavevmode\thispagestyle{empty}\newpage
\maketitle
\vspace*{\stretch{1.0}} \ \\
\begin{center}
\setlength{\parskip}{0.5\baselineskip}
Copyright 2011-\the\year.
\end{center}
\vspace*{20mm} \ \\
\begin{minipage}{\linewidth}
This work is licensed under the Creative Commons Attribution 4.0 International License.
To view a copy of this license, visit \url{http://creativecommons.org/licenses/by/4.0/}.
\end{minipage}
\vspace*{20mm} \ \\
\begin{minipage}{\linewidth}
The newest version of this book can be found at \url{http://hlsbook.ucsd.edu}. The authors welcome your feedback and suggestions.
\end{minipage}
\vspace*{\stretch{2.0}} \ \\
\newpage
\tableofcontents
\newpage
\input{preface}
\input{acknowledgements}
%\note{Add section describing formatting used to denote matrices, vector, math, etc.?}
%\part{Basic Concepts}
\input{intro}
\input{fir}
\input{cordic}
\input{dft}
\input{fft}
\input{sparse_matrix_vector}
\input{matrix_multiplication}
\input{prefix_histogram}
\input{video}
\input{sorting}
\input{huffman_encoding}
\input{bnn}
%\part{Appendix: Wireless Systems Projects}
%\label{wirelessProjects}
%\input{wirelessBasics}
%\input{projects}
\bibliographystyle{plainnat}
\bibliography{all}
%\printindex
\printnoidxglossaries
\end{document}