Get a list of nets in the current design
Syntax
get_nets [‑hsc <arg>] [‑hierarchical] [‑regexp] [‑nocase] [‑filter <arg>]
[‑of_objects <args>] [‑match_style <arg>]
[‑top_net_of_hierarchical_group] [‑segments] [‑boundary_type <arg>]
[‑quiet] [‑verbose] [<patterns>]
Returns
List of net objects.
Usage
Name | Description |
---|---|
[-hsc]
|
Hierarchy separator Default: / |
[-hierarchical]
|
Search level-by-level in current instance |
[-regexp]
|
Patterns are full regular expressions |
[-nocase]
|
Perform case-insensitive matching (valid only when -regexp specified) |
[-filter]
|
Filter list with expression |
[-of_objects]
|
Get nets of these pins, ports, cells, timing paths or clocks, drc violations |
[-match_style]
|
Style of pattern matching, valid values are ucf, sdc Default: sdc |
[-top_net_of_hierarchical_group]
|
Return net segment(s) which belong(s) to the high level of a hierarchical net |
[-segments]
|
Return all segments of a net across the hierarchy |
[-boundary_type]
|
Return net segment connected to a hierarchical pin which resides at the same level as the pin (upper) or at the level below (lower), or both. Valid values are : upper, lower, both Default: upper |
[-quiet]
|
Ignore command errors |
[-verbose]
|
Suspend message limits during command execution |
[<patterns>]
|
Match net names against patterns Default: * |
Description
Gets a list of nets in the current design that match a specified search pattern. The default command gets a list of all nets in the current_instance of the open design, as specified by the current_instance
command.
You can use the -hierarchical
option to extract nets from the hierarchy of the current design.
get_*
commands return a container list of a single type of objects (e.g. cells, nets, pins, or ports). You can add new objects to the list (using lappend
for instance), but you can only add the same type of object that is currently in the list. Adding a different type of object, or string, to the list is not permitted and will result in a Tcl error.
Arguments
-hsc <arg>
- (Optional) The default hierarchy separator is '/'. Use this argument to specify a different hierarchy separator.
-hierarchical
- (Optional) Get nets from all levels of the design hierarchy starting at the current instance. Without this argument, the command will only get nets from the current instance, as set by the current_instance
command. When using -hierarchical
, the search pattern should not contain a hierarchy separator because the search pattern is applied at each level of the hierarchy, not to the full hierarchical net name. For instance, searching for U1/* searches each level of the hierarchy for nets with U1/ in the name. This may not return the intended results. See get_cells
for examples of -hierarchical
searches.
-regexpr
, the specified search string is matched against the full hierarchical name, and the U1/* search pattern will work as intended.-regexp
- (Optional) Specifies that the search <patterns> are written as regular expressions. Both search <patterns> and -filter
expressions must be written as regular expressions when this argument is used. Xilinx regular expression Tcl commands are always anchored to the start of the search string. You can add ".*" to the beginning or end of a search string to widen the search to include a substring. See http://perldoc.perl.org/perlre.html for help with regular expression syntax.
regexp
is not anchored, and works as a standard Tcl command. For more information refer to http://www.tcl.tk/man/tcl8.5/TclCmd/regexp.htm.
-nocase
- (Optional) Perform case-insensitive matching when a pattern has been specified. This argument applies to the use of -regexp
only.
-filter
<args> - (Optional) Filter the results list with the specified expression. The -filter
argument filters the list of objects returned by get_nets
based on property values on the nets. You can find the properties on an object with the report_property
or list_property
commands. In the case of the nets object, "PARENT", "TYPE" and "MARK_DEBUG" are some of the properties that can be used to filter results.
get_pins * -filter {DIRECTION == IN && NAME !~ "*RESET*"}
bool
) type properties can be directly evaluated in filter expressions as true or not true: -filter {IS_PRIMITIVE && !IS_LOC_FIXED}
-of_objects <arg>
- (Optional) Get a list of the nets connected to the specified cells, pins, ports, or clocks; or nets associated with specified DRC violation objects.
-of_objects
option requires objects to be specified using the get_*
commands, such as get_cells
or get_pins
, rather than specifying objects by name. In addition, -of_objects
cannot be used with a search <pattern>
.
-match_style [sdc | ucf]
- (Optional) Indicates that the search pattern matches UCF constraints or SDC constraints. The default is SDC.
-top_net_of_hierarchical_group
- (Optional) Returns the top-level net segment of a hierarchical net, or nets, or the top-level net segments of all nets. Use this option with -segment
to return the top-level net segment from all the segments of a hierarchical net.
-segments
- (Optional) Get all the segments of a hierarchical net, across all levels of the hierarchy. This differs from the -hierarchical
argument in that it returns all segments of the specified net, rather than just the specified net.
-segments
option is applied after the -filter
option has eliminated nets that do not match the filter pattern. Because of this, you may expect to see net segments returned that have already been filtered out of the returned results. To change this behavior, you can use the filter
command rather than the -filter
option to apply the -segments
option to the get_nets
command, and then filter the segments returned. See the Examples for more information.-boundary_type [ upper | lower | both ]
- (Optional) Gets the net segment at the level (upper) of a specified hierarchical pin, at the level below (lower) the pin or port, or both the level of and the level below. Valid values are upper, lower, or both. The default value is upper.
-of_objects
argument to specify the hierarchical pin.-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.
-verbose
- (Optional) Temporarily override any message limits and return all messages from this command.
set_msg_config
command.Examples
report_drc
command on the current design, returns the list of violations in the specified DRC report, and then returns any nets associated with the driverless net rule (NDRV):
report_drc -name drc_1
get_drc_violations -name drc_1
get_nets -of_objects [get_drc_violations -name drc_1 NDRV*]
get_nets -hier -filter {MARK_DEBUG==1}
get_nets \
-of [get_pins cpuEngine/or1200_cpu/or1200_sprs/esr_reg[9]_i_3/I0]
get_nets -segments \
-of [get_pins cpuEngine/or1200_cpu/or1200_sprs/esr_reg[9]_i_3/I0]
get_nets -top -segments \
-of [get_pins cpuEngine/or1200_cpu/or1200_sprs/esr_reg[9]_i_3/I0]
-filter
to find nets that have the IS_INTERNAL property, and then -segment
is applied to return the segments of those nets. This command returns 0 net segments (and a warning). The second command, returns the segments of all nets, and filters the results to find the segments that have the IS_INTERNAL property, of which there are 448:
llength [get_nets -segments -filter {IS_INTERNAL}]
WARNING: [Vivado 12-1023] No nets matched for command 'get_nets -segments
-filter IS_INTERNAL'.
0
llength [filter [get_nets -segments] {IS_INTERNAL}]
448