\subsubsection{Message}
\label{message}

A \messages is specified by the following definitions:\\

(1) It allows to model data exchanges between 
\tasks located in different \processor.\\

(2) A \messages can be sent by one or several sending \task and 
can be received by one or several receiving
\tasks.\\

(3) \messagess can be queued on the receiver side before they are read by sending \task.\\

(4) \messagess are read/write according to a protocol specified by the 
dependency expressed between the tasks and the messages (see dependency entity for
further readings.\\


\begin{center}
Standard attributes
\end{center}

$Name$: It is the unique name of the \messages.\\

$Message_{-}Type$: It specifies the type of \messages.\\

$Parameters$: It is the type of $User_{-}Defined_{-}Parameters_{-}Table$, 
which is the list of $Parameter$.\\

$Deadline$: It is deadline of the \messages. This corresponds to the 
last time that the \messages should be received or sent.\\

$Jitter$: The jitter of the \messages.\\

$Size$: It is the size of the payload of the \messages.\\

$Response_{-}Time$ : Amount of time a message takes to reach the receiver 
after it has been
sent by the sender. A receiver is blocked until this delay is not exhausted during
scheduling simulation.
It also corresponds to the end to end time 
between the emission and reception of the \messages.\\

$Communication_{-}Time$: It is the 
duration of the \messages in the \buffer. It is not currently used du
scheduling simulation\\

$mils_{-}confidentiality_{-}level$:
 
$mils_{-}integrity_{-}level$: 


\begin{center}
Legality rules
\end{center}

(L1) The \messages name must not be empty.\\

(L2) The \messages name must be a valid identifier.\\

(L3) The $Size$ must be greater than 0.\\

(L4) The $Deadline$ must be less than or equal to $Jitter$.\\

(L5) \messages is sent when the sender is running its last 
time unit of its capacity.\\

(L6) A \messages is received at the execution of the at 
completion time of a sender \task.\\

(L7) A \messages cannot be received before the specified number 
of units of time specified by the attribute $response_-time$ after the 
message sending time. $response_-time$ can be equal to 0: in that case, the
message is immiediatly available for the receiving task.  \\

(L8) A \messages is received when ($L7$) holds and when a receiver task is running
 its first unit of time of its $Capacity$.\\

(L9) To have message exchanges during the scheduling simulation, a asynchronous
communication dependency must exist in the model. Two protocols can be specified
during dependency expression: 
\begin{itemize}
\item $first$\_$message$ protocol: in this case, a receiving task  waiting for 
several message is woken up when one message is arrived. This protocol is the 
default protocol.
\item $all$\_$messages$ protocol: in this case, a receiving task waiting for 
several messages is woken up when all messages are arrived.
\item With any of these protocol, when a receiving task is run, it consumes only one
message whataver the number of arrived messages.
\end{itemize}


(L10) Period of messages are not used during scheduling simulation.


\begin{center}
Annexes
\end{center}

(A1) The types of \messages.\\

\indent \indent (A11) $Periodic_{-}Type$: A $periodic$ message is automatically 
sent at each $Period$.\\

\indent \indent (A12) $Aperiodic_{-}Type$: In this case, the $message$ is sent 
according to $aperiodic$ time.\\

\indent \indent (A13) $Generic_{-}Type$: It is the case when we have no 
information about the sending time of \messages.\\

(A2) Each $Parameter$ is characterized by:\\

\indent \indent (A21) $Discriminant$. It is the type of $Parameter_{-}Type$.\\

\indent \indent \indent \indent (A211) $Boolean_{-}Parameter$: When the parameter is boolean.\\

\indent \indent \indent \indent (A212) $Integer_{-}Parameter$: When the parameter is integer.\\

\indent \indent \indent \indent (A213) $Double_{-}Parameter$: When the parameter is double.\\

\indent \indent \indent \indent (A214) $String_{-}Parameter$: When the parameter is string.\\

\indent \indent (A22) $Union$, which is the type of $Parameter_{-}Union$.\\

\indent \indent \indent \indent (A221) $Boolean_{-}Parameter$: When the parameter is boolean.\\

\indent \indent \indent \indent (A222) $Integer_{-}Parameter$: When the parameter is integer.\\

\indent \indent \indent \indent (A223) $Double_{-}Parameter$: When the parameter is double.\\

\indent \indent \indent \indent (A224) $String_{-}Parameter$: When the parameter is string.\\

\indent \indent (A23) $Name$: The name of the parameter.\\

\begin{center}
Implementation
\end{center}

The figure \ref{dtd_message} gives the DTD of entity $Message$.


\begin{figure}{}
\begin{lstlisting}{}

<!ELEMENT messages (generic_message | 
  periodic_message | aperiodic_message)+>
<!ELEMENT generic_message (object_type | name | 
  message_type | parameters | deadline | size | 
  response_time | communication_time)*>
<!ATTLIST generic_message id ID #REQUIRED>
<!ELEMENT periodic_message (object_type | name | 
  message_type | parameters | deadline | size | 
  response_time | communication_time | period | jitter)*>
<!ATTLIST periodic_message id ID #REQUIRED>
<!ELEMENT aperiodic_message (object_type | name | 
  message_type | parameters | deadline | size | 
  response_time | communication_time)*>
<!ATTLIST aperiodic_message id ID #REQUIRED>

\end{lstlisting}
\caption{The DTD of entity $Message$}
\label{dtd_message}
\end{figure}



\begin{center}
Example
\end{center}

The figure \ref{example_message} gives an example of entity \messages, 
described using Cheddar ADL.

The example describes a periodic message, named $M1$, with $deadline$, 
$size$, $response_-time$, $period$ and $jitter$ equal to $1$.


\begin{figure}{}
\begin{lstlisting}{}

<messages>
 <periodic_message id=" 58" >
 <object_type>MESSAGE_OBJECT_TYPE</object_type>
 <name>M1</name>
 <message_type>PERIODIC_TYPE</message_type>
 <deadline>1</deadline>
 <size>1</size>
 <response_time>1</response_time>
 <communication_time>1</communication_time>
 <period>1</period>
 <jitter>1</jitter>
 </periodic_message>
</messages>

\end{lstlisting}
\caption{An example of entity \messages}
\label{example_message}
\end{figure}
