Get_rtl_cells, Usage, Options – Altera Quartus II Scripting User Manual

Page 403: Description, Example, Get_rtl_cells –273

Advertising
background image

Chapter 3: Tcl Packages & Commands

3–273

rtl

© July 2013

Altera Corporation

Quartus II Scripting Reference Manual

get_rtl_cells

Usage

get_rtl_cells [-hierarchical] [-nocase] [-tcl_string] <filter>

Options

-hierarchical: Specifies use of a hierarchical searching method

-nocase: Specifies case insensitive node name matching

-tcl_string: Uses the basic Tcl String matching method

<filter>: Valid destinations (string patterns are matched using Tcl string matching)

Description

Returns a collection of cells in the design. All cell names in the collection match the specified pattern.
Wildcards can be used to select multiple cells at once.

There are three Tcl string matching schemes available with this command: the default method, the
-hierarchical option and the -tcl_string option.

When you use the default matching scheme, use pipe characters to separate one hierarchy level from the
next. They are treated as special characters and are taken into account when string matching with
wildcards is performed. When this matching scheme is enabled, the specified pattern is matched against
absolute cell names: the names that include the entire hierarchical path. A full cell name can contain
multiple pipe characters in it to reflect the hierarchy. All hierarchy levels in the pattern are matched level
by level. Any included wildcards refer to only one hierarchical level. For example, "*" and "*|*" produce
different collections since they refer to the highest hierarchical level and second highest hierarchical level
respectively.

When using the -hierarchical matching scheme, pipe characters are treated as special characters and are
taken into account when string matching with wildcards is performed. This matching scheme forces the
search to proceed recursively down the hierarchy. The specified pattern is matched against the relative cell
names: the immediate names that do not include any of the hierarchy information. Note that a short cell
name cannot contain pipe characters in it. Any included wildcards are expanded to match the relative pin
names.

The -tcl_string matching scheme uses the simple Tcl string matching on absolute cell names. Pipe
characters are not treated as special characters when used with wildcards.

The filter for the collection is a Tcl list of wildcards, and must follow standard Tcl rules.

Example

# Find a cell called "reg" using case insensitive search
get_rtl_cells -nocase reg
# Create a collection of all cells whose names start with "reg"
get_rtl_cells reg*
# Create a collection of all cells on the highest hierarachical level
set mycollection [get_rtl_cells *]
# Create a collection of all cells in the design
# Output cell names.
foreach_in_collection cell $mycollection {
puts [get_rtl_cell_info -name $cell]
}
set fullcollection [get_rtl_cells -hierarchical *]
# Output cell IDs and names.
foreach_in_collection cell $fullcollection {
puts -nonewline $cell
puts -nonewline ": "

Advertising