com.sun.electric.tool.simulation
Class DigitalSignal

java.lang.Object
  extended by com.sun.electric.tool.simulation.Signal
      extended by com.sun.electric.tool.simulation.DigitalSignal

public class DigitalSignal
extends Signal

Class to define a digital signal in the simulation waveform window.


Field Summary
 
Fields inherited from class com.sun.electric.tool.simulation.Signal
bounds, leftEdge, rightEdge
 
Constructor Summary
DigitalSignal(DigitalAnalysis an)
          Constructor for a digital signal.
 
Method Summary
 void addToBussedSignalList(DigitalSignal ws)
          Method to add a signal to this bus signal.
 void buildBussedSignalList()
          Method to request that this signal be a bus.
 void buildState(int numEvents)
          Method to initialize this simulation signal with a specified number of events.
 void buildTime(int numEvents)
          Method to build a time vector for this TimedSignal.
protected  void calcBounds()
          Method to compute the low and high range of time value on this signal.
 void clearBussedSignalList()
          Method to request that this bussed signal be cleared of all signals on it.
 void finished()
           
 DigitalAnalysis getAnalysis()
          Method to return the DigitalAnalysis in which this signal resides.
 java.util.List<DigitalSignal> getBussedSignals()
          Method to return a List of signals on this bus signal.
 int getNumEvents()
          Method to return the number of events in this signal.
 int getState(int index)
          Method to get the state of this signal at a given event.
 int[] getStateVector()
          Method to return the state information for all events in this signal.
 double getTime(int index)
          Method to return the value of time for a given event on this TimedSignal.
 double[] getTimeVector()
          Method to return the time vector for this TimedSignal.
 boolean isInBus()
          Method to tell whether this signal is part of a bus.
 void setState(int index, int st)
          Method to set the state of this signal at a given event.
 void setStateVector(int[] state)
          Method to set the state information for all events in this signal.
 void setTime(int entry, double t)
          Method to set an individual time entry for this TimedSignal.
 void setTimeVector(double[] time)
          Method to set the time vector for this TimedSignal.
 
Methods inherited from class com.sun.electric.tool.simulation.Signal
addControlPoint, clearControlPoints, getBounds, getControlPoints, getFullName, getLeftEdge, getRightEdge, getSignalContext, getSignalName, removeControlPoint, setSignalContext, setSignalName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DigitalSignal

public DigitalSignal(DigitalAnalysis an)
Constructor for a digital signal.

Parameters:
an - the DigitalAnalysis object in which this signal will reside.
Method Detail

finished

public void finished()
Overrides:
finished in class Signal

getAnalysis

public DigitalAnalysis getAnalysis()
Method to return the DigitalAnalysis in which this signal resides.

Specified by:
getAnalysis in class Signal
Returns:
the DigitalAnalysis in which this signal resides.

buildBussedSignalList

public void buildBussedSignalList()
Method to request that this signal be a bus. Builds the necessary data structures to hold bus information.


getBussedSignals

public java.util.List<DigitalSignal> getBussedSignals()
Method to return a List of signals on this bus signal. Each entry in the List points to another simulation signal that is on this bus.

Returns:
a List of signals on this bus signal.

clearBussedSignalList

public void clearBussedSignalList()
Method to request that this bussed signal be cleared of all signals on it.


addToBussedSignalList

public void addToBussedSignalList(DigitalSignal ws)
Method to add a signal to this bus signal.

Parameters:
ws - a single-wire signal to be added to this bus signal.

isInBus

public boolean isInBus()
Method to tell whether this signal is part of a bus.

Returns:
true if this signal is part of a bus.

buildTime

public void buildTime(int numEvents)
Method to build a time vector for this TimedSignal. TimedSignals can have their own time information, or they can use a "common time" array that is part of the simulation data. If using common time, then each TimedSignal must have the same number of entries, and each entry must be at the same time as the corresponding entries in other TimedSignals. Using common time saves memory, because the time information does not have to be stored with each TimedSignal. This method requests that the TimedSignal have its own time array, and not use common time data.

Parameters:
numEvents - the number of events on this TimedSignal (the length of the time array).

getTime

public double getTime(int index)
Method to return the value of time for a given event on this TimedSignal. Depending on whether common time data is being used, the time information is found on this TimedSignal or on the overall simulation data.

Parameters:
index - the event being querried (0-based).
Returns:
the value of time at that event.

getTimeVector

public double[] getTimeVector()
Method to return the time vector for this TimedSignal. The vector is only valid if this TimedSignal is NOT using common time. TimedSignals can have their own time information, or they can use a "common time" array that is part of the simulation data. If using common time, then each TimedSignal must have the same number of entries, and each entry must be at the same time as the corresponding entries in other TimedSignals.

Returns:
the time array for this TimedSignal. Returns null if this TimedSignal uses common time.

setTimeVector

public void setTimeVector(double[] time)
Method to set the time vector for this TimedSignal. Overrides any previous time vector that may be on this TimedSignal. TimedSignals can have their own time information, or they can use a "common time" array that is part of the simulation data. If using common time, then each TimedSignal must have the same number of entries, and each entry must be at the same time as the corresponding entries in other TimedSignals.

Parameters:
time - a new time vector for this TimedSignal.

setTime

public void setTime(int entry,
                    double t)
Method to set an individual time entry for this TimedSignal. Only applies if common time is NOT being used for this TimedSignal. TimedSignals can have their own time information, or they can use a "common time" array that is part of the simulation data. If using common time, then each TimedSignal must have the same number of entries, and each entry must be at the same time as the corresponding entries in other TimedSignals.

Parameters:
entry - the entry in the event array of this TimedSignal (0-based).
t - the new value of time at this event.

buildState

public void buildState(int numEvents)
Method to initialize this simulation signal with a specified number of events. Allocates an array to hold those events.

Parameters:
numEvents - the number of events in this signal.

setState

public void setState(int index,
                     int st)
Method to set the state of this signal at a given event.

Parameters:
index - the event index (0-based).
st - the state of the signal at that event.

getState

public int getState(int index)
Method to get the state of this signal at a given event.

Parameters:
index - the event index (0-based).
Returns:
the state of the signal at that event.

getStateVector

public int[] getStateVector()
Method to return the state information for all events in this signal.

Returns:
the state array for this signal.

setStateVector

public void setStateVector(int[] state)
Method to set the state information for all events in this signal.

Parameters:
state - an array of state information for every event on this signal.

getNumEvents

public int getNumEvents()
Method to return the number of events in this signal. This is the number of events along the horizontal axis, usually "time".

Returns:
the number of events in this signal.

calcBounds

protected void calcBounds()
Method to compute the low and high range of time value on this signal. The result is stored in the "bounds", "leftEdge", and "rightEdge" field variables.

Overrides:
calcBounds in class Signal