Design Diagram

Design Diagrams help you inspect and document the structure of a design element.

To create a design diagram, place the cursor over a type, instance, or state variable in the editor, use the DVT: Show Diagram command and choose the type of diagram you are interested in.

The Design Breadcrumb is updated with the diagram’s input when the diagrams gets generated.

../../_images/design_diagrams.gif

Schematic Diagrams

A schematic diagram presents the internal structure of a design element: ports, sub-instances, combinational and sequential logic and connections.

You can draw a nested schematic by increasing the depth using the preferences from the toolbar.

Flow Diagrams

A flow diagram presents a high level view of internal connectivity. Multiple connections from one instance to another are collapsed in a single directional edge.

Transform a schematic into a flow diagram using the preferences from the toolbar.

Block Diagrams

A block diagram presents the ports.

Transform a schematic into a block diagram using the preferences from the toolbar.

Finite-State Machine Diagrams

The DVT: Show Diagram command on a state variable inside a module or entity will generate a Finite-State Machine (FSM) diagram. States and transitions are automatically detected in the enclosing scope by analyzing all the assignments and conditions in which the state variable is used.

Multiple transitions between the same two states are merged into a single one with multiple conditions.

Next state variables are supported. Method call transitions and “one-hot” array case conditions are not supported.

The initial state is colored gray. Selecting any state or transition will highlight the previous and next states differently.

You can change the look and feel of the diagram using the preferences from the toolbar:

  • Graph Direction: The direction of the diagram.

  • Placement Strategy: The algorithm used for placing blocks and edges.

  • Opposite In/Out Edges for: For which states should incoming and outgoing edges be constrained to opposite sides? The default is All States except Initial.

  • Initial State Position: The position of the initial state relative to the graph direction. The default is First.

  • Show Explicit Loopback Edges: Show explicit transitions to the same state as a loopback edge.

  • Transition Labels: The label displayed on transitions. It can be the Index of the transition or the Condition (merged transitions will have multiple conditions). The default is None.

  • Hide Names in Conditions: A list of signal names that will be filtered out of conditions. Strict text matching is used.

You can inspect transitions in the diagram table. Select any entry in the table and the transition will be highlighted in the diagram. Any selection in the diagram will highlight the corresponding elements in the table.

The conditions for all transitions are presented in the last column.

../../_images/fsm_diagrams.gif

Design Diagram Actions

Design Diagram actions are available in the context menu.

Action

Diagram kind

Element kind

Description

Go to Source

Block

Flow

Schematic

FSM

ALL

Jump to the selected element source code (instances, state values, ports, power domains, connections, state transitions).

Go to Declaration

Flow

Schematic

Instance

Jump directly to the module or entity declaration.

Step into

Flow

Schematic

Instance

Show the diagram for the selected instance.

Step out

Flow

Schematic

Instance

Show the diagram one level above the current diagram top (if available).

Expand

Schematic

Instance

Show the sub-instaces of the selected instance while keeping the initial diagram.

Collapse

Schematic

Instance

Hide all the sub-instances and signals from within the selected instance.

Show Sources

Schematic

Instance

Logic Gate

Port

Show the instances that drive the selected port.

Show Destinations

Schematic

Instance

Logic Gate

Port

Show the instances that load from the selected port.

Delete

Flow

Schematic

Instance

Logic Gate

Connection

Port

Delete the selected element.

Show Connections

Flow

Schematic

Instance

Logic Gate

Connection

Port

Show all connections of the selected instances with other instances; when triggering this operation on a signal, the diagram shows that signal and all the instances it connects; when triggering this operation on a port, the diagram shows that port and all the instances connected through it.

Show Connections Between

Flow

Schematic

Instance

Show all connections between the selected instances, passing through logic.

Note

When performing an action on an instance, signal or port, a purple highlight contour is added to it.

Design Diagram Filters

Note

Filters only apply to Schematic and Flow diagrams.

You can customize the diagram using the Filters button filters-icon from the toolbar.

../../_images/vscode-filters-dialog-clk-rst.png

Use the drop-down menu at the top of the dialog to select from available filters.

Use the buttons in the top-right corner of the dialog to create, duplicate, or delete the current filter.

Use the checkboxes at the bottom of the dialog to further clean up the diagram.

A filter is defined using filter rules (one per line). The general form of a filter rule is:

command element_kinds matching regex [using color_name_or_code] 
  • command is one of hide, show, or color

  • element_kinds is a comma-separated list of kinds. The available kinds are instances, types, ports, port types and transaction types

  • regex is a regular expression that matches the relevant diagram element labels

  • color_name_or_code is a color specified by name, 6- or 3-digit hexadecimal code, comma-separated decimal RGB code or the keyword random. This is relevant only for color rules.

To apply a filter rule only to elements under a specific instance, you must provide the relevant path in the regex section of the rule:

  • a path must always begin with the name of the top instance in the diagram (if instance is under top_instance, then top_instance/instance/… is valid, while instance/… is not)

  • a path consists only of names of instances and “/

  • each level is separated from the previous using “/” (valid: top_instance/inst1/inst2/…; not valid: top_instance.inst1.inst2…)

  • regular expressions may be used in the path section of a rule (for example, top_instance/.*/some_instance)

  • if the regex contains “/”, everything before the last “/” is the path, the rest is used to match the relevant diagram elements (in the following example, the bolded text is the path: top_instance/.*/inst1/.*drv.*)

  • if the regex does not contain “/”, it applies to all elements of the appropriate element_kinds

Tip

You can hide the hierarchy under an instance with the filter “hide instances matching path/to/instance/.*”.