summaryrefslogtreecommitdiffstats
path: root/algorithm.tex
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-11-20 01:48:47 +0000
committerYann Herklotz <git@yannherklotz.com>2020-11-20 01:48:47 +0000
commita2f75b2fc01bd18513b2f7395e16e4cae66eee6f (patch)
treefcfae5c225a5e7faaeb684cf9c5016e3f7691ee6 /algorithm.tex
parent0159982015b96224fd5a67ab57cd61d72b625177 (diff)
downloadoopsla21_fvhls-a2f75b2fc01bd18513b2f7395e16e4cae66eee6f.tar.gz
oopsla21_fvhls-a2f75b2fc01bd18513b2f7395e16e4cae66eee6f.zip
Improve diagram
Diffstat (limited to 'algorithm.tex')
-rw-r--r--algorithm.tex82
1 files changed, 75 insertions, 7 deletions
diff --git a/algorithm.tex b/algorithm.tex
index c590b00..5c98854 100644
--- a/algorithm.tex
+++ b/algorithm.tex
@@ -137,14 +137,82 @@ An HTL program thus consists of two maps: a control map that describes how to ca
\definecolor{control}{HTML}{b3e2cd}
\definecolor{data}{HTML}{fdcdac}
\begin{tikzpicture}
- \fill[control,fill opacity=1] (6.5,0) rectangle (12,5);
- \fill[data,fill opacity=1] (0,0) rectangle (5.5,5);
- \filldraw[white,rounded corners=10pt] (7,0.5) rectangle (11.5,2);
- \node at (1,4.7) {\footnotesize Data Path};
- \node at (7.5,4.7) {\footnotesize Control Logic};
- \node at (8,1.8) {\tiny Next State FSM};
+ \fill[control,fill opacity=1] (6.5,0) rectangle (12,4);
+ \fill[data,fill opacity=1] (0,0) rectangle (5.5,4);
+ \node at (1,3.7) {\footnotesize Data Path};
+ \node at (7.5,3.7) {\footnotesize Control Logic};
+
+ \fill[white,rounded corners=10pt] (7,0.5) rectangle (11.5,2.2);
+ \node at (8,2) {\tiny Next State FSM};
+ \foreach \x in {15,...,9}
+ {\pgfmathtruncatemacro{\y}{\x-9}%
+ \node[draw,circle,inner sep=0,minimum size=10,scale=0.8] (s\x) at (7.5+\y/2,1.6) {\tiny \x};}
+ \foreach \x in {8,...,2}
+ {\pgfmathtruncatemacro{\y}{8-\x}%
+ \node[draw,circle,inner sep=0,minimum size=10,scale=0.8] (s\x) at (7.5+\y/2,1.1) {\tiny \x};}
+ \node[draw,circle,inner sep=0,minimum size=10,scale=0.8] (s1c) at (11,1.35) {\tiny 1};
+ \node[draw,circle,inner sep=0,minimum size=13,scale=0.8] (s1) at (s1c) {};
+ \foreach \x in {15,...,2}
+ {\pgfmathtruncatemacro{\y}{\x-1}\draw[-{Latex[length=1mm,width=0.7mm]}] (s\x) -- (s\y);}
+ \draw[-{Latex[length=1mm,width=0.7mm]}] (10.8,2) to [out=200,in=70] (s15);
+ \draw[-{Latex[length=1mm,width=0.7mm]}] (s3) to [out=210,in=330] (s7);
+
+ \node[draw,fill=white] (nextstate) at (9.25,3) {\tiny Current State};
+ \draw[-{Latex[length=1mm,width=0.7mm]}] let \p1 = (nextstate) in
+ (11.5,1.25) -| (11.75,\y1) -- (nextstate);
+ \draw let \p1 = (nextstate) in (nextstate) -- (6,\y1) |- (6,1.5);
+ \node[scale=0.4,rotate=60] at (7.5,0.75) {\texttt{clk}};
+ \node[scale=0.4,rotate=60] at (7.7,0.75) {\texttt{rst}};
+ \draw[-{Latex[length=1mm,width=0.7mm]}] (7.65,-0.5) -- (7.65,0.5);
+ \draw[-{Latex[length=1mm,width=0.7mm]}] (7.45,-0.5) -- (7.45,0.5);
+
+ \fill[white,rounded corners=10pt] (2,0.5) rectangle (5,3);
+ \filldraw[fill=white] (0.25,0.5) rectangle (1.5,3);
+ \node at (2.6,2.8) {\tiny Update};
+ \node at (0.875,2.8) {\tiny \texttt{RAM}};
+ \node[scale=0.4] at (4.7,1.5) {\texttt{state}};
+ \draw[-{Latex[length=1mm,width=0.7mm]}] (6,1.5) -- (5,1.5);
+ \node[scale=0.4,rotate=60] at (4.1,0.9) {\texttt{finished}};
+ \node[scale=0.4,rotate=60] at (3.9,0.95) {\texttt{return\_val}};
+ \node[scale=0.4,rotate=60] at (2.5,0.75) {\texttt{clk}};
+ \node[scale=0.4,rotate=60] at (2.7,0.75) {\texttt{rst}};
+
+ \draw[-{Latex[length=1mm,width=0.7mm]}] (4,0.5) -- (4,-0.5);
+ \draw[-{Latex[length=1mm,width=0.7mm]}] (3.75,0.5) -- (3.75,-0.5);
+ \draw[-{Latex[length=1mm,width=0.7mm]}] (2.45,-0.5) -- (2.45,0.5);
+ \draw[-{Latex[length=1mm,width=0.7mm]}] (2.65,-0.5) -- (2.65,0.5);
+
+ \node[scale=0.4] at (1.2,2.2) {\texttt{wr\_en}};
+ \node[scale=0.4] at (1.2,2) {\texttt{wr\_addr}};
+ \node[scale=0.4] at (1.2,1.8) {\texttt{wr\_data}};
+ \node[scale=0.4] at (1.2,1.4) {\texttt{r\_addr}};
+ \node[scale=0.4] at (1.2,1.2) {\texttt{r\_data}};
+
+ \node[scale=0.4] at (2.3,2.2) {\texttt{wr\_en}};
+ \node[scale=0.4] at (2.3,2) {\texttt{wr\_addr}};
+ \node[scale=0.4] at (2.3,1.8) {\texttt{wr\_data}};
+ \node[scale=0.4] at (2.3,1.4) {\texttt{r\_addr}};
+ \node[scale=0.4] at (2.3,1.2) {\texttt{r\_data}};
+
+ \draw[-{Latex[length=1mm,width=0.7mm]}] (2,2.2) -- (1.5,2.2);
+ \draw[-{Latex[length=1mm,width=0.7mm]}] (2,2) -- (1.5,2);
+ \draw[-{Latex[length=1mm,width=0.7mm]}] (2,1.8) -- (1.5,1.8);
+ \draw[-{Latex[length=1mm,width=0.7mm]}] (2,1.4) -- (1.5,1.4);
+ \draw[-{Latex[length=1mm,width=0.7mm]}] (1.5,1.2) -- (2,1.2);
+
+ %\filldraw[fill=white] (2.8,3.25) rectangle (4.2,4.75);
+ %\node at (3.5,4.55) {\tiny \texttt{Registers}};
+ %\draw[-{Latex[length=1mm,width=0.7mm]}] (2,2.4) -| (1.75,4) -- (2.8,4);
+ %\draw[-{Latex[length=1mm,width=0.7mm]}] (4.2,4) -- (5.25,4) |- (5,2.4);
+
+ %\node[scale=0.4] at (3.5,4.2) {\texttt{reg\_1}};
+ %\node[scale=0.4] at (3.5,4) {\texttt{reg\_2}};
+ %\node[scale=0.4] at (3.5,3.8) {\texttt{reg\_3}};
+ %\node[scale=0.4] at (3.5,3.6) {$\cdots$};
+ %\node[scale=0.4] at (3.5,3.4) {\texttt{reg\_8}};
\end{tikzpicture}
- \caption{The FSMD for our running example. \JW{Maybe replace `State' with `Current State'? And maybe `Calculate State' could be clearer as `Calculate Next State'?} \JW{Can state 15 (or should it be state 16??) have a dangling incoming arrow to indicate that it is the start state? And perhaps state 1 could have a double outline to indicate that it is an `accepting' state? Since there's space above the `Calculate State' box, I'd be mildly in favour of expanding that box a bit so that it included all 15 states explicitly (snaking back and forth).}\YH{If this is better I can mock up a tikz version of it maybe and fix the last bits then too.}}\label{fig:accumulator_diagram}
+ \caption{The FSMD for our running example.}\label{fig:accumulator_diagram}
+%\JW{Maybe replace `State' with `Current State'? And maybe `Calculate State' could be clearer as `Calculate Next State'?} \JW{Can state 15 (or should it be state 16??) have a dangling incoming arrow to indicate that it is the start state? And perhaps state 1 could have a double outline to indicate that it is an `accepting' state? Since there's space above the `Calculate State' box, I'd be mildly in favour of expanding that box a bit so that it included all 15 states explicitly (snaking back and forth).}\YH{If this is better I can mock up a tikz version of it maybe and fix the last bits then too.}
\end{figure*}
\paragraph{Translating memory}