hades.signals
Class SignalStdLogic1164

java.lang.Object
  extended byhades.signals.Signal
      extended byhades.signals.SignalStdLogic1164
All Implemented Interfaces:
ColorSource, ContextToolTip, java.io.Serializable, Simulatable

public class SignalStdLogic1164
extends Signal

SignalStdLogic1164 - a class that models an IEEE StdLogic1164 Signal

This class also supports the StdLogic1164 standard resolution function for Signals with multiple drivers via the 'resolve()' method. By subclassing SignalStdLogic1164 and by overriding resolve() it is easy to provide other signal models, e.g. with wired-or or wired-and semantics. However, for performance reasons, the resolve() method is called only for Signals with more than one driver.

See Also:
Serialized Form

Field Summary
protected  int _cur
           
protected  int _last
           
protected  StdLogic1164 current_1164
           
protected  StdLogic1164 last_1164
           
protected  StdLogic1164[] myDriverValues
           
 
Fields inherited from class hades.signals.Signal
debug, design, DFS, driverValues, EA, glowMode, isRoot, label, lastChangeTime, lastValue, name, portPositionTable, probe, probeSymbol, receivers, segments, senders, simulator, solderDots, st, VA, value, vertexTable, VI, visible, visited
 
Constructor Summary
SignalStdLogic1164()
           
SignalStdLogic1164(java.lang.String name)
           
SignalStdLogic1164(java.lang.String name, Port[] senders, Port[] receivers)
           
 
Method Summary
 boolean addSender(Port p)
          add a new driver for this Signal and initialize its default driving value to 'StdLogic1164._U'.
 void animate()
          called after the value of this Signal changed.
 boolean deleteSender(Port p)
          delete a sender from this Signal
 void elaborate(java.lang.Object arg)
          initialize this Signal: first, call Signal.elaborate() for the general initialization.
 void evaluate(java.lang.Object arg)
          evaluate
 void extractDriverValue(java.lang.Object arg)
          extractDriverValue(): check that Object "arg" is a SimEvent, then extract the sender port and the new value of the sender.
 java.awt.Color getColor()
          get the color to be used for drawing the WireSegments and SolderDots for this Signal during animation.
static Signal getDefaultValue()
           
 java.lang.Object getPreviousValue()
           
 java.lang.String getToolTip(java.awt.Point position, long millis)
          construct a (short) tool tip message for a SignalStdLogic1164.
 java.lang.Object getValue()
           
 void handleGlowMode()
          do whatever is necessary to update our graphical representation when the glow mode state changed.
 boolean hasFallingEdge()
           
 boolean hasRisingEdge()
           
 void propagateConnectivityChanges()
          this method is called from the connect() and disconnect() methods to inform all senders/receivers of this Signal of any interactive changes made to the Signal connectivity status.
 java.lang.Object resolve()
           
 java.lang.String toString()
          toString() - the usual info method
 void updateDriverArray()
           
 
Methods inherited from class hades.signals.Signal
addReceiver, addSegment, addSolderDot, buildEdgeVectors, buildVertexArrays, canConnect, canMerge, connect, countSegments, countSendersAndReceivers, countSubgraphs, createLabel, createPortPositionTable, createVertexTable, dbg, deleteReceiver, deleteSegment, deleteSingularSegments, DFS, disconnect, disconnectAll, getDebug, getDesign, getDriverValues, getFullName, getGlowMode, getLabel, getLastChangeTime, getName, getProbe, getProbeSymbol, getReceivers, getSegments, getSenders, getSimulator, getSolderDots, getVertexTable, getVisible, hasEvent, hasProbe, isConnected, isPortPosition, isStable, isVertex, isVisible, merge, message, moveLabelTo, numberOfDrivers, parseName, parsePorts, parseSegments, parseSolderDots, printDFS, printGraph, printPortPositionTable, printSegments, printVertexTable, readFromString, rebuildSolderDots, removeProbe, renameAfterDriver, setDebug, setDesign, setGlowMode, setName, setProbe, setProbeSymbol, setSimulator, setTrafo, setValue, setValue, setVisible, showInternalWireSegments, splitIntoSubgraphs, tearDown, toStringVerbose, toStringVerboseOld, write, writeAsResource, writePorts, writeSegments, writeSolderDots
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

current_1164

protected StdLogic1164 current_1164

last_1164

protected StdLogic1164 last_1164

_cur

protected int _cur

_last

protected int _last

myDriverValues

protected StdLogic1164[] myDriverValues
Constructor Detail

SignalStdLogic1164

public SignalStdLogic1164()

SignalStdLogic1164

public SignalStdLogic1164(java.lang.String name)

SignalStdLogic1164

public SignalStdLogic1164(java.lang.String name,
                          Port[] senders,
                          Port[] receivers)
Method Detail

updateDriverArray

public void updateDriverArray()

getValue

public java.lang.Object getValue()
Overrides:
getValue in class Signal

getPreviousValue

public java.lang.Object getPreviousValue()
Overrides:
getPreviousValue in class Signal

getDefaultValue

public static Signal getDefaultValue()

addSender

public boolean addSender(Port p)
add a new driver for this Signal and initialize its default driving value to 'StdLogic1164._U'.

Overrides:
addSender in class Signal
See Also:
Signal.addSender(hades.simulator.Port)

deleteSender

public boolean deleteSender(Port p)
Description copied from class: Signal
delete a sender from this Signal

Overrides:
deleteSender in class Signal

getColor

public java.awt.Color getColor()
get the color to be used for drawing the WireSegments and SolderDots for this Signal during animation. This method is required to implement the ColorSource interface. In this class, we always return Color.blue, but subclasses should override this method as needed.

Specified by:
getColor in interface ColorSource
Overrides:
getColor in class Signal

elaborate

public void elaborate(java.lang.Object arg)
initialize this Signal: first, call Signal.elaborate() for the general initialization. Then set our lastValue to null, the current value to _U, and all myDriverValues to _U as well.

Specified by:
elaborate in interface Simulatable
Overrides:
elaborate in class Signal

evaluate

public void evaluate(java.lang.Object arg)
evaluate

Specified by:
evaluate in interface Simulatable
Overrides:
evaluate in class Signal
Parameters:
arg - An object with the new value for this signal.

propagateConnectivityChanges

public void propagateConnectivityChanges()
this method is called from the connect() and disconnect() methods to inform all senders/receivers of this Signal of any interactive changes made to the Signal connectivity status. This method should be overridded by subclasses as necessary to maintain a consistent state between the Signal itself and the connected SimObjects.

For example, we want to propagate the current Signal value to a newly added receiver port, in order to avoid additional simulation restarts.

Note that this method should not generate additional SimEvents during simulation startup.

Overrides:
propagateConnectivityChanges in class Signal

handleGlowMode

public void handleGlowMode()
do whatever is necessary to update our graphical representation when the glow mode state changed. We request a paint() for all WireSegments and SolderDots, whose colors are updated on their next asynchronous refresh via the ColorSource interface and our getColor() method.

Overrides:
handleGlowMode in class Signal

animate

public void animate()
called after the value of this Signal changed. If glowMode is active, update all WireSegments and SolderDots belonging to this Signal. We request a paint() for all WireSegments and SolderDots, whose colors are updated on their next asynchronous refresh via the ColorSource interface and our getColor() method.


hasRisingEdge

public boolean hasRisingEdge()

hasFallingEdge

public boolean hasFallingEdge()

extractDriverValue

public void extractDriverValue(java.lang.Object arg)
extractDriverValue(): check that Object "arg" is a SimEvent, then extract the sender port and the new value of the sender. Finally, set the driverValue (and time) for the sender port.


resolve

public java.lang.Object resolve()

getToolTip

public java.lang.String getToolTip(java.awt.Point position,
                                   long millis)
construct a (short) tool tip message for a SignalStdLogic1164.

Specified by:
getToolTip in interface ContextToolTip
Overrides:
getToolTip in class Signal

toString

public java.lang.String toString()
toString() - the usual info method

Overrides:
toString in class Signal