DVT e Language IDE User Guide
Rev. 24.1.5, 13 March 2024

13.3.1 template-config.xml

You may use the template-config.xml file in the template directory to:

  • specify default values and description for the parameters

  • define template parameter filters

template-config.xml file syntax

 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!DOCTYPE template-config PUBLIC "-//DVT//template_config" "template_config.dtd">
 <template-config version="1">
   <parameter-config name="pn" default-value="i2c" description="Package Name"/>
   <parameter-filter type="REJECT" identifier="__main__" path="*.py"/>
 </template-config>

The <parameter-config> tag allows you to define default values and description for parameters. Attributes:

  • name: the parameter name, excluding surrounding double underscores / x_..._x (mandatory)

  • default-value: the default value to be used when generating a project from template

  • description: the description to be displayed in the wizard when generating a project from template

If a config is specified multiple times for the same parameter, the last one has precedence. If a template.config file is also present in the template it has a lower priority (that is, it is analyzed before the template-config.xml).

The <parameter-filter> tag allows you to skip replacement of particular identifiers in particular template files. Attributes:

  • type: ALLOW or REJECT (mandatory)

  • identifier: a simple pattern to be matched against the full template parameter identifier (including surrounding underscores or x_..._x)

  • path: a simple pattern to be matched against the full path of the template file

At least one of the identifier or path attributes must exist. Filters are cumulative. For example in a particular file you can allow only identifiers matching __tp_*__ like this:

    <parameter-filter type="REJECT" identifier="*" path="*/template/file.sv"/>
    <parameter-filter type="ALLOW" identifier="__tp_*__" path="*/template/file.sv"/>

The following parameters are predefined:

  • __user__ expands to current user name

  • __date__ expands to current date

  • __year__ expands to current year