Search code examples
listcollectionstcl

Collections to list in tcl


Hi I would like to know how to convert a collection into list in tcl. The output I am getting is in form of collections but I want to change it to list.


Solution

  • Generally we use collections when dumping/querying data from certain tools which use TCL (for example Design compiler from synopsys). These collections look as list but are not accessible for normal list commands. To access them you need to use "foreach_in_collection" command and need to use get_object_name (or equivalent command) and need to build list (lappend) of the output of get_object_name. From this list you can use all TCL list operations.

    foreach_in_collection and get_object_name are tool specific commands and can not be found in TCL and they work only run through tool interface.

    Hope this helps.