dioscuri.module
Class ModuleMotherboard

java.lang.Object
  extended by dioscuri.module.AbstractModule
      extended by dioscuri.module.ModuleMotherboard
All Implemented Interfaces:
Addressable, Module
Direct Known Subclasses:
Motherboard

public abstract class ModuleMotherboard
extends AbstractModule
implements Addressable

Abstract class representing a generic motherboard module.


Nested Class Summary
 
Nested classes/interfaces inherited from interface dioscuri.interfaces.Module
Module.Type
 
Field Summary
 int ioSpaceSize
           
 
Fields inherited from class dioscuri.module.AbstractModule
type
 
Constructor Summary
ModuleMotherboard()
           
 
Method Summary
abstract  boolean getA20()
          Get value of A20 address line
abstract  long getCurrentInstructionNumber()
          Retrieve current number of instruction (instructions executed so far)
abstract  byte getIOPortByte(int portAddress)
          
abstract  byte[] getIOPortDoubleWord(int portAddress)
          
abstract  byte[] getIOPortWord(int portAddress)
          
abstract  boolean registerClock(ModuleClock clock)
          Registers a clock to motherboard
abstract  boolean requestTimer(Updateable device, int updatePeriod, boolean continuous)
          Requests a timer for given device at clock
abstract  boolean resetTimer(Updateable device, int updateInterval)
          Resets the timer of device (if any)
abstract  void setA20(boolean a20)
          Set value of A20 address line
abstract  boolean setIOPort(int portAddress, Addressable device)
          Set I/O address port to given device
abstract  void setIOPortByte(int portAddress, byte dataByte)
          
abstract  void setIOPortDoubleWord(int portAddress, byte[] dataDoubleWord)
          
abstract  void setIOPortWord(int portAddress, byte[] dataWord)
          
abstract  boolean setTimerActiveState(Updateable device, boolean runState)
          Set a timer to start/stop running
 
Methods inherited from class dioscuri.module.AbstractModule
getConnection, getConnections, getDebugMode, getDump, getExpectedConnections, getType, isConnected, reset, setConnection, setDebugMode, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface dioscuri.interfaces.Module
getConnection, getConnections, getDebugMode, getDump, getExpectedConnections, getType, isConnected, reset, setConnection, setDebugMode, start, stop
 

Field Detail

ioSpaceSize

public int ioSpaceSize
Constructor Detail

ModuleMotherboard

public ModuleMotherboard()
Method Detail

registerClock

public abstract boolean registerClock(ModuleClock clock)
Registers a clock to motherboard

Parameters:
clock -
Returns:
boolean true if registration is successfully, false otherwise

requestTimer

public abstract boolean requestTimer(Updateable device,
                                     int updatePeriod,
                                     boolean continuous)
Requests a timer for given device at clock

Parameters:
device -
continuous -
updatePeriod -
Returns:
boolean true if registration is successfully, false otherwise

setTimerActiveState

public abstract boolean setTimerActiveState(Updateable device,
                                            boolean runState)
Set a timer to start/stop running

Parameters:
device -
runState -
Returns:
boolean true if timer is reset successfully, false otherwise

resetTimer

public abstract boolean resetTimer(Updateable device,
                                   int updateInterval)
Resets the timer of device (if any)

Parameters:
device -
updateInterval -
Returns:
boolean true if reset is successfully, false otherwise

setIOPort

public abstract boolean setIOPort(int portAddress,
                                  Addressable device)
Set I/O address port to given device

Parameters:
portAddress -
device -
Returns:
boolean true if data is set successfully, false otherwise

getIOPortByte

public abstract byte getIOPortByte(int portAddress)
                            throws ModuleException

Specified by:
getIOPortByte in interface Addressable
Returns:
Throws:
ModuleException
See Also:
Addressable

setIOPortByte

public abstract void setIOPortByte(int portAddress,
                                   byte dataByte)
                            throws ModuleException

Specified by:
setIOPortByte in interface Addressable
Throws:
ModuleException
See Also:
Addressable

getIOPortWord

public abstract byte[] getIOPortWord(int portAddress)
                              throws ModuleException

Specified by:
getIOPortWord in interface Addressable
Returns:
Throws:
ModuleException
See Also:
Addressable

setIOPortWord

public abstract void setIOPortWord(int portAddress,
                                   byte[] dataWord)
                            throws ModuleException

Specified by:
setIOPortWord in interface Addressable
Throws:
ModuleException
See Also:
Addressable

getIOPortDoubleWord

public abstract byte[] getIOPortDoubleWord(int portAddress)
                                    throws ModuleException

Specified by:
getIOPortDoubleWord in interface Addressable
Returns:
Throws:
ModuleException
See Also:
Addressable

setIOPortDoubleWord

public abstract void setIOPortDoubleWord(int portAddress,
                                         byte[] dataDoubleWord)
                                  throws ModuleException

Specified by:
setIOPortDoubleWord in interface Addressable
Throws:
ModuleException
See Also:
Addressable

getA20

public abstract boolean getA20()
Get value of A20 address line

Returns:
true if set, false if not

setA20

public abstract void setA20(boolean a20)
Set value of A20 address line

Parameters:
a20 - true to set, false to clear

getCurrentInstructionNumber

public abstract long getCurrentInstructionNumber()
Retrieve current number of instruction (instructions executed so far)

Returns:
long containing number of instructions