Product Documentation
Virtuoso Schematic Editor SKILL Functions Reference
Product Version IC23.1, November 2023

schTraceNet

schTraceNet(
?topCellView td_topCellView
?net td_net
[ ?viewList t_viewList ]
[ ?hierPath lt_hierPath ]
?traceCB su_traceCB
)
=> t / nil

Description

Traces a schematic hierarchical net through the design hierarchy and calls a user-defined callback at each level of the hierarchy where the net is present. The user-defined callback is passed as an argument, a user type describing the occurrence of the net being traced at a specific location in the design hierarchy.

To find out how to use the SKILL schTraceNet to calculate the connected area of a net, see Probing and Calculating the Area of a Net.

Arguments

?topCellView td_topCellView

The design cellview to be searched within. The cellview can be specified by database ID ?topCellView(db:0x1ce0bc9c) or ?topCellView ("libName" "cellName" "viewName").

"viewName" can refer to a Virtuoso config view.

?net td_net

The net to be traced. Specify the database ID or a string; for example, "net07".

?viewList t_viewList

A list of view names to be searched within.

For example, "schematic symbol".

?hierPath lt_hierPath

The hierarchical path to the master cellview, specified either as a string or a list:

"/I2/I0/I1/I0"

((db:0x1ce0bc9c 0 0 0)
(db:0x1ce0ba9a 0 0 0)
(db:0x1ce06d1b 0 0 0)
(db:0x1ce0b19a 0 0 0)
)

?traceCB su_traceCB

A user-defined callback that is called when a net is found during hierarchy traversal. It is specified using either a symbol representing the user specified callback or a lambda function:
lambda( (netStruct) info("%s\n" netStruct->netName ).

The netStruct is a user type with the following content: pathToNet, netName, hierPath, and net.

All instances are traced, including ignored instances that are not displayed in the Navigator.

Value Returned

t

The net was successfully traced.

nil

The net trace failed. This can be due to it missing the cellview, missing the net, no hierarchy to traverse.

Examples

In the following example, the callback TraceNetCB is predefined to return the name, length, and width of each instance encountered during the trace.

defun( TraceNetCB (netStruct)
    let( ( inst (insts makeTable("visited" nil) ) )
        foreach(instTerm netStruct->net~>allInstTerms
            inst = instTerm~>inst
            unless(insts[inst]
                insts[inst] = t
                when(inst~>w &&inst~>l
                  info("Instance: %s  length: %s width: %s\n" \
strcat(netStruct->pathToNet "/" inst~>name) \
inst~>w inst~>l)
                )
            )
        ) 
    )
)

The schTraceNet call below traces schematic net ‘avss’ through the design hierarchy and calls the callback TraceNetCB at each level where the net is found.

schTraceNet(?topCellView cv ?net "avss" ?traceCB 'TraceNetCB)

It uses the lambda function u_traceCB which uses the predefined netStruct as lambda( (netStruct) info("%s\n" netStruct->netName ). This uses SKILL and contains the following fields: pathToNet, netName (strings) and hierPath and net.

Results similar to the following are returned:

Instance: /I1/m9  length: 2.5 width: 3.5
Instance: /I1/m7  length: 2.5 width: 3.5
Instance: /I1/m5  length: 2.5 width: 3.5
Instance: /I1/m3  length: 2.5 width: 3.5
Instance: /I1/m1  length: 2.5 width: 3.5

Related Topics

Probing and Calculating the Area of a Net

geGetInstHierPath

geGetInstHier


Return to top
 ⠀
X