hades.models.register
Class LFSRGenerator
java.lang.Object
hades.simulator.SimObject
hades.models.gates.GenericGate
hades.models.register.LFSRGenerator
- All Implemented Interfaces:
- java.lang.Cloneable, ContextToolTip, java.io.Serializable, Simulatable
- Direct Known Subclasses:
- LFSRGenerator16, LFSRGenerator24, LFSRGenerator32, LFSRGenerator8
- public class LFSRGenerator
- extends GenericGate
- implements Simulatable
LFSRGenerator: abstract base class for LFSR pseudorandom value generators
based on the (31 3 0) polynom.
Subclasses will output some of the (lower) bits of the LFSR to ports.
Use setValue() and getValue() to initialize and read-out the generator.
- 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 |
configure()
create and display a 'ConfigDialog' to set the parameters for
a SimObject. |
void |
elaborate(java.lang.Object arg)
on elaboration, set the initial value of the LFSR32 to "seed". |
void |
evaluate(java.lang.Object arg)
evaluate: on a rising-edge of the CLK input calculate
a new shift-register value, and put the lower bits of the new value
on the Q outputs. |
int |
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, and gate delay. |
int |
getValue()
|
boolean |
initialize(java.lang.String s)
initialize the LFSR from a String that contains the integer
version id of this gate, its propagation delay (in seconds),
and the initial (seed) value for the shift-register, e.g. |
void |
setSeed(int seed)
|
void |
setSeed(java.lang.String s)
|
void |
setValue(int value)
|
void |
setValue(java.lang.String s)
|
void |
write(java.io.PrintWriter ps)
write "versionId", gate delay "t_delay", seed "seed" |
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 |
n_outputs
protected int n_outputs
port_CLK
protected PortStdLogic1164 port_CLK
port_NRESET
protected PortStdLogic1164 port_NRESET
LFSRGenerator
public LFSRGenerator(int n_outputs)
elaborate
public void elaborate(java.lang.Object arg)
- on elaboration, set the initial value of the LFSR32 to "seed".
- Specified by:
elaborate
in interface Simulatable
- Overrides:
elaborate
in class GenericGate
evaluate
public void evaluate(java.lang.Object arg)
- evaluate: on a rising-edge of the CLK input calculate
a new shift-register value, and put the lower bits of the new value
on the Q outputs.
- Specified by:
evaluate
in interface Simulatable
- Overrides:
evaluate
in class SimObject
- Parameters:
arg
- an arbitrary object argument
write
public void write(java.io.PrintWriter ps)
- write "versionId", gate delay "t_delay", seed "seed"
- Overrides:
write
in class GenericGate
initialize
public boolean initialize(java.lang.String s)
- initialize the LFSR from a String that contains the integer
version id of this gate, its propagation delay (in seconds),
and the initial (seed) value for the shift-register, e.g.
'1001 0.5E-8 12343775'.
- Overrides:
initialize
in class GenericGate
getValue
public int getValue()
setValue
public void setValue(java.lang.String s)
setValue
public void setValue(int value)
getSeed
public int getSeed()
setSeed
public void setSeed(java.lang.String s)
setSeed
public void setSeed(int seed)
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 GenericGate
getToolTip
public java.lang.String getToolTip(java.awt.Point position,
long millis)
- Description copied from class:
GenericGate
- construct a (short) tool tip message for a logic gate with name,
class name, and gate delay.
- Specified by:
getToolTip
in interface ContextToolTip
- Overrides:
getToolTip
in class GenericGate