com.sun.electric.tool.simulation
Class Stimuli

java.lang.Object
  extended by com.sun.electric.tool.simulation.Stimuli

public class Stimuli
extends java.lang.Object

Class to define a set of simulation data. This class encapsulates all of the simulation data that is displayed in a waveform window. It includes the labels and values. It can handle digital, analog, and many variations (intervals, sweeps).


Field Summary
static int GATE_STRENGTH
           
static int LOGIC
           
static int LOGIC_HIGH
           
static int LOGIC_LOW
           
static int LOGIC_X
           
static int LOGIC_Z
           
static int NODE_STRENGTH
           
static int OFF_STRENGTH
           
static int STRENGTH
           
static int VDD_STRENGTH
           
 
Constructor Summary
Stimuli()
          Constructor to build a new Simulation Data object.
 
Method Summary
 void addAnalysis(Analysis an)
           
 void addControlPoint(Signal sig, double time)
          Method to add a new control point to the list on a signal.
 void clearControlPoints(Signal sig)
          Method to clear the list of control points associated with a signal.
static java.lang.String describeLevel(int state)
          Method to describe the level in a given state.
static java.lang.String describeLevelBriefly(int state)
          Method to describe the level in a given state, with only 1 character.
static java.lang.String describeStrength(int strength)
          Method to describe the strength in a given state.
 Analysis findAnalysis(Analysis.AnalysisType type)
          Method to find an Analysis of a given type.
 void finished()
          Free allocated resources before closing.
 java.util.Iterator<Analysis> getAnalyses()
           
 java.awt.geom.Rectangle2D getBounds()
          Method to compute the time and value bounds of this simulation data.
 Cell getCell()
          Method to return the Cell associated with this simulation data.
 java.lang.Double[] getControlPoints(Signal sig)
          Method to return an array of control points associated with a signal.
 FileType getDataType()
          Method to return the type of this simulation data.
 Engine getEngine()
          Method to return the simulation Engine associated with this simulation data.
 java.net.URL getFileURL()
          Method to return a URL to the file containing this simulation data.
 double getLeftEdge()
          Method to return the leftmost X coordinate of this Stimuli.
 int getNumAnalyses()
           
 double getRightEdge()
          Method to return the rightmost X coordinate of this Stimuli.
 char getSeparatorChar()
          Method to return the separator character for names in this simulation.
 WaveformWindow getWaveformWindow()
          Method to return the WaveformWindow that displays this simulation data.
static int indexToStrength(int index)
          Method to convert a strength index to a strength value.
 boolean isAnalog()
          Method to tell whether this simulation data is analog or digital.
static int parseLevel(java.lang.String s1)
          Method to convert a state representation (L, H, X, Z) to a state
 void removeControlPoint(Signal sig, double time)
          Method to remove control points the list on a signal.
 void setCell(Cell cell)
          Method to set the Cell associated with this simulation data.
 void setDataType(FileType type)
          Method to set the type of this simulation data.
 void setEngine(Engine engine)
          Method to set the simulation Engine associated with this simulation data.
 void setFileURL(java.net.URL fileURL)
          Method to set a URL to the file containing this simulation data.
 void setSeparatorChar(char sep)
          Method to set the separator character for names in this simulation.
 void setWaveformWindow(WaveformWindow ww)
           
static int strengthToIndex(int strength)
          Method to convert a strength to an index value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGIC

public static final int LOGIC
See Also:
Constant Field Values

LOGIC_LOW

public static final int LOGIC_LOW
See Also:
Constant Field Values

LOGIC_X

public static final int LOGIC_X
See Also:
Constant Field Values

LOGIC_HIGH

public static final int LOGIC_HIGH
See Also:
Constant Field Values

LOGIC_Z

public static final int LOGIC_Z
See Also:
Constant Field Values

STRENGTH

public static final int STRENGTH
See Also:
Constant Field Values

OFF_STRENGTH

public static final int OFF_STRENGTH
See Also:
Constant Field Values

NODE_STRENGTH

public static final int NODE_STRENGTH
See Also:
Constant Field Values

GATE_STRENGTH

public static final int GATE_STRENGTH
See Also:
Constant Field Values

VDD_STRENGTH

public static final int VDD_STRENGTH
See Also:
Constant Field Values
Constructor Detail

Stimuli

public Stimuli()
Constructor to build a new Simulation Data object.

Method Detail

finished

public void finished()
Free allocated resources before closing.


addAnalysis

public void addAnalysis(Analysis an)

findAnalysis

public Analysis findAnalysis(Analysis.AnalysisType type)
Method to find an Analysis of a given type.

Parameters:
type - the stimulus type being queried.
Returns:
the Analysis of that type (null if not found).

getNumAnalyses

public int getNumAnalyses()

getAnalyses

public java.util.Iterator<Analysis> getAnalyses()

setCell

public void setCell(Cell cell)
Method to set the Cell associated with this simulation data. The associated Cell is the top-level cell in the hierarchy, and is usually the Cell that was used to generate the simulation input deck.

Parameters:
cell - the Cell associated with this simulation data.

getCell

public Cell getCell()
Method to return the Cell associated with this simulation data. The associated Cell is the top-level cell in the hierarchy, and is usually the Cell that was used to generate the simulation input deck.

Returns:
the Cell associated with this simulation data.

setEngine

public void setEngine(Engine engine)
Method to set the simulation Engine associated with this simulation data. This is only for data associated with built-in simulators (ALS and IRSIM).

Parameters:
engine - the simulation Engine associated with this simulation data.

getEngine

public Engine getEngine()
Method to return the simulation Engine associated with this simulation data. This is only for data associated with built-in simulators (ALS and IRSIM).

Returns:
the simulation Engine associated with this simulation data.

setWaveformWindow

public void setWaveformWindow(WaveformWindow ww)

getSeparatorChar

public char getSeparatorChar()
Method to return the separator character for names in this simulation. The separator character separates levels of hierarchy. It is usually a "."

Returns:
the separator character for names in this simulation.

setSeparatorChar

public void setSeparatorChar(char sep)
Method to set the separator character for names in this simulation. The separator character separates levels of hierarchy. It is usually a "."

Parameters:
sep - the separator character for names in this simulation.

setDataType

public void setDataType(FileType type)
Method to set the type of this simulation data. Data types are file types, which are unique among the different simulation output formats. For example, OpenFile.Type.HSPICEOUT is the output of HSpice, whereas OpenFile.Type.SPICEOUT is the output of Spice3/GNUCap.

Parameters:
type - the type of this simulation data.

getDataType

public FileType getDataType()
Method to return the type of this simulation data. Data types are file types, which are unique among the different simulation output formats. For example, OpenFile.Type.HSPICEOUT is the output of HSpice, whereas OpenFile.Type.SPICEOUT is the output of Spice3/GNUCap.

Returns:
the type of this simulation data.

setFileURL

public void setFileURL(java.net.URL fileURL)
Method to set a URL to the file containing this simulation data.

Parameters:
fileURL - a URL to the file containing this simulation data.

getFileURL

public java.net.URL getFileURL()
Method to return a URL to the file containing this simulation data.

Returns:
a URL to the file containing this simulation data.

getWaveformWindow

public WaveformWindow getWaveformWindow()
Method to return the WaveformWindow that displays this simulation data.

Returns:
the WaveformWindow that displays this simulation data.

getControlPoints

public java.lang.Double[] getControlPoints(Signal sig)
Method to return an array of control points associated with a signal. Control points are places where the user has added stimuli to the signal (set a level or strength). These points can be selected for change of the stimuli.

Parameters:
sig - the signal in question.
Returns:
an array of times where there are control points. Null if no control points are defined.

clearControlPoints

public void clearControlPoints(Signal sig)
Method to clear the list of control points associated with a signal. Control points are places where the user has added stimuli to the signal (set a level or strength). These points can be selected for change of the stimuli.

Parameters:
sig - the signal to clear.

addControlPoint

public void addControlPoint(Signal sig,
                            double time)
Method to add a new control point to the list on a signal. Control points are places where the user has added stimuli to the signal (set a level or strength). These points can be selected for change of the stimuli.

Parameters:
sig - the signal in question.
time - the time of the new control point.

removeControlPoint

public void removeControlPoint(Signal sig,
                               double time)
Method to remove control points the list on a signal. Control points are places where the user has added stimuli to the signal (set a level or strength). These points can be selected for change of the stimuli.

Parameters:
sig - the signal in question.
time - the time of the control point to delete.

getBounds

public java.awt.geom.Rectangle2D getBounds()
Method to compute the time and value bounds of this simulation data.

Returns:
a Rectangle2D that has time bounds in the X part and value bounds in the Y part.

getLeftEdge

public double getLeftEdge()
Method to return the leftmost X coordinate of this Stimuli. This value may not be the same as the minimum-x of the bounds, because the data may not be monotonically increasing (may run backwards, for example).

Returns:
the leftmost X coordinate of this Stimuli.

getRightEdge

public double getRightEdge()
Method to return the rightmost X coordinate of this Stimuli. This value may not be the same as the maximum-x of the bounds, because the data may not be monotonically increasing (may run backwards, for example).

Returns:
the rightmost X coordinate of this Stimuli.

isAnalog

public boolean isAnalog()
Method to tell whether this simulation data is analog or digital.

Returns:
true if this simulation data is analog.

strengthToIndex

public static int strengthToIndex(int strength)
Method to convert a strength to an index value. The strengths are OFF_STRENGTH, NODE_STRENGTH, GATE_STRENGTH, and VDD_STRENGTH. The indices are integers that can be saved to disk.

Parameters:
strength - strength level.
Returns:
the index for that strength (0-based).

indexToStrength

public static int indexToStrength(int index)
Method to convert a strength index to a strength value. The strengths are OFF_STRENGTH, NODE_STRENGTH, GATE_STRENGTH, and VDD_STRENGTH. The indices of the strengths are integers that can be saved to disk.

Parameters:
index - a strength index (0-based).
Returns:
the equivalent strength.

describeLevel

public static java.lang.String describeLevel(int state)
Method to describe the level in a given state. A 'state' is a combination of a level and a strength. The levels are LOGIC_LOW, LOGIC_HIGH, LOGIC_X, and LOGIC_Z.

Parameters:
state - the given state.
Returns:
a description of the logic level in that state.

describeLevelBriefly

public static java.lang.String describeLevelBriefly(int state)
Method to describe the level in a given state, with only 1 character. A 'state' is a combination of a level and a strength. The levels are LOGIC_LOW, LOGIC_HIGH, LOGIC_X, and LOGIC_Z.

Parameters:
state - the given state.
Returns:
a description of the logic level in that state.

parseLevel

public static int parseLevel(java.lang.String s1)
Method to convert a state representation (L, H, X, Z) to a state

Parameters:
s1 - character string that contains state value.
Returns:
the state value.

describeStrength

public static java.lang.String describeStrength(int strength)
Method to describe the strength in a given state. A 'state' is a combination of a level and a strength. The strengths are OFF_STRENGTH, NODE_STRENGTH, GATE_STRENGTH, and VDD_STRENGTH.

Parameters:
strength - the given strength.
Returns:
a description of the strength in that state.