Formatting Lists of Objects - 2020.2 English

Vivado Design Suite User Guide: Using Tcl Scripting (UG894)

Document ID
UG894
Release Date
2021-03-30
Version
2020.2 English

When a list is returned from the get_* commands, the list is un-formatted and returned to stdout in a single line delimited by a space. This is shown in the following example:

get_cells
A B clk_IBUF_inst rst_IBUF_inst din0_IBUF_inst din1_IBUF_inst dout0_OBUF_inst 
dout1_OBUF_inst dout2_OBUF_inst dout3_OBUF_inst clk_IBUF_BUFG_inst

This un-formatted return makes it difficult to see what has been returned in the Tcl Console and the Vivado IDE. To have each item in the list returned on a separate line, simply execute the command nested in a join command, with the newline character, '\n', as follows:

join [get_cells] \n
A
B
clk_IBUF_inst
rst_IBUF_inst
din0_IBUF_inst
din1_IBUF_inst
dout0_OBUF_inst
dout1_OBUF_inst
dout2_OBUF_inst
dout3_OBUF_inst
clk_IBUF_BUFG_inst

The list returned by the get_* command is unaffected by the join command.

Note: When converting a Vivado collection of objects into a string representation, not all the objects have to be included in the string representation. The number of objects to be included in the string representation is defined with the parameter tcl.collectionResultDisplayLimit (default: 500). Refer to section Collection versus String Representation for more information.