Development features¶
Code analysis¶
Diplomat client relies on the slang open source SystemVerilog compiler to analyze code, through Diplomat Server. It allows a management in C++ and offer great performances.
Slang also provides a great support of SystemVerilog syntax, and not only Verilog. The supported language features are listed in the slang documentation.
The errors and warnings reported by slang will be returned to the editor and shown with squiggle lines in the editor and in the Problems view of VS Code.
The list of available warnings is provided in the slang warning reference. Only the following warnings are ignored:
- Mismatched time scales
Reports mismatched
`timescale
statements, often not relevant as overriden at top level for the simulation. This is fairly annoying when dealing with source code comming from different sources.- Missing time scale
Reports every file without the
`timescale
statement. Generally omitted in design files, therefore ignored.- Unused definition
Report every module found in the workspace that is not used in the design. Particularly annoying when working with a library of components and not really relevant in this context.
Note
When a top level module is specified, the design is elaborated before reporting the errors and warning. Thus effectively ommiting diagnostics from file that are not used in the design.
Symbol renaming¶
Using VS Code UI, the extension is able to performs symbol renaming.
In editor, select a net and hit F2
to trigger this feature.
All reference and the definition of the symbol will be renamed.
This is not a “Search and replace” function, as the lookup is done on symbols extracted from the elaborated design, while being aware of the context. Therefore, renaming a net in a module will not affect nets from another module. However, renaming a port will also affect the port name in all module instanctiations.
Module instanciaton¶
Diplomat client povide an “Instanciate module” function, directly from the command palette.
This is invoked by using Ctrl+P > Instanciate Module
.
VS Code will then present a list of modules detected across the workspace, that may be instanciated.
Note
On large workspaces, there might be few seconds between the command invocation and the selector popping up.
Selecting a module in the list will generate the instanciation statement where the editing cursor is located.