These automation features are available for projects using the new Sigasi Project format.
Introduction: Automating Your Designflow
In modern HDL design, efficiency is key. Manually running compilers, test benches, and export scripts after every change is time-consuming and error-prone. Sigasi Visual HDL streamlines this process by integrating with VS Code’s powerful task runner , allowing you to automate these repetitive actions.
By creating automated tasks, you can:
- Get Instant Feedback: Automatically compile your code with a third-party compiler every time you save a file.
- Automate and Standardize: Reduce manual work and ensure consistency across your team by using a single, version-controlled source (
.vscode/tasks.json
) for your project’s build and test commands . Tasks can be set to run automatically when you open your project. - Integrate with Downstream Tools: Programmatically export your project’s structure for use in custom scripts for downstream tools like CI/CD pipelines, Linters, or synthesis tools.
This guide will walk you through creating and configuring automated tasks for VUnit testing, exporting, and external compilation.
Creating an Automated Task: The General Process
Creating a task is a simple process using the Sigasi UI. The steps are similar for all task types.
- Initiate Task Creation: In the Sigasi Projects view, right-click on either a project node or a specific target node and select Automate Designflow. Choose the desired task from the submenu (e.g., VUnit, External Compiler).
- Select a Target: If you initiated the task from the project node, you will be prompted to select a build target. This is the name of the build target defined in your
project.sigasi
file that the task should process. This step is skipped if you start from a specific target node. - Configure Common Options: A dialog will appear with the following options:
- Watch mode: Enable this for a “live” development experience. The task will automatically re-run every time you save a relevant file, giving you immediate feedback without leaving the editor.
- Run at startup: Enable this for a “fire-and-forget” setup. The task will run automatically every time you open your VS Code workspace, so your environment is always ready.
Following these steps, Sigasi creates or updates the .vscode/tasks.json
file in your project. A confirmation dialog appears in the bottom-right corner of the window, with a Run now button to execute your new task immediately. For advanced control, you can edit the generated .vscode/tasks.json
file directly. VS Code offers full autocompletion for these tasks, making manual configuration easier.
Running a Task
Once a task has been created, there are several ways to run it:
- Immediately after creation: When you first create a task, a confirmation dialog appears in the bottom-right corner with a Run now button.
- From the Command Palette: At any time, you can run a task manually:
- Open the Command Palette with Ctrl+Shift+P.
- Type Tasks: Run Task and press Enter.
- Select the task you want to run from the list. Recently used tasks will appear at the top.
- With a Keybinding: For tasks you run frequently, you can assign a keyboard shortcut .
Tasks configured with Watch mode or Run at startup will, of course, run automatically based on their configuration.
For more details on running and managing tasks, refer to the official VS Code documentation .
VUnit Integration
Project Setup: Before creating a VUnit automation task, you must first configure your VUnit project as a
scripted target
in yourproject.sigasi
file. For detailed instructions, please refer to our tech article on Setting up VUnit with Sigasi Projects.
What is VUnit Integration?
This feature integrates the VUnit open-source unit testing framework by creating a task that compiles your testbench files. With a Sigasi Visual HDL Professional Edition license or higher, this task also populates the VS Code Test Explorer view , allowing you to see and manage your tests directly within the IDE.
Creating the VUnit Task
Follow the general process. The only VUnit-specific step is providing the path to your VUnit runner script, usually run.py
. Sigasi will automatically detect this file if it’s in your project root.
Advanced Configuration (tasks.json
)
For more advanced control, you can directly edit the sigasiVUnitIntegration
task in your .vscode/tasks.json
file. All tasks share a set of common base properties, but VUnit has its own specific options.
Here is an example of a configured VUnit task:
{
"version": "2.0.0",
"tasks": [
{
"label": "VUnit Integration (test_runner)",
"type": "sigasiVUnitIntegration",
"target": "test_runner",
"watch": true,
"runOptions": {
"runOn": "folderOpen"
},
"runPy": "vunit_tests/run.py",
"simulator": "modelsim",
"simulatorInstallationPath": "/tools/questa_sim/bin",
"venv": ".venv",
"modelsimIni": "config/modelsim.ini"
}
]
}
VUnit Task Properties
In addition to the common base properties, the following options are available for sigasiVUnitIntegration
tasks:
Property | Type | Description |
---|---|---|
runPy | string | The path to your main VUnit script, relative to the project’s root directory. Defaults to run.py . |
simulator | string | Optionally, specify which simulator VUnit should use. If this is not provided, VUnit will use the first supported simulator it finds on your system. Supported values are: "activehdl" , "rivierapro" , "ghdl" , "nvc" , "modelsim" . See the VUnit simulator selection guide for the complete list and resolution rules. |
simulatorInstallationPath | string | Optional path to the simulator’s installation directory. This can be useful if the simulator is not on your system’s PATH . |
venv | string | Optional path to a Python virtual environment directory. If provided, the task will activate this environment before running VUnit. |
modelsimIni | string | If you are using ModelSim or Questa, this property allows you to specify a path to a custom modelsim.ini file. |
A Note on Python Virtual Environments
The VUnit integration fully supports the use of Python virtual environments. If your VUnit installation is inside a virtual environment, it is crucial that you specify the path to it using the
venv
property.This feature works with standard environments created with
venv
, as well as modern alternatives likeuv
.Before running the task, please ensure that your virtual environment is correctly initialized and contains all necessary dependencies, including VUnit itself. The task will then activate this environment before executing the VUnit script.
Automated Export of Compilation Recipes
[Only in Sigasi Visual HDL Enterprise Edition]
What is Recipe Export?
This task automates the generation of a Compilation Recipe, a JSON file that describes your project’s exact file list, library mapping, and compilation order. This is extremely useful for scripting and integrating with downstream tools such as CI/CD pipelines, custom Linters, or synthesis tools. You can even chain VS Code tasks to automatically run a downstream tool whenever the recipe is regenerated. For more details on the format, see the Compilation Recipe V2 documentation.
Creating the Export Task
Follow the general process. The specific steps are:
- Choose Automated Export from the Automate Designflow menu.
- Select Export Compilation Recipe.
- You will be prompted to specify an Output directory.
Advanced Configuration (tasks.json
)
The recipe export task is defined with the type sigasiExportCompilationRecipe
. For advanced configuration, you can edit its entry in .vscode/tasks.json
.
Here is an example of a fully configured task:
{
"version": "2.0.0",
"tasks": [
{
"label": "Export Compilation Recipe (top_level_design)",
"type": "sigasiExportCompilationRecipe",
"target": "top_level_design",
"logLevel": "verbose",
"watch": false,
"runOptions": {
"runOn": "folderOpen"
},
"outputDirectory": "build/sigasi",
"absolutePaths": true,
"includeDependencies": true,
"precompiledLibraries": [ "unisim" ]
}
]
}
Recipe Export Task Properties
This task uses the common base properties and adds the following specific properties:
Property | Type | Description |
---|---|---|
outputDirectory | string | The path to the directory where the compilation_recipe.json file will be saved, relative to the project root. Defaults to .sigasi/compilationRecipe . |
absolutePaths | boolean | If set to true , all file paths within the generated recipe will be absolute. If false , they will be relative to the project root. Defaults to false . |
includeDependencies | boolean | If set to true , the compilation recipe will also include information about the project’s dependencies. Defaults to true . |
precompiledLibraries | string[] | An optional list of library names that are considered pre-compiled in your tool environment. These libraries and their files will not be included in the generated recipe. |
External Compilers
What is External Compilation?
This feature allows you to continuously check your code against a third-party compiler like Questa, Riviera-PRO, or XSim, without leaving VS Code. It helps you catch tool-specific syntax or semantic issues early in the development cycle, long before you run a full simulation.
Creating the Compiler Task
Follow the general process. The only compiler-specific step is choosing your desired compiler from the list:
- Questa Compile (Siemens ModelSim/Questa)
- Riviera Compile (Aldec Riviera-PRO)
- XSim Compile (AMD-Xilinx Vivado XSim)
- NVC Compile (NVC, VHDL only)
Advanced Configuration (tasks.json
)
You may need to further configure the arguments in
tasks.json
to match your specific tool setup and command-line options.
Example tasks.json
Here is an example of a tasks.json
file with a configured external compiler task:
{
"version": "2.0.0",
"tasks": [
{
"label": "Compile with Questa (rtl_target)",
"type": "sigasiQuestaCompile",
"target": "rtl_target",
"watch": true,
"runOptions": {
"runOn": "folderOpen"
},
"installationPath": "/opt/questa_sim/2023.1/bin",
"precompiledLibraries": [ "unisim", "xpm" ],
"vlogArguments": [ "-suppress 2223" ]
}
]
}
Common External Compiler Properties
These properties are available for all four external compiler tasks.
Property | Type | Description |
---|---|---|
installationPath | string | An optional, absolute path to the directory containing the compiler’s executables, e.g. /opt/questa/bin . If not provided, the extension will search for the executables in the system’s PATH . |
precompiledLibraries | string[] | An optional list of library names that are already compiled in the tool environment and should be skipped during compilation, e.g. ["unisim"] . |
Compiler-Specific Properties
These properties provide fine-grained control and are unique to each compiler task.
sigasiQuestaCompile (Siemens ModelSim/Questa)
Property | Type | Description |
---|---|---|
modelsimIni | string | Optional path to a custom modelsim.ini file to be used for the compilation. |
vcomArguments | string[] | A list of additional command-line arguments to pass to the vcom VHDL compiler. |
vlogArguments | string[] | A list of additional command-line arguments to pass to the vlog Verilog/SystemVerilog compiler. |
sigasiRivieraCompile (Aldec Riviera-PRO)
Property | Type | Description |
---|---|---|
libraryCfg | string | Optional path to a custom library.cfg file to be used for the compilation. |
vcomArguments | string[] | A list of additional command-line arguments to pass to the vcom VHDL compiler. |
vlogArguments | string[] | A list of additional command-line arguments to pass to the vlog Verilog/SystemVerilog compiler. |
sigasiXSimCompile (AMD-Xilinx Vivado XSim)
Property | Type | Description |
---|---|---|
xvhdlArguments | string[] | A list of additional command-line arguments to pass to the xvhdl VHDL compiler. |
xvlogArguments | string[] | A list of additional command-line arguments to pass to the xvlog Verilog/SystemVerilog compiler. |
sigasiNvcCompile (NVC)
Note: The NVC task only supports VHDL and will fail if the selected target contains Verilog or SystemVerilog files.
Property | Type | Description |
---|---|---|
nvcGlobalArguments | string[] | A list of additional global arguments to pass to the nvc compiler. |
nvcAnalysisArguments | string[] | A list of additional arguments to pass to the nvc analysis phase. |
Troubleshooting
If a task fails, the first place to look for information is the Terminal panel in VS Code, where the error messages are displayed. If you’re new to it, the Terminal documentation covers navigation and troubleshooting tips. For more detailed logs, you can increase the verbosity by setting the logLevel
property in your tasks.json
file to "verbose"
.
If you continue to have issues, please contact our support team at support@sigasi.com and include the terminal output.
Reference: Task Properties
Task Types
The type
property in .vscode/tasks.json
identifies the task’s function.
External Compilation Tasks
Task Type | Associated Tool/Task |
---|---|
sigasiQuestaCompile | Siemens ModelSim/Questa compilation |
sigasiRivieraCompile | Aldec Riviera-PRO compilation |
sigasiXSimCompile | AMD-Xilinx Vivado XSim compilation |
sigasiNvcCompile | NVC compilation (VHDL only) |
Testing Tasks
Task Type | Associated Tool/Task |
---|---|
sigasiVUnitIntegration | VUnit test framework integration |
Data Export Tasks
Task Type | Associated Tool/Task |
---|---|
sigasiExportCompilationRecipe | Exporting a compilation recipe (JSON) |
Common Base Properties
These properties are the foundation for any task created by the Sigasi extension.
Property | Type | Description |
---|---|---|
label | string | The name of the task as it appears in the VS Code UI. This is automatically generated but can be changed. |
type | string | (Required) The task type, which identifies the task’s function. It should not be changed. |
target | string | (Required) The name of the build target, as defined in your project.sigasi file, that you want to process. |
watch | boolean | If set to true , the task will remain active and automatically re-run whenever a relevant source file is changed. Defaults to false . |
runOptions | object | Standard VS Code property to configure when the task runs. For example, to make it run when a folder is opened, set it to { "runOn": "folderOpen" } . See the official documentation for more options. |
logLevel | string | Controls the verbosity of the task’s log output. Can be one of "critical" , "standard" (default), or "verbose" . |