find_top - 2023.2 English

Vivado Design Suite Tcl Command Reference Guide (UG835)

Document ID
Release Date
2023.2 English

Find top module candidates in the supplied files, fileset, or active fileset. Returns a rank ordered list of candidates.


find_top [‑fileset <arg>] [‑files <args>] [‑return_file_paths] [‑quiet]


Name Description
[-fileset] Fileset to parse to search for top candidates
[-files] Files to parse to search for top candidates
[-return_file_paths] For each top returned, also include the associated file path. The returned value will be a single list of strings, alternating top names and file paths.
[-quiet] Ignore command errors
[-verbose] Suspend message limits during command execution




Find the most likely candidates for the top module in the files defined in the current fileset, or in the specified fileset, or in the specified list of files.

The command returns an ordered list of modules that the tool identifies as the best candidates for the top-level of the design. You can use the lindex command, and choose index 0 to select the best candidate for the top module.


-fileset <arg> - (Optional) Search the specified simulation or source fileset for top module candidates. The default is to search the current fileset of the current design.

-files <arg> - (Optional) Find the top module candidates in the specified list of files.

-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.


The following example chooses the best top module of the current design for synthesis:

synth_design -top [lindex [find_top] 0]
Note: Since find_top returns multiple possible candidates, choosing index 0 chooses the best top candidate for synthesis.

The following example returns the best top module candidate from the specified list of files:

find_top -files [get_files -filter {NAME =~ *or1200*}]

The following example sets the results of find_top into the variable $topVar, then uses that variable to define the top module in the current fileset using the set_property command:

set topVar [ find_top -files [get_files -filter {NAME =~ *usbf*} ] ]
set_property top $topVar [current_fileset]