A configuration file can also be used to specify the Vitis compiler options. A configuration file provides an
organized way of passing options to the compiler by grouping similar switches together,
and minimizing the length of the v++
command line.
Some of the features that can be controlled through config file entries include:
- HLS options to configure kernel compilation
- Connectivity directives for system linking such as the number of kernels to instantiate or the assignment of kernel ports to global memory
- Package directives to configure the --package Options.
- Directives for the Vivado Design Suite to manage hardware synthesis and implementation.
In general, any v++
command option can
be specified in a configuration file. However, the configuration file supports defining
sections containing groups of related commands to help manage build options and
strategies. The following table lists the defined sections.
v++ -c
) and linking (v++
-l
) commands can be put into a single configuration file, error checking
may return errors related to linking during the compilation process. Therefore you are
recommended to keep separate configuration files for compilation and linking. Section Name | Compiler/Linker | Description |
---|---|---|
[advanced] | either |
--advanced Options:
|
[clock] | compiler |
--clock Options:
|
[connectivity] | linker |
--connectivity Options:
|
[debug] | linker |
--debug Options
|
[hls] | compiler | HLS directives --hls Options:
|
[linkhook] | linker |
--linkhook Options
|
[package] | packager |
--package Options
|
[profile] | linker |
--profile Options
|
[vivado] | linker |
--vivado Options:
|
Because the v++
command supports
multiple config files on a single v++
command line,
you can partition your configuration files into related options that define compilation
and linking strategies or Vivado implementation
strategies, and apply multiple config files during the build process.
Configuration files are optional. There are no naming restrictions on
the files and the number of configuration files can be zero or more. All v++
options can be put in a single configuration file if
desired. However, grouping related switches into separate files can help you organize
your build strategy. For example, group [connectivity]
related switches in one file, and [Vivado]
options
into a separate file.
The configuration file is specified through the use of the v++ --config
option as discussed in the Vitis Compiler General Options. An example of the --config
option follows:
v++ --config ../src/system.cfg
Switches are read in the order they are encountered. If the same switch is repeated with conflicting information, the first switch read is used. The order of precedence for switches is as follows, where item one takes highest precedence:
- Command line switches.
- Config files (on command line) from left-to-right.
- Within a config file, precedence is from top-to-bottom.