hades.models.flipflops
Class DffMetastable
java.lang.Object
hades.simulator.SimObject
hades.models.flipflops.GenericFlipflop
hades.models.flipflops.DffMetastable
- All Implemented Interfaces:
- Assignable, java.lang.Cloneable, ContextToolTip, java.io.Serializable, Simulatable
- public class DffMetastable
- extends GenericFlipflop
- implements Simulatable, java.io.Serializable
DffMetastable: a rising-edge triggered metastable D-flipflop.
Unlike Dff, this simulation component models a metastable flipflop
which won't generate 'U' or 'X' values, but is set to random '0'/'1'
StdLogic1164 values at initialization and on every hazard or
undefined input condition.
Note that the delay for the propagation of this random value is
random, too, with a delay of up to fifty times the usual flipflop
propagation delay, t_pass.
Signals are expected to be StdLogic1164 objects.
- See Also:
- Serialized Form
Fields inherited from class hades.simulator.SimObject |
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible |
Method Summary |
void |
elaborate(java.lang.Object arg)
elaborate: store a reference to the simulator,
then call evaluate() to generate a random initial 0/1 output value. |
void |
evaluate(java.lang.Object arg)
evaluate: calculate a new output value for this metastable DFF. |
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, 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 |
DffMetastable
public DffMetastable()
elaborate
public void elaborate(java.lang.Object arg)
- elaborate: store a reference to the simulator,
then call evaluate() to generate a random initial 0/1 output value.
- Specified by:
elaborate
in interface Simulatable
- Overrides:
elaborate
in class GenericFlipflop
evaluate
public void evaluate(java.lang.Object arg)
- evaluate: calculate a new output value for this metastable DFF.
Check for a rising-edge on the C input and propagate the D input.
If either C or D are undefined, or if setup- or hold-time violations
are detected, this metastable DFF will enter a random 0/1 state
after a random delay.
- 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.