V4P supports a separate set of preferences for each root-/workspace-folder. The configuration file can either be INI-based (recommended) or JSON-based.
The file must be named
You can find a detailed description of
»Glob-Patterns on Wikipedia. However, I am supporting the list enhancement (curly braces, see examples).
Remarks
- As the MasterConfig is not part of any specific project/workspace/root-folder, the glob-patterns therein should be 'absolute' (i.e., start with **/)
- Root-folder specific Glob-patterns are always relative to that specific root-folder
- Glob-Patterns are case-sensitive (also in Windows)
- Glob-Patterns can be written in Linux (with slashes) or Windows style (with backslahes and drive-prefix like c:\). Escaping the backslashes is not necessary. It does not matter whether V4P is executed on Windows or Linux.
The following table shows a couple of glob-patterns with exemplary matches and mismatches for the given patterns. Notice that in these example we assume that the patterns are defined in a
config.v4p of some root-folder
<r>
Glob |
Matches |
Mismatch |
*/src/?.vhd |
<r>/a/src/b.vhd<r>/abc/src/1.vhd |
<r>/a/src/.vhd <r>/a/src/file.vhd <r>/a/b/src/a.vhd |
**/src or **/src/*.* |
<r>/src/a.vhd <r>/a/b/src/abc.vhd |
<r>/src/a/a.vhd |
**/src/** |
<r>/a/b/src/c/d <r>/src/a.vhd <r>/src/d/e.vhd |
<r>/dst/a.vhd |
*.vhd? |
<r>/file.vhdl <r>/file.vhdA |
<r>/file.vhd <r>/file.VHDL |
*.{vhd,vhdl} |
<r>/file.vhdl <r>/file.vhd |
<r>/file.VHDL |
file[A-G].vhd |
<r>/fileA.vhd <r>/fileD.vhd |
<r>/fileH.vhd <r>/filea.vhd <r>/file.vhd |
file{[A-G],[1-3]}.vhd |
<r>/fileA.vhd <r>/file2.vhd |
<r>/fileH.vhd <r>/fileA1.vhd |
a/{b,[cd],e/*/f}/*.vhd |
<r>/a/b/c.vhd <r>/a/d/c.vhd <r>/a/e/e1/f/c.vhd |
<r>/a/cd/c.vhd <r>/a/e/f/c.vhd |
Assign libraries to design files: You can specify a comma-separated list of libraries for each design file or sets of files. Files are specified as
»Glob-Pattern as shown in the example above. The Glob-patterns are case sensitive (also in Windows).
|
The libraries section does not add files to the project! It rather defines library assignments for existing files. Use symlinks to add external files (or add the entire folders to the workspace). |
Example:
Exclude design files from parsing: In addition to Visual Studio Code's exclude list, you can provide a separate list of excludes
for each root-folder. The files are specified as
»Glob-Pattern and will not be parsed or analyzed by V4P if they are assigned with
true. The Glob-patterns are case sensitive (also in Windows).
Example:
Define specific preferences for the corresponding root-folder.
There are two special assignments that can always be used:
- @default: Uses the value from V4P's default settings. The list below shows the default value for each setting.
- @inherit: Uses the value from the Master Config (if present), otherwise V4P's default.
V4p.Settings.Basics.TopLevelEntities
Values
|
String
|
Default
|
""
|
Remarks
|
Specifies the top-level entities of the design as comma-separated list. Can contain the corresponding library as prefix, e.g. "sim_top, design_lib.dut_top". Entities specified in the MasterConfig will be merged with local entities. If no library is specified, all entities with the given name(s) are considered as top-level
|
V4p.Settings.Basics.LogSeverity
Values
|
Detail Debug Note Info Warning Error Fatal
|
Default
|
Note
|
Remarks
|
Specifies minimum severity for log-messages. Messages below the given threshold are not written to the logfile.
|
V4p.Settings.Basics.LicenseFile
Values
|
String
|
Default
|
""
|
Remarks
|
Path to the license file (must include filename!). There are other ways as well to specify a license file, see Section License.
|
V4p.Settings.Formatting.StandardLibraryStyle
Values
|
AsDefined Lower Upper
|
Default
|
Lower
|
Remarks
|
Defines the capitalization style of standard-library elements for snippets and code-completion.
|
V4p.Settings.Formatting.KeywordStyle
Values
|
Lower Upper VbaStyle
|
Default
|
Lower
|
Remarks
|
Defines the capitalization style of keywords. If style VbaStyle is used, the first letter is converted to upper case, while the reset is lower case.
|
V4p.Settings.Formatting.EndIdentifiers
Values
|
String
|
Default
|
""
|
Remarks
|
A comma-separated list of VHDL-constructs which support "end identifiers" (e.g., procedure proc (...) is begin (...) end procedure proc; The following values are supported: architecture block case component context entity function generate loop package procedure process protected record
|
V4p.Settings.Formatting.AlignSequentialAssignments
Values
|
Boolean
|
Default
|
False
|
Remarks
|
If true, consecutive signal/variable assignments inside sequential blocks (processes, subroutines) will be aligned wrt. the assignment operator <= or :=
|
V4p.Settings.Formatting.Newlines.[ProtectedKeyword|RecordKeyword|UnitsKeyword]
Values
|
Boolean
|
Default
|
-
|
Remarks
|
Defines when V4P inserts newlines when formatting code. Allowed values in the definition above are ProtectedKeyword RecordKeyword UnitsKeyword .
|
V4p.Settings.Formatting.Newlines.WhenChoices
Values
|
Always Never Keep
|
Default
|
Keep
|
Remarks
|
Defines whether choices of case-when statements shall be put is a separate line or not
|
V4p.Settings.Formatting.Indentation.UseTabs
Values
|
Boolean
|
Default
|
False
|
Remarks
|
Defines whether to use tab-stops or whitespaces for indentation. This affecs code-completion, snippets and type-time (smart) indenation.
|
V4p.Settings.Formatting.Indentation.TabWidth
Values
|
Integer
|
Default
|
2
|
Remarks
|
Defines how many spaces to insert for each level of indentation. See also V4p.Settings.Formatting.Indentation.UseTabs
|
V4p.Settings.Formatting.Indentation.<*>
Values
|
Boolean
|
Default
|
True
|
Remarks
|
Specifies when V4P shall add indentation (relative to the previous line). Allowed values for the * in the definition above are ReportSeverity WhenChoices Declarations PortMaps UseClauses PortDeclarations .
|
V4p.Settings.Completion.ShowKeywords
Values
|
Boolean
|
Default
|
True
|
Remarks
|
Defines whether keywords shall be part of the code-completion list.
|
V4p.Settings.Completion.ShowUncommon
Values
|
Boolean
|
Default
|
False
|
Remarks
|
Defines whether uncommon elemments of the IEEE standard libs shall be part of the completion list. Uncommon elements are for example character-literals, ux01 to_ux01 , ...
|
V4p.Settings.Completion.ShowEnums
Values
|
Boolean
|
Default
|
True
|
Remarks
|
Defines whether enumeration values shall be part of the code-completion list.
|
V4p.Settings.Completion.ShowVendorSymbols
Values
|
Boolean
|
Default
|
False
|
Remarks
|
Defines whether symbols of Vendor Libraries (eg, unisim, altera_mf) shall be part of code completion suggestions. This might severely impact performance as Vendor Libraries tend to be huge. Currently the following files are recognized as Vendor Libraries (filenames case insensitive) if the specified libary name is assigned:Filename | Library |
---|
retarget_VCOMP.vhd | unisim | unisim_retarget_VCOMP.vhd | unisim | unisim_VCOMP.vhd | unisim | unisim_VPKG.vhd | unisim | altera_mf.vhd | altera_mf | altera_mf_components.vhd | altera_mf |
|
V4p.Settings.Completion.ShowVendorSnippets
Values
|
Boolean
|
Default
|
False
|
Remarks
|
Defines whether component-snippets of Vendor Libraries (eg, unisim, altera_mf) shall be part of code completion suggestions. This might severely impact performance as Vendor Libraries tend to be huge. Currently the following files are recognized as Vendor Libraries (filenames case insensitive) if the specified libary name is assigned:Filename | Library |
---|
retarget_VCOMP.vhd | unisim | unisim_retarget_VCOMP.vhd | unisim | unisim_VCOMP.vhd | unisim | unisim_VPKG.vhd | unisim | altera_mf.vhd | altera_mf | altera_mf_components.vhd | altera_mf |
|
V4p.Settings.HoverInfo.ShowLibraries
Values
|
Boolean
|
Default
|
False
|
Remarks
|
If true, the hoverinfo shows the library to which the current symbol belongs.
|
V4p.Settings.HoverInfo.ShowLocation
Values
|
Boolean
|
Default
|
False
|
Remarks
|
If true, the hoverinfo shows the file and location of the current symbol.
|
V4p.Settings.HoverInfo.ResolveStdTypes
Values
|
Boolean
|
Default
|
False
|
Remarks
|
If true, standard ieee types are further resolved into their primitive types (if any).
|
V4p.Settings.HoverInfo.ResolveTypes
Values
|
Boolean
|
Default
|
True
|
Remarks
|
If true, complex types (eg, arrays) will be further resolved to their primitive types.
|
V4p.Settings.HoverInfo.ShowAllOverloads
Values
|
Boolean
|
Default
|
False
|
Remarks
|
If true, the hoverinfo contains all overloads of the current subroutine. Notice that this might result in truncated output. If false, only a summary of the overloaded subroutines is displayed.
|
V4p.Settings.ParameterHelp.Instances
Values
|
Boolean
|
Default
|
True
|
Remarks
|
If true, parameter-help for instances is provided. As this might be quite annoying for large entities, it can be disabled.
|
V4p.Settings.StutterMode.Enabled
Values
|
Boolean
|
Default
|
True
|
Remarks
|
If true, stutter mode is enabled. See below for details.
|
V4p.Settings.StutterMode.HorizontalLineWidth
Values
|
Integer
|
Default
|
100
|
Remarks
|
Defines the number of dashes to insert for the "horizontal line (---)" stutter insertion
|
V4p.Settings.ErrorChecker.MissingAssociations.IgnoreInstanceOutputs
Values
|
Boolean
|
Default
|
True
|
Remarks
|
If true, missing associations in instances, which are of type output, are ignored. No warning is issued.
|
V4p.Settings.ErrorChecker.MissingAssociations.IgnoreInstanceInputsWithDefaultValues
Values
|
Boolean
|
Default
|
False
|
Remarks
|
If true, missing associations in instances, which are of type input and have a default value, are ignored. No warning is issued.
|
V4p.Settings.ErrorChecker.SymbolUnused.IgnoreLoopVariables
Values
|
Boolean
|
Default
|
True
|
Remarks
|
If true, for-loop (generate) variables are not checked whether their value is actually used somewhere.
|
V4p.Settings.ErrorChecker.SymbolUnused.AttributesReadValue
Values
|
String
|
Default
|
delayed, driving_value, transaction, quiet, stable
|
Remarks
|
Defines a comma-separated list of attributes that are treated as "read-access" to the respective symbol (e.g., mySignal'delayed(1 ns)). You can use @default and @inherit as part of the list to add something to default/inherited settings, e.g. "@default, event". You can use all to simply treat all calls to attributes as read-access for the respective symbol.
|
Example:
The
[ignores] section is an alternative to
Meta Comments, e.g. if your company forbids tool specific comments
as part of your source code. In this section you can define warning messages for specific symbols which shall be ignored by the error checker. The syntax is as follows:
glob-pattern-file @ glob-pattern-symbol = "msg1,msg2"
glob-pattern-file defines a (case sensitive) GLOB pattern to match any source file(s).
glob-pattern-symbol defines a (case insensitive) GLOB pattern to match any symbol within the set
of source files. You can use unqualified, partially qualified or fully qualified symbol names with wildcards.
"msg1,msg2" is a comma-separated list of error/warning names or error-warning codes (see table below) which are to be ignored for the matched symbols.
To improve readability, the parts left and right of the equality sign = can be put inside double quotes. A detailed description of the supported errors/warnings
can be found in Meta Comments.
Code |
Name |
w-301 |
missing-association |
w-302 |
never-written |
w-303 |
never-read |
w-304 |
alias-unused |
e-202 |
not-found |
Example: