|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.simulator.SimObject
hades.models.register.Register
Register - a simple subclass of SimObject that models a n-bit rising-edge triggered, editable D-register without reset or enable. Signals are expected to be StdLogic1164 objects.
Field Summary | |
protected StdLogic1164[] |
data
|
protected FigCompound |
display
|
int |
h
|
protected Label[] |
labels
|
protected int |
n_bits
|
protected Port |
port_C
|
protected static double |
t_pass
|
protected static double |
t_setup
|
protected StdLogic1164 |
value_0
|
protected StdLogic1164 |
value_1
|
protected StdLogic1164 |
value_U
|
protected StdLogic1164 |
value_X
|
int |
w
|
Fields inherited from class hades.simulator.SimObject |
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible |
Constructor Summary | |
Register()
construct an rising-edge triggered, editable D-Register without reset or enable, using a default width of 4 bits. |
Method Summary | |
protected void |
addDisplayElementsToSymbol()
add a graphical elements from 'display' directly to 'symbol', in order to get the layer ordering right. |
void |
configure()
create and display a 'ConfigDialog' to set the parameters for a SimObject. |
void |
constructDynamicSymbol()
|
SimObject |
copy()
copy(): This function is used to create a clone of the current SimObject. |
protected void |
createGlobalPortSymbols()
|
void |
elaborate(java.lang.Object arg)
elaborate(): This method is called by the simulation engine to initialize the simulation object. |
void |
evaluate(java.lang.Object arg)
evaluate(): called by the simulation engine on all events that concern this object. |
int |
getBitWidth()
|
protected int |
getDefaultBitWidth()
|
double |
getPassTime()
|
void |
initDisplay()
|
boolean |
initialize(java.lang.String s)
initialize a SimObject from a String. |
protected void |
initPortsAndData()
the internal utility method to create the array of ports and flipflop values, corresponding to the desired bit-width specified by the global variable n_bits. |
void |
mousePressed(java.awt.event.MouseEvent me)
react to a MouseEvent. |
boolean |
needsDynamicSymbol()
to support registers of arbitrary width, we need a dynamical Symbol |
protected void |
removeDisplayElementsFromSymbol()
currently unused |
void |
schedule(int bitIndex,
double time)
|
void |
setBitWidth(int n_new)
try to set a new width for this register. |
void |
setBitWidth(java.lang.String s)
|
void |
setPassTime(double t)
|
void |
setPassTime(java.lang.String s)
|
void |
setSymbol(Symbol s)
|
void |
show()
|
protected boolean |
showDInputPorts()
|
java.lang.String |
toString()
toString() - the usual info method |
void |
write(java.io.PrintWriter ps)
|
Methods inherited from class hades.simulator.SimObject |
getBindkey, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getToolTip, getVersionId, isVisible, keyPressed, message, 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 |
Methods inherited from interface hades.simulator.Simulatable |
message |
Field Detail |
protected int n_bits
protected Port port_C
protected StdLogic1164 value_U
protected StdLogic1164 value_X
protected StdLogic1164 value_0
protected StdLogic1164 value_1
protected StdLogic1164[] data
protected Label[] labels
protected FigCompound display
protected static double t_pass
protected static double t_setup
public final int w
public final int h
Constructor Detail |
public Register()
The width can be changed later in the 'initialize' method or interactively using the 'PropertySheet' dialog.
Method Detail |
protected int getDefaultBitWidth()
protected boolean showDInputPorts()
protected void initPortsAndData()
A register uses n_bits inputs, n_bits outputs, and one clock input.
public int getBitWidth()
public void setBitWidth(int n_new)
public void setBitWidth(java.lang.String s)
public boolean needsDynamicSymbol()
needsDynamicSymbol
in class SimObject
public void constructDynamicSymbol()
constructDynamicSymbol
in class SimObject
public boolean initialize(java.lang.String s)
SimObject
initialize
in class SimObject
public void write(java.io.PrintWriter ps)
write
in class SimObject
public double getPassTime()
public void setPassTime(double t)
public void setPassTime(java.lang.String s)
public void setSymbol(Symbol s)
setSymbol
in class SimObject
public void initDisplay()
protected void createGlobalPortSymbols()
protected void addDisplayElementsToSymbol()
protected void removeDisplayElementsFromSymbol()
public void show()
public void mousePressed(java.awt.event.MouseEvent me)
SimObject
Note that the HADES schematic editor will also deliver jfig.canvas.FigCanvasEvent object, which also include the world-coordinates of the Event.
mousePressed
in class SimObject
public void elaborate(java.lang.Object arg)
elaborate
in interface Simulatable
elaborate
in class SimObject
public void evaluate(java.lang.Object arg)
evaluate
in interface Simulatable
evaluate
in class SimObject
arg
- an arbitrary object argumentpublic void schedule(int bitIndex, double time)
public void configure()
SimObject
configure
in class SimObject
public SimObject copy()
SimObject
I am not yet sure about the correct and best semantic for copy(). Currently a new object of the current class is created by calling the default constructor.
copy
in class SimObject
public java.lang.String toString()
toString
in class SimObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |