hades.models.rtlib.memory
Class MR20

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

public class MR20
extends MR

MR20 - a microcode ROM with some bus- and 20 single outputs.

See Also:
Serialized Form

Field Summary
(package private) static java.lang.String[] labels
           
 
Fields inherited from class hades.models.rtlib.memory.MR
alabel, cache_read_addr, D_SIZE, fdata, fdefaultValues, flabel, flength, fseparator, lengthMask, MEF, n_fields, n_words, port_A, port_D, port_S0, port_S1, port_STATE, port_X, port_Y, stateLabel, t_access, t_tristate, 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, n_bits, 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
MR20()
          MR20 constructor
 
Method Summary
(package private)  boolean checkChange(int addr, int field)
           
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 void createField(int index, int length, java.lang.String name)
           
 void createTypesAndFieldsAndMemory()
           
 void elaborate(java.lang.Object arg)
          elaborate(): On elaboration, the inputs of the MR20 will be undefined.
 void evaluate(java.lang.Object arg)
          evaluate(): Return the data at address after t_access
 boolean parse(java.io.BufferedReader reader)
          parse RAM data from a file specified via its Java 1.1 resourcename.
 boolean save(java.io.PrintWriter PW)
          write the memory data in a trivial addr:data format, one address per line.
 void setData(int addr, int field, int value)
          set the data of microcode field 'field' at address 'addr' to 'value'.
 void setDataAt(int address, long value)
           
 void setDSize()
           
 
Methods inherited from class hades.models.rtlib.memory.MR
constructPorts, createDefaultValues, getData, getFieldBits, getFieldChars, getFieldName, getNumberOfFields, getSize, getStateLabel, getToolTip, initializeWithDefaultValues, isDefaultValue, isSeparator, schedulePortOutput, scheduleSingleOutput, setFieldName, setStateLabel, setSymbol
 
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, initialize, initializeWithRandomValues, initializeWithX, initializeWithZeroes, isConnected, main, merge, needsExternalResources, notifyReadListeners, notifyReadListenersOld, notifyWriteListeners, notifyWriteListenersOld, parseLabelLine, parseRAM, removeMemoryListener, removeMemoryListenerOld, resize, setBitsPerWord, setDataArray, 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, setVersionId, setVisible, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

labels

static java.lang.String[] labels
Constructor Detail

MR20

public MR20()
MR20 constructor

Method Detail

setDSize

public void setDSize()
Overrides:
setDSize in class MR

createTypesAndFieldsAndMemory

public void createTypesAndFieldsAndMemory()
Overrides:
createTypesAndFieldsAndMemory in class MR

createField

public void createField(int index,
                        int length,
                        java.lang.String name)
Overrides:
createField in class MR

setData

public void setData(int addr,
                    int field,
                    int value)
set the data of microcode field 'field' at address 'addr' to 'value'.

We also reset the internal cache_read_addr to a negative value, to ensure that the changed data will appear in the simulation

Overrides:
setData in class MR

save

public boolean save(java.io.PrintWriter PW)
write the memory data in a trivial addr:data format, one address per line. Both address and data are hex-formatted and separated by a colon (and optionally, some blanks).

Specified by:
save in interface Memory
Overrides:
save in class MR

parse

public boolean parse(java.io.BufferedReader reader)
              throws java.lang.Exception
parse RAM data from a file specified via its Java 1.1 resourcename. If the file is not found or contains illegal data, the RAM is re-initialized to the all-invalid state.

Comment lines starting with '#' or ';' are allowed in the data part of the microcode file only.

Specified by:
parse in interface Memory
Overrides:
parse in class MR
Throws:
java.lang.Exception

setDataAt

public void setDataAt(int address,
                      long value)
Specified by:
setDataAt in interface Memory
Overrides:
setDataAt in class GenericMemory

elaborate

public void elaborate(java.lang.Object arg)
elaborate(): On elaboration, the inputs of the MR20 will be undefined. Correspondingly, the outputs are, too.

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

evaluate

public void evaluate(java.lang.Object arg)
evaluate(): Return the data at address after t_access

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

checkChange

boolean checkChange(int addr,
                    int field)

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 MR