1

I want to create a collection from a list. friends1 is a list of names.

I am trying to do:

    set friends2 ""          
    foreach frnd $friends1 {
        append_to_collection friends2 $frnd
    }

Error: At least one collection required for argument 'object_spec' to append_to_collection when the 'collection' argument is empty (SEL-014)

Any ideas? thanks!

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215
Tlalit
  • 11
  • 2
  • 3
  • 2
    What code defines `append_to_collection`? It's not standard Tcl (as defined in http://www.tcl-lang.org/man/tcl8.6/) – Donal Fellows Jul 02 '16 at 15:23
  • I'm using ic compiler and it is a built in command: append_to_collection Adds objects to a collection and modifies a variable. – Tlalit Jul 03 '16 at 14:29

2 Answers2

1

I believe Synopsys collections can only be made from Synopsys objects, like nets, pins, etc. Friend is not a Synopsys object...but assuming instead you have a list of names of Synopsys objects, you can use the respective 'get' function to turn the list into a collection.

set col_of_nets [get_nets $nets]
set col_of_pins [get_pins $pins]
...

To go backwards (collection to list of names), use get_object_name.

set names_of_nets [get_object_name $col_of_nets]
...
teadotjay
  • 1,395
  • 12
  • 15
1

Its old question. But still not answered.

You need to create a collection first to append to it.

Here is a short video about how to do it...

https://www.usessionbuddy.com/user/vlsicoder/termtosvg_v6ai8tfv.svg/

vlsicoder
  • 11
  • 1