How can i get the library list?

Í

ÍőłÉłŹ

Guest
HI
I want to get all schmematic in a library and operate them with skill.
How can I get the all schematic list in my library?

thanks
Wang chengchao
 
Wang:
schlist=list()

foreach(cell ddGetObj("libName")~>cells

when(member("schematic" cell~>views~>name)

schlist=append1(schlist cell~>name)

) ; when

) ; foreach

dprint(schlist)
---
erik

"ÍőłÉłŹ" <ccwang@sanguine.com.cn> wrote in message news:<cbopqv$4m8$1@mail.cn99.com>...
HI
I want to get all schmematic in a library and operate them with skill.
How can I get the all schematic list in my library?

thanks
Wang chengchao
 
Just a little point - you'd be better off doing:

schlist=cons(cell~>name schlist)

than using append1, since if the library has a very large number of schematics,
building that list is going to be quite expensive, as appends have to copy the
list in the first argument before adding the entry on the end. So you end up
copying each list cell n*(n+1)/2 times, i.e. O(2), so if there are 10,000
schematics, that means roughly 50 million list cell copies. That ends up with
a lot of garbage being collected.

Since the order of the list of cells is not terribly meaningful, I see little
benefit in keeping that order when you do the append1, so you're not losing
out by using cons. If you really want the order to be maintained, you can
always do a one-off reverse() of the list at the end, or use tconc() to build
the list in the right order (efficiently) to start off with. append is a
non-destructive list operator (like most list operators), which is why it
copies the list first.

So this is a little away from the original request, and a bit pedantic on my
part, but I like to make sure that bad habits don't set in early!

Regards,

Andrew.

On 28 Jun 2004 13:18:36 -0700, erikwanta@starband.net (Erik Wanta) wrote:

Wang:
schlist=list()

foreach(cell ddGetObj("libName")~>cells

when(member("schematic" cell~>views~>name)

schlist=append1(schlist cell~>name)

) ; when

) ; foreach

dprint(schlist)
---
erik

"ÍőłÉłŹ" <ccwang@sanguine.com.cn> wrote in message news:<cbopqv$4m8$1@mail.cn99.com>...
HI
I want to get all schmematic in a library and operate them with skill.
How can I get the all schematic list in my library?

thanks
Wang chengchao
--
Andrew Beckett
Senior Technical Leader
Custom IC Solutions
Cadence Design Systems Ltd
 
you could also try something like the following if you
are concerned about the order of the list and absolutely
want each new cell name at the end of the list.

;; build two lists, one of cells and one of cell names
schlist = setof( cell ddGetObj("libName")~>cells
member("schematic" cell~>views~>name))~>name

or better

;; use mapcan to efficiently build a list of selected names
schlist = foreach( mapcan cell ddGetObj("libName")~>cells
when( member("schematic" cell~>views~>name)
list( cell~>name)))


schlist=list()

foreach(cell ddGetObj("libName")~>cells

when(member("schematic" cell~>views~>name)

schlist=append1(schlist cell~>name)

) ; when

) ; foreach
 
Jim Newton wrote:
you could also try something like the following if you
are concerned about the order of the list and absolutely
want each new cell name at the end of the list.

;; build two lists, one of cells and one of cell names
schlist = setof( cell ddGetObj("libName")~>cells
member("schematic" cell~>views~>name))~>name

or better

;; use mapcan to efficiently build a list of selected names
schlist = foreach( mapcan cell ddGetObj("libName")~>cells
when( member("schematic" cell~>views~>name)
^^^^^^^^
Jim, you can better check on the viewtype. Many designers use a different name.

list( cell~>name)))


schlist=list()

foreach(cell ddGetObj("libName")~>cells

when(member("schematic" cell~>views~>name)

schlist=append1(schlist cell~>name)

) ; when

) ; foreach
 

Welcome to EDABoard.com

Sponsor

Back
Top