CPUs, boards, programmers and runtime systems are described by configuration files. These files must be put into the directory config in the target library. Within config there are 5 subdirectories: base, arch, cpus, boards, operatingsystems and programmers. These subdirectories are scanned for configuration files. All files found will be parsed. Whenever a new project is created the desired target library has to be declared.
Configuration files have the ending .deep. They are pure text files with the syntax described in Syntax for Configuration Files.
Example:
#deep-1 meta { version = "2014-01-06"; description = "CPU description file for myCPU"; } cpu MyCPU { description = "Example CPU"; arch = ppc32; sysconst { MyConstant = 0x548; } memorymap { device MyRamDev { attributes = read, write; width = 4; size = 0x10000; base = 0x0; technology = ram; } segment MyRamDev.Seg1 { base = sysTabBaseAddr; attributes = read, write, systab; } segment MyRamDev.Seg2 { attributes = read, write, const; } } registermap { register MSR { type = MSR; addr = 1; size = 4; } register CR { type = CR; addr = 1; size = 4; } } }
A configuration file starts with #deep-1, whereas the number stands for the syntax version. Next comes a meta information block followed by all the other blocks in arbitrary order.
A comment starts with # and go to the line end. The exception to this is the keyword on the first line.
Each deep file contains one or more of the following blocks:
Registers are defined in the architecture and in the CPU. Initial values for certain registers can be defined for a CPU and a board. System constants can be defined for a board, a CPU and as compiler constants. All these items are stored as linked lists (see figure) for efficient searching.
A memory map can be given for a CPU and a board. Such a map contains several devices. For each device several segments can be specified. A segment is a memory area. As an example: device A contains a segment S1, where S1 accepts programs data (instructions). Thus, segments are logical blocks whereas devices are physical entities.
Flash devices have additionally a description of their sectors. This arrangement is physically given by the flash architecture.
A board description may contain one or several run configurations. A run configuration indicates the location of the system table(system), into which segments certain classes may be linked (modules) and may define further initial values for registers.
Alongside the configuration there exists a project file for each deep project with the name ProjectName.deep. the following tags may be defined therein:
Hint: If you want to create a new configuration for a board, an operating system or a programmer this new configuration is obviously not yet contained in the existing runtime library. You create the new configuration file within the actual project directory and add this directory to the library path in the project file!
The configuration can be read by calling
Configuration.readProjectFile(String file)
. Subsequently you have to specify which run configuration to use.
When eclipse is used part of the configuration must be read already when a new project is created or of projects properties are changed. This is for the wizards to be able to list the various options in the combo boxes.
Part of the configuration is used by the kernel in the runtime system. This information has to go into several interface classes. If the configuration changes in this respect you have to newly create those interface files with
public static void createInterfaceFiles(String libraryPath)
.
You can call the TestLauncher with the option –interface-files-path, see TestLauncher. The following files are created:
For changes in the configuration all this interface files might change as well and should be rebuilded before the runtime system can be used together with the new configuration.