Connect Instances Across the Design Hierarchy

Connect Instances Using New Ports

In order to connect two module instances using new ports, you must specify the output instance (the signal source) and the input instance (the signal destination). New ports will be created across the design hierarchy as needed, in order to propagate the signal.

  1. Press the Select Top design-hierarchy-top button and pick one of the available design tops.

    ../../_images/sv-connect-instances-select-top.png
  2. Right click on an instance and select Connect Output from the context menu.

    ../../_images/sv-connect-instances-connect-output.png

    The output instance is presented in the Refactoring Connect View Output textbox:

    ../../_images/sv-connect-instances-connect-output-toolbar-after.png
  3. Select another instance, right click and Connect Input.

    ../../_images/sv-connect-instances-connect-input.png

    The input instance is presented in the Refactoring Connect View Input textbox along the previous set output instance:

    ../../_images/sv-connect-instances-connect-input-toolbar-after.png
  4. Press Compute Changes button.

    ../../_images/sv-connect-instances-dialog.png
  5. You can choose Diagram Preview to see the design affected by the refactoring operation or Code Preview to see the source code changes.

    ../../_images/connect-instance-diagram.png
    ../../_images/sv-connect-instances-code-preview.png
  6. Press the Connect button in order to perform the changes.

Note

You can undo the whole refactoring operation using the application menu Edit -> Undo.

Note

You can select the output/input instances from editor right click menu Refactoring -> Connect Output / Connect Input.

Connect Instances Using Existing Ports

In order to connect two module instances using existing ports, you must specify the output port (the signal source) and the input port (the signal destination). New ports will be created across the design hierarchy as needed, in order to propagate the signal.

  1. Press the Select Top button and pick one of the available design tops.

    ../../_images/sv-connect-instances-connect-existing-select-top.png
  2. Press the Show/Hide Ports button to see the ports of the selected instance, if needed.

  3. Select an instance using left click and a port using right click Connect Output Port.

    ../../_images/sv-connect-instances-connect-existing-output.png

    The output instance and port are presented in the Refactoring Connect View Output textbox:

    ../../_images/sv-connect-instances-connect-existing-output-toolbar-after.png
  4. Select another instance using left click and a port using right click Connect Input Port.

    ../../_images/sv-connect-instances-connect-existing-input.png

    The input instance and port are presented in the Refactoring Connect View Input textbox along the previous set instance and port:

    ../../_images/sv-connect-instances-connect-existing-input-toolbar-after.png
  5. The rest of the steps are the same as connecting instances using new ports. More details Connect Instances Using New Ports.

Note

The swap between output instance and input instance doesn’t work for directional ports (input or output).

Structural Changes Preview Diagram

Any change to a module or entity definition, like new ports or new signals being added, affects all its instances. Before proceeding to source code changes, you can preview the design structural changes.

Terminology:

  • output instance is the module instance where the connection starts. It outputs the signal that will be connected. output module is the module being instantiated as an output instance.

  • input instance is the module instance where the connection ends. It inputs the signal that will be connected. input module is the module being instantiated as an input instance.

  • closest parent instance is the parent instance through which a signal is routed to connect the ports leading from the output instance to the input instance across the design hierarchy. No ports will be added to the closest parent instance. The closest parent module is the module corresponding to the closest parent instance.

  • relevant modules are the modules that will change by adding new ports and/or new signals. relevant instances are instances of relevant modules.

Ports are added only to modules that are instantiated on the paths leading from the output module instance and the input module instance to the closest parent instance. Ports are added to the output module or the input module only if the connection is not using an existing port.

All relevant instances are colored in green in the preview diagram. All the instances that will not change are colored in blue.

They are hidden by default but the Show Side Effects button from the left side of the diagram can be used for showing them.

../../_images/connect-instance-diagram.png
../../_images/connect-instance-diagram-full.png

Refactoring Connect View

../../_images/sv-connect-instances-connect-toolbar.png

In the design hierarchy you can select the instances that you want to connect.

  1. You can Swap the ports direction.

  2. The output instance path. The port segment is presented only if you use an existing port.

  3. The input instance path. The port segment is presented only if you use an existing port.

  4. The output port / input port / signal name used for connect operation.

  5. Press Compute Changes to start the refactoring operation.

  6. Press Diagram Preview / Code Preview to visualize the structural/source code changes.

  7. Press Apply changes to finish the refactoring operation.

  8. Press Close to hide the Refactoring Connect View.

  9. (Optional) Press Reset to return to initial state of the view.