hades.models.rtlib.register
Class LFSR
java.lang.Object
hades.simulator.SimObject
hades.models.rtlib.GenericRtlibObject
hades.models.rtlib.register.LFSR
- All Implemented Interfaces:
- Assignable, java.lang.Cloneable, ContextToolTip, java.io.Serializable, Simulatable, Wakeable
- public class LFSR
- extends GenericRtlibObject
- implements Assignable
LFSR - an edge-triggered 1..32-bit output LFSR register based
on the (31 3 0) polynom.
Signals are expected to be of type SignalStdLogicVector for D and Q,
and SignalStdLogic1164 for CLK and NR(eset).
- See Also:
- Serialized Form
Fields inherited from class hades.models.rtlib.GenericRtlibObject |
BINARY, DECIMAL, defaultdelay, delay, enableAnimationFlag, HEX, labelFormatter, n_bits, valueLabel, vector, vector_000, vector_111, vector_UUU, vector_XXX, vector_ZZZ, vectorOutputPort |
Fields inherited from class hades.simulator.SimObject |
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible |
Constructor Summary |
LFSR()
|
Method Summary |
void |
configure()
create and display a 'ConfigDialog' to set the parameters for
a SimObject. |
void |
constructPorts()
|
void |
elaborate(java.lang.Object arg)
elaborate(): This method is called by the simulation engine
to initialize this RTLIB object for simulation. |
void |
evaluate(java.lang.Object arg)
evaluate(): called by the simulation engine on all events that
concern this object. |
long |
getLFSRValue()
|
int |
getSeed()
|
boolean |
initialize(java.lang.String s)
initialize a RTLIB object from a String
which contains the integer version id, the width of this vector,
and optionally a String of the desired start value
(e.g. |
void |
setSeed(int _seed)
|
void |
setSeed(java.lang.String s)
|
void |
setValue(long _value)
|
void |
setValue(java.lang.String s)
|
void |
setWidth(int _n)
|
void |
write(java.io.PrintWriter ps)
write the following data to PrintWriter ps:
our versionId, the width (n_bits), the default output value (vector),
the default delay, and the default seed
Hopefully, many RTLIB classes won't need to override write(). |
Methods inherited from class hades.models.rtlib.GenericRtlibObject |
assign, constructStandardValues, copy, getDelay, getEnableAnimationFlag, getFormattedValue, getNumberFormat, getToolTip, getValue, getWidth, initValueLabel, isConnected, scheduleAfter, scheduleAfter, scheduleVectorOutputPort, setDelay, setDelay, setEnableAnimationFlag, setEnableAnimationFlag, setFormattedValue, setNumberFormat, setNumberFormat, setSymbol, setWidth, toString, updateSymbol, wakeup, wakeupAfter |
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, setVersionId, setVisible, tearDown |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
port_Q
protected PortStdLogicVector port_Q
port_CLK
protected PortStdLogic1164 port_CLK
port_NR
protected PortStdLogic1164 port_NR
t_setup
protected double t_setup
lfsr
protected LFSR32 lfsr
seed
protected int seed
LFSR
public LFSR()
setWidth
public void setWidth(int _n)
- Overrides:
setWidth
in class GenericRtlibObject
getSeed
public int getSeed()
setSeed
public void setSeed(int _seed)
setSeed
public void setSeed(java.lang.String s)
constructPorts
public void constructPorts()
- Overrides:
constructPorts
in class GenericRtlibObject
setValue
public void setValue(long _value)
- Overrides:
setValue
in class GenericRtlibObject
setValue
public void setValue(java.lang.String s)
- Overrides:
setValue
in class GenericRtlibObject
getLFSRValue
public long getLFSRValue()
elaborate
public void elaborate(java.lang.Object arg)
- elaborate(): This method is called by the simulation engine
to initialize this RTLIB object for simulation.
GenericRtlibObject just calls
updateSymbol() to initialize its graphical representation.
Probably, most RTLIB classes won't need to override this method.
- Specified by:
elaborate
in interface Simulatable
- Overrides:
elaborate
in class GenericRtlibObject
evaluate
public void evaluate(java.lang.Object arg)
- Description copied from interface:
Simulatable
- evaluate(): called by the simulation engine on all events that
concern this object. The object is responsible for updating its
internal state and for scheduling all pending output events.
- 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 the following data to PrintWriter ps:
our versionId, the width (n_bits), the default output value (vector),
the default delay, and the default seed
Hopefully, many RTLIB classes won't need to override write().
- Overrides:
write
in class GenericRtlibObject
initialize
public boolean initialize(java.lang.String s)
- Description copied from class:
GenericRtlibObject
- initialize a RTLIB object from a String
which contains the integer version id, the width of this vector,
and optionally a String of the desired start value
(e.g. "1001 8 01ZXW001" for an 8 bit vector),
and optionally the default delay.
- Overrides:
initialize
in class GenericRtlibObject
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 GenericRtlibObject