|
When building an application, the configurer must be told the details of both the software and the hardware on which it is to run. Supplying it with a suitable configuration file does this. You must write the configuration file explicitly or use the IDE to construct it for you. It describes the system to be built: all the physical processors in the system, the wires connecting them, the tasks to be loaded into the system and their logical interconnections.
Earlier, we looked at the configuration file that we needed for our single-task example. It is quite instructive to look more closely at a (strangely) reformatted version of the same file, as shown below.
! ¤1
! UPPER.CFG
!
processor - ¤2
root - ! processor connected to host ¤3
type=SMT361 - ! your processor type ¤4
task upper data=? ! the single task ¤5
place upper - ! locate the task... ¤6 ¤7
root ! ...on the root
¤1
|
To start with, we have a number of comment lines, introduced by an exclamation mark.
|
¤2
|
The first significant line is a PROCESSOR statement: a declaration of the single processor, root. In Diamond terminology, the root processor is the only one that is connected to the host. All communication with the file system on the host must pass through it. Every configuration must include a processor named root or one marked with the root attribute. In fact, the host processor could be regarded as part of the configuration as well, but the configurer assumes this; the host processor need not be declared. A root processor, however, must be declared; this informs the configurer that it must be connected to the host in an appropriate way.
|
¤3
|
You will notice that comments can also occur further along the line, again introduced by an exclamation mark, and that spaces, tab characters and blank lines can be used as desired, to improve readability. The configurer ignores the case of letters: 'a' and 'A' are not distinguished.
|
¤4
|
The type of root is declared as SMT361:
processor root type=SMT361
The processor type makes the configurer aware of the properties of the processor you are using, including:
| • | the processor class (C6000, in this case); |
| • | the sort of module or board supporting the processor; |
| • | how it communicates with other modules and the host; |
| • | the layout and size of available memory areas; and |
|
¤5
|
This line declares the single user task, upper and directs the configurer to load the task upper from the task image file upper.tsk. The TASK statement also specifies the memory allocation strategy to be used for this task. Here, the data=? attribute results in the stack and heap data areas sharing a single area of memory, this being the largest area left vacant once all the other parts of the task (code, static data, etc) have been loaded. If you omit this clause, the configurer acts in the same way, but will print a warning.
|
¤6
|
Notice that in the full example this line has been broken; this is indicated by placing a hyphen '-' as the last non-whitespace character before the comment.
|
¤7
|
Finally, we have a PLACE statement that directs the configurer to place the upper task on the root processor:
place upper root
|
In this small configuration file, we have seen two examples of objects (root, upper) that have been declared with configuration language names. Objects like these can have arbitrary names made up of letters, digits and the characters '_' and '$', but are usually given mnemonic names.
|