hades.models.rtlib.memory
Class RealTimeClock

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.rtlib.memory.GenericMemory
          extended byhades.models.rtlib.memory.RealTimeClock
All Implemented Interfaces:
java.lang.Cloneable, ContextToolTip, Memory, java.io.Serializable, Simulatable, Wakeable

public class RealTimeClock
extends GenericMemory
implements Wakeable

RealTimeClock - a generic real-time clock with RAM-like addressing and control.

The RTC model contains the following registers:

       addr:      contents:        range:
        0x0:      milliseconds     (0..999)
        0x1:      seconds          (0..59)
        0x2:      minutes          (0..59)
        0x3:      hours            (0..23)
        0x4:      day              (0..30)
        0x5:      month            (0..11)
        0x6:      year             (0..9999)
   
When chip-select or output enable are high, the data output of the RTC is tristated and writes are ignored. This component models a standard MSI/LSI RTC with asynchronous write enable - the adress is never latched. As long as write enable is low, the input data is written to the currently selected address.

Note that the model currently does not check for timing violations during write cycles.

See Also:
Serialized Form

Field Summary
static int ADDR_DAY
           
static int ADDR_HOUR
           
static int ADDR_MILLIS
           
static int ADDR_MINUTE
           
static int ADDR_MONTH
           
static int ADDR_SECOND
           
static int ADDR_YEAR
           
static int[] limits
           
protected  PortStdLogicVector port_A
           
protected  PortStdLogicVector port_DIN
           
protected  PortStdLogicVector port_DOUT
           
protected  PortStdLogic1164 port_nCS
           
protected  PortStdLogic1164 port_nOE
           
protected  PortStdLogic1164 port_nWE
           
static double t_access
           
static double t_min_we_cycle
           
static double t_setup
           
protected  double t_tick
           
static double t_tristate
           
static double t_undefined
           
 
Fields inherited from class hades.models.rtlib.memory.GenericMemory
bit_mask, data, enableAnimationFlag, last_read_addr, last_read_data, last_write_addr, last_write_data, MEF, n_bits, n_words, resourcename, TRISTATED, UNDEFINED, vector_000, vector_111, vector_UUU, vector_XXX, vector_ZZZ
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
RealTimeClock()
          RealTimeClock constructor
 
Method Summary
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
protected  void constructPorts()
           
 void elaborate(java.lang.Object arg)
          elaborate(): If the RTC data values are 'XXX', we initialize the clock to default data.
 void evaluate(java.lang.Object arg)
          evaluate(): If either port_nCS, port_nOE or port_nWE are undefined, the RealTimeClock data is invalidated, and the DOUT value is undefined.
 void wakeup(java.lang.Object arg)
          wakeup(): This method is called by the simulation engine to wakeup the simulation object.
 
Methods inherited from class hades.models.rtlib.memory.GenericMemory
addMemoryListener, addMemoryListenerOld, canChangeSize, checkInvalidateMemory, constructStandardValues, createMemory, dataAtAddressIsUndefined, dbg, getAddressBusWidth, getAddrOffset, getBitsPerWord, getConfigDialog, getDataArray, getDataAt, getEnableAnimationFlag, getExternalResources, getHexDigitsPerWord, getHexString, getInstructionDecoder, getPropertySheet, getResourcename, getSize, getToolTip, initialize, initializeWithDefaultValues, initializeWithRandomValues, initializeWithX, initializeWithZeroes, isConnected, main, merge, needsExternalResources, notifyReadListeners, notifyReadListenersOld, notifyWriteListeners, notifyWriteListenersOld, parse, parseLabelLine, parseRAM, removeMemoryListener, removeMemoryListenerOld, resize, save, setBitsPerWord, setDataArray, setDataAt, setEnableAnimationFlag, setEnableAnimationFlag, setInstructionDecoder, setResourcename, setSize, toString, warning, write
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, copy, getBindkey, getClassLoader, getDebug, getEditor, getFullName, getName, getParent, getPort, getPorts, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getVersionId, isVisible, keyPressed, message, mousePressed, needsDynamicSymbol, setClassLoader, setConsole, setDebug, setEditor, setName, setParent, setPorts, setSimulator, setSymbol, 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

port_A

protected PortStdLogicVector port_A

port_DIN

protected PortStdLogicVector port_DIN

port_DOUT

protected PortStdLogicVector port_DOUT

port_nWE

protected PortStdLogic1164 port_nWE

port_nCS

protected PortStdLogic1164 port_nCS

port_nOE

protected PortStdLogic1164 port_nOE

t_access

public static final double t_access
See Also:
Constant Field Values

t_tristate

public static final double t_tristate
See Also:
Constant Field Values

t_undefined

public static final double t_undefined
See Also:
Constant Field Values

t_setup

public static final double t_setup
See Also:
Constant Field Values

t_min_we_cycle

public static final double t_min_we_cycle
See Also:
Constant Field Values

t_tick

protected double t_tick

ADDR_MILLIS

public static final int ADDR_MILLIS
See Also:
Constant Field Values

ADDR_SECOND

public static final int ADDR_SECOND
See Also:
Constant Field Values

ADDR_MINUTE

public static final int ADDR_MINUTE
See Also:
Constant Field Values

ADDR_HOUR

public static final int ADDR_HOUR
See Also:
Constant Field Values

ADDR_DAY

public static final int ADDR_DAY
See Also:
Constant Field Values

ADDR_MONTH

public static final int ADDR_MONTH
See Also:
Constant Field Values

ADDR_YEAR

public static final int ADDR_YEAR
See Also:
Constant Field Values

limits

public static final int[] limits
Constructor Detail

RealTimeClock

public RealTimeClock()
RealTimeClock constructor

Method Detail

constructPorts

protected void constructPorts()
Overrides:
constructPorts in class GenericMemory

elaborate

public void elaborate(java.lang.Object arg)
elaborate(): If the RTC data values are 'XXX', we initialize the clock to default data.

Specified by:
elaborate in interface Simulatable
Overrides:
elaborate in class GenericMemory

wakeup

public void wakeup(java.lang.Object arg)
Description copied from interface: Wakeable
wakeup(): This method is called by the simulation engine to wakeup the simulation object.

Specified by:
wakeup in interface Wakeable

evaluate

public void evaluate(java.lang.Object arg)
evaluate(): If either port_nCS, port_nOE or port_nWE are undefined, the RealTimeClock data is invalidated, and the DOUT value is undefined. If port_nCS is high, the RealTimeClock is inactive. That is, the outputs are tristated, and all write requests are ignored. If port_nCS is low, the output is driven with the memory contents of the currently active address. Also, as long as port_nWE is low, the input data is written to the active address.

Warning: The RealTimeClock model currently does not check for timing violations or address glitches during write cycles. Instead, the corresponding memory locations are written.

Specified by:
evaluate in interface Simulatable
Overrides:
evaluate in class GenericMemory

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 GenericMemory