Table of Contents
Previous Chapter
ACIS
The purpose of the Detector Electronics Assembly (DEA) Device is to provide access to Back End's DEA interface logic and registers.
NOTE: The responsibility for forming command words, and interpreting reply words is lies with the Protocols layer, specifically, by classes operating under the direction of the DeaManager. See Section TBD.
The DEA Device class provides the following features:
- Send a command to the DEA
- Read a response from the DEA
- Read the timestamp latched by the previous command sent to the DEA
Figure 26 illustrates the relationships used by the DeaDevice class.
FIGURE 26. DEA Device Class Relationships
DeaDevice- This class is responsible for providing access to the Back End Processor's Detector Electronics Assembly command and reply port hardware, and the microsecond science timestamp. This class provides functions to test the status of the command and reply ports (isCmdPortReady(), isReplyPortReady()), write commands to and read replies from the DEA (sendCmd(), readReply()), and read the microsecond timestamp value, latched when a command is sent to the DEA (readTimestamp()). This class uses the BepReg class to get access to the DEA interface register addresses (deaCmdReg(), deaStatReg(), deaTimeReg()), to read the command port and reply port status (getStatus()), and to reset the reply port ready bit (pulse()).
BepReg- This class represents the lowest level hardware access to the features provided by the Back End hardware control, status, and pulse registers. For more detail, see Section 5.0 .
Figure 27 illustrates the steps used to send a command to the DEA.
FIGURE 27. Send command to DEA
- client polls the DEA Device until the command port becomes available, using deaDevice.isCmdPortReady(). NOTE: It is client's responsibility to detect and handle time-outs on the DEA interface.
- isCmdPortReady() uses bepReg.getStatus() to read the BEP's Status Register. It tests the DEA Command Port Available bit in the returned status word, and returns whether or not the port is busy.
- Once the port is ready, client tells the DEA Device to send a command word to the DEA, using deaDevice.sendCmd().
- sendCmd() uses bepReg.deaCmdReg() to obtain the address of the DEA Command Port.
- sendCmd() then writes the command word into the port.
- The command port hardware then proceeds to serially clock the word out to the DEA.
- Once the command word has been clocked to the DEA, the interface hardware latches the current microsecond counter into the DEA Timestamp register.
Figure 28 illustrates the steps used to read a reply word, sent by the DEA in response to a command.
FIGURE 28. Read command reply
- client sends a command to the DEA (which is intended to illicit a response) using deaDevice.sendCmd() (see Section 11.4.1 for more detail on this action).
- sendCmd() writes the command word to the DEA Command Port.
- The DEA command hardware transmits the command word to the DEA
- Meanwhile the client polls the reply status using deaDevice.isReplyReady(). NOTE: It is client's responsibility to detect and handle time-outs on the DEA interface.
- isReplyReady() uses bepReg.getStatus() to read the BEP's Status Register. It then tests the DEA Reply Ready bit, and returns whether or not a response is in the DEA's Reply Port.
- Eventually, the commanded DEA board generates a response to the sent command, and sends it back to the BEP's DEA Reply Port.
- Once the reply is received, isReplyReady() indicates that a response is available. client then reads the reply word using deaDevice.readReply().
- readReply() uses bepReg.deaStatReg() to get the address of the DEA Reply Port.
- readReply() reads the value from the reply port.
- readReply() then resets the Reply Ready bit in the BEP's Status Register, using bepReg.pulse(). It then returns the read reply word to client.
Figure 29 illustrates the steps used to read the latched DEA command timestamp.
FIGURE 29. Read DEA Command Timestamp
- client sends a command to the DEA using deaDevice.sendCmd().
- sendCmd() writes the command word to the DEA Command Port
- The command port hardware transmits the command word to the DEA
- Meanwhile, client polls the command port status, using deaDevice.isCmdPortReady(). Once the port becomes available, the command word will have been completely sent, and the timestamp value will be valid.
- isCmdPortReady() uses bepReg.getStatus() to obtain the command port status.
- Eventually, the command word transmission will be complete, and the DEA interface hardware will latch the current microsecond counter into the DEA Timestamp register.
- Once isCmdPortReady() indicates that the command has been completely sent, client calls deaDevice.readTimestamp() to read the latched microsecond timestamp value. NOTE: It is the caller's responsibility to detect and handle time-outs on the DEA interface.
- readTimestamp() uses bepReg.deaTimeReg() to get the address of the timestamp register.
- readTimestamp() then reads the contents of the timestamp register, and returns the read value to client.
Documentation:
- This class is responsible for sending commands to the Detector Electronics Assembly (DEA) and providing status information send by the DEA.
Export Control:
- Public
Cardinality:
- 1
Hierarchy:
Superclasses:
none
Implementation Uses:
BepReg
Public Interface:
Operations:
isCmdPortReady()
isReplyReady()
readReply()
readTimestamp()
sendCmd()
Concurrency:
- Guarded
Persistence:
- Persistent
Public member of:
- DeaDevice
Return Class:
- Boolean
Documentation:
- This function tests the current status of the DEA command port (via BepReg::getStatus()). It returns BoolTrue if the DEA is able to accept commands and BoolFalse if the DEA is not ready to accept commands (i.e. the interface port is busy).
Concurrency:
- Synchronous
Public member of:
- DeaDevice
Return Class:
- Boolean
Documentation:
- This function tests the BEP status register (accessed via BepReg::getStatus()) to determine the DEA status register contains a reply word supplied by one of the DEA boards. This function returns BoolTrue if there is a DEA reply word ready for reading, and BoolFalse if a reply has not yet been received.
Concurrency:
- Synchronous
Public member of:
- DeaDevice
Return Class:
- unsigned
Documentation:
- This function reads and returns the contents of the DEA Status Register (whose address is determined using BepReg::deaStatReg()), and clears the DEA Reply Ready bit using BepReg::pulse().
Preconditions:
- The caller must ensure that a command which requests a reply has been sent at least TBD microseconds prior to invoking this function. See sendCmd() and isReplyReady(). This function DOES NOT CHECK to ensure that a reply is in the status register. If no reply is present, garbage may be returned to the caller.
Postconditions:
- The DEA reply ready status will remain de-asserted until another command requesting information is sent.
Concurrency:
- Guarded
Public member of:
- DeaDevice
Return Class:
- unsigned
Documentation:
- This function reads and returns the contents of the microsecond timestamp, latched when the last command was sent to the DEA. This function uses BepReg::deaTimeReg() to get the address of the timestamp register.
Preconditions:
- The client must ensure that the timestamp is read after the command has been sent to the DEA, using isCmdPortReady().
Concurrency:
- Guarded
Public member of:
- DeaDevice
Return Class:
- void
Arguments:
unsigned cmdWord
Documentation:
This function writes cmdWord to the DEA's Command Interface port.
Preconditions:
- The command port must be ready for use (see isCmdPortReady()). If not, a previous command may be corrupted by cmdWord.
Postconditions:
- If the command requested status information, this information will be available after TBD microseconds (see isReplyReady()).
Concurrency:
- Guarded
Table of Contents
Next Chapter