Input file format

This was documented from the DTD: linkgen.dtd.

This format works as an input format for the linker, to then produce the layouts. Some of the data is relevant for this project, whereas some is not.[EMORIG]

An executable corresponds to a memory in a DSP. It has a target tag which references which type of DSP this is (as well as provides details on how much memory and which other characteristics it has). An executable has at least one area which specifies one or more modules. A module is a block of code or data that will be placed into the DSPs memory.

A module has files, a total size as well as potential characteristics such as information on a memory address where it needs to be be placed if requires absolute placement. A module also has a parameter called SWU which provides a grouping of modules in the file.

The file format also specifies dependency information. Currently this dependency information is between modules and has a property which specifies which file created the dependency [EMJAN]. Dependencies have a refTo and a refFrom tag. This specify the direction of the dependency. For certain absolute dependencies we won't have a refFrom tag. This means that the absolute dependency comes from an external source and we are not aware of why and from where but we know only that the module had to be placed on that location because of the external absolute dependency.

Overlays are used where multiple modules are placed on the same location in memory and dynamically loaded there when needed. That means that for a specific address segment you might have modules A,B,C all allocated to that address segment and loaded there as and when needed.

Graphical Overview of Input File Format

Input DTD

Input DTD attributes

Commented DTD

A commented DTD documentation is as follows:

<?xml version="1.0" encoding="UTF-8" ?>

*<!-- *

*Each file contains a list of modules, areas, dependencies and one or more executables and one or more dependencies. These are specified at the top level.  *

*-->*

<!ELEMENT linkgen (executable+,modules,target+,areas,dependencies)>

<!ELEMENT modules (module+)>

<!ELEMENT areas (area+)>

<!ELEMENT dependencies (dependency+)>

*<!-- *

*One memory in a DSP is represented by an executable.  One DSP can have multiple memories so there might be multiple executable tags referring to the same dsp-id. *

*References a target which describe the type of memory *

*-->*

<!ELEMENT executable (target-ref,maximize?,area-ref+)>

<!ATTLIST executable name CDATA #REQUIRED>

<!ATTLIST executable dsp-id CDATA #REQUIRED>

*<!-- *

*A reference to an area, ie. stating that this area should be placed on a specific executable *

*-->*

<!ELEMENT area-ref EMPTY>

<!ATTLIST area-ref name CDATA #REQUIRED>

*<!-- *

*Provides a reference to a target ie. specifying what type of DSP a given executable refers to. The container attribute references the type of dsp (which characteristics are specified below in the "target" lines) and the memory-type references which memory type on a given dsp this specfiies.  *

*-->*

<!ELEMENT target-ref EMPTY>

<!ATTLIST target-ref container (dsp-large|dsp-small|dsp-debug|cm-container) #REQUIRED>

<!ATTLIST target-ref memory-type (lpm|ldm|cm) #REQUIRED>

*<!-- *

*One area is one block of modules that needs to be placed in memory, *

*It consists of multiple entries where an entry is a reference to a module. *

* -->*

<!ELEMENT area (interval?,entry+)>

<!ATTLIST area name CDATA #REQUIRED>

<!ATTLIST area overlay (true|false) #REQUIRED>

*<!-- *

*An entry is a reference to a specific module which is on a specific position in an area. *

*-->*

<!ELEMENT entry EMPTY>

<!ATTLIST entry module CDATA #REQUIRED>


*<!-- *

*One module is one code component. Modules are referenced by entries.*

*-->*

<!ELEMENT module (size,file+,alignment?,absolute-placement?)>

<!ATTLIST module name CDATA #REQUIRED>

<!ATTLIST module swu CDATA>

*<!-- *

*There are multiple files within a module - these are linked to source files - either .c or .asm files. [EM1210]*

*-->*

<!ELEMENT file (#CDATA)>

<!--

*The size gives the entire memory size of the module.*

*[EM1210]*

-->

<!ELEMENT size (#PCDATA)>

<!--

*Defines that this module needs to be placed absolutely on a given address. *

*[EM1210]*

-->

<!ELEMENT absolute-placement (#PCDATA)>

*<!--*

*Describe a dependency between one module and another. Currently these dependencies are only to/from modules, but later they should also be able to specify files and function dependencies[MT1206]. refFrom might be left out in the case of an absolute dependency, and then that means that there is an absolute dependency coming from an external source.[EMORIG] *

*-->*

<!ELEMENT dependency (refFrom?,refTo)>

<!ATTLIST dependency type (relative|absolute) #REQUIRED>

<!ELEMENT refFrom (entry)>

<!ELEMENT refTo (entry)>

*<!-- *

*This is a description of a specific type of DSP. We can think of it as a template of a DSP providing additional information about the DSP features. [EMORIG]*

*Each target is identified by the tuple (container, memory-type) meaning you can have (dsp-large, lpm) specifying the code memory on a dsp-large type container. *

*-->*

<!ELEMENT target (addrhigh,addrlow,alignment)>

<!ATTLIST target container (dsp-large|dsp-small|dsp-debug|cm-container) #REQUIRED>

<!ATTLIST target memory-type (lpm|ldm|cm) #REQUIRED>

<!ELEMENT addrhigh (#PCDATA)>

<!ELEMENT addrlow (#PCDATA)>

*<!-- Input to linker, please ignore: -->*

<!ELEMENT maximize (area-ref)>

<!ELEMENT interval (addrlow,addrhigh)>

<!ELEMENT alignment (#PCDATA)>