How to count instances in a hierarchy

S

spectrallypure

Guest
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.
 
On 18 Feb 2006 08:27:47 -0800, "spectrallypure" <jorgelagos@gmail.com> wrote:

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.
 
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)))))
 
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@imag.fr
http://cmp.imag.fr
======================

llc wrote:

I have a separate program that operates on GDSII data.
 
Hi Dominic,

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

Tim
 
spectrallypure wrote:
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
 
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@gmail.com wrote:
Hi Dominic,

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

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

Welcome to EDABoard.com

Sponsor

Back
Top