SV
[[sv.filesets]] entries specify SystemVerilog files, such as IPs, which are managed together with a Veryl project.
The specified files and include directories are added to the filelist.
[[sv.filesets]]
root = "ip/foo"
enable_if = "!for_asic && width == 32"
files = ["rtl/foo_pkg.sv", "rtl/foo.sv"]
include_dirs = ["include"]
Multiple filesets can be specified by repeating [[sv.filesets]].
Available configurations
| Configuration | Value | Required | Description |
|---|---|---|---|
| root | string | no | Base directory of relative paths in files and include_dirs |
| files | array of string | yes | SystemVerilog files |
| include_dirs | array of string | no | Include directories |
| enable_if | string | no | Condition expression on project properties. The fileset is enabled only if it is evaluated to true. If omitted, the fileset is always enabled. |
Relative paths are relative to the project root directory (the directory containing Veryl.toml) if root is omitted.
An absolute path ignores root.
Condition expression
The enable_if field takes a condition expression on project properties.
The following operands can be used:
- Property names
- Unsized numbers in Veryl syntax (e.g.
32,'b1010,'hff) - Parenthesized expressions
The following operators can be used. All operators are left-associative.
| Precedence | Operator | Operand type |
|---|---|---|
| Highest | ! | bool |
<: >: <= >= | int | |
== != | both of the same type | |
&& | bool | |
| Lowest | || | bool |
[properties]
for_asic = false
width = 32
[[sv.filesets]]
enable_if = "for_asic"
files = ["ip/asic/foo_asic.sv"]
[[sv.filesets]]
enable_if = "!for_asic && (width == 32 || width == 64)"
files = ["ip/fpga/foo_fpga.sv"]
Syntax errors of the condition expression are reported when Veryl.toml is loaded.
Unknown properties and type mismatches are reported when the expression is evaluated.
Filelist
Files and include directories of the enabled filesets are added to the filelist before the generated files.
Include directories are also passed to the simulators run by veryl test.
Dependencies
Filesets of dependencies are also added to the filelist.
enable_if of a dependency is evaluated with the property values of the dependency,
which reflect project property override.
- Git dependencies: files and include directories are copied into the
dependenciesdirectory, and the copied paths are referred. - Path dependencies: files and include directories are referred directly.
Publish
Paths in [[sv.filesets]] of a published project must be relative paths which don’t contain ...
veryl publish reports an error if an absolute path or a path containing .. is found in any fileset, regardless of enable_if.