Skip to content

Commit

Permalink
Clarify that a clock cannot be input to hold. (#2773)
Browse files Browse the repository at this point in the history
Closes #2174
  • Loading branch information
HansOlsson committed Dec 16, 2020
1 parent abab745 commit c84e8d1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions chapters/synchronous.tex
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,14 @@ \subsection{Clocks and Clocked Variables}\label{clocks-and-clocked-variables}
\caption{A clock variable. The value of a clock variable is not defined -- the plot marks only indicate \emph{when} the clock is active.}\label{fig:clock-variable}
\end{figure}

\begin{definition}[Clocked variable]
\begin{definition}[Clocked variable]\label{def:clocked-variable}
The elements of clocked variables $r(t_{i})$ are of base type \lstinline!Real!, \lstinline!Integer!, \lstinline!Boolean!, enumeration, \lstinline!String! that are associated uniquely with
a clock $c(t_{i})$. A clocked variable can only be directly accessed at the event instant where the associated clock is active. A constant and a parameter can always be used at a place
a clock $c(t_{i})$. A clocked variable can only be directly accessed at the event instant where the associated clock is active. A constant and a parameter can always be used at a place
where a clocked variable is required.
\begin{nonnormative}
Note that clock variables are not included in this list.
This implies that clock variables cannot be used where clocked variables are required.
\end{nonnormative}

At time instants where the associated clock is not active, the value of a clocked variable can be inquired by using an explicit cast operator, see below. In such a case \lstinline!hold! semantics is
used, in other words the value of the clocked variable from the last event instant is used. See \cref{fig:clocked-variable}.
Expand Down Expand Up @@ -585,7 +589,7 @@ \subsection{Base-clock conversion operators}\label{base-clock-conversion-operato
hold($u$)
\end{lstlisting}\end{synopsis}
\begin{semantics}
Input argument $u$ is a clocked component expression (\cref{def:component-expression}) or a parameter expression.
Input argument $u$ is a clocked (\cref{def:clocked-variable}) component expression (\cref{def:component-expression}) or a parameter expression.
The operator returns a piecewise constant signal of the same type as $u$.
When the clock of $u$ ticks, the operator returns $u$ and otherwise returns the value of $u$ from the last clock activation.
Before the first clock activation of $u$, the operator returns the start value of $u$, see \cref{initialization-of-clocked-partitions}.
Expand Down

0 comments on commit c84e8d1

Please sign in to comment.