Syntax Coloring
Source code is colored in the DVT editor. Some language constructs are colored based on a syntactical analysis of the code, while others require a more elaborate semantic analysis, as detailed in the table below. Semantic coloring is only performed when the source code is compiled.
Category |
Requires compilation |
Details |
---|---|---|
Arguments |
y |
Function and task arguments |
Comment Hyperlinks |
||
Comment Pragmas |
y |
Compilation is required for Custom Pragmas |
Comments |
||
Compiler Directives |
||
Constants |
y |
Const fields, enum members, value parameters |
Constraints |
y |
|
Default |
Any word which does not belong to other categories |
|
End Labels |
y |
|
Escaped Identifiers |
||
Events |
y |
|
Fields |
y |
Class variables, struct fields, module and interface signals |
Functions, Tasks |
y |
|
Javadoc Tags |
||
Keywords |
||
Labels |
y |
Named blocks, generate blocks, assert names |
Local Variables |
y |
Variables declared in methods and named blocks |
Macros |
||
Numbers |
||
Object Arguments |
y |
Function and task arguments of class type |
Object Fields |
y |
Class variables, struct fields, module and interface signals of class type |
Object Local Variables |
y |
Variables of class type declared in methods and named blocks |
OVM, UVM, VMM, AVM Macros |
||
Parameterized types |
||
Ports - Input, Inout, Ref |
y |
|
Ports - Output |
y |
|
Static Functions, Tasks |
y |
|
Static Object Variables |
y |
Static variables of class type |
Static Variables |
y |
|
Strings |
||
System Tasks |
||
Task Tags |
||
Template Identifiers |
||
Types |
y |
Classes, interfaces, modules, coverpoints, covergroups, modports, packages, type parameters, typedefs |
UVM Static Object Variables |
y |
Static variables of UVM class type |
UVM Object Arguments |
y |
Function and task arguments of UVM class type |
UVM Object Fields |
y |
Class variables, struct fields, module and interface signals of UVM class type |
UVM Object Local Variables |
y |
Variables of UVM class type declared in methods and named blocks |
You can change the coloring style for each of the categories defined in the table above. Go to Window > Preferences > DVT > SystemVerilog > Editor > Syntax Coloring, select the category you wish to modify from the list and set the color and font style.
A code sample in the Syntax Coloring preference page helps you preview the changes instantly. The default style is shown below:
Note
Inside macro definitions, macro calls and PSL vunits, only syntactic coloring is performed.