|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthades.simulator.SimObject
hades.models.gates.GenericGate
hades.models.register.LFSRAnalyzer
LFSRAnalyzer: abstract base class for a 32-bit LFSR pseudorandom signature analyzer based on the (31 3 0) polynom.
Subclasses will sample their ports and generate an input value consisting of zeroes for the highest bits, and 0/1 values based on the inputs for the lowest bits. To keep things manageable, we interpret StdLogic1164 values '1' and 'H' as 1, all other StdLogic1164 values including 'U' and 'X' as 0. For example, when used with 8-bit inputs "UW010011", the signature will be updated by the 32-bits MSB "0000 0000 0000 0000 0000 0000" + "0001 0011" LSB Use setValue() and getValue() to initialize and read-out the LFSR value.
To allow detection of undefined ('U', 'X', 'Z', etc.) input values, this class also maintains an integer mask called 'uxz_mask' that is reset during elaborate() or when the reset input for the register is active. Whenever an data input to the LFSRAnalyzer has an StdLogic1164.is_UXZ() value, the corresponding bit in variable 'uxz_mask' is set. Use setUXZMask() and getUXZMask() to set and/or read the mask value.
| Field Summary | |
protected int |
n_inputs
|
protected PortStdLogic1164 |
port_CLK
|
protected PortStdLogic1164 |
port_NRESET
|
| 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 | |
LFSRAnalyzer(int n_inputs)
|
|
| 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 |
getExpectedValue()
|
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 |
getUXZMask()
|
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 |
setExpectedValue(int value)
|
void |
setExpectedValue(java.lang.String s)
|
void |
setSeed(int seed)
|
void |
setSeed(java.lang.String s)
|
void |
setUXZMask(int mask)
|
void |
setUXZMask(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.models.gates.GenericGate |
copy, 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 |
message |
| Field Detail |
protected int n_inputs
protected PortStdLogic1164 port_CLK
protected PortStdLogic1164 port_NRESET
| Constructor Detail |
public LFSRAnalyzer(int n_inputs)
| Method Detail |
public void elaborate(java.lang.Object arg)
elaborate in interface Simulatableelaborate in class GenericGatepublic void evaluate(java.lang.Object arg)
evaluate in interface Simulatableevaluate in class SimObjectarg - an arbitrary object argumentpublic void write(java.io.PrintWriter ps)
write in class GenericGatepublic boolean initialize(java.lang.String s)
initialize in class GenericGatepublic int getValue()
public void setValue(java.lang.String s)
public void setValue(int value)
public int getExpectedValue()
public void setExpectedValue(int value)
public void setExpectedValue(java.lang.String s)
public int getSeed()
public void setSeed(java.lang.String s)
public void setSeed(int seed)
public int getUXZMask()
public void setUXZMask(int mask)
public void setUXZMask(java.lang.String s)
public void configure()
SimObject
configure in class GenericGate
public java.lang.String getToolTip(java.awt.Point position,
long millis)
GenericGate
getToolTip in interface ContextToolTipgetToolTip in class GenericGate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||