Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
Andre Souto edited this page Dec 5, 2015 · 4 revisions

vim-hdl wiki

  1. Project file formats
  1. Known issues

Project file formats

Project file has two available formats chosen by extension: prj and conf.

Both are detailed below, but notice that the conf version is deprecated, consider using the prj version.

Prj format

This format is inspired by Xilinx ISE prj format though it's not compatible with it.

There are 2 sections: build info and sources definition

Build info

This section tells vim-hdl how to build the project. Format is pretty straightforward:

  • Set option values with option = value
  • Comments start with # and are ignored until the end of the line
  • Selection of target_dir with relative path takes in account Vim's pwd. (you can use :pwd inside Vim to check its value).

If Vim's pwd is set to /home/foo and target_dir is set to build, libraries will be placed at /home/foo/build.

Paths with ~ work as well.

# Flags passed to the compiler when building the entire project
# This happens when you open a VHDL file with the variable g:vimhdl_conf_file set
batch_build_flags = -explicit -permissive
# Flags passed to the compiler when building a single file.
# This is triggered when Syntastic checks the file (on :w for instance)
single_build_flags = -explicit -check_synthesis -lint -rangecheck
# Compiler selection
# Available compilers are 'msim' and 'xvhdl'
builder = msim
# Location of the built files
target_dir = .build

Sources definition

This section tells vim-hdl what to needs to be built. Each line defines the language (only VHDL is currently supported), the library, the path to the file (the same rules of target_dir for relative paths are applied here) and some optionally file specific build flags, divided by whitespaces, in this order.

# A source to be compiled in library 'basic_library' with no specific build flags
vhdl basic_library basic_library/package_with_functions.vhd
# A source to be compiled in library 'another_library' with flag '-93'
vhdl another_library another_library/foo.vhd -93

Conf format

This format uses Python ConfigParser notation.

The are two types of sections, akin to prj: global info and library definition

Global info

See the prj format build info for details on the meaning of each parameter.

[global]
# Use relaxed flags when building the whole project
batch_build_flags = -explicit -permissive
# Use stricter flags for building the file we're working on
single_build_flags = -explicit -check_synthesis -lint -rangecheck
# Compiler selection
builder = msim
# Location of the built files
target_dir = .build

Library definition

See the prj format sources definition for details on the meaning of each parameter.

Notice that on the conf format you can't set build flags per individual file, only per library.

# The library name in enclosed in square brackets
[basic_library]
# Build flags applied only to this library
build_flags = -93
# Source file list. A line with leading whitespaces is considered a continuation
# of the previous line
sources = basic_library/clock_divider.vhd
    basic_library/package_with_constants.vhd
    basic_library/package_with_functions.vhd
    basic_library/very_common_pkg.vhd

[another_library]
build_flags = -93 -explicit
# Source file list with two files on the same line
sources = another_library/foo.vhd another_library/bar.vhd

Known issues

Detection of built-in libraries

Built-in libraries are statically defined, which means that things will break on different environments. We can either use the compiler to get them somehow or create an option for the user to set manually. Using the compiler is the preferred approach.

Clone this wiki locally