hades.models.special
Class EdgeTrigger

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.special.EdgeTrigger
All Implemented Interfaces:
java.lang.Cloneable, ContextToolTip, java.util.EventListener, java.awt.event.ItemListener, java.io.Serializable, Simulatable

public class EdgeTrigger
extends SimObject
implements Simulatable, java.awt.event.ItemListener

EdgeTrigger - a class to detect and react to selected edges (changes) on SignalStdLogic1164 signals.

For example, a EdgeTrigger object may be used as a 'breakpoint' which pauses the simulation on certain input value changes, e.g. a Z->0 transition.

See Also:
Serialized Form

Field Summary
 int _0
           
 int _0L
           
 int _1
           
 int _1H
           
 int _ANY
           
 int _D
           
 int _H
           
 int _L
           
 int _NONE
           
 int _U
           
 int _UX
           
 int _W
           
 int _X
           
 int _Z
           
 int _ZWLHD
           
(package private)  javax.swing.JPanel actionPanel
           
(package private)  javax.swing.JCheckBox beepCB
           
protected  boolean beepFlag
           
(package private)  javax.swing.JPanel buttonPanel
           
(package private)  javax.swing.JButton closeButton
           
protected  int currentIndex
           
(package private)  javax.swing.JComboBox currentIndexChoice
           
(package private)  StdLogic1164 currentValue
           
(package private)  javax.swing.JPanel edgePanel
           
(package private)  javax.swing.JCheckBox logMessageCB
           
protected  boolean logMessageFlag
           
(package private)  javax.swing.JCheckBox pauseSimulationCB
           
protected  boolean pauseSimulationFlag
           
protected  int previousIndex
           
(package private)  javax.swing.JComboBox previousIndexChoice
           
(package private)  StdLogic1164 previousValue
           
protected  Label symbolTypeLabel
           
(package private)  javax.swing.JFrame topFrame
           
(package private)  StdLogic1164 value_0
           
(package private)  StdLogic1164 value_1
           
protected  java.lang.String[] valueNames
           
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
EdgeTrigger()
          EdgeTrigger(): simple constructor
 
Method Summary
(package private)  void buildActionPanel()
           
(package private)  void buildButtonPanel()
           
(package private)  void buildEdgePanel()
           
 void buildGUI()
           
 void buildGUICallbacks()
           
 void changeName()
           
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 SimObject copy()
          copy(): create a clone of the current EdgeTrigger, including its color
 void elaborate(java.lang.Object arg)
          elaborate(): This method is called by the simulation engine to initialize the simulation object.
 void evaluate(java.lang.Object arg)
          evaluate(): called by the simulation engine on all events that concern this object.
static java.lang.String formatPaddedLong(long value, int n_chars)
           
 StdLogic1164 getInputValue(Port p)
           
 java.awt.Component getPropertySheet()
          return a reference to the 'property sheet' or configuration window for this SimObject.
 java.lang.String getToolTip(java.awt.Point position, long millis)
          construct a (short) tool tip message for a SimObject.
 boolean initialize(java.lang.String s)
          initialize a SimObject from a String.
 void itemStateChanged(java.awt.event.ItemEvent evt)
           
static void main(java.lang.String[] argv)
          main(): simple selftest of the EdgeTrigger's GUI
 boolean match(StdLogic1164 value_A, int intValue)
           
 void setSymbol(Symbol s)
           
 java.lang.String toString()
          toString() - the usual info method
 void trigger(java.lang.Object arg)
           
 void write(java.io.PrintWriter ps)
           
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, getBindkey, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getVersionId, isVisible, keyPressed, message, mousePressed, needsDynamicSymbol, needsExternalResources, setClassLoader, setConsole, setDebug, setEditor, setName, setParent, setPorts, setSimulator, setVersionId, setVisible, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hades.simulator.Simulatable
message
 

Field Detail

previousValue

StdLogic1164 previousValue

currentValue

StdLogic1164 currentValue

value_0

StdLogic1164 value_0

value_1

StdLogic1164 value_1

_U

public final int _U
See Also:
Constant Field Values

_X

public final int _X
See Also:
Constant Field Values

_0

public final int _0
See Also:
Constant Field Values

_1

public final int _1
See Also:
Constant Field Values

_Z

public final int _Z
See Also:
Constant Field Values

_L

public final int _L
See Also:
Constant Field Values

_H

public final int _H
See Also:
Constant Field Values

_W

public final int _W
See Also:
Constant Field Values

_D

public final int _D
See Also:
Constant Field Values

_0L

public final int _0L
See Also:
Constant Field Values

_1H

public final int _1H
See Also:
Constant Field Values

_UX

public final int _UX
See Also:
Constant Field Values

_ZWLHD

public final int _ZWLHD
See Also:
Constant Field Values

_ANY

public final int _ANY
See Also:
Constant Field Values

_NONE

public final int _NONE
See Also:
Constant Field Values

valueNames

protected java.lang.String[] valueNames

previousIndex

protected int previousIndex

currentIndex

protected int currentIndex

pauseSimulationFlag

protected boolean pauseSimulationFlag

beepFlag

protected boolean beepFlag

logMessageFlag

protected boolean logMessageFlag

symbolTypeLabel

protected Label symbolTypeLabel

topFrame

javax.swing.JFrame topFrame

edgePanel

javax.swing.JPanel edgePanel

buttonPanel

javax.swing.JPanel buttonPanel

actionPanel

javax.swing.JPanel actionPanel

previousIndexChoice

javax.swing.JComboBox previousIndexChoice

currentIndexChoice

javax.swing.JComboBox currentIndexChoice

closeButton

javax.swing.JButton closeButton

beepCB

javax.swing.JCheckBox beepCB

pauseSimulationCB

javax.swing.JCheckBox pauseSimulationCB

logMessageCB

javax.swing.JCheckBox logMessageCB
Constructor Detail

EdgeTrigger

public EdgeTrigger()
EdgeTrigger(): simple constructor

Method Detail

setSymbol

public void setSymbol(Symbol s)
Overrides:
setSymbol in class SimObject

buildEdgePanel

void buildEdgePanel()

buildActionPanel

void buildActionPanel()

buildButtonPanel

void buildButtonPanel()

buildGUI

public void buildGUI()

buildGUICallbacks

public void buildGUICallbacks()

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent evt)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

changeName

public void changeName()

write

public void write(java.io.PrintWriter ps)
Overrides:
write in class SimObject

initialize

public boolean initialize(java.lang.String s)
Description copied from class: SimObject
initialize a SimObject from a String. The method returns true once all required data has been read. Until then, you should repeatedly call initialize() with additional Strings.

Overrides:
initialize in class SimObject

configure

public void configure()
Description copied from class: SimObject
create and display a 'ConfigDialog' to set the parameters for a SimObject. The default ConfigDialog for the base class (SimObject) itself is empty except for the 'instance name' of the SimObject.

Overrides:
configure in class SimObject

getPropertySheet

public java.awt.Component getPropertySheet()
Description copied from class: SimObject
return a reference to the 'property sheet' or configuration window for this SimObject. We cast the return value to an AWT Component, but typically you can expect either a hades.gui.PropertySheet or an java.awt.Window (Dialog or Frame).

Overrides:
getPropertySheet in class SimObject

elaborate

public void elaborate(java.lang.Object arg)
elaborate(): This method is called by the simulation engine to initialize the simulation object.

Specified by:
elaborate in interface Simulatable
Overrides:
elaborate in class SimObject
Parameters:
arg - This parameter is ignored by EdgeTrigger

getInputValue

public StdLogic1164 getInputValue(Port p)

evaluate

public void evaluate(java.lang.Object arg)
evaluate(): called by the simulation engine on all events that concern this object. The object is responsible for updating its internal state and for scheduling all pending output events.

Specified by:
evaluate in interface Simulatable
Overrides:
evaluate in class SimObject
Parameters:
arg - An arbitrary and unused object

match

public boolean match(StdLogic1164 value_A,
                     int intValue)

trigger

public void trigger(java.lang.Object arg)

formatPaddedLong

public static java.lang.String formatPaddedLong(long value,
                                                int n_chars)

copy

public SimObject copy()
copy(): create a clone of the current EdgeTrigger, including its color

Overrides:
copy in class SimObject

getToolTip

public java.lang.String getToolTip(java.awt.Point position,
                                   long millis)
Description copied from class: SimObject
construct a (short) tool tip message for a SimObject. This method should be overridden as needed.

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

toString

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

Overrides:
toString in class SimObject

main

public static void main(java.lang.String[] argv)
main(): simple selftest of the EdgeTrigger's GUI