Home The Dirt Page Demos ESNUGs
Subscribe Feedback Photos Trip Reports
ESNUG
( ESNUG 360 Item 17 ) -------------------------------------------- [11/02/00]

From: Rajkumar Kadam <rkadam@asic.qntm.com>
Subject: Synopsys Tcl 'Collections' in DC Not Like Tcl 'Lists'!  Why!???

Hi John!

I thought that this may be useful for people using Tcl as their scripting
language for DC.  Synopsys has a new form of list equivalent in Tcl called
'collection'.  I assumed that the 'collection' worked similar to 'list' with
their custom commands, but it did not turn out so.

Following is the example which I thought should have worked logically.

  set in_list [all_inputs]
    foreach_in_collection element [all_clocks] {
        set in_list [remove_from_collection $in_list  $clock_name]
    }

I was trying to remove a collection item from an collection, but it does not
work.  The following was the workaround to make it work, which I achieved
with the help of a Synopsys FAE.

  set in_list [all_inputs]
  foreach_in_collection element [all_clocks] {
     set clock_name [get_port  $element]
     set in_list [remove_from_collection $in_list  $clock_name]
  }

Reasoning: You cannot remove a collection item from a collection which has
a different object class.  When you run all_clocks it returns a collection
which has a object class as clock.  When you run all_inputs it returns a
collection which has a object class as ports.

I understand this logic, but I really do not understand the need for having
such a limitation in Synopsys tools.  I always wanted it to be like Tcl
'list'.  Why not?

    - Rajkumar Kadam
      Quantum Corp.





Got a better banner in mind?

Top Home  

"This here ain't no one's opinion 'cept my own."
This Web Site Is Modified Every 2 to 3 Days
Copyright 1999-2008 John Cooley.  All Rights Reserved.
| Contact John Cooley | Webmaster | Legal | Feedback Form |