hades.models.flipflops
Class GenericFlipflop

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.flipflops.GenericFlipflop
All Implemented Interfaces:
Assignable, java.lang.Cloneable, ContextToolTip, java.io.Serializable, Simulatable
Direct Known Subclasses:
Dff, Dffe, DffMetastable, Dffr, Dffre, DffrMetastable, Dffrs, Jkff, JkffMetastable, Latch, LatchMetastable, Latchr, Srff

public class GenericFlipflop
extends SimObject
implements Simulatable, Assignable, ContextToolTip, java.io.Serializable

GenericFlipflop: abstract base class used for flipflops. Signals are expected to be StdLogic1164 objects. This class also provides three timing parameters, for flipflop setup time, flipflop hold time, and D-to-Q propagation time.

See Also:
Serialized Form

Field Summary
protected  PortStdLogic1164 port_NQ
           
protected  PortStdLogic1164 port_Q
           
protected  double t_hold
           
protected  double t_pass
           
protected  double t_setup
           
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
GenericFlipflop()
           
 
Method Summary
 void assign(java.lang.String value, double time)
          used to specify a new output value from an external source (e.g.
 void configure()
          display a dialog window allowing to specify the name, setup time, hold time, and propagation delay time for this flipflop model.
 void elaborate(java.lang.Object arg)
          elaborate: just store a reference to the current simulator
 double getDelay()
           
 double getHoldTime()
           
 double getSetupTime()
           
 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 GenericFlipflop from a String that contains the integer version id of this gate and its propagation delay (in seconds), e.g.
 void scheduleEvent(Signal signal, double time, StdLogic1164 value, Port port)
           
 void scheduleEventAfter(Signal signal, double delay, StdLogic1164 value, Port port)
           
 void scheduleOutputValue(Port port, StdLogic1164 value, double time)
           
 void scheduleOutputValueAfter(Port port, StdLogic1164 value, double delay)
           
 void setDelay(double t)
           
 void setDelay(java.lang.String s)
           
 void setHoldTime(double t)
           
 void setHoldTime(java.lang.String s)
           
 void setSetupTime(double t)
           
 void setSetupTime(java.lang.String s)
           
 void write(java.io.PrintWriter ps)
          write out the versionId, propagation delay, setup time, hold time
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, copy, evaluate, getBindkey, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getVersionId, isVisible, keyPressed, message, mousePressed, needsDynamicSymbol, needsExternalResources, setClassLoader, setConsole, setDebug, setEditor, setName, setParent, setPorts, setSimulator, setSymbol, setVersionId, setVisible, tearDown, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hades.simulator.Simulatable
evaluate, message
 

Field Detail

t_pass

protected double t_pass

t_setup

protected double t_setup

t_hold

protected double t_hold

port_Q

protected PortStdLogic1164 port_Q

port_NQ

protected PortStdLogic1164 port_NQ
Constructor Detail

GenericFlipflop

public GenericFlipflop()
Method Detail

getDelay

public double getDelay()

getSetupTime

public double getSetupTime()

getHoldTime

public double getHoldTime()

setDelay

public void setDelay(double t)

setSetupTime

public void setSetupTime(double t)

setHoldTime

public void setHoldTime(double t)

setDelay

public void setDelay(java.lang.String s)

setSetupTime

public void setSetupTime(java.lang.String s)

setHoldTime

public void setHoldTime(java.lang.String s)

configure

public void configure()
display a dialog window allowing to specify the name, setup time, hold time, and propagation delay time for this flipflop model.

Overrides:
configure in class SimObject

initialize

public boolean initialize(java.lang.String s)
initialize a GenericFlipflop from a String that contains the integer version id of this gate and its propagation delay (in seconds), e.g. '1001 0.5E-8'.

Overrides:
initialize in class SimObject

write

public void write(java.io.PrintWriter ps)
write out the versionId, propagation delay, setup time, hold time

Overrides:
write in class SimObject

elaborate

public void elaborate(java.lang.Object arg)
elaborate: just store a reference to the current simulator

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

scheduleEvent

public void scheduleEvent(Signal signal,
                          double time,
                          StdLogic1164 value,
                          Port port)

scheduleEventAfter

public void scheduleEventAfter(Signal signal,
                               double delay,
                               StdLogic1164 value,
                               Port port)

scheduleOutputValue

public void scheduleOutputValue(Port port,
                                StdLogic1164 value,
                                double time)

scheduleOutputValueAfter

public void scheduleOutputValueAfter(Port port,
                                     StdLogic1164 value,
                                     double delay)

assign

public void assign(java.lang.String value,
                   double time)
used to specify a new output value from an external source (e.g. a script). Calling this method will result in the corresponding output events on both the Q (normal) and NQ (inverted) output ports of this flipflop.

The 'value' String is expected to have a one-character encoding of the StdLogic1164 value, namely "U" "X" "0" "1" "Z" "H" "L" "W" "D".

Note that you have to override this method for simulation models who need to update their graphical symbol in order to show or highlight their internal state.

Specified by:
assign in interface Assignable

getToolTip

public java.lang.String getToolTip(java.awt.Point position,
                                   long millis)
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