|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hades.simulator.SimObject hades.models.gates.GenericGate hades.models.io.RandomBitGenerator
RandomBitGenerator: a simulation model which generates a new random 0/1 value on each rising clock-edge. This model is useful for testbenches and automatic selftest of other circuits. Random generator seed and 0/1 probability can be specified. Signals are expected to be StdLogic1164 objects.
Field Summary | |
protected StdLogic1164 |
next_Y
|
protected PortStdLogic1164 |
port_C
|
protected PortStdLogic1164 |
port_Y
|
Fields inherited from class hades.models.gates.GenericGate |
t_delay |
Fields inherited from class hades.simulator.SimObject |
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible |
Constructor Summary | |
RandomBitGenerator()
RandomBitGenerator: create a new RandomBitGenerator with its own exclusive java.util.Random instance, and 0.5 probability for 0/1 output values each. |
Method Summary | |
void |
configure()
configure: display a dialog with options to specify instance name, C-to-Y propagation delay, probability of a StdLogic1164._1 output, and random generator seed. |
SimObject |
copy()
create a copy of the current GenericGate with the same gate delay. |
void |
evaluate(java.lang.Object arg)
evaluate: check for a rising edge on the C input and calculate a new random StdLogic1164._0/_1 output value with the selected 1-probability, then schedule to Y after t_delay |
float |
getProbability()
return the probability (0.0 .. |
long |
getSeed()
|
java.lang.String |
getToolTip(java.awt.Point position,
long millis)
construct a (short) tool tip message for a logic gate with name, class name, gate delay, seed, and 1-probability. |
boolean |
initialize(java.lang.String s)
initialize a RandomBitGenerator from a String that contains the integer version id, the C-to-Y gate propagation delay (in seconds), the random number generator seed, and the 1-probability, e.g. |
void |
setProbability(float p)
|
void |
setProbability(java.lang.String s)
|
void |
setSeed(long _seed)
|
void |
setSeed(java.lang.String s)
|
void |
write(java.io.PrintWriter ps)
write "versionId", gate delay "t_delay", random generator seed, and 1-probability |
Methods inherited from class hades.models.gates.GenericGate |
elaborate, getDelay, scheduleEvent, scheduleEventAfter, scheduleOutputValue, scheduleOutputValueAfter, setDelay, setDelay |
Methods inherited from class hades.simulator.SimObject |
constructDynamicSymbol, 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 |
Field Detail |
protected PortStdLogic1164 port_C
protected PortStdLogic1164 port_Y
protected StdLogic1164 next_Y
Constructor Detail |
public RandomBitGenerator()
Method Detail |
public long getSeed()
public void setSeed(long _seed)
public void setSeed(java.lang.String s)
public float getProbability()
public void setProbability(float p)
public void setProbability(java.lang.String s)
public boolean initialize(java.lang.String s)
initialize
in class GenericGate
public void write(java.io.PrintWriter ps)
write
in class GenericGate
public void evaluate(java.lang.Object arg)
evaluate
in interface Simulatable
evaluate
in class SimObject
arg
- an arbitrary object argumentpublic void configure()
configure
in class GenericGate
public SimObject copy()
copy
in class GenericGate
public java.lang.String getToolTip(java.awt.Point position, long millis)
getToolTip
in interface ContextToolTip
getToolTip
in class GenericGate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |