edu.byu.ece.edif.core
Class EdifUtils

java.lang.Object
  extended by edu.byu.ece.edif.core.EdifUtils

public class EdifUtils
extends java.lang.Object

Contains a collection of static utility methods. These methods will likely be moved to other classes and packages as their usefulness is better understood.

Version:
$Id:EdifUtils.java 198 2008-04-16 21:14:21Z jamesfcarroll $

Constructor Summary
EdifUtils()
           
 
Method Summary
static int countPortRefs(EdifCell cell, boolean primsOnly)
          Count the number of EdifPortRefs in the cell.
static int countRecursiveNets(EdifCell cell)
          Count the number of nets in the EdifCell.
static int countRecursivePrimitives(EdifCell cell)
          Count the number of leaf cells in the EdifCell.
static java.util.Map getUniqueInstanceTypes(EdifCell cell, java.util.Map map)
          Return a Map of all unique instance types found within the given EdifCell object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EdifUtils

public EdifUtils()
Method Detail

countPortRefs

public static int countPortRefs(EdifCell cell,
                                boolean primsOnly)
Count the number of EdifPortRefs in the cell. This method operates recursively and will call all hierarchical cells found within the top-level cell and add the count to the top-level.

Parameters:
cell -
primsOnly - If true, count only port refs that are connected to leaf-cells. If false, count all port refs.
Returns:
The number of recursive nets in the cell

countRecursiveNets

public static int countRecursiveNets(EdifCell cell)
Count the number of nets in the EdifCell. This method operates recursively and will call all hierarchical cells found within the top-level cell and add the count to the top-level.

Parameters:
cell -
Returns:
The number of recursive nets in the cell

countRecursivePrimitives

public static int countRecursivePrimitives(EdifCell cell)
Count the number of leaf cells in the EdifCell. This method operates recursively and will call all hierarchical cells found within the top-level cell and add the count to the top-level.

Parameters:
cell -
Returns:
The number of recursive leaf-cells

getUniqueInstanceTypes

public static java.util.Map getUniqueInstanceTypes(EdifCell cell,
                                                   java.util.Map map)
Return a Map of all unique instance types found within the given EdifCell object. The key of this Map is an EdifCell representing a "type" of an instance within the given top-level cell. The value of this Map is a Collection of EdifCellInstance objects that instance this type in the cell.

Parameters:
cell - The EdifCell to investigate
map - A Map object to add the entries to. If this is null, a new Map will be created. This parameter is used to allow recursive calling of this method.