|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.kbna.dioscuri.module.Module
nl.kbna.dioscuri.module.ModuleDevice
nl.kbna.dioscuri.module.ModulePIT
nl.kbna.dioscuri.module.pit.PIT
public class PIT
An implementation of a Programmable Interval Timer (PIT) module based on the Intel 82C54 PIT chip.
ModuleDevice,
Metadata module
********************************************
general.type : pit
general.name : Programmable Interval Timer (PIT) based on Intel 82C54 PIT
general.architecture : Von Neumann
general.description : Implements the Intel 82C54 PIT extended with a system clock
general.creator : Tessella Support Services, Koninklijke Bibliotheek, Nationaal Archief of the Netherlands
general.version : 1.0
general.keywords : pit, timer, counter
general.relations : motherboard, cpu
general.yearOfIntroduction : 1994
general.yearOfEnding :
general.ancestor : Intel 8253
general.successor :
pit.numberOfCounters : 3
pit.numberOfModes : 6
pit.clockFrequency : 1193181 (ideally, but maybe not feasible in Java)
Notes:
This PIT is implemented to be as close as possible to the functional behaviour of an original Intel 82C54.
However, not all logic has to be implemented. Not part of this implementation is:
- Signal lines WR, RD, CD, A0 and A1.
Normally counters 0,1,2 are defined to a particular task (RTC, etc.). In this implementation counter zero
generates a IRQ 0 if the count becomes zero. Other counters are not assigned.
In the original PIT, the clock signal is generated by a separate hardware component (crystal).
In the emulated PIT, the clock signal is generated by a separate moduleClock (imitates the crystal, but may have a different frequency).| Field Summary | |
|---|---|
private Counter[] |
counters
|
private ModuleCPU |
cpu
|
private boolean |
debugMode
|
private Emulator |
emu
|
protected int |
irqNumber
|
private boolean |
isObserved
|
private static java.util.logging.Logger |
logger
|
static int |
MODULE_ID
|
static java.lang.String |
MODULE_NAME
|
static java.lang.String |
MODULE_TYPE
|
private java.lang.String[] |
moduleConnections
|
protected ModuleMotherboard |
motherboard
|
protected ModulePIC |
pic
|
private static int |
PORT_KB_CTRL_B
|
private static int |
PORT_PIT_CONTROLWORD1
|
private static int |
PORT_PIT_CONTROLWORD2
|
private static int |
PORT_PIT_COUNTER0
|
private static int |
PORT_PIT_COUNTER1
|
private static int |
PORT_PIT_COUNTER2
|
private static int |
PORT_PIT_COUNTER3
|
private static int |
PORT_PIT_EISA
|
private static int |
PORT_PIT_EISA_PIT2A
|
private static int |
PORT_PIT_EISA_PIT2B
|
private static int |
PORT_PIT_TIMER2
|
private int |
updateInterval
|
| Constructor Summary | |
|---|---|
PIT(Emulator owner)
Class constructor |
|
| Method Summary | |
|---|---|
java.lang.String[] |
getConnection()
Returns a String[] with all names of modules it needs to be connected to |
byte[] |
getData(Module requester)
Returns data from this module |
boolean |
getDebugMode()
Returns the status of the debug mode toggle |
java.lang.String |
getDump()
Returns a dump of this module |
int |
getID()
Returns the ID of the module |
byte |
getIOPortByte(int portAddress)
Return a byte from I/O address space at given port |
byte[] |
getIOPortDoubleWord(int portAddress)
Return a double word from I/O address space at given port |
byte[] |
getIOPortWord(int portAddress)
Return a word from I/O address space at given port |
java.lang.String |
getName()
Returns the name of the module |
java.lang.String |
getType()
Returns the type of the module |
int |
getUpdateInterval()
Retrieve the interval between subsequent updates |
boolean |
isConnected()
Checks if this module is connected to operate normally |
boolean |
isObserved()
Returns the status of observed toggle |
protected void |
lowerIRQ(Counter counter)
|
protected void |
raiseIRQ(Counter counter)
Sets the clock rate for this PIT |
boolean |
reset()
Reset all parameters of module |
boolean |
setConnection(Module mod)
Sets up a connection with another module |
boolean |
setData(byte[] data,
Module sender)
Set data for this module |
boolean |
setData(java.lang.String[] data,
Module sender)
Set String[] data for this module |
void |
setDebugMode(boolean status)
Sets the debug mode toggle |
void |
setIOPortByte(int portAddress,
byte data)
Set a byte in I/O address space at given port |
void |
setIOPortDoubleWord(int portAddress,
byte[] dataDoubleWord)
Set a double word in I/O address space at given port |
void |
setIOPortWord(int portAddress,
byte[] dataWord)
Set a word in I/O address space at given port |
void |
setObserved(boolean status)
Sets the observed toggle |
void |
setUpdateInterval(int interval)
Defines the interval between subsequent updates |
void |
start()
Starts the module |
void |
stop()
Stops the module |
void |
update()
Update device |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Emulator emu
private java.lang.String[] moduleConnections
protected ModuleMotherboard motherboard
private ModuleCPU cpu
protected ModulePIC pic
private Counter[] counters
private boolean isObserved
private boolean debugMode
protected int irqNumber
private int updateInterval
private static java.util.logging.Logger logger
public static final int MODULE_ID
public static final java.lang.String MODULE_TYPE
public static final java.lang.String MODULE_NAME
private static final int PORT_PIT_COUNTER0
private static final int PORT_PIT_COUNTER1
private static final int PORT_PIT_COUNTER2
private static final int PORT_PIT_CONTROLWORD1
private static final int PORT_PIT_COUNTER3
private static final int PORT_PIT_CONTROLWORD2
private static final int PORT_PIT_EISA
private static final int PORT_PIT_TIMER2
private static final int PORT_PIT_EISA_PIT2A
private static final int PORT_PIT_EISA_PIT2B
private static final int PORT_KB_CTRL_B
| Constructor Detail |
|---|
public PIT(Emulator owner)
| Method Detail |
|---|
public int getID()
getID in class ModuleModulepublic java.lang.String getType()
getType in class ModuleModulepublic java.lang.String getName()
getName in class ModuleModulepublic java.lang.String[] getConnection()
getConnection in class Modulepublic boolean setConnection(Module mod)
setConnection in class Modulemod - Module that is to be connected to this class
Modulepublic boolean isConnected()
isConnected in class Modulepublic boolean reset()
reset in class Modulepublic void start()
start in class ModuleModulepublic void stop()
stop in class ModuleModulepublic boolean isObserved()
isObserved in class ModuleModulepublic void setObserved(boolean status)
setObserved in class Modulestatus - Modulepublic boolean getDebugMode()
getDebugMode in class ModuleModulepublic void setDebugMode(boolean status)
setDebugMode in class Modulestatus - Modulepublic byte[] getData(Module requester)
getData in class ModuleModule - requester, the requester of the data
Module
public boolean setData(byte[] data,
Module sender)
setData in class Modulebyte[] - dataModule - sender, the sender of the data
Module
public boolean setData(java.lang.String[] data,
Module sender)
setData in class ModuleString[] - dataModule - sender, the sender of the data
Modulepublic java.lang.String getDump()
getDump in class ModuleModulepublic int getUpdateInterval()
getUpdateInterval in class ModuleDevicepublic void setUpdateInterval(int interval)
setUpdateInterval in class ModuleDeviceint - interval in microsecondspublic void update()
update in class ModuleDevice
public byte getIOPortByte(int portAddress)
throws ModuleException,
ModuleUnknownPort
getIOPortByte in class ModuleDeviceint - portAddress containing the address of the I/O port
ModuleException, - ModuleWriteOnlyPortException
ModuleException
ModuleUnknownPort
public void setIOPortByte(int portAddress,
byte data)
throws ModuleException,
ModuleUnknownPort
setIOPortByte in class ModuleDeviceint - portAddress containing the address of the I/O portbyte - data
ModuleException, - ModuleWriteOnlyPortException
ModuleException
ModuleUnknownPort
public byte[] getIOPortWord(int portAddress)
throws ModuleException,
ModuleWriteOnlyPortException
ModuleDevice
getIOPortWord in class ModuleDeviceModuleException
ModuleWriteOnlyPortException
public void setIOPortWord(int portAddress,
byte[] dataWord)
throws ModuleException
ModuleDevice
setIOPortWord in class ModuleDeviceModuleException
public byte[] getIOPortDoubleWord(int portAddress)
throws ModuleException,
ModuleWriteOnlyPortException
ModuleDevice
getIOPortDoubleWord in class ModuleDeviceModuleException
ModuleWriteOnlyPortException
public void setIOPortDoubleWord(int portAddress,
byte[] dataDoubleWord)
throws ModuleException
ModuleDevice
setIOPortDoubleWord in class ModuleDeviceModuleExceptionprotected void raiseIRQ(Counter counter)
long - milliseconds, the time between two consequtive clock pulsesprotected void lowerIRQ(Counter counter)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||