The OPT Attribute

Top  Previous  Next

The OPT attribute of the TASK statement is used to indicate to the configurer that you wish a logical area to be placed, if possible, in fast memory. The attribute has the following format:

 

opt=logical-area

 

The logical-area could be CODE, STATIC, STACK, HEAP or DATA, or the name of a user-defined section:

 

task integral stack=23K opt=stack opt=my_segment

 

Here, my_segment is a user-defined section; it may have been defined using a CODE_SECTION pragma, for example.

 

The logical area name DATA may be used to refer to the heap and the stack, treated as a single, combined area; see below.

 

The fact that you write some OPT attributes does not necessarily mean that the mapping you want will happen:


There may not be enough fast memory available;

The configurer does not guarantee that the requirements of a task are dealt with in any particular order. By the time any particular OPT is dealt with, other OPT attributes may have used up the resources it is requesting;

The configurer examines tasks in the order in which they have been placed on processors; earlier processing an OPT in another task may have reduced the amount fast memory available for allocation.

The configurer cannot optimize a logical area whose size has not yet been determined; see the following section.