connect_net - 2024.2 English

Vivado Design Suite Tcl Command Reference Guide (UG835)

Document ID
UG835
Release Date
2024-11-13
Version
2024.2 English

Connect a net to pins or ports

Syntax

connect_net [‑hierarchical] [‑basename <arg>] [‑net <args>]
    [‑objects <args>] [‑net_object_list <args>] [‑dict <args>] [‑quiet]
    [‑verbose]

Usage

Name Description
[-hierarchical] Allow hierarchical connection, creating nets and pins as needed (see -basename).
[-basename] base name to use for net / pin names needed when doing hierarchical connection (see -hier). Default value is inferred from the name of the net being connected (see -net).
[-net] Net to connect to given objects.
[-objects] List of pin and port objects to connect
[-net_object_list] optional, a list of net and pin/port list pairs, each pin or port list element is connected to the corresponding net, e.g. { net_a { pin_b port_c } net_d pin_e }. Cannot be used with -net, -objects list is ignored when -net_object_list is used.
[-dict] alternative to -net_object_list, faster, but requires a list of net and pin/port object pairs (must be a list of objects, not names or other TCL objects), each pin or port list element is connected to the corresponding net, e.g. { $net_1 $pin_1 $net_2 $pin_2 }. Cannot be used with -net, -objects list is ignored when -dict is used.
[-quiet] Ignore command errors
[-verbose] Suspend message limits during command execution

Categories

Netlist

Description

This command allows the user to connect a specified net to one or more pins or ports in the netlist of an open Synthesized or Implemented Design.

The connect_net command will also connect nets across levels of hierarchy in the design, by adding pins and hierarchical nets as needed to complete the connection. Added nets and pins can be assigned a custom basename to make them easy to identify, or will be assigned a basename by the AMD Vivado™ tool.

Tip: You can specify multiple nets, and a list of pins and ports to connect those nets to, using a single connect_net command with the -net_object_list or -dict options, to significantly speed the addition of multiple nets to the current design.
Netlist editing changes the in-memory view of the netlist in the current design. It does not change the files in the source fileset, or change the persistent design on the disk. Changes made to the netlist may be saved to a design checkpoint using the write_checkpoint command, or may be exported to a netlist file such as Verilog, VHDL, or EDIF, using the appropriate write_* command.
Note: Netlist editing is not allowed on the elaborated RTL design.

Arguments

-hierarchical - (Optional) Connect the net across different levels of the hierarchy.

Important: If -hierarchical is not specified, attempting to connect to hierarchical pins will fail with a warning.

-basename <arg> - (Optional) Specifies a custom name to use for any hierarchical nets or pins that are needed to connect the specified net across levels of the hierarchy. If this option is not used, the basename is automatically derived from the net being connected.

-net <arg> - (Required) Specifies the net to connect.

Tip: Although you can create a bus using the -from and -to arguments of the create_net command, you must connect each bit of the bus separately using the connect_net command.

-objects <args> - (Required) Specified the list of pins or ports to connect the net to. You can connect a net to one or more pin or port objects.

-net_object_list <args> - (Optional) A list of multiple nets and the pins and ports to connect those nets to. This option lets you connect multiple nets with a single connect_net command. Nets, pins, and ports, can be specified by name, or as objects as returned by get_nets, get_pins, or get_ports commands. The nets and pins/ports to connect it to are listed in the following form: {net1 {pin1 pin2...pinN} net2 {pin1 pin2} ...netN {pin1 pin2...pinN}}.

Tip: When -net_object_list or -dict is specified, -net and -objects should not be specified, and will be ignored by the tool. Although -net/-objects and -net_object_list, or -dict are all listed as optional, you must specify the net and objects to connect using one of those argument forms.

-dict <args> - (Optional) This provides an alternate syntax to the -net_object_list option which offers some performance advantage. Specified as a list of net/pin or net/port object pairs that must be specified as objects, and not by name. For example:

set myNetA [get_nets netA]
set myPin1 [get_pins pin1]
set myPin2 [get_pins pin2]
set myPin3 [get_pins pin3]
connect_net -dict [list $myNetA $myPin1 $myNetA $myPin2 $myNetA $myPin3 ]
-quiet - (Optional) Execute the command quietly, returning no messages from the command. The command also returns TCL_OK regardless of any errors encountered during execution.
Note: Any errors encountered on the command-line, while launching the command, will be returned. Only errors occurring inside the command will be trapped.
-verbose - (Optional) Temporarily override any message limits and return all messages from this command.
Note: Message limits can be defined with the set_msg_config command.

Example

The following example creates a port; creates a pin on the myDMA instance; creates a net called myEnable; and connects the net to the newly created port and pin:

create_port -direction IN enableIn
create_pin -direction IN myDMA/en
create_net myEnable
connect_net -net myEnable -objects {enableIn myDMA/en}

The following example creates 32-bit bus ports, pins, and nets, then connects them together one bit at a time using a for loop to connect each bit individually:

create_port -from 0 -to 31 -direction IN dataIN
create_pin -from 0 -to 31 -direction IN myDMA/data
create_net -from 0 -to 31 dataBus
for {set x 0} {$x<32} {incr x} { \
   connect_net -net dataBus[$x] -objects [list dataIN[$x] myDMA/data[$x]] }
Note: Attempting to connect the dataBus will result in a "Net not found error." Each bit of the bus must be separately connected.

This example creates a new cells, then uses the -net_object_list to connect multiple nets in a single connect_net command:

create_cell -ref inv a2_i
connect_net -net_object_list {top_I[2] {I[2] a2_i/I} \
   top_O[2] {O[2] a2_i/O} top_clk a2_i/clk}