edu.byu.ece.edif.tools.replicate.nmr
Class NMRUtilities

java.lang.Object
  extended by edu.byu.ece.edif.tools.replicate.nmr.NMRUtilities

public abstract class NMRUtilities
extends java.lang.Object

Utilities common to all types of replication (NMR)

Author:
James Carroll

Nested Class Summary
static class NMRUtilities.UtilizationFactor
          Valid utilization factor types.
 
Field Summary
private static boolean debug
          Use to enable or disable debugging print statements
static java.lang.String DEFAULT_FACTOR_VALUE
           
static NMRUtilities.UtilizationFactor DEFAULT_UTILIZATION_FACTOR
          The default utilization factor to use if omitted by the user.
static java.lang.String[] EDIF_SUFFIXES
          Typical suffixes for EDIF files.
static long PRECISION_FACTOR
          Used to increase precision of step size in Multiple EDIF Creation.
static java.lang.String[] SLAAC1V_PORTS_NOT_TO_REPLICATE
          Set of ports that should not be triplicated, specific to the BYU SLAAC board.
static java.lang.String VIRTEX
           
static java.lang.String VIRTEX2
           
static java.lang.String VIRTEX2PRO
           
static java.lang.String VIRTEX4
           
 
Constructor Summary
NMRUtilities()
           
 
Method Summary
protected static boolean cellHasInoutPorts(EdifCell cell)
          Determine if the EdifCell contains any in-out ports.
static java.io.PrintStream createLogFile(java.lang.String filename)
          Create a log file If the file cannot be created, for whatever reason, the exception is caught, printed, and the program will terminate.
static void createOutputFile(java.lang.String filename, EdifCell cell)
          Write the EdifEnvironment corresponding to the given EdifCell to the given filename.
static FlattenedEdifCell flattenCell(EdifCell origCell, java.io.PrintStream out)
          Creates a flattened cell and prints out design flattening information.
static java.util.Set<EdifCellInstance> getPortBufs(java.util.Collection<EdifPort> ports, EdifCellInstanceGraph graph)
          Return the Set of BUF instances that are associated with this Collection of EdifPorts.
static java.util.Collection<EdifPortRef> getPortRefsToCutFromEdges(java.util.Collection<Edge> cutSet, EdifCellInstanceGraph graph, NMRArchitecture nmrArch)
           
static java.lang.String getVerboseUtilizationFactor(NMRUtilities.UtilizationFactor factor)
          Return the verbose equivalent of the given NMRUtilities.UtilizationFactor.
static java.lang.String msToString(long milliseconds)
           
static java.lang.String removeEdifSuffixes(java.lang.String s)
          Remove any of the typical suffixes for EDIF files, if present.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_UTILIZATION_FACTOR

public static final NMRUtilities.UtilizationFactor DEFAULT_UTILIZATION_FACTOR
The default utilization factor to use if omitted by the user. Currently, this is NMRUtilities.UtilizationFactor.ASUF, but this could change in the future.


PRECISION_FACTOR

public static final long PRECISION_FACTOR
Used to increase precision of step size in Multiple EDIF Creation.

See Also:
Constant Field Values

SLAAC1V_PORTS_NOT_TO_REPLICATE

public static final java.lang.String[] SLAAC1V_PORTS_NOT_TO_REPLICATE
Set of ports that should not be triplicated, specific to the BYU SLAAC board.


VIRTEX

public static final java.lang.String VIRTEX
See Also:
Constant Field Values

VIRTEX2

public static final java.lang.String VIRTEX2
See Also:
Constant Field Values

VIRTEX2PRO

public static final java.lang.String VIRTEX2PRO
See Also:
Constant Field Values

VIRTEX4

public static final java.lang.String VIRTEX4
See Also:
Constant Field Values

debug

private static boolean debug
Use to enable or disable debugging print statements


DEFAULT_FACTOR_VALUE

public static final java.lang.String DEFAULT_FACTOR_VALUE
See Also:
Constant Field Values

EDIF_SUFFIXES

public static final java.lang.String[] EDIF_SUFFIXES
Typical suffixes for EDIF files.

Constructor Detail

NMRUtilities

public NMRUtilities()
Method Detail

getPortBufs

public static java.util.Set<EdifCellInstance> getPortBufs(java.util.Collection<EdifPort> ports,
                                                          EdifCellInstanceGraph graph)
Return the Set of BUF instances that are associated with this Collection of EdifPorts. NOTE: This method is currently Xilinx-specific

Parameters:
ports - The Collection of EdifPort objects
graph - The EdifCellInstanceGraph graph
Returns:
the Set of BUF instances that are associated with this Collection of EdifPorts.

cellHasInoutPorts

protected static boolean cellHasInoutPorts(EdifCell cell)
Determine if the EdifCell contains any in-out ports.

Parameters:
cell - The EdifCell
Returns:
true if any of the EdifPort objects in the EdifCell is an in-out port.

flattenCell

public static FlattenedEdifCell flattenCell(EdifCell origCell,
                                            java.io.PrintStream out)
Creates a flattened cell and prints out design flattening information.

Parameters:
origCell - The original, un-flattened EdifCell.
out - A PrintStream to which a summary of the flattened cell will be printed.
Returns:
The flattened EdifCell.
See Also:
FlattenedEdifCell

removeEdifSuffixes

public static java.lang.String removeEdifSuffixes(java.lang.String s)
Remove any of the typical suffixes for EDIF files, if present. The original String object is not modified.

Parameters:
s - The given String
Returns:
The modified String.
See Also:
EDIF_SUFFIXES

createOutputFile

public static void createOutputFile(java.lang.String filename,
                                    EdifCell cell)
Write the EdifEnvironment corresponding to the given EdifCell to the given filename. If any exceptions are thrown, they are printed and the program exits.

Parameters:
filename - The filename
cell - The EdifCell

getVerboseUtilizationFactor

public static java.lang.String getVerboseUtilizationFactor(NMRUtilities.UtilizationFactor factor)
Return the verbose equivalent of the given NMRUtilities.UtilizationFactor.

Parameters:
factor - The UtilizationFactor
Returns:
the verbose equivalent of the given NMRUtilities.UtilizationFactor.

msToString

public static java.lang.String msToString(long milliseconds)

createLogFile

public static java.io.PrintStream createLogFile(java.lang.String filename)
Create a log file If the file cannot be created, for whatever reason, the exception is caught, printed, and the program will terminate.

Parameters:
filename - The path and filename of the desired log file.
Returns:
A PrintStream for the logfile

getPortRefsToCutFromEdges

public static java.util.Collection<EdifPortRef> getPortRefsToCutFromEdges(java.util.Collection<Edge> cutSet,
                                                                          EdifCellInstanceGraph graph,
                                                                          NMRArchitecture nmrArch)
Parameters:
cutSet -
portRefsToCut -