|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object avrora.sim.mcu.RegisterSet
The RegisterSet
class is a utility that simplifies the implementation
of certain IO registers that contain many types of fields whose bits may be spread
out and mixed up over multiple IO registers. For example, a 5 bit field used to
configure a device might be spread among multiple 1, 2, 3, or 4 bit fields across
multiple registers. This class allows a set of those registers to be created,
and collects together writes and reads easily.
Nested Class Summary | |
static class |
RegisterSet.Field
The Field class represents a collection of bits that represent
a quantity used by a device. |
class |
RegisterSet.MultiFieldRegister
The Register class implements an IO register that is
directly read and written by the program. |
Field Summary | |
protected java.util.HashMap |
fields
|
protected RegisterLayout |
layout
|
protected ActiveRegister[] |
registers
|
Constructor Summary | |
RegisterSet(RegisterLayout rl)
The constructor for the RegisterSet class creates a new register set with the specified register
layout and size. |
Method Summary | |
RegisterSet.Field |
getField(java.lang.String fname)
The getField() gets an object that represents an entire field which
may be stored across multiple registers in multiple bit fields. |
RegisterLayout |
getRegisterLayout()
The getRegisterLayout() method gets a reference to the register layout object for this
register set. |
int |
getSize()
The getSize() method returns the total number of registers in this register set. |
RegisterSet.Field |
installField(java.lang.String fname,
RegisterSet.Field fo)
The installField() method allows device implementations to substitute a new field
implementation for the named field. |
void |
installIOReg(ActiveRegister ar,
int ior)
The installIOReg() method installs a new register at the specified address. |
ActiveRegister[] |
share()
The share() method is NOT meant for general use. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final java.util.HashMap fields
protected final ActiveRegister[] registers
protected final RegisterLayout layout
Constructor Detail |
public RegisterSet(RegisterLayout rl)
RegisterSet
class creates a new register set with the specified register
layout and size.
rl
- the layout of all the registers in the setMethod Detail |
public int getSize()
getSize()
method returns the total number of registers in this register set.
public void installIOReg(ActiveRegister ar, int ior)
installIOReg()
method installs a new register at the specified address. This is intented
to be used only in the device implementations.
ar
- the active register to installior
- the address to install the active register topublic RegisterLayout getRegisterLayout()
getRegisterLayout()
method gets a reference to the register layout object for this
register set. The register layout describes where each IO register is and what fields it contains.
public ActiveRegister[] share()
share()
method is NOT meant for general use. It is used ONLY by the interpreter to
share the underlying array representation that maps from register address to an actual register
object.
public RegisterSet.Field getField(java.lang.String fname)
getField()
gets an object that represents an entire field which
may be stored across multiple registers in multiple bit fields. This object allows
access to the field's value without consideration for its underlying representation
in the IO register(s).
fname
- the name of the fieldWriter to get the fieldWriter representation for
FieldWriter
object that represents the fieldpublic RegisterSet.Field installField(java.lang.String fname, RegisterSet.Field fo)
installField()
method allows device implementations to substitute a new field
implementation for the named field. The field implementation can then override the appropriate
methods of the RegisterSet.Field
class to be notified upon writes.
fname
- the name of the fieldfo
- the field object to install for this field
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |