Contact us Start a Trial

Dependencies

Defining a dependency on another target makes HDL definitions from that target’s sources available in the current target’s sources, as well as in sources of all targets that would depend on this target. You can define a dependency on:

  • Another target of the same project
  • One or multiple targets of another project
  • A library from the Library Database

These dependencies can be added to a target in a project, by specifying them in the dependencies array on the target, or to a whole project, by specifying them in the dependencies array at the root of the project configuration JSON. Adding a dependency to a whole project is equivalent to adding it to all targets in the project.

Each dependency is an object with dependency project name as a key, and an object with the following fields as a value:

FieldDescription
versionDepend on the specified version of the referenced project, tool libraries, or library
targetsDepend on the specified targets of the referenced project, or on libraries of the referenced tool

When you want to specify only a specific version or target, or depend on a target of the current project, a shorter dependency declaration syntax is available:

Short versionFull version
{ "common_cells": "1.0" }{ "common_cells": { "version": "1.0" }
{ "apb_uart": ["test"] }{ "apb_uart": { "targets": ["test"] } }
"rtl"{ "current_project": { "targets": ["rtl"] } }

Note that the latter form is only allowed for dependencies between targets of the same project. It cannot be used to specify dependencies of the whole project.

Example:

{
    "name": "Target Dependencies",
    "dependencies": [ // Dependencies for all targets of this project:
        // Dependency on all targets of another project named "common_cells" with version "1.0"
        { "common_cells": "1.0" },
        // Dependency on a target named "rtl" of another project named "apb_uart"
        { "apb_uart": ["rtl"] }
    ],
    "targets": {
        "ip1": { /* ... */ },
        "rtl": {
            // ...
            "dependencies": [ // Dependencies specific to this target:
                // Dependency on another target of this project with the name "ip1"
                "ip1",
                // Dependency on the UVM 1.2 library from the Library Database
                { "UVM": "1.2" },
                // Dependency on "altera" and "lpm" libraries from the latest "Quartus" tool in Library Database
                { "Quartus": [ "altera", "lpm" ] }
                // Dependency on Vivado 2023.2's "unisim" library from the Library Database
                { "Vivado": { "version": "2023.2", "targets": [ "unisim" ] } }
            ]
        }
    }
}

When you specify a dependency, Sigasi searches for them in:

  • VS Code workspace folders,
  • paths specified in the sigasi.dependenciesSearchPaths setting, and specifically:
    • a directory at the specified path, and recursively all subdirectories thereof and
    • a Library Database at the specified path, allowing using multiple Library Databases if necessary,
  • the Path To Library Database specified in the sigasi.pathToLibraryDatabase setting, and
  • the Built-in Library Database that’s shipped with Sigasi. It contains the UVM library versions 1.1d, 1.2, 2017-1.1, and 2020-3.1.

These locations are searched in order, and the first project or Library Database library that satisfies dependency requirements (name and version) is used.

You can use environment variables in the sigasi.dependenciesSearchPaths setting. Supported formats: $ENV_VAR, ${ENV_VAR}, and ${ENV_VAR:default_value}. You can also use paths relative to the home directory (e.g. ~/some/path).

version

If no dependency version is specified, the latest version found is used. Note that currently Sigasi does no interpretation of version strings, so:

  • the latest version is determined by alphabetical comparison of version strings; and
  • currently there’s no way to specify more complex version requirements (e.g., defining version ranges): only exact matches are supported.

Currently, only one version of the project or library can be present in a target’s dependency tree. If the dependency tree contains multiple versions of the same project or library, the last specified version (in other words, a version specified closer to the current target in a dependency tree) is used.

targets

Specify a list of targets of referenced project that should be available in current target. If no targets are specified, all targets from the referenced project become available. If an empty list is specified, no targets (other than targets already specified by other dependencies) are added.

Example:

{
    "name": "Dependency Version Override",
    "targets": {
        "common": {
            // ...
            "dependencies": [
                { "Vivado": { "version": "2021.1", "targets": [ "unisim" ] } }
            ]
        },
        "rtl": {
            // ...
            "dependencies": [
                "common",
                // Incorrect way to override version. It overrides version, but also adds all Vivado libraries.
                { "Vivado": "2023.2" },
                // Correct way to override a version. It overrides the version, but does not add any new libraries.
                { "Vivado": { "version": "2023.2", "targets": [] } }
            ]
        }
    }
}

Fragments

A target can be marked as a fragment. This disables validation of that target unless it is added as a dependency of another non-fragment target. Fragment targets are validated in the context of the non-fragment targets that depend on them.

Fragments may be helpful if shared code is not complete (cannot be compiled) without specific configuration code.

Example:

{
    "name": "Fragment Targets",
    "targets": {
        "common": {
            "fragment": true,
            "libraryMapping": {
                "common": "work"
            }
        },
        "asic": {
            "libraryMapping": {
                "asic_cells": "work"
            },
            "dependencies": [
                "common"
            ]
        },
        "fpga": {
            "libraryMapping": {
                "fpga_cells": "work"
            },
            "dependencies": [
                "common"
            ]
        }
    }
}