![]() |
![]() |
![]() |
![]() |
![]() |
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 #MAINxMainLoop();}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 signalelse if (a process can execute a transition){remove the signal from the input portset up Sender in the process to Sender of the signalcall 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:
- If you are allowed to have a main function in your application.
- If your start-up function must be specified in a configuration file.
- If the cross compiler requires additional OS-specific header files to be included.
- If it is possible to run the application in a simulated target environment.
- Syntax for the makefile.
General Steps
The normal steps to create a Light Integration under an external RTOS can be summarized as follows:
- 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:
- Generate an <application>.c file with the SDL to C Compiler.
- Generate an environment header file (an option in the Organizer Make dialog).
- Edit the sctenv.c template file to handle your in and out environment signals. Include the generated <application>.ifc file (the environment header file).
- Create a makefile or edit the generated makefile. Write entries for the kernel source files, the environment file and the application file.
- Set the appropriate compilation switches for your RTOS and your compiler.
- Compile the application and the kernel file to create a relocatable object file.
- Download.
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |