hades.models.flipflops
Class JkffMetastable

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.flipflops.GenericFlipflop
          extended byhades.models.flipflops.JkffMetastable
All Implemented Interfaces:
Assignable, java.lang.Cloneable, ContextToolTip, java.io.Serializable, Simulatable

public class JkffMetastable
extends GenericFlipflop
implements Simulatable, java.io.Serializable

Jkff: a falling-edge triggered JK-flipflop with asynchronous clear. Unlike Jkff, which models a typical CMOS-style library flipflop with strict input-value checking, this flipflop model won't generate 'U' or 'X' output values, but generates random output values instead. The main use of this flipflop model is for the simulation of "legacy circuits" like the TTL 74xx series counters, which often don't use or hardwire the flipflop reset inputs.

Signals are expected to be StdLogic1164 objects.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class hades.models.flipflops.GenericFlipflop
port_NQ, port_Q, t_hold, t_pass, t_setup
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
JkffMetastable()
           
 
Method Summary
 void evaluate(java.lang.Object arg)
          evaluate: check the J, K, NC inputs and calculate Q and NQ.
 int getRandom01Value()
          get a random StdLogic1164 0/1 value (with probability 0.5).
 double getRandomDelay()
          get a random delay time, which may be up to 50 times the value of the current gate propagation delay, t_pass.
 
Methods inherited from class hades.models.flipflops.GenericFlipflop
assign, configure, elaborate, getDelay, getHoldTime, getSetupTime, getToolTip, initialize, scheduleEvent, scheduleEventAfter, scheduleOutputValue, scheduleOutputValueAfter, setDelay, setDelay, setHoldTime, setHoldTime, setSetupTime, setSetupTime, write
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, copy, 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
elaborate, message
 

Constructor Detail

JkffMetastable

public JkffMetastable()
Method Detail

evaluate

public void evaluate(java.lang.Object arg)
evaluate: check the J, K, NC inputs and calculate Q and NQ. See any logic design textbook for the function table of a JK flipflop. If any input is undefined or a timing-violation is detected, the flipflop state and Q/NQ outputs are set to 'X'.

Specified by:
evaluate in interface Simulatable
Overrides:
evaluate in class SimObject
Parameters:
arg - an arbitrary object argument

getRandom01Value

public int getRandom01Value()
get a random StdLogic1164 0/1 value (with probability 0.5).


getRandomDelay

public double getRandomDelay()
get a random delay time, which may be up to 50 times the value of the current gate propagation delay, t_pass.