$db htree

This command provides access to the hierarchical tree information of the current database.

$db htree foreachClass

This command iterates over all hierarchical children of the given startOid. This loop iterates only over the first instance of a module and ignores all instantiations beginning at the second instantiation.


Usage:

htree foreachClass startOid child type cellName instName body


Parameters:

startOid

The given startOid can be empty, a module OID or a inst OID of a module. If it is an inst oid, then the referenced module of the instance is used. If startOid is empty only the top modules are unrolled.

child

The loop variable "child" is set to module oids or to inst oids (whatever this foreachClass function decides - to get highest speed).

type

The loop variable type can be encoded bitwise, where x means don’t care:

Value Description

x0

current child is node

x1

current child is leave

0x

current child no brothers

1x

current child has brothers

cellName

The loop variable is set to cell name of the current child node.

instName

The loop variable is set to instance name of the child (leader of instance group). Empty if startOid is empty.

body

Executed body for each child.


Example:

set startOid {module top top}
$db htree foreachClass $startOid child type cellName instName {}

$db htree foreachInst

Iterate over all instance names which have the same reference module as the given instance. Iterates only over the instances which are located in the same parent module as the start instance.


Usage:

htree foreachInst inst instName body


Parameters:

inst

Start instance.

instName

The members’s instance name.

body

Executed body for each instance.


Example:

$db htree foreachInst {inst top i1} instName {}

$db htree moduleOf

This command converts a node-id into a database object id (oid).


Usage:

htree moduleOf instance treeLeadName


Parameters:

instance

If this parameter is empty or a module OID the function return the value without conversion.

treeLeadName

Name of the tree leader table.


Example:

$db htree moduleOf {inst top i1} {inst top i1}

$db htree foreachNode

The "foreachNode" gets a database oid and must return all node-ids on the way from lowest node (that maps to the given oid) up to the top node.


Usage:

htree foreachNode oid node instName body


Parameters:

oid

The given $oid (must be a module-oid) is translated into a set of node-ids. If $oid is a null-string, then we just return without an error.

node

The node as returned by foreachClass (as child).

instName

The members’s instance name.

body

Executed body for each node.


Example:

$db htree foreachNode oid node instName {}

$db htree portCount

Get the total number of external ports of the given module. The number is the sum of single bit ports which are not member of a bus and multi bit ports (portBuses).


Usage:

htree portCount module


Parameters:

module

The ports are counted in this module.


Example:

$db htree portCount {module top top}

$db htree portCountByDir

Count the single bit ports which are not member of a bus and multi bit ports and group the results by direction.


Usage:

htree portCountByDir module resultArray


Parameters:

module

The ports are counted in this module.

resultArray

Array where the results is stored.


Example:

array set portCount {}
$db htree portCountByDir {module top top} portCount

$db htree netCount

Count the single bit nets which are not member of a bus and multi bit nets in the given module. Ignore all auto generated nets.


Usage:

htree netCount module


Parameters:

module

The nets are counted in this module.


Example:

$db htree netCount {module top top}

$db htree instCount

Count the instances of modules and primitives in the given module.


Usage:

htree instCount module


Parameters:

module

The instances are counted in this module.


Example:

$db htree instCount {module top top}

$db htree clockCount

Count the number of clocked instances in the given module. Members of tree groups are ignored.


Usage:

htree clockCount module


Parameters:

module

The clocked instances are counted in this module.


Example:

$db htree clockCount {module top top}

$db htree operCount

Count the operator instances in the given module. Members of tree groups are ignored.


Usage:

htree operCount module


Parameters:

module

The operator instances are counted in this module.


Example:

$db htree operCount {module top top}

$db htree primCount

Count the primitive instances in the given module. Clocked primitives and operators are ignored.


Usage:

htree primCount module


Parameters:

module

The primitives instances are counted in this module.


Example:

$db htree primCount {module top top}

$db htree combinedCount

Get the detailed count of instances grouped by primitive, clocked and operator. Count all instances which tree group members separately. Returns tcl list with the order {primitiveCount clockedCount operatorCount groupCount}.


Usage:

htree combinedCount module


Parameters:

module

The primitives instances are counted in this module.


Example:

$db htree combinedCount {module top top}

$db htree brotherCount

Count all instances of the same type in the containing module of the given instance.


Usage:

htree brotherCount instance


Parameters:

instance

Reference instance.


Example:

$db htree brotherCount {inst top i1}