EDAboard.com | EDAboard.de | EDAboard.co.uk | WTWH Media

How to count instances in a hierarchy

Ask a question - edaboard.com

elektroda.net NewsGroups Forum Index - Cadence - How to count instances in a hierarchy

spectrallypure
Guest

Sat Feb 18, 2006 4:27 pm   



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
Guest

Tue Feb 21, 2006 6:55 am   



On 18 Feb 2006 08:27:47 -0800, "spectrallypure" <jorgelagos_at_gmail.com> wrote:

Quote:
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.

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
Guest

Tue Feb 28, 2006 9:27 pm   



I have a separate program that operates on GDSII data.

llc
Guest

Tue Feb 28, 2006 9:27 pm   



I have a separate program that operates on GDSII data.

Dominic Duvarney
Guest

Fri Mar 03, 2006 9:29 pm   



spectrallypure wrote:
Quote:
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.


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

Kholdoun TORKI
Guest

Fri Mar 03, 2006 9:55 pm   



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.

======================
Kholdoun.Torki_at_imag.fr
http://cmp.imag.fr
======================

llc wrote:

Quote:
I have a separate program that operates on GDSII data.


Dominic Duvarney
Guest

Tue Mar 07, 2006 3:44 pm   



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


TimRoy1_at_gmail.com wrote:
Quote:
Hi Dominic,

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

Tim



Guest

Tue Mar 07, 2006 3:55 pm   



Hi Dominic,

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

Tim


Guest

Tue Mar 07, 2006 8:02 pm   



Thanks Dominic!

That worked great.

Tim

Jimka
Guest

Fri Mar 10, 2006 7:17 am   



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)))))


Guest

Wed May 08, 2019 4:45 pm   



On Tuesday, March 7, 2006 at 8:14:57 PM UTC+5:30, Dominic Duvarney wrote:
Quote:
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


TimRoy1_at_gmail.com wrote:
Hi Dominic,

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

Tim



procedure(getSchAllInstCnt(@optional (start geGetWindowCellView()) (firstTime t) (itInstCnt 1))
can u tell me what is @optional firstTime t) (itInstCnt 1) and its value

elektroda.net NewsGroups Forum Index - Cadence - How to count instances in a hierarchy

Ask a question - edaboard.com

Arabic version Bulgarian version Catalan version Czech version Danish version German version Greek version English version Spanish version Finnish version French version Hindi version Croatian version Indonesian version Italian version Hebrew version Japanese version Korean version Lithuanian version Latvian version Dutch version Norwegian version Polish version Portuguese version Romanian version Russian version Slovak version Slovenian version Serbian version Swedish version Tagalog version Ukrainian version Vietnamese version Chinese version Turkish version
EDAboard.com map