[Previous] [Next] [Contents] [Index]


    Building an Application

This chapter describes how you can use the Cadvanced Code Generator in SDT to generate applications and especially how to design the environment functions. These functions are the place where you connect the SDL system and the environment of the system.

You should read The Cadvanced/Cbasic Code Generator before reading this chapter to understand the general behavior of the Cadvanced Code Generator. Much of what you need to know to generate an application may be found there, and that information is not repeated here.

Table of Contents 

Introduction

The Basic Idea

An application generated with the Cadvanced Code Generator can be viewed as having three parts:

  1. The SDL system
  2. The physical environment of the system
  3. The environment functions, where you connect the SDL system with the environment of the system

In the SDL system process transitions are executed in priority order, signals are sent from one process to another initiating new transitions, timer signals are sent, and so on. These are examples of internal actions that only affect the execution of the SDL system. An SDL system communicates with its environment by sending signals to the environment and by receiving signals from the environment.

The physical environment of an application consists of an operating system, a file system, the hardware, a network of computers, and so on. In this world other actions than just signal sending are required. Examples of actions that an application wants to perform are:

The environment functions are the place where the two worlds, the SDL system and the physical environment, meet. Here signals sent from the SDL system to the environment can induce all kinds of events in the physical environment, and events in the environment might cause signals to be sent into the SDL system. You have to provide the environment functions, as the Cadvanced Code Generator has no knowledge of the actions that should be performed.

Figure 483 : Structure of an application

Extracted pic [5]

In a distributed system an application might consist of several communicating SDL systems. Each SDL system will become one executable program. It might execute either as an operating system process, communicating with other operating system processes, or it might execute in a processor of its own, communicating over a network with other processors. There may, of course, also be combinations of these cases. Let us for the sake of simplicity call the operating system processes or processors for nodes communicating over a network. In the case of communicating operating system (OS) processes, the network will be the facilities for process communication provided by the OS.

There are no problems in building an application consisting of several nodes communicating over a network using the Cadvanced Code Generator. However, you have to implement the communication between the nodes in the environment functions.

Note: 

All nodes in a network do not need to be programs generated by the Cadvanced Code Generator from SDL systems. As long as a node can communicate with other nodes, it might be implemented using any technique.

The PId values (references to process instances), are a problem in a distributed world containing several communicating SDL systems. We still want, for example, "Output To Sender" to work, even if Sender refers to a process instance in another SDL system. To cope with this kind of problem, a global node number has been introduced as a component in a PId value. The global node number, which is a unique integer value assigned to each node, identifies the node where the current process instance resides, while the other component in the PId value is a local identification of the process instance within the node (SDL system).

The partitioning of an application into an SDL system and the environment functions has additional advantages. It separates external actions into the logical decision to perform the action (the decision to send a signal to the environment) and the implementation details of the action (treating the signal in the environment functions). This kind of separation reduces the complexity of the problem and allows separate testing. It also allows parallel development of the logic (the SDL system) and the interface towards the environment (the environment functions). When the signal interface between the SDL system and its environment is settled, it is possible to continue both the activities in parallel.

Libraries

Two libraries, Application and ApplicationDebug, are provided to generate applications. Both use real time (see Time and perform calls to environment functions (see section The Environment Functions). The difference is that ApplicationDebug includes the monitor system while Application does not include the monitor system.

When an application is developed, it is usually appropriate to first simulate and debug the SDL system or systems without its environment. One of the libraries Simulation or RealTimeSimulation may then be used. You first simulate each SDL system on its own and can then simulate the systems together (if you have communicating systems) using the facility of communicating simulations. After that you probably want to debug the application with the environment functions. This may be performed with the library ApplicationDebug. You may then generate the application with the library Application.

The library Validation allows you to build validators from the code generated by the Cadvanced Code Generator. A Validator has a user interface and executing principles that are similar to a Simulator. The technical approach is however different; a Validator is based on a technique called state space exploration and operates on structures called behavior trees. Its purpose is to validate an SDL system in order to find errors and to verify its consistency against Message Sequence Charts.

Reference Section

Representation of Signals and Processes

In this first section, the representation of signals and processes is presented. The symbol table, which is a representation of the static structure of the system, will also be discussed. The information given here will be used in the next part of this section where the environment functions, which should be provided by the user, are described.

Types Representing Signals

A signal is represented by a C struct containing general information about the signal followed by the parameters carried by the signal.

Figure 484 : Data structure representing a signal

Extracted pic [4]

A general typedef xSignalRec for a signal without parameters and for a pointer to such a signal, xSignalNode, are given below. These types may be found in the file scttypes.h. These types may be used for type casting of any signal to access the general components.

A xSignalRec contains the following components:

In the generated code there will be types to represent the parameters of the signals according to the following example:


Example 230 : Generated C Code for Signal Definition      

Assume the following signal definitions in SDL:

then the C code below will be generated:

where SIGNAL_VARS is a macro defined in scttypes.h that is expanded to the common components in a signal struct.


For each signal with parameters there are two generated types, a struct type and a pointer type. The struct type contains one component for each parameter in the signal definition and the components will be named Param1, Param2 and so on. The components will be placed in the same order in the struct as the parameters are placed in the signal definition.

Note: 

There are no generated types for a signal without parameters.

Types Representing Processes

A PId value is a struct consisting of two components, a global node number, which is an integer (see also section Function xGlobalNodeNumber and section The Basic Idea) and a local PId value, which is a pointer.

The global node number identifies the SDL system that the process instance belongs to, while the local PId value identifies the process instance within the system. The local PId pointer value should not be referenced outside the SDL system where it is defined.

By introducing a global node number in the PId values, these values are possible to interpret throughout an application consisting of several SDL systems. You can also define your own PId values in non-SDL defined parts of the application and still use communication with signals.

The variable SDL_NULL, which represents a null value for PIds and which is defined in the runtime library and available through the file scttypes.h, contains zero in both the global node number and the local PId component. Note that the global node number should be greater than zero in all PId values except SDL_NULL.

The Symbol Table

The symbol table is a tree built up during the initialization phase in the execution of the generated program and contains information about the static structure of the SDL system. The symbol table contains, for example, nodes which represent signal types, blocks, channels, process types, and procedures. The C type that are used to represent for example signals in the symbol table is given below.

It is the nodes that represent the signal types, for signals sent to and from the environment of the SDL system, that are of major interest in connection with the environment functions. For each signal type there will be a symbol table node. That node may be referenced using the name ySigN_ followed by the signal name with prefix. Such references may be used in, for example, xOutEnv to find the signal type of the signal passed as parameter.

In some cases the symbol table nodes for channels from the environment to a block in the system are of interest to refer to. In a similar way as for signals such nodes may be referenced using the name yChaN_ followed by the channel name with prefix.

The Environment Functions

An SDL system communicates with its environment by sending signals to the environment and by receiving signals from the environment. As no information about the environment is given in the SDL system, the Cadvanced Code Generator cannot generate the actions that should be performed when, for instance, a signal is sent to the environment. Instead you have to provide a function that performs this mapping between a signal sent to the environment and the actions that then should be performed. Examples of such actions are writing a bit pattern on a port, sending information over a network to another computer and sending information to another OS process using some OS primitive.

You should provide the following functions to represent the environment of the SDL system:

There are two ways to get a skeleton for the env functions:

An advantage with the generated env functions is that the code generator knows about the signal interface to be implemented in the env functions, and can therefore insert code or macros for all signals in the interface. To calculate this information is not that easy, especially if partitioning (generating code for a part of a system) is used.

The env functions are thoroughly discussed below, but first we will introduce the system interface header file which considerably simplifies writing the environment functions.

System Interface Header File

It is possible to generate a header file (.h file) which is suitable to use when implementing the environment functions. This file is generated if both:

The system interface header file (also known as environment header file), which will have the name system_file_name.ifc, will contain all type definitions and other extern definitions that are necessary to implement the environment functions in a file that may be compiled on its own.

The system interface header file, which only contains code for objects defined in the system diagram, has the following structure:

Together with these definitions, macros that simplify the translation of SDL names to C names will also be generated. Normally there are problems when the name used in C code for an SDL object is to be determined, as prefixing is used to make the C identifiers unique (see section Names and Prefixes in Generated Code. In the system interface, header file macros are introduced to make the SDL names directly available in C.


Example 231 : Contents of an .ifc File      

If an SDL signal called Sig1 is defined in the system, then the .ifc file will contain:


This means that the xIdNode for the signal may be referred to using the signal name directly, and not only by a name containing a prefix that cannot be predicted in advance and that may change due to changes in the system diagram.

The strategy used means that you have to regenerate the system interface header file each time you regenerate code for the system, but also that the code in the environment functions need not to be changed (only recompiled).

The following SDL names will in the same way be available directly in C:


Example 232 : Contents of an .ifc File      

Suppose the following objects are defined in a system diagram:

Then the following system interface header file will be generated (assuming some appropriate prefixes):


Structure of File for Environment Functions

The file containing the environment functions should have the following structure:

The last function, xGlobalNodeNumber, will be discussed later, see Function xGlobalNodeNumber. The usage of the macros XPP and XNOPROTO makes the code possible to compile both with compilers that can handle prototypes and with compilers that cannot. If you do not need this portability, you can reduce the complexity of the function headings somewhat. In the minor examples in the remaining part of this section, only versions with prototypes are shown.

Functions xInitEnv and xCloseEnv

There are two functions among the environment functions that handle initialization and termination of the environment. These functions, as well as the other environment functions, should be provided by the user.

In the implementation of these functions you can place the appropriate code needed to initialize and terminate the software and the hardware. The function xInitEnv will be called during the start up of the program as first action, while the xCloseEnv will be called in the function SDL_Halt. Calling SDL_Halt is the appropriate way to terminate the program. The easiest way to call SDL_Halt is to include the call in a #CODE directive in a TASK. SDL_Halt is part of the runtime library and has the following definition:

Note: 

xInitEnv will be called before the SDL system is initialized, which means that no references to the SDL system are allowed in this function. To, for example, send signals into the system during the initialization phase, the #MAIN directive should be used (see Initialization -- Directive #MAIN). This directive code can be used after the initialization of the SDL system, but before any transitions are executed.

Function xOutEnv

Each time a signal is sent from the SDL system to the environment of the system, the function xOutEnv will be called.

The xOutEnv function will have the current signal as parameter, so you have all the information contained in the signal at your disposal when you implement the actions that should be performed. The signal contains the signal type, the sending and receiving process instance and the parameters of the signal. For more information about the types used to represent signals and processes, see section Types Representing Signals and Types Representing Processes.

Note that the parameter of xOutEnv is an address to xSignalNode, that is, an address to a pointer to a struct representing the signal. The reason for this is that the signal that is given as parameter to xOutEnv should be returned to the pool of available memory before return is made from the xOutEnv function. This is made by calling the function xReleaseSignal, which takes an address to an xSignalNode as parameter, returns the signal to the pool of available memory, and assigns 0 to the xSignalNode parameter. Thus, there should be a call

before returning from xOutEnv. The xReleaseSignal function is defined as follows:

In the function xOutEnv you may use the information in the signal that is passed as parameters to the function. First it is usually suitable to determine the signal type of the signal. This is best performed by if statements containing expressions of the following form, assuming the use of the system interface header file and that the signal has the name Sig1 in SDL:

Suitable expressions to reach the Receiver, the Sender, and the signal parameters are:

(and so on)

Sender will always refer to the sending process instance, while Receiver is either a reference to a process in the environment or the value xEnv. xEnv is a PId value that refers to an environment process instance, which is used to represent the general concept of environment, without specifying an explicit process instance in the environment.

Note: 

It is not possible to calculate the PId value for a process in the environment, the value has to be taken from an incoming signal (sender or signal parameter). This is the normal procedure in SDL to establish direct communication between two processes in the same SDL system.

Receiver will refer to the process xEnv if the PId expression in an output TO refers to xEnv, or if the signal was sent in an output without a TO clause and the environment was selected as receiver in the scan for receivers.

Remote procedure calls to or from the environment should in the environment functions be treated a two signals, a pCALL_procedurename and a pREPLY_procedurename signal.

Recommended Structure of the xOutEnv Function

You can, of course, write the xOutEnv function as you wish -- the structure discussed below may be seen as an example -- but also as a guideline of how to design xOutEnv functions.


Example 233 : Structure of xOutEnv Function      

Function xInEnv

To make it possible to receive signals from the environment and to send them into the SDL system, the user provided function xInEnv is repeatedly called during the execution of the system (see section Program Structure). During such a call you should scan the environment to see if anything has occurred which should trigger a signal to be sent to a process within the SDL system.

To implement the sending of a signal into the SDL system, two functions are available: xGetSignal, which is used to obtain a data area suitable to represent the signal, and SDL_Output, which sends the signal to the specified receiver according to the semantic rules of SDL. These functions will be described later in this subsection.

The parameter Time_for_next_event will contain the time for the next event scheduled in the SDL system. The parameter will either be 0, which indicates that there is a transition (or a timer output) that can be executed immediately, or be greater than Now, indicating that the next event is a timer output scheduled at the specified time, or be a very large number, indicating that there is no scheduled action in the system, that is, the system is waiting for an external stimuli. This large value can be found in the variable xSysD.xMaxTime.

You should scan the environment, perform the current outputs, and return as fast as possible if Time has past Time_for_next_event.

If Time has not past Time_for_next_event, you have a choice to either return from the xInEnv function at once and have repeated calls of xInEnv, or stay in the xInEnv until something triggers a signal output (a signal sent to the SDL system) or until Time has past Time_for_next_event.

Note: 

We recommend always to return from the xInEnv function as fast as possible to ensure that it will work appropriately together with the monitor (during debugging). Otherwise, the keyboard polling, that is, typing <RETURN> in order to interrupt the execution, will not work.

The function xGetSignal, which is one of the service functions suitable to use when a signal should be sent, returns a pointer to a data area that represents a signal instance of the type specified by the first parameter.

The components Receiver and Sender in the signal instance will also be given the values of the corresponding parameters.

The function SDL_Output takes a reference to a signal instance and outputs the signal according to the rules of SDL.

We now have enough information to be able to write the code to send a signal. Suppose we want to send a signal S1, without parameters, from xEnv into the system without an explicit receiver (without TO). The code will then be:


Example 234 : C Code to Send a Signal to the Environment      

If S2, with two integer parameters, should be sent from xEnv to the process instance referenced by the variable P, the code will be:


For the details of how to reference the parameters of a signal see the subsection Types Representing Signals.

To introduce a via list in the output requires a variable, which should be an array of xIdNode, that contains references to the symbol table nodes representing the current channels (or signal routes) in the via list. In more detail, we need a variable

where N should be replaced by the length of the longest via list we want to represent plus one. The components in the variable should then be given appropriate values, such that component 0 is a reference to the first channel (its symbol table node) in the via list, component 1 is a reference to the second channel, and so on. The last component with a reference to a channel must be followed by a component containing a null pointer (the value (xIdNode)0). Components after the null pointer will not be referenced. Below is an example of how to create a via list of two channels, C1 and C2.


Example 235 : Via List of two Channels.      

The variable ViaList may then be used as a ViaList parameter in a subsequent call to SDL_Output.

Guidelines for the xInEnv Function

It is more difficult to give a structure for the xInEnv function, than for the xOutEnv function discussed in the previous subsection. A xInEnv function will in principle consist of a number of if statements where the environment is investigated. When some information is found that means that a signal is to be sent to the SDL system, then the appropriate code to send a signal (see above) should be executed.

The structure given in the example below may serve as an idea of how to design the xInEnv function.


Example 236 : Structure of xInEnv Function      

This basic structure can be modified to suit your own needs. The if statements could, for example, be substituted for while statements. The signal types might be sorted in some "priority order" and a return can be introduced last in the if statements. This means that only one signal is sent during a xInEnv call, which reduces the latency.

Alternative to OutEnv - Directive #EXTSIG

To speed up an application it is sometimes possible to use the directive #EXTSIG instead of the xOutEnv function. The decision to use #EXTSIG or xOutEnv may be taken individually for each signal type.

The usage of the #EXTSIG directive is described in the section Modifying Outputs -- Directive #EXTSIG, #ALT, #TRANSFER. This information is not repeated here.

By using the #EXTSIG directive the following overhead can be avoided:

Including the Environment Functions in the SDL System Design

Apart from having the environment functions on a file of their own, it is of course possible to include these function directly into the system diagram in a #CODE directive.


Example 237 : Including Environment Functions in SDL System      

In this case you cannot use the system interface header file, but instead you have all the necessary declarations already at your disposal, as the functions will be part of the SDL system. The only problem you will encounter is the prefixing of SDL names when they are translated to C. The #SDL directive should be used to handle this problem (or the #NAME directive), see sections Accessing SDL Names in C Code -- Directive #SDL and Specifying Names in Generated Code -- Directive #NAME. The following table shows how to obtain C names for some SDL objects of interest:

Function xGlobalNodeNumber

You should also provide a function, xGlobalNodeNumber, with no parameters, which returns an integer that is unique for each executing system.

The returned integer should be greater than zero and should be unique among the communicating SDL systems that constitutes an application. If the application consists of only one application then this number is of minor interest (it still has to be set). The global node number is used in PId values to identify the node (OS process / processor) that the process instance belongs to. PId values are thereby universally accessible and you may, for example, in a simple way make "Output To Sender" work between processes in different SDL systems (OS processes / processors).

When an application consisting of several communicating SDL systems is designed, you have to map the global node number to the current OS process or processor, to be able to transmit signals addressed to non-local PIds to the correct OS process or processor. This will be part of the xOutEnv function.

Program Structure

The generated code will contain two important types of functions, the initialization functions and the PAD functions. The PAD functions implement the actions performed by processes during transitions. There will be one initialization function in each generated .c file. In the file that represents the system this function will have the name yInit. Each process in the system will be represented by a PAD function, which is called when a process instance of the current instance set is to execute a transition.

The example below shows the structure of the main, MainInit, and MainLoop functions.


Example 238 : Start up structure      

The function xMainLoop contains an endless loop. The appropriate way to stop the execution of the program is to call the runtime library function SDL_Halt. The call of this C function should normally be included in an appropriate task, using the directive #CODE. SDL_Halt which has the following structure:

To complete this overview, which emphasizes the usage of the environment functions, we have to deal with the xOutEnv function. Within PAD functions, the runtime library function SDL_Output is called to implement outputs of signals. When SDL_Output identifies the receiver of a signal to be a process instance that is not part of the current SDL system, SDL_Output will call the xOutEnv function.

Dynamic Errors

In the library for applications SDL runtime errors will not be reported. The application will just perform some appropriate actions and continue to execute. These actions are in almost all cases the same as the actions at dynamic errors described in the Dynamic Errors.

Example Section

In this section a complete example of an application is presented. The application is simple but it still contains most of the problems that arise when the Cadvanced Code Generator is used to generate applications. All source code for this example, together with the running application are delivered with the runtime libraries for application generation. The example is developed for SunOS 5 and HP-UX.

The Example

We want to develop an application that consists of several communicating UNIX processes. Each UNIX process should also be connected to the keyboard and the screen. When a complete line is typed on the keyboard (when <Return> is pressed) in one of the UNIX processes, that line should be sent to and printed by all the UNIX processes, including the one where the line was entered. If a line starting with the character "." is entered in any UNIX process then all the UNIX processes should terminate immediately.

There are some observations we can make from this short description.

The SDL System

The SDL system with a behavior as outlined above is very simple. It contains, for example, only one process. The system can receive three types of signals, TermInput from the terminal, and Message and Terminate from the SDL system that is the previous node in the ring. The system will respond by sending Display to the terminal and Message and Terminate to the SDL system next in the ring. The signals TermInput and Display take a line (which is read from the terminal or should be printed on the terminal) as parameter. The signal Message takes a line and a PId value (the original sender in the ring) as parameter, while the signal Terminate takes a PId value (the original sender in the ring) as parameter.

The diagrams for the SDL system may be found in Appendix A: The SDL System. In the section Where to Find the Example, references to where to find the source code for this example are given.

Simulating the Behavior

At this stage of the development of the application, when the SDL system is completed but the environment functions are not implemented, it is time to simulate the SDL system to debug it at the SDL level. The runtime library Simulation is appropriate in this case for simulation.

There are six cases that should be tested:

Let us now verify that the SDL system behaves according to this. In the two executions of the simulation shown below, the cases described above are tested in the same order as they are listed.


Example 239 : Execution Trace of Generated Application      

Start program Phone.sim.sct:


Example 240       

Start program Phone.sim.sct:


By running the system with the SDL monitor, as in the examples above, you may debug the system at the SDL level. The overall behavior of the system can thus be tested.

It is possible to start two instances of the simulation and have the simulators communicate with each other. Then Message and Terminate signals sent to the environment in one of the simulations will appear as signals coming from the environment in the other.

Note: 

Do not forget the monitor command Start-SDT-Env to make the simulation programs start communicating.

The Environment

In the environment functions we use the socket facility in UNIX to implement the communication between the executing programs. In the current example, the implementation is developed for SunOS 5 and HP-UX.

To simplify the example we assume that each instance of the application is started in a window of its own (a shell tool window under for instance X Windows, where UNIX commands can be entered). This means that we will have no problems with the interpretation of stdin and stdout in the programs.

The name of the socket for incoming messages for a certain instance of the application will be the string "Phone" concatenated with the UNIX process number for the current program. The socket will be created in the directory /tmp. Each application instance will print this number during the initialization and will then ask for the process number of the application instance where it should send its messages. You have to enter these numbers in such a way as to form a ring among the applications.

The Environment Functions

The environment functions, which may be found in the file PhoneEnv.c, are shown in section Appendix B: The Environment Functions. The file is developed according to the structure discussed in the previous part of this chapter and uses the system interface header file generated from the SDL system.

As the PhoneEnv.c file includes scttypes.h and uses some C macros, it should be compiled using the same compiler options as the C file for the SDL system. For information about how to extend the generated make file to handle also non-generated files, please see Makefile Options.

In the code for the environment functions a number of UNIX functions are used. Their basic behavior is described below. For any details please see the UNIX manuals available from Sun Microsystems.

Function name Functionality
getpid

Returns the UNIX process number for the current program.

socket

Returns a new, unnamed socket.

bind

Binds a socket to a name in the file system.

listen

Starts listen for other programs trying to connect to this socket.

connect

Should be called by other programs that want to establish a connection to the current socket.

accept

Accepts a connection request.

select

Returns 1 if anything readable can be found in any of the specified file descriptors, where a file descriptor can represent a file, a socket, and the terminal (stdin and stdout).

read, write

Reads or writes on a file (a file descriptor).

close

Closes a file.

unlink

Removes a file.

If we now look at the code for the environment functions (see Appendix B: The Environment Functions), we see that xInitEnv mainly performs the following actions:

In xCloseEnv the created sockets are closed and removed.

The xInEnv and xOutEnv functions follow the guidelines for these functions given in the reference section. In xInEnv the select function is used to determine if any messages are ready to be received from the terminal (stdin) or from the incoming socket. An available message is then read and the information is converted to an SDL signal, which is sent to the SDL system using the SDL_Output function. In xOutEnv a test on the NameNode in the signal is used to determine the signal type. Depending on the signal type the appropriate information is written either on the outgoing socket or on the terminal (stdout).

Debugging

The first part of the debugging activity is, of course, when the SDL system is simulated and examined through the monitor system. Now we also want to include the environment functions during debugging. The intention of the library ApplicationDebug is to use the monitor and the environment functions together.

When the environment functions (xInEnv) read information from the keyboard there is, however, a problem in using xInEnv together with the monitor. In our system, for instance, a line typed on the keyboard may either be a monitor command or a line typed to the SDL system. As both the monitor and xInEnv are polling for lines from stdin, the interpretation of a typed line depends on which one first finds the line.

A better way is to eliminate this indeterministic behavior by not polling for typed lines in xInEnv. Instead, you may use the monitor command:

to simulate a line typed on the keyboard. In this way all the other parts of the environment functions can be tested under the monitor. If you enclose the sections in xInEnv handling keyboard pollingbetween #ifndef XMONITOR and #endif this code is removed when the monitor is used; that is if the library ApplicationDebug is used (see the code for xInEnv in Appendix B: The Environment Functions).

A C source code debugger is of course also useful when debugging the environment functions. The initialization phase, xInitEnv, is probably the most difficult part to get working correctly in our system. All the source code for this function is available, and a C debugger can be used.

While debugging generated code from SDL at the C level, it is always easy to find the currently executing SDL symbol, by using the SDT references (see Syntax) in the C code and the Go To Source menu choice in the Edit menu in the Organizer. For more details please see Go To Source.

Running the Application

To have an application of the Phone system you now only need to make a new executing program with the library Application.

When you run the Phone system, start the program from two (or more) shell tools (on UNIX). Each instance of the program will then print:

You should answer these questions in such a way that a ring is formed by the programs. When the initialization is completed for a program it prints:

The program is now ready to receive lines printed on the keyboard and messages sent from other programs. A Display signal received from another program is printed as follows:

Where to Find the Example

All files concerning this example may be found in the directory:

Use these files if you only want to look at the source files and if you are using a Sun workstation you could try the executing versions of the program. Otherwise you should copy the files to one of your own directories. Please be sure not to change the original files.

In the directory you will find the following files:

File name Purpose
Phone.sdt

The system file

Phone.ssy

Represents the SDL system

PhoneBl.sbk

Represents the SDL block

PhonePr.spr

Represents the SDL process

phone.pr

The generated PR file after GR to PR

phone.c

The generated C file after C code generation

phone.ifc

The generated .ifc file

PhoneEnv.c

Contains the environment functions

Phone.m

The make file for HP-UX

Phone.solaris.m

The make file for SunOS 5

Appendix A: The SDL System

Figure 485 : The system Phone

Extracted pic [1]

Figure 486 : The block PhoneBl

Extracted pic [2]

Figure 487 : The process PhonePr

Extracted pic [3]

Appendix B: The Environment Functions

This section contains the environment functions included in the example.


[Previous] [Next] [Contents] [Index]