Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 352
user2533429 Avatar asked Oct 17 '25 02:10

user2533429


2 Answers

Assuming you are using some synopsys tool:

  set MyList [get_object_name $MyCollection]

The above should convert your collection to a list.

like image 77
blah Avatar answered Oct 18 '25 21:10

blah


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.

like image 28
GIC82 Avatar answered Oct 18 '25 21:10

GIC82



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!