Table of Contents Previous Chapter
The purpose of the Parameter Block Management classes are to maintain sets of science and DEA housekeeping parameter blocks.
This section describes two main classes, the PblockList class, the Pblock class, and lists their respective subclasses. Detailed descriptions of each of the subclasses are provided in Appendix TBD.
The following lists the primary uses of the Parameter Block Management classes:
Figure 79 illustrates the class relationships used by the Parameter Block Management classes.
FIGURE 79. Parameter Block Management Classes
Pblock- This abstract class is responsible for interpreting the contents of a single parameter block, and for moving parameter data into and out of storage in Instruction Cache RAM. It provides functions to load the contents of its internal buffer from the contents of a command packet (loadFromCmdPkt), to copy its contents into a client supplied buffer (copyToBuffer), to store and retrieve the contents of its internal buffer to and from a region of instruction cache memory (storeToIcache and loadFromIcache), to verify the integrity of the block using its CRC value (checkCrc), and to retrieve the slot id and number of words contained within the block (getBlockId and getWordCnt). This class uses the services provided by the Devices::Mongoose device class to copy data, and to store and load data from instruction cache RAM.
PblockList- This abstract class is responsible for maintaining a fixed size collection of homogenous parameter blocks (Pblock or one of its subclasses). This class provides functions to replace the contents of one its parameter blocks with the contents of a command packet (replaceBlock), to check the integrity of all of its blocks (checkBlocks) and to retrieve the contents of one of its blocks (getBlock). It also provides functions to obtain and release a semaphore associated with the collection (waitForLock and releaseLock). This class uses the services provided by the Pblock class to manage the contents of a single parameter block, and contains a Executive::Semaphore instance associated with its collection of parameter blocks.
The following lists the various subclasses of Pblock. Each of these classes are responsible for providing functions with return the values of the various fields within the parameter block. The functions belonging to each of these classes are produced using a code-generator directly from the Instrument Program and Command List specification. The functions belonging to each of these classes are described in Appendix TBD:
PbTimedExp - Timed Exposure Parameter Block
PbContClock - Continuous Clocking Parameter Block
Pb2dWindow - 2D Window List Parameter Block
Pb1dWindow - 1D Window List Parameter Block
PbDeaHouse - DEA Housekeeping Parameter Block
The following lists the various subclasses of PblockList. There is one global instance of each of these classes within the instrument. Each of these classes is responsible for managing the collection of parameter blocks of the indicated type, and, in addition to the member functions provided by PblockList, overload the getBlock() function with a public member function. Rather than using the generic Pblock type as an argument, the overloaded functions require the correct parameter block type for their input arguments.
PblTimedExp -Manage all Timed Exposure Parameter Blocks (PbTimedExp)
PblContClock - Manage all Continuous Clocking Parameter Blocks (PbContClock)
Pbl2dWindow -Manage all 2D Window List Parameter Blocks (Pb2dWindow)
Pbl1dWindow- Manage all 1D Window List Parameter Blocks (Pb1dWindow)
PblDeaHouse - Manage all DEA Housekeeping Parameter Blocks (PbDeaHouse)
In order to reduce the opportunity that writes through a corrupted data pointer will corrupt parameter blocks intended for use for longer periods of time, parameter blocks within ACIS are maintained in Instruction Cache RAM. The Pblock class and its various subclasses are used as temporary objects which move data into and out of I-cache slots, and provide functions which retrieve specific fields of a given type of parameter block. Each parameter block slot in I-cache is sized to hold the maximum size allowed for a parameter block (i.e. one command packet). The number of slots reserved for each type of block is TBD. Upon power-on, this area of I-cache is loaded with default parameter blocks from the main instrument ROM. Subsequent resets do not modify the slot contents. Assuming, for now, that the instrument supports 4 blocks of each type, Table 22 illustrates the overall layout of parameter block slots within I-cache RAM, where the addresses and sizes are gross approximations. The first two slots of each type of block contain the default parameter blocks for Imaging and Spectroscopy observations.
TABLE 22. I-cache Parameter Block Layout (TBD)
--------------------------------------------------------------------------------- Region Address Byte Size Description Slot #--------------------------------------------------------------------------------- Patch Area (grow down from 0x800fffff 0x30400 0x800fffff) 0x800cfc00 Bad Pixel and Column Maps 0x800c2c00 0xd000 DEA Housekeeping Blocks 0x800c2a00 0x200 General Purpose 3 0x800c2800 0x200 General Purpose 2 0x800c2600 0x200 General Purpose 1 0x800c2400 0x200 Default 0 1D Window Blocks 0x800c2200 0x200 General Purpose 3 0x800c2000 0x200 General Purpose 2 0x800c1e00 0x200 Default Spectroscopy 1 0x800c1c00 0x200 Default Imaging 0 2D Window Blocks 0x800c1a00 0x200 General Purpose 3 0x800c1800 0x200 General Purpose 2 0x800c1600 0x200 Default Spectroscopy 1 0x800c1400 0x200 Default Imaging 0 Continuous Clocking Blocks 0x800c1200 0x200 General Purpose 3 0x800c1000 0x200 General Purpose 2 0x800c0e00 0x200 Default Spectroscopy 1 0x800c0c00 0x200 Default Imaging 0 Timed Exposure Blocks 0x800c0a00 0x200 General Purpose 3 0x800c0800 0x200 General Purpose 2 0x800c0600 0x200 Default Spectroscopy 1 0x800c0400 0x200 Default Imaging 0 System Configuration 0x800c0000 0x400 Code 0x80080000 0x40000 ---------------------------------------------------------------------------------
Figure 80 illustrates the steps used to store Timed Exposure Parameter blocks. The steps used to store Continuous Clocking, 2D Window, 1D Window and DEA Housekeeping parameter blocks are identical except for the identities of the parameter block list objects.
FIGURE 80. Load Parameter Block Scenario
Figure 81 illustrates the steps used to check the integrity of the collection of Timed Exposure Parameter blocks. The steps used to check other types of blocks are identical, except for the identities of the parameter block list objects.
FIGURE 81. Check integrity of stored Parameter Blocks
Figure 82 illustrates the steps used to retrieve the contents of a Timed Exposure Parameter block. The steps used to obtain Continuous Clocking, 2D Window, 1D Window and DEA Housekeeping parameter blocks are identical except for the identities of the parameter block list objects.
FIGURE 82. Retrieve contents of Parameter Block
Hierarchy:
Superclasses:
none
Public Uses:
Pblock
Public Interface:
Operations:
PblockList() checkBlocks() releaseLock() replaceBlock() waitForLock()
Protected Interface:
Operations:
getBlock()
Private Interface:
Has-A Relationships:
Arguments:
unsigned semid
unsigned* base
unsigned nSlots
unsigned wordCnt
Documentation:
This is the constructor for a parameter block list. semid is the RTX id for the semaphore the instance uses to synchronize access to the parameters, base is the starting address within I-cache used to maintain the list of blocks, nSlots is the number of parameter block slots maintained by the instance, and wordCnt is the number of 32-bit words in each parameter block slot.
Arguments:
unsigned slotid
Pblock& pblock
Documentation:
This function fills pblock with the parameter block data stored in the location identified by slotid. If successful, this function returns BoolTrue. If slotid is invalid, the wait for the lock times-out, or if the CRC of the requested block is invalid, this function returns BoolFalse.
Arguments:
const CmdPkt* cmdpkt
Documentation:
This function uses the cmdpkt to replace the contents of the block specified by the block id in the command. This function returns BoolTrue if the replacement succeeds, and BoolFalse if it fails.
Arguments:
unsigned timeout
Documentation:
This function waits for the parameter block list to become available, and locks it by calling lock.waitFor(). If successful, this function returns BoolTrue. If timeout is reached first, it returns BoolFalse.
Hierarchy:
Superclasses:
none
Public Uses:
CmdPkt
Implementation Uses:
Mongoose
Public Interface:
Operations:
checkCrc() copyToBuffer() getSlotId() getWordCnt() loadFromCmdPkt() loadFromIcache() storeToIcache()
Protected Interface:
Has-A Relationships:
Arguments:
unsigned* dstptr
Documentation:
This function copies the body of the parameter block to the buffer pointed to by dstptr. The caller must ensure that the destination buffer is large enough to hold the contents of the parameter block.
Arguments:
const CmdPkt* cmdpkt
Documentation:
This function loads the parameter block contents from the command packet pointed to by cmdpkt.
Arguments:
const unsigned* srcptr
Documentation:
This function loads the parameter block from data store in I-cache at the address, srcptr into its data buffer, using mongoose.icacheRead().
Arguments:
unsigned* dstptr
Documentation:
This function stores the parameter block information at the I-cache address dstptr, using mongoose.icacheWrite().