hades.models.register
Class CounterRE

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.gates.GenericGate
          extended byhades.models.register.CounterRE
All Implemented Interfaces:
java.lang.Cloneable, ContextToolTip, java.io.Serializable, Simulatable
Direct Known Subclasses:
CounterRE16, CounterRE8

public class CounterRE
extends GenericGate
implements Simulatable

CounterRE: abstract base class for n-bit positive-edge triggered counters with enable and reset. The maximum value of the counter is also user-settable. Subclasses output some of the (lower) bits of the counter to ports.

See Also:
Serialized Form

Field Summary
protected  int n_outputs
           
protected  PortStdLogic1164 port_CLK
           
protected  PortStdLogic1164 port_COUT
           
protected  PortStdLogic1164 port_ENABLE
           
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
CounterRE(int n_outputs)
           
 
Method Summary
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 SimObject copy()
          create a copy of this counter register with the same "limit" value and an initial counter value of "0".
 void elaborate(java.lang.Object arg)
          on elaboration, set the initial value of the counter.
 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 getLimit()
           
 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 counter from a String that contains the integer version id of this register, the propagation delay (in seconds), and the current "value" and maximum "limit" counter values.
 void setLimit(int limit)
           
 void setLimit(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", current counter "value" and maximum counter value "limit".
 
Methods inherited from class hades.models.gates.GenericGate
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

n_outputs

protected int n_outputs

port_CLK

protected PortStdLogic1164 port_CLK

port_NRESET

protected PortStdLogic1164 port_NRESET

port_ENABLE

protected PortStdLogic1164 port_ENABLE

port_COUT

protected PortStdLogic1164 port_COUT
Constructor Detail

CounterRE

public CounterRE(int n_outputs)
Method Detail

elaborate

public void elaborate(java.lang.Object arg)
on elaboration, set the initial value of the counter.

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", current counter "value" and maximum counter value "limit".

Overrides:
write in class GenericGate

initialize

public boolean initialize(java.lang.String s)
initialize the counter from a String that contains the integer version id of this register, the propagation delay (in seconds), and the current "value" and maximum "limit" counter values. '1001 0.5E-8 0 255'

Overrides:
initialize in class GenericGate

getValue

public int getValue()

setValue

public void setValue(java.lang.String s)

setValue

public void setValue(int value)

getLimit

public int getLimit()

setLimit

public void setLimit(java.lang.String s)

setLimit

public void setLimit(int limit)

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

copy

public SimObject copy()
create a copy of this counter register with the same "limit" value and an initial counter value of "0".

Overrides:
copy in class GenericGate