edu.byu.ece.edif.tools.replicate.nmr.xilinx
Class XilinxDeviceUtilizationTracker

java.lang.Object
  extended by edu.byu.ece.edif.tools.replicate.nmr.AbstractDeviceUtilizationTracker
      extended by edu.byu.ece.edif.tools.replicate.nmr.xilinx.XilinxDeviceUtilizationTracker
All Implemented Interfaces:
DeviceUtilizationTracker
Direct Known Subclasses:
XilinxVirtex4DeviceUtilizationTracker, XilinxVirtexDeviceUtilizationTracker, XilinxVirtexIIDeviceUtilizationTracker, XilinxVirtexIIProDeviceUtilizationTracker

public abstract class XilinxDeviceUtilizationTracker
extends AbstractDeviceUtilizationTracker

An abstract implementation of a Xilinx device utilization tracker.

Version:
$Id: XilinxDeviceUtilizationTracker.java 151 2008-04-02 16:27:55Z jamesfcarroll $
Author:
Keith Morgan

Field Summary
protected  double _desiredUtilizationFactor
          This factor scales the total max utilization ratio.
protected  boolean _ignoreEstimatedStops
           
protected  boolean _ignoreHardStops
           
protected  int _maxLogicBlocks
          This is the number of logic blocks contained in the device, a logic block consisting of one LUT and one FF.
protected  double _mergeFactor
          This factor scales the number of LUTs and FFs which will share a logic block
private  int _numVoters
          Keep track of the number of voters added.
protected  double _optimizationFactor
          This factor scales the number of logic blocks used by LUTs and FFs (to account for logic minimization)
protected static java.lang.String BF957_PACKAGE
           
protected static java.lang.String BG256_PACKAGE
           
protected static java.lang.String BG352_PACKAGE
           
protected static java.lang.String BG432_PACKAGE
           
protected static java.lang.String BG560_PACKAGE
           
protected static java.lang.String BG575_PACKAGE
           
protected static java.lang.String BG728_PACKAGE
           
protected static java.lang.String CS144_PACKAGE
           
static double DEFAULT_DESIRED_UTILIZATION_FACTOR
          The default desired utilization factor
static double DEFAULT_MERGE_FACTOR
          The default merge factor
static double DEFAULT_OPTIMIZATION_FACTOR
          The default optimization factor
protected static java.lang.String FF1148_PACKAGE
           
protected static java.lang.String FF1152_PACKAGE
           
protected static java.lang.String FF1513_PACKAGE
           
protected static java.lang.String FF1517_PACKAGE
           
protected static java.lang.String FF1696_PACKAGE
           
protected static java.lang.String FF1704_PACKAGE
           
protected static java.lang.String FF668_PACKAGE
           
protected static java.lang.String FF672_PACKAGE
           
protected static java.lang.String FF676_PACKAGE
           
protected static java.lang.String FF896_PACKAGE
           
protected static java.lang.String FFG1148_PACKAGE
           
protected static java.lang.String FFG1152_PACKAGE
           
protected static java.lang.String FFG1513_PACKAGE
           
protected static java.lang.String FFG1517_PACKAGE
           
protected static java.lang.String FFG668_PACKAGE
           
protected static java.lang.String FFG672_PACKAGE
           
protected static java.lang.String FFG676_PACKAGE
           
protected static java.lang.String FG256_PACKAGE
           
protected static java.lang.String FG456_PACKAGE
           
protected static java.lang.String FG676_PACKAGE
           
protected static java.lang.String FG680_PACKAGE
           
protected static java.lang.String HQ240_PACKAGE
           
protected static java.lang.String PQ240_PACKAGE
           
protected static java.lang.String SF363_PACKAGE
           
protected static java.lang.String SFG363_PACKAGE
           
protected static java.lang.String TQ144_PACKAGE
           
 
Fields inherited from class edu.byu.ece.edif.tools.replicate.nmr.AbstractDeviceUtilizationTracker
_cachedCurrentUtilizationMap, _currentUtilizationMap, _maxUtilizationMap, _numInstances, _origNumInstances, _resourceMapper, coverage_factor
 
Constructor Summary
XilinxDeviceUtilizationTracker(double mergeFactor, double optimizationFactor, double desiredUtilizationFactor)
           
 
Method Summary
protected  void _init(EdifCell cell)
           
 void decrementResourceCount(java.lang.String resourceType)
          Decrements the utilization of the cell-type of the parameter eci.
 double getDesiredUtilizationFactor()
           
 double getEstimatedLogicBlockUtilization()
          Estimates the logic block utilization of the current design.
 double getEstimatedLogicBlockUtilizationRatio()
           
protected  int getMaxLogicBlocks()
          This assumes that the number of logic blocks (LUT-FF pairs) is equal to the number of LUTs.
 double getMergeFactor()
          The merge factor is a scaler which tries to estimate the percentage of Flip-Flops and LUTs which can share a logic block.
 double getOptimizationFactor()
          The optimization factor is a scaler which tries to estimate the percentage of logic blocks which will be optimized away.
 void ignoreHardResourceUtilizationLimits()
          Causes this DeviceUtilizationTracker to ignore all hard resource limits
 void ignoreSoftLogicUtilizationLimit()
          Causes this DeviceUtilizationTracker to ignore the soft logic utilization limit
 void incrementResourceCount(java.lang.String resourceType)
          Increments the utilization of the cell-type parameter resourceType.
 void setDesiredUtilizationFactor(double desiredUtilizationFactor)
          TODO: Check to make sure we aren't setting the utilization factor too low.
 java.lang.String toString()
           
 
Methods inherited from class edu.byu.ece.edif.tools.replicate.nmr.AbstractDeviceUtilizationTracker
addResourceForTracking, addSingleCell, addSingleInstance, addSingleInstances, cacheCurrentUtilization, getResourceLimit, getResourceLimit, getResourceLimit, getResourceUtilization, getResourceUtilization, getResourceUtilization, getResourceUtilizationRatio, getResourceUtilizationRatio, getResourceUtilizationRatio, nmrCell, nmrInstance, nmrInstancesAsManyAsPossible, nmrInstancesAtomic, removeNMRInstance, removeNMRInstances, removeSingleInstance, removeSingleInstances, restoreCurrentUtilization, setDesiredCoverageFactor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_desiredUtilizationFactor

protected double _desiredUtilizationFactor
This factor scales the total max utilization ratio. For example if a user wants to only utilize 75% of the chip, they would specify this factor to be 0.75


_maxLogicBlocks

protected int _maxLogicBlocks
This is the number of logic blocks contained in the device, a logic block consisting of one LUT and one FF.


_mergeFactor

protected double _mergeFactor
This factor scales the number of LUTs and FFs which will share a logic block


_optimizationFactor

protected double _optimizationFactor
This factor scales the number of logic blocks used by LUTs and FFs (to account for logic minimization)


BF957_PACKAGE

protected static final java.lang.String BF957_PACKAGE
See Also:
Constant Field Values

BG256_PACKAGE

protected static final java.lang.String BG256_PACKAGE
See Also:
Constant Field Values

BG352_PACKAGE

protected static final java.lang.String BG352_PACKAGE
See Also:
Constant Field Values

BG432_PACKAGE

protected static final java.lang.String BG432_PACKAGE
See Also:
Constant Field Values

BG560_PACKAGE

protected static final java.lang.String BG560_PACKAGE
See Also:
Constant Field Values

BG575_PACKAGE

protected static final java.lang.String BG575_PACKAGE
See Also:
Constant Field Values

BG728_PACKAGE

protected static final java.lang.String BG728_PACKAGE
See Also:
Constant Field Values

CS144_PACKAGE

protected static final java.lang.String CS144_PACKAGE
See Also:
Constant Field Values

FF672_PACKAGE

protected static final java.lang.String FF672_PACKAGE
See Also:
Constant Field Values

FF896_PACKAGE

protected static final java.lang.String FF896_PACKAGE
See Also:
Constant Field Values

FF1148_PACKAGE

protected static final java.lang.String FF1148_PACKAGE
See Also:
Constant Field Values

FF1152_PACKAGE

protected static final java.lang.String FF1152_PACKAGE
See Also:
Constant Field Values

FF1517_PACKAGE

protected static final java.lang.String FF1517_PACKAGE
See Also:
Constant Field Values

FF1696_PACKAGE

protected static final java.lang.String FF1696_PACKAGE
See Also:
Constant Field Values

FF1704_PACKAGE

protected static final java.lang.String FF1704_PACKAGE
See Also:
Constant Field Values

FG256_PACKAGE

protected static final java.lang.String FG256_PACKAGE
See Also:
Constant Field Values

FG456_PACKAGE

protected static final java.lang.String FG456_PACKAGE
See Also:
Constant Field Values

FG676_PACKAGE

protected static final java.lang.String FG676_PACKAGE
See Also:
Constant Field Values

FG680_PACKAGE

protected static final java.lang.String FG680_PACKAGE
See Also:
Constant Field Values

HQ240_PACKAGE

protected static final java.lang.String HQ240_PACKAGE
See Also:
Constant Field Values

PQ240_PACKAGE

protected static final java.lang.String PQ240_PACKAGE
See Also:
Constant Field Values

TQ144_PACKAGE

protected static final java.lang.String TQ144_PACKAGE
See Also:
Constant Field Values

SF363_PACKAGE

protected static final java.lang.String SF363_PACKAGE
See Also:
Constant Field Values

FF668_PACKAGE

protected static final java.lang.String FF668_PACKAGE
See Also:
Constant Field Values

FF676_PACKAGE

protected static final java.lang.String FF676_PACKAGE
See Also:
Constant Field Values

FF1513_PACKAGE

protected static final java.lang.String FF1513_PACKAGE
See Also:
Constant Field Values

SFG363_PACKAGE

protected static final java.lang.String SFG363_PACKAGE
See Also:
Constant Field Values

FFG668_PACKAGE

protected static final java.lang.String FFG668_PACKAGE
See Also:
Constant Field Values

FFG672_PACKAGE

protected static final java.lang.String FFG672_PACKAGE
See Also:
Constant Field Values

FFG676_PACKAGE

protected static final java.lang.String FFG676_PACKAGE
See Also:
Constant Field Values

FFG1148_PACKAGE

protected static final java.lang.String FFG1148_PACKAGE
See Also:
Constant Field Values

FFG1152_PACKAGE

protected static final java.lang.String FFG1152_PACKAGE
See Also:
Constant Field Values

FFG1513_PACKAGE

protected static final java.lang.String FFG1513_PACKAGE
See Also:
Constant Field Values

FFG1517_PACKAGE

protected static final java.lang.String FFG1517_PACKAGE
See Also:
Constant Field Values

_numVoters

private int _numVoters
Keep track of the number of voters added.


_ignoreEstimatedStops

protected boolean _ignoreEstimatedStops

_ignoreHardStops

protected boolean _ignoreHardStops

DEFAULT_MERGE_FACTOR

public static final double DEFAULT_MERGE_FACTOR
The default merge factor

See Also:
Constant Field Values

DEFAULT_OPTIMIZATION_FACTOR

public static final double DEFAULT_OPTIMIZATION_FACTOR
The default optimization factor

See Also:
Constant Field Values

DEFAULT_DESIRED_UTILIZATION_FACTOR

public static final double DEFAULT_DESIRED_UTILIZATION_FACTOR
The default desired utilization factor

See Also:
Constant Field Values
Constructor Detail

XilinxDeviceUtilizationTracker

public XilinxDeviceUtilizationTracker(double mergeFactor,
                                      double optimizationFactor,
                                      double desiredUtilizationFactor)
Method Detail

decrementResourceCount

public void decrementResourceCount(java.lang.String resourceType)
                            throws UnsupportedResourceTypeException
Decrements the utilization of the cell-type of the parameter eci.

Throws:
UnsupportedResourceTypeException

getDesiredUtilizationFactor

public double getDesiredUtilizationFactor()

getEstimatedLogicBlockUtilization

public double getEstimatedLogicBlockUtilization()
Estimates the logic block utilization of the current design.
The equation is as follows:
Estimate = optimizationFactor*(utilizedFFs + utilizedLUTs - mergeFactor * utilizedFFs);
Derivation:
Let A represent the total number of FF's, B represent the number of logic blocks in which FF's and LUTs are combined, and C represent the total number of LUTs. Then
total FF's = (A + B)
total LUTs = (B + C)
total logic blocks = (A + B + C)
We define mergeFactor to be
mergeFactor = (mergeable flipflops) / (total FF's)
so
mergeFactor = B / (A + B)
and
B = mergeFactor * (A + B)
Note that
(A + B + C) = (A + B) + (B + C) - B
Substitute B to get
(A + B + C) = (A + B) + (B + C) - mergeFactor * (A + B)
Thus the total number of logic blocks (without taking into account optimization) is given by the following equation:
total logic blocks = FF's + LUTs - mergeFactor * FF's
We define optimizationFactor to be the number of logic blocks after optimization divided by the number of logic blocks before optimization. So the final equation for the total number of logic blocks is as follows:
Estimate = optimizationFactor * (FF's + LUTs - mergeFactor * FF's)
If you need to calculate a custom mergeFactor for a specific design, use the following equation:
mergeFactor = (FF's + LUTs - 2 * slices) / FF's

Returns:
Logic block utilization estimate.
See Also:
getMergeFactor(), getOptimizationFactor()

getEstimatedLogicBlockUtilizationRatio

public double getEstimatedLogicBlockUtilizationRatio()

getMergeFactor

public double getMergeFactor()
The merge factor is a scaler which tries to estimate the percentage of Flip-Flops and LUTs which can share a logic block.

Returns:
The merge scale factor.

getOptimizationFactor

public double getOptimizationFactor()
The optimization factor is a scaler which tries to estimate the percentage of logic blocks which will be optimized away.

Returns:
The optimization scale factor.

ignoreSoftLogicUtilizationLimit

public void ignoreSoftLogicUtilizationLimit()
Causes this DeviceUtilizationTracker to ignore the soft logic utilization limit


ignoreHardResourceUtilizationLimits

public void ignoreHardResourceUtilizationLimits()
Causes this DeviceUtilizationTracker to ignore all hard resource limits


incrementResourceCount

public void incrementResourceCount(java.lang.String resourceType)
                            throws OverutilizationEstimatedStopException,
                                   OverutilizationHardStopException,
                                   UnsupportedResourceTypeException
Increments the utilization of the cell-type parameter resourceType.

Throws:
OverutilizationEstimatedStopException
OverutilizationHardStopException
UnsupportedResourceTypeException

toString

public java.lang.String toString()
Specified by:
toString in interface DeviceUtilizationTracker
Overrides:
toString in class AbstractDeviceUtilizationTracker

setDesiredUtilizationFactor

public void setDesiredUtilizationFactor(double desiredUtilizationFactor)
TODO: Check to make sure we aren't setting the utilization factor too low.

Parameters:
desiredUtilizationFactor -

_init

protected void _init(EdifCell cell)
              throws OverutilizationEstimatedStopException,
                     OverutilizationHardStopException
Overrides:
_init in class AbstractDeviceUtilizationTracker
Throws:
OverutilizationEstimatedStopException
OverutilizationHardStopException

getMaxLogicBlocks

protected int getMaxLogicBlocks()
This assumes that the number of logic blocks (LUT-FF pairs) is equal to the number of LUTs.