|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjmce.sim.AbstractHardware
jmce.sim.AbstractPeripheral
public abstract class AbstractPeripheral
Abstract implementation of Peripheral
To support idle loop detection and save cpu time the peripheral must call the method setIdle when a status operation is made and setLive when a read / write operation is made. So after 10 seconds of only status operation any subseguent call to setIdle release the cpu.
Field Summary | |
---|---|
protected CPU |
cpu
|
Constructor Summary | |
---|---|
AbstractPeripheral()
Default constructor |
|
AbstractPeripheral(java.lang.String name)
Constructor with name |
Method Summary | |
---|---|
int |
idle()
If a CPU is registred call the idle method oterwise use the Thread.yield method to wait for few ms. |
void |
registerCPU(CPU cpu)
Register a parent CPU for future reference. |
protected void |
setIdle()
Set idle. |
protected void |
setLive()
Set live. |
Methods inherited from class jmce.sim.AbstractHardware |
---|
addHardware, createFrame, destroy, getHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareForName, getHardwareInstances, getHardwareTree, getName, getParent, init, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface jmce.sim.Hardware |
---|
addHardware, destroy, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareInstances, getHardwareTree, getName, getParent, init, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName |
Field Detail |
---|
protected CPU cpu
Constructor Detail |
---|
public AbstractPeripheral(java.lang.String name)
public AbstractPeripheral()
Method Detail |
---|
public void registerCPU(CPU cpu) throws SIMException
Peripheral
registerCPU
in interface Peripheral
SIMException
public int idle() throws SIMException
Thread.yield
method to wait for few ms.
idle
in interface Peripheral
SIMException
protected final void setIdle() throws SIMException
Called from sub class when the cpu make a status I/O operation. After 10 seconds of only status operation the method call automatically idle.
SIMException
idle()
,
setLive()
protected final void setLive()
Called from sub class when the cpu make a read / write opearation.
setIdle()
|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |