aboutsummaryrefslogtreecommitdiff
path: root/spec/spec.tex
diff options
context:
space:
mode:
authorSchuyler Eldridge2020-05-06 12:35:48 -0400
committerSchuyler Eldridge2020-05-06 16:32:32 -0400
commit21cf4cfa4bcf1d5febe5efd791633c8ea0185c6a (patch)
treed1aa61893a910c1896d376f7f3e698d5425b081c /spec/spec.tex
parent6e5721442c067829ad1e5d0c2c5c52f4056c83b7 (diff)
Clarify spec indentation of when/else
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Diffstat (limited to 'spec/spec.tex')
-rw-r--r--spec/spec.tex24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/spec.tex b/spec/spec.tex
index 9645e137..682c76a0 100644
--- a/spec/spec.tex
+++ b/spec/spec.tex
@@ -712,6 +712,30 @@ module MyModule :
x <= d
\end{lstlisting}
+To additionally aid readability, a conditional statement where the contents of the \verb|when| branch consist of a single line may be combined into a single line.
+If an \verb|else| branch exists, then the \verb|else| keyword must be included on the same line.
+
+The following statement:
+\begin{lstlisting}
+when c :
+ a <= b
+else :
+ e <= f
+\end{lstlisting}
+
+can have the \verb|when| keyword, the \verb|when| branch, and the \verb|else| keyword expressed as a single line:
+
+\begin{lstlisting}
+when c : a <= b else :
+ e <= f
+\end{lstlisting}
+
+The \verb|else| branch may also be added to the single line:
+
+\begin{lstlisting}
+when c : a <= b else : e <= f
+\end{lstlisting}
+
\subsubsection{Nested Declarations}
If a component is declared within a conditional statement, connections to the component are unaffected by the condition. In the following example, register \verb|myreg1| is always connected to \verb|a|, and register \verb|myreg2| is always connected to \verb|b|.