5 - Declarations
5.1 - Process
A process is implicitly declared in the architecture of the system (Cf. "Architecture" on page 8) since the communication channels need to be connected.
A process has an initial number of instances at startup and a maximum number of instances. A process can also be an instance of a process class (Cf. "Object orientation" on page 52), in that case the name of the class follows the name of the instance after a colon.
<process instance name>[:<process class>][(<initial number of instances>, <maximum number of instances>)]
When a process is an instance of a process class the gates of the process class need to be connected in the architecture diagram. The names of the gates appear in the process symbol with a black circle representing the connection point.
The messages defined in the package going through the gates must be consistent with the messages listed in the architecture diagram where the process instance is defined.
Example:
5.2 - Procedure declaration
An SDL-RT procedure can be defined in any diagram: system, block, or process. It is usually not connected to the architecture but since it can output messages a channel can be connected to it for informational purpose.
The declaration syntax is the same as a C function. A procedure definition can be done graphically with SDL-RT or textually in a standard C file.
5.2.1 SDL-RT defined procedure
If defined with SDL-RT the calling process context is implicitly given to the procedure. So if a message output is done, the message will be output from the process calling the procedure. That is why the message should be defined in one of the channels connected to the process instead of a channel connected to a procedure. To call such a procedure the procedure call symbol should be used.
5.2.2 C defined procedure
If defined in C language the process context is not present. To call such a procedure a standard C statement should be used in a action symbol.
Example:
5.3 - Messages
Messages do not need any declaration. They are self declared when listed in a channel. It is possible to declare message lists to make the architecture view more synthetic. Such a declaration can be made at any architecture level with the additional heading symbol. The syntax is:
SDL_RT_MESSAGE_LIST <message list name> = <message name> {,<message name>}*;
A message list can contain a message list, the included message list name is surrounded by parenthesis.
Example:
5.4 - Timers
There is no need to declare timers. They are self declared when used in a diagram.
5.5 - Semaphores
Semaphores can be declared at any architecture level. Since each RTOS has its own type of semaphores with specific options there will be no detailed description of the syntax. The general syntax in the declaration symbol is:
It is important to note the semaphore is identified by its name.
http://www.sdl-rt.org info@sdl-rt.org |