|
miSim | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--misim.Register | +--misim.Port
The Port class extends Register to emulate microcontroller Ports, with associated I/O capabilities. Ports have the means to receive input, generate output and inform PortListeners of changes to their output state. Methods to add and remove PortListeners are provided, though this more easily achieved through similar methods in the MachineState class.
Field Summary | |
protected int |
inputBits
|
static int |
MAX_PORT_ID
|
int |
outputMask
|
static java.lang.String |
Port_A
|
static java.lang.String |
Port_B
|
static java.lang.String |
Port_C
|
static java.lang.String |
Port_D
|
static java.lang.String |
Port_E
|
static int |
PortAId
|
static int |
PortBId
|
static int |
PortCId
|
static int |
PortDId
|
static int |
PortEId
|
protected int |
portIdentifier
|
Fields inherited from class misim.Register |
machineState, simple, val |
Constructor Summary | |
Port(MachineState machineState,
int bitWidth)
Constructor method, sets machine state and bit width |
Method Summary | |
void |
addPortListener(PortListener pl)
Add a port listener to this Port. |
abstract void |
checkPortInterrupt()
Check to see if the new data placed on this port by an external device will cause an interrupt. |
void |
clearPortBits(int data)
Clear the bits being applied to this port by an external device, this performs a logical AND of the port inputs with the complement of the given data. |
int |
getBitWidth()
Return the bit width of this port. |
int |
getIdentifier()
Return a unique identifier for this port. |
void |
handleUpdate()
Dispatch a Port event to any listeners that are interested in it. |
void |
rebuildPortMasks()
This rebuilds the masks for identifying when a significant event has occured on the processor ports. |
void |
removePortListener(PortListener pl)
Remove a port listener from this port. |
void |
setPortBits(int data)
Set the bits being applied to this port by an external device, this performs a logical OR of the given data. |
void |
writePort(int data,
int mask)
Set the data applied to this port according to the given mask and input. |
Methods inherited from class misim.Register |
toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String Port_A
public static final java.lang.String Port_B
public static final java.lang.String Port_C
public static final java.lang.String Port_D
public static final java.lang.String Port_E
public static final int PortAId
public static final int PortBId
public static final int PortCId
public static final int PortDId
public static final int PortEId
public static final int MAX_PORT_ID
public int outputMask
protected int portIdentifier
protected int inputBits
Constructor Detail |
public Port(MachineState machineState, int bitWidth)
Method Detail |
public void handleUpdate()
handleUpdate
in class Register
public abstract void checkPortInterrupt()
public void setPortBits(int data)
data
- The new bits applied to this portpublic void clearPortBits(int data)
data
- The new bits applied to this portpublic void writePort(int data, int mask)
data
- The data being applied to this portmask
- The mask indicating which bits should be altered.public int getIdentifier()
public int getBitWidth()
public void addPortListener(PortListener pl)
pl
- The port listener to addpublic void removePortListener(PortListener pl)
pl
- The port listener to remove.public void rebuildPortMasks()
|
miSim | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |