IBM
Contents Index Previous Next



Light Integration


A Light Integration is a stand-alone executable which can be generated with or without a simulator. An executable that should run under UNIX can use the precompiled kernels. Only the environment functions need to be written by the user.

PAD Functions

The PAD function is called by the scheduler when its process is in turn to execute a transition. The scheduler calls the PAD function with a symbol table node of the type xPrsNode, pointing to the instance specific data of the instance that is scheduled.

Start-Up

A Light Integration starts when the generated main function is called. The start-up phase works like this (pseudocode shown in italics):

void main( void )
{
   xMainInit();
   Code from #MAIN
   xMainLoop();
}


void xMainInit( void )
{
   xInitEnv();
   Init of internal structures
}

You must supply the xInitEnv() function to initialize external code and hardware, etc. (this is of course application dependent). This function is placed in the same program module (environment module) as the xInEnv() and xOutEnv() functions. The xMainLoop() function contains an eternal loop, which constitutes the scheduler itself. See below:

void xMainLoop (void)
{
   while (1)
   {
       xInEnv(...)
         if (a timer has expired)
             send the corresponding timer signal
         else if (a process can execute a transition)
     {
             remove the signal from the input port
             set up Sender in the process to Sender of the signal
             call the PAD function for the process
     }
   }
}

Connection to the Environment

Signals going in and out of the SDL system are handled in the two user written functions xInEnv and xOutEnv. There is a template file for writing these two function in the standard distribution. This file can be found at <installation directory>/sdt/
sdtdir/<your platform os version>sdtdir/INCLUDE/
sctenv.c
.

Running a Light Integration under an External RTOS

Since there are some fundamental differences between different RTOS we can only give a general idea of how to generate a Light Integration under an external RTOS here. Typical things that may be different in different RTOS:

General Steps

The normal steps to create a Light Integration under an external RTOS can be summarized as follows:

  1. Copy the source and header files for an application kernel from the installation of the SDL Suite. The files are residing in the following directory:
    <installation directory>/sdt/
    sdtdir/<your host and os version>sdtdir/INCLUDE
    .
  2. Generate an <application>.c file with the SDL to C Compiler.

Note:

The code generator option Cadvanced must be used.

  1. Generate an environment header file (an option in the Organizer Make dialog).
  2. Edit the sctenv.c template file to handle your in and out environment signals. Include the generated <application>.ifc file (the environment header file).
  3. Create a makefile or edit the generated makefile. Write entries for the kernel source files, the environment file and the application file.
  4. Set the appropriate compilation switches for your RTOS and your compiler.
  5. Compile the application and the kernel file to create a relocatable object file.
  6. Download.

http://www.ibm.com/rational
Contents Index Previous Next