|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object avrora.sim.mcu.RegisterLayout
The RegisterLayout
class stores information about the IO register addresses for a particular
microcontroller model. It maps the names of the IO registers to their addresses and also contains information
about which fields are stored in which registers. When a microcontroller is instantiated, this class is used
to create an instance of RegisterSet
that corresponds to the layout of the registers on
this device.
Nested Class Summary | |
protected static class |
RegisterLayout.Field
|
protected static class |
RegisterLayout.RegisterInfo
|
protected static class |
RegisterLayout.SubField
|
Field Summary | |
protected java.util.HashMap |
fields
The fields field stores a reference to a hashmap that maps from a field name to a representation
of the field. |
protected RegisterLayout.RegisterInfo[] |
info
|
int |
ioreg_length
The ioreg_length field stores the length of each register in bits. |
int |
ioreg_size
The ioreg_size field stores the number of IO registers on this microcontroller. |
protected java.util.HashMap |
ioregAssignments
The ioregAssignments field stores a reference to a hashmap from IO register names to their
addresses. |
static RegisterLayout.Field |
RESERVED
|
static RegisterLayout.Field |
UNUSED
|
Constructor Summary | |
RegisterLayout(int is,
int rlength)
The constructor for the RegisterLayout class creates a new register layout with the specified
size. |
Method Summary | |
void |
addIOReg(java.lang.String n,
int ior_num)
The addIOReg() method adds a new IO register with the specified name and address to this
register layout. |
void |
addIOReg(java.lang.String n,
int ior_num,
java.lang.String format)
The addIOReg() method adds a new IO register with the specified name and address to this
register layout. |
int |
getIOReg(java.lang.String n)
The getIOReg() method retrieves the IO register number for the given IO
Register name for this microcontroller. |
boolean |
hasIOReg(java.lang.String n)
The hasIOReg() method simply checks whether this register layout has a register with
the specified name. |
RegisterSet |
instantiate()
The instantiate() method creates a new register set that contains the actual register
implementations that can be used in simulation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final RegisterLayout.Field UNUSED
public static final RegisterLayout.Field RESERVED
public final int ioreg_size
ioreg_size
field stores the number of IO registers on this microcontroller.
public final int ioreg_length
ioreg_length
field stores the length of each register in bits.
protected final java.util.HashMap ioregAssignments
ioregAssignments
field stores a reference to a hashmap from IO register names to their
addresses.
protected final RegisterLayout.RegisterInfo[] info
protected final java.util.HashMap fields
fields
field stores a reference to a hashmap that maps from a field name to a representation
of the field.
Constructor Detail |
public RegisterLayout(int is, int rlength)
RegisterLayout
class creates a new register layout with the specified
size.
is
- the number of registers in this register layoutMethod Detail |
public void addIOReg(java.lang.String n, int ior_num)
addIOReg()
method adds a new IO register with the specified name and address to this
register layout.
n
- the name of the IO registerior_num
- the address of the IO registerpublic void addIOReg(java.lang.String n, int ior_num, java.lang.String format)
addIOReg()
method adds a new IO register with the specified name and address to this
register layout. This variant of the method also accepts a format string describing which fields are
in this IO register. The format description is used to automatically generate an instance of the IO
register that puts the right bits of the right fields in the right places when the register is
written to.
n
- the name of the IO registerior_num
- the address of the IO registerformat
- the format of the IO register as a string describing which fields and which bits of
which fields are present in this IO registerpublic int getIOReg(java.lang.String n)
getIOReg()
method retrieves the IO register number for the given IO
Register name for this microcontroller.
n
- the name of the IO register such as "TCNT0"
java.util.NoSuchElementException
- if the specified IO register name does not have an assignmentpublic boolean hasIOReg(java.lang.String n)
hasIOReg()
method simply checks whether this register layout has a register with
the specified name.
n
- the name of the IO register
public RegisterSet instantiate()
instantiate()
method creates a new register set that contains the actual register
implementations that can be used in simulation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |