Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to count instances in a hierarchy

2,231 views
Skip to first unread message

spectrallypure

unread,
Feb 18, 2006, 11:27:47 AM2/18/06
to
Hi all! Could somebody please tell if there exists a way in Virtuoso
(schematic editor) to count all the instances of cell that exist within
a given hierarchy (that is, the current schematic and all lower
hierarchies)? I am looking for something like a summary of all the
cells used and the number of instances of each cell, for statistical
purposes.

I tried to use the results browser to search in the files generated by
the netlisting process during simulation (I am using Spectre, btw),
but found nothing. Any ideas?

Thanks in advance and best regards,

Jorge Luis.

Andrew Beckett

unread,
Feb 21, 2006, 1:55:33 AM2/21/06
to

There's currently nothing to produce this BOM-like information (Bill of
Materials) - you could of course do it with some SKILL code to traverse the
hierarchy and count all the components.

I don't have anything lying around to do this - perhaps somebody else in the
group does?

Regards,

Andrew.

llc

unread,
Feb 28, 2006, 4:27:16 PM2/28/06
to
I have a separate program that operates on GDSII data.

llc

unread,
Feb 28, 2006, 4:27:34 PM2/28/06
to

Kholdoun TORKI

unread,
Mar 3, 2006, 2:55:00 PM3/3/06
to
In Virtuoso Layout the command is Design -> Hierarchy -> Tree ...
(you don't need to have this processed on the GDSII)

Unfortunatly, this menu Tree does not exist in Virtuoso Schematic.

======================
Kholdou...@imag.fr
http://cmp.imag.fr
======================

Dominic Duvarney

unread,
Mar 3, 2006, 3:29:16 PM3/3/06
to

I didn't have time to thouroughly check the output but I think this will do an accurate
count. It was correct for a schematic with a couple of levels of hierearchy and some
iterated instances.
The fucntion will print out the instance information as well as define a global
table called _schTreeTable that can be accessed outside the function.

procedure(getSchAllInstCnt(@optional (start geGetWindowCellView()) (firstTime t) (itInstCnt 1))
let((cells instSch cl cn startTime)
when(firstTime
startTime = getCurrentTime()
_schTreeTable = makeTable("tree" 0)
_schTreeTable[start~>cellName] = 1
)
cells = setof(x start~>instances x~>purpose == "cell" && x~>instTerms)
foreach(inst cells
cl = inst~>master~>lib~>name
cn = inst~>master~>cellName
_schTreeTable[cn] = _schTreeTable[cn] + itInstCnt*inst~>numInst
instSch = nil
when(ddGetObj(cl cn "schematic")
instSch = dbOpenCellViewByType(cl cn "schematic" nil "r"))
when(instSch getSchAllInstCountFromHier(instSch nil inst~>numInst*itInstCnt))
);foreach inst
when(firstTime
foreach(x _schTreeTable[?] printf("%L ------> %L\n" x _schTreeTable[x]))
printf("Instance count took %L seconds \n" compareTime( getCurrentTime() startTime))
)
t
); let
);procedure

Tim...@gmail.com

unread,
Mar 7, 2006, 8:55:43 AM3/7/06
to
Hi Dominic,

Thanks for posting the skill but the getSchAllInstCountFromHier()
procedure is missing.

Tim

Dominic Duvarney

unread,
Mar 7, 2006, 9:44:57 AM3/7/06
to
My apologies Tim, I renamed the function to shorten the name but missed the call
to itself in the procedure. getSchAllInstCountFromHier() should be getSchAllInstCnt().


procedure(getSchAllInstCnt(@optional (start geGetWindowCellView()) (firstTime t) (itInstCnt 1))
let((cells instSch cl cn startTime)
when(firstTime
startTime = getCurrentTime()
_schTreeTable = makeTable("tree" 0)
_schTreeTable[start~>cellName] = 1
)
cells = setof(x start~>instances x~>purpose == "cell" && x~>instTerms)
foreach(inst cells
cl = inst~>master~>lib~>name
cn = inst~>master~>cellName
_schTreeTable[cn] = _schTreeTable[cn] + itInstCnt*inst~>numInst
instSch = nil
when(ddGetObj(cl cn "schematic") instSch = dbOpenCellViewByType(cl cn
"schematic" nil "r"))

when(instSch getSchAllInstCnt( instSch nil inst~>numInst*itInstCnt))


);foreach inst
when(firstTime
foreach(x _schTreeTable[?] printf("%L ------> %L\n" x _schTreeTable[x]))
printf("Instance count took %L seconds \n" compareTime( getCurrentTime() startTime))
)
t
); let
);procedure

Tim...@gmail.com

unread,
Mar 7, 2006, 3:02:34 PM3/7/06
to
Thanks Dominic!

That worked great.

Tim

Jimka

unread,
Mar 10, 2006, 2:17:13 AM3/10/06
to
What would you like to do with arrayed instances
and mfactors? If you are happy treating such instances
as simple instances, and you only want to look in schematic cellviews
and you want to look to the bottom of the hierarhy with no special
stopping
special cases you could do something like the following.

untested

;; call a given function on all instances found in a schematic
hierarchy
(defun traverse (d_cv u_fun)
(foreach d_inst d_cv~>instances
(funcall u_fun d_inst)
(when (ddGetObj d_inst~>libName d_inst~>cellName "schematic")
(traverse (dbOpenCellViewByType d_inst~>libName
d_inst~>cellName
"schematic"
nil
"r")))))

(inScheme
;; build a hash table which counts all instances in a schematic
hierarchy.
;; and finally print out a report of the hierarchy
(defun count_instances (@optional (d_cv (geGetEditCellView)))
(let ((hash (makeTable 'count 0)))
(traverse d_cv
(lambda (inst)
hash[(list inst~>libName inst~>cellName)] = 1 + hash[(list
inst~>libName inst~>cellName)]))
(foreach key hash
(printf "%d: %L\n" key)))))

kiranku...@gmail.com

unread,
May 8, 2019, 11:30:27 AM5/8/19
to
can u tell me what is @optional firstTime t) (itInstCnt 1) and its value
0 new messages