Reference

Command Reference

usage: vte [-h] {generate,preprocess,list,quickstart} ...

Positional Arguments

subcmd

Possible choices: generate, preprocess, list, quickstart

Sub-commands

generate

generate source files

vte generate [-h] [-force] template name
Positional Arguments
template

ID of template

name

Name to use in the template

Named Arguments
-force

force overwrite of existing files

Default: False

preprocess

Pre-process a file

vte preprocess [-h] [-o OUTPUT] file
Positional Arguments
file

Input file

Named Arguments
-o, --output

Specify output

list

list available templates

vte list [-h]

quickstart

Creates an initial .vte template-descriptor file

vte quickstart [-h] [-o OUTDIR]
Named Arguments
-o, --outdir

Specifies the output directory (default: cwd)

Specifying Template-Parameter Values

Templates may declare and use any number of parameters. Parameter values may be specified on the command-line using -DKEY=VALUE format. Parameters without a specified value expand to the empty string.

Custom Template Directives

Filename Directive

By default, VTE generates an output file with the same name as each template file. The filename directive provides a way for a template file to specify its output filename.

/****************************************************************************
 * {{name}}_agent_pkg.sv
 *
 ****************************************************************************/
{% set filename = "{{name}}_agent_pkg.sv" %}
`include "uvm_macros.svh"

In the case above, we want to name the output file based on the value of the name parameter. All paths specified with set filename are relative to the original output directory of the template file.

Template Marker-File Reference

The .vte file identifies the root of a VTE template directory hierarchy. In the simplest case, it only specifies a description for the template. While this description can be empty (VTE uses the template identifier), it is highly recommended to provide one.

template:
  description: Create a simple README

Parameter Declarations

VTE templates that use template-specific parameters (ie beyond name) must specify those parameters in the .vte file. Each parameter is required to have a name. A description is highly recommended.

template:
  description: Create a simple README
  parameters:
  - name: SUBJECT
    description: Specifies the subject of the readme
    default: "TODO: Change me"

The user must supply a value for any template parameter that doesn’t have a default value specified in its .vte file.