CMSIS-Pack  Version 1.3.3
Delivery Mechanism for Software Packs
 All Pages
/package/generators element

The element /package/generators/generator specifies a tool or utility that is used to generate and/or configure software (source code, header files, configuration files, etc.) in the context of a project. For this purpose, a generator package description file (GPDSC) needs to be created (see <gpdsc>). The GPDSC file details the selected device, components, project files and conditions, as well as information about the generator and how it can be launched again for iterative development cycles. A GPDSC file follows the same schema as a static PACK. However, the files generated by the utility are not installed and managed centrally in the PACK folder, but locally within the project folder.

A generator can be associated with a component by it's name. Selecting the component will automatically include the files provided by the generator in the project. If the specified GPDSC file is not present, the generator command is executed by the environment to generate the files and GPDSC. In this way project specific configurations can be made, files being generated and included and maintained as part of the project.

Example Generator Section

<generators>
<generator id="DAVE3">
<description>DAVE3 Infineon XMC1000/XMC4000 Environment</description>
<select Dvendor="Infineon:7" Dname="XMC1100-64"/>
<command>%DAVE3%\eclipse\DAVE-3.1.6.exe</command>
<arguments>
<argument switch="-f">$S</argument> <!-- $S points to the active Device Family PACK -->
</arguments>
<project_files>
<file category="source" name="Main.c"/>
<!-- add any other user application modules and header files -->
</project_files>
<files>
<file category="source" name="output_gen.log"/>
<!-- add any other generator files -->
</files>
</generator>
</generators>

Example Generator Package Description File (gpdsc)

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<package xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.0" xs:noNamespaceSchemaLocation="PACK.xsd">
<vendor>Infineon</vendor>
<name>Test</name>
<description>Generated Configuration Files for CE Project Test</description>
<url>C:\DAvE_Bench\Workspace\DAVE-3.1.10\Test</url>
<releases>
<release version="1.0.0">- Initial setup for Test</release>
</releases>
<generators>
<generator id="DAVE3">
<description>DAVE3 Infineon XMC1000/XMC4000 Environment</description>
<select Dname="XMC4500-F144x1024" Dvendor="Infineon:7"/>
<command>C:\DAVE-3.1.10\eclipse\DAVE-3.1.10.exe</command>
<arguments>
<argument switch="-data">C:\DAvE_Bench\Workspace\DAVE-3.1.10</argument>
</arguments>
</generator>
</generators>
<taxonomy>
<description Cclass="DAVE3" generator="DAVE3">Configuration Files generated by DAVE3</description>
</taxonomy>
<conditions>
<condition id="CMSIS Device Startup">
<description>Condition to include CMSIS core and Device Startup components</description>
<require Cclass="CMSIS" Cgroup="CORE" Csub=""/>
<require Cclass="Device" Cgroup="Startup"/>
</condition>
</conditions>
<components generator="DAVE3">
<component Cclass="DAVE3" Cgroup="Framework" Cversion="1.0.38" condition="CMSIS Device Startup">
<description>DAVE3 Framework</description>
<RTE_Components_h>
#define DAVE_CE
</RTE_Components_h>
<files>
<file category="header" name="Dave\Generated\inc\DAVESUPPORT\DAVE3.h"/>
<file category="source" name="Dave\Generated\src\DAVESUPPORT\DAVE3.c"/>
</files>
</component>
<component Cclass="DAVE3" Cgroup="RESET001" Cversion="1.0.10">
<description>App which provides APIs to assert/deassert peripheral modules.</description>
<files>
<file category="doc" name="http://dave.infineon.com/Libraries/DAVEApps/DAVEAppsDocuArchive/www.infineon.com/1.0.10/app/reset001/0/doc/html/group___r_e_s_e_t001_app.html"/>
<file category="header" name="Dave\Generated\inc\RESET001\RESET001.h"/>
<file category="source" name="Dave\Generated\src\RESET001\RESET001.c"/>
</files>
</component>
</components>
</package>

 


/package/generators

Grouping element for generators. Only one such group can exist in a PACK.

Parent Chain
package /package
Child Elements Description Type Occurrence
generator Description of the generator and the related files GeneratorType 1..*

The following variables can be used in the elements <command>, <workingDir>, <argument>, <gpdsc>:

Variable Description
$P PATH to current project
#P PATH and name of the current project
$S PATH to PACK folder containing the Device description used by the current project
$D Name of the device configured in the current project

 


/package/generators/generator

The generator section is used to provide the details about the tool that has been used to create the GPDSC file. At least one generator element must exist.

Parent Chain
generators /package/generators
Attributes Description Type Use
id Identifier of the generator tool. Can be used by other elements to determine the generator. xs:string required
Gvendor Vendor name of the generator tool. xs:string optional
Gtool Plain text name of the generator. xs:string optional
Gversion Version of the generator tool. xs:string optional
Child Elements Description Type Occurrence
description Briefly describes the generator tool. xs:string 0..1
select Complex type describing a device (specified by the device name, vendor, and variant). GeneratorSelectType 0..1
workingDir Directory to be set as current directory before launching the <command>. This is either an absolute or relative path to PDSC or GPDSC file. If not specified, the current directory is the directory of the project configured by the environment. xs:string 0..1
command Invocation command for the generator tool (for an example see top of the page). Command line options should be passed via arguments. xs:string 0..1
arguments Section for command line arguments of the format <argument switch="-data">myFileName</argument>. Path information for files can be specified absolute or relative to the location (path) of the GPDSC file. GeneratorCommandArgumentsType 0..1
gpdsc Path and name of the GPDSC that the generator creates and updates. The path is either absolute or relative to the working directory. If no explicit gpdsc file is provided a gpdsc file named after the project with extension gpdsc in the working directory is assumed (<project>.gpdsc). xs:string 0..1
project_files Grouping element for all project files generated by the tool. group 0..1
files Grouping element for generator tool files. group 0..1
extensions Generator vendor specific section ignored by other tools N/A 0..1

 


/package/generators/generator/select

This element contains information about the device and vendor that has been used to generate the GPDSC file. Only one such element can exist in <generators>.

Example:

<generators>
<generator id="DAVE3">
<select Dvendor="Infineon:7" Dname="XMC1100-64"/>
</generator>
</generators>

 

Parent Chain
generator /package/generators/generator
Attributes Description Type Use
Dvendor Vendor name of the target device. Use predefined values as listed in the table Device Vendor. DeviceVendorEnum required
Dname Name of the target device. xs:string optional
Dvariant Name of a device variant. xs:string optional

 


/package/generators/generator/arguments

This element contains information about the arguments passed along the <command> string.

Example:

<generators>
<generator id="DAVE3">
...
<command>%DAVE3%\eclipse\DAVE-3.1.6.exe</command>
<arguments>
...
</arguments>
</generator>
</generators>

 

Parent Chain
generator /package/generators/generator
Child Elements Description Type Occurrence
argument Arguments passed along with the <command>. GeneratorCommandArgumentType required

 


/package/generators/generator/arguments/argument

This element describes a single command line argument passed along with <command> for launching the generator. The argument is split up in a switch value pair. The switch is passed as an attribute and the value as the element value. Both switch and element values are of type xs:string.

Example

<generators>
<generator id="DAVE3">
<arguments>
<argument switch="-data">C:\DAvE_Bench\Workspace\DAVE-3.1.10</argument>
...
</arguments>
...
</generator>
</generators>

 

Parent Element Chain
arguments /package/generators/generator/arguments
Current Description Type
argument value of argument without command line switch xs:string
Attributes Description Type Use
switch Specifies the command line switch separated from the argument value. xs:string optional

 


/package/generators/generator/project_files

The group project_files specifies all files that are required for the project setup. Only one such group can exist.

Example

<generators>
<generator id="DAVE3">
<description>DAVE3 Infineon XMC1000/XMC4000 Environment</description>
<select Dvendor="Infineon:7" Dname="XMC1100-64"/>
<command>%DAVE3%\eclipse\DAVE-3.1.6.exe</command>
<arguments>
<argument switch="-f">$S</argument> <!-- $S points to the active Device Family PACK -->
</arguments>
<project_files>
<file category="source" name="Main.c"/>
...
</project_files>
</generator>
</generators>

 

Parent Element Chain
generator /package/generators/generator
Child Elements Description Type Occurrence
file Frame for files created by the generator and used in a project. group 0..1

 


/package/generators/generator/files

The group files specifies files that are required by the generator tool. Only one such group can exist.

Example

<generators>
<generator id="DAVE3">
<files>
...
<files>
</generator>
</generators>

 

Parent Element Chain
generator /package/generators/generator
Child Elements Description Type Occurrence
file Frame for files used by the generator. group 0..1

 


/package/generators/generator/files/file

This element contains information about files used by a generator.

Example

<generators>
<generator id="DAVE3">
<files>
<file category="generator" name="Main.c"/>
<file category="you_name_it" name="database/connection.odbc" version="1.2.3"/>
...
<files>
</generator>
</generators>

 

Parent Element Chain
files /package/generators/generator/files
Attributes Description Type Use
condition Reference using the name of the respective condition specified in the conditions section of this package (/package/conditions). If the condition resolves to false, then the element will be ignored and treated as if not present. xs:string optional
category Describes the file type (for example: doc, header, library). You can use predefined values as listed in the table File Categories, however, this is not mandatory. xs:string required
name Can consist of the path (relative to the PACK base directory) and the file name with extension. xs:string required
version File-specific version information. The version format is described in Version Type. VersionType optional