Skip to content
Jean-Luc Béchennec edited this page Dec 8, 2015 · 9 revisions

A quick introduction to the OIL language

The application you are going to build must be described using the OIL language. An OIL file have 2 parts , the IMPLEMENTATION part and the CPU part. In the IMPLEMENTATION you can set default values for the objects of your application. In the CPU part you describe the application. The first item in an OIL file is the OIL_VERSION attributes. It defines the kind of objects you may use in the CPU part. Three values are allowed:

  • OIL_VERSION = "2.5"; is used for an OSEK/VDX application;
  • OIL_VERSION = "3.1"; is used for an AUTOSAR 3.1 application;
  • OIL_VERSION = "4.0"; is used for an AUTOSAR 4 application.

The IMPLEMENTATION

The IMPLEMENTATION part is mainly used to set default values for attributes of application objects. For instance the following declaration sets a default stack size to 50 bytes.

IMPLEMENTATION myAppDefaults {
  TASK {
    UINT32 STACKSIZE = 50;
  };
};

The CPU

The CPU part is used to describe the application. In this part, each object is declared with its attributes. Available objects are OS, TASK, ISR, RESOURCE, ALARM, COUNTER, APPMODE, EVENT and MESSAGEfor OSEK/VDX. AUTOSAR adds SCHEDULETABLE, IOC and APPLICATION.

The OS object

The OS object is used to parametrize Trampoline. The following attributes of the OS object are standard in the OIL language.

STATUS

this attribute is an enum. Possible values are:

  • STANDARD: the services are compiled with minimum error checking. Trampoline will be smaller. Should be use un deployment but not in test. Basically, object identifier are not checked before using them.
  • EXTENDED: the services are compiled with extended error checking.

STARTUPHOOK

this boolean attribute specifies if Trampoline is compiled with a call to the startup hook or not. If set to TRUE, the application must provide the following function:

FUNC(void, OS_CODE) StartupHook(CONST(AppModeType, AUTOMATIC) appMode)
{
  ...
}

where the appMode argument is the value given to the StartOS service call.

SHUTDOWNHOOK

this boolean attribute specifies if Trampoline is compiled with a call to the startup hook or not. If set to TRUE, the application must provide the following function:

FUNC(void, OS_CODE) ShutdownHook(CONST(StatusType, AUTOMATIC) error)
{
  ...
}

where the error argument is the value given to the ShutdownOS service call.

Clone this wiki locally