Hints, Tips and Solutions

Q: I have some trouble counting the number of in-stances in a layout using Expert. I have tried to use the Chip Rover feature, but it does not give the right answer. I have the same cell instanced repeatedly in an array. What is the procedure for counting the number of occurrences of an instance in a top cell?

A: The Chip Rover>>Active Cell Tree shows the number of instances and arrays in the current cell. To see the number of instances in each array, expand the tree as in Figure 1. If there are arrays in it, multiply number of rows by number of columns to get cell count within the array.

Figure 1. There are 9 instances of mux1
in the current cell ( [2,4] = 8 instances )


The Edit>>Search command allows to find all cell instances and arrays in the Cell Hierarchy. To calculate the number of instance’s occurring in a cell, check the number of rows and columns for each found object.

Figure 2. Counting the number
of instances, using Search


For complex cell hierarchy or if this operation is frequently performed, it would be more efficient to use LISA script to automate the routine as shown below:

listCells = “”;

aCellNames = get_cell_list(“”);

nCountCells = aCellNames.size;

i = 1;


IF (i GTR nCountCells) THEN (LEAVE LOOP);

$$objs = (find objects (SEARCH_INSTANCE)

/criteria = ({search_criterion_create(OA_CELL, aCellNames[i], EQ)})


IF ($$objs.size GTR 0) THEN BEGIN

IF (listCells EQL “”) THEN ( listCells = (aCellNames[i]) )

ELSE ( listCells = listCells & “\t” & (aCellNames[i]) );


i = i + 1;


varparams = {{listCells, “Instance of cell”}};

dlgparams = {“Instance count”};

vars = form_create(varparams, dlgparams);

if (vars.size GTR 0) THEN BEGIN


$$objs = (find objects (SEARCH_INSTANCE)

/criteria = ({search_criterion_create(OA_CELL, vars[1], EQ)})


len = $$objs.size;


$$cur_obj = $$objs.first;

count = 0;


IF ($$cur_obj EQL nil) THEN (LEAVE LOOP);

display($$cur_obj.shape & “(“&&$$cur_obj.cols & “, “ & $$cur_obj.rows&”)”);

count = count + $$cur_obj.cols * $$cur_obj.rows;

$$cur_obj = $$objs.next;


display(count); ! Display count or write to file



Download pdf Version