At the beginning of each science run, low-level CCD clocking sequences are copied from the ACIS Back End Processor (BEP) into Sequencer RAM (SRAM) in the video boards. So is the higher-level Pixel Ram (PRAM) code, which executes SRAM instructions in complete charge transfer sequences.
Charge accumulates in the 1026 row x 1024 column image store on each active CCD. The accumulated charge is transferred, all rows together in parallel, into the 1024 x 1024 frame store. To prevent a sudden large power draw, the transfers are staggered, with only one chip clocked at a time. Each chip's transfer takes 0.04104 seconds, a period referred to as the smear time. To transfer the maximum number of six chips, with five smear intervals, therefore takes 0.2052 seconds.
The data is then transferred from frame store to the video boards in the Detector Electronics Assembly (DEA) while charge for the next frame accumulates in the image store. Transfer to the DEA occurs simultaneously for all active chips. Charge moves down the frame store a row at a time in parallel, and then the bottom row is clocked serially through four readout nodes, a pixel at a time. (In 2x2 summing, which has not yet been used for a science run on orbit, framestore rows move two at a time, and pixels are read out of the nodes two at a time as well.) At the end of each row, the number of overclock pairs requested by the parameter block are clocked through each node. Finally, there's a horizontal synch pseudo-pixel for each row, and a vertical synch for each frame.
The video boards in the DEA digitize the analog charges clocked out of the CCDs. To each 12 bits of digitized pixel data, they append a 4-bit pixel code (start image, start row, pixel value, overclock, or ignore), prescribed by PRAM. The resulting 2-byte words are multiplexed to the appropriate Front End Processer (FEP) in the ACIS Digital Processor Assembly (DPA).
Each FEP contains the following special storage areas:
subarrayRowCount
specified for subarray readout) from
frame store into the FEP image buffer. Otherwise, firmware just throws away
pixels until the next vertical synch arrives.
The BEP accesses each of the FEP's special storage areas via
hardware mapping of FEP to shared BEP memory. The hardened areas of
FEP memory (D-cache and I-cache) are not directly shared. When it
needs to access those, as for FEP loads or certain
readFep
commands,
the BEP does so by inserting commands into the FEP/BEP mailbox.
The FEP ring buffer is of particular interest, and is described in greater detail in section 4.10 of the Detailed Design Specification. Within the ring buffer, FEP records are laid out in an array of 8184 physical records of 32 4-byte words each. Some FEP-to-BEP record types will utilize the whole 32 words; some (e.g., raw rows and raw histograms) will span several physical records; and some (e.g., event data records and especially exposure records) are less efficient, using only a fraction of a physical record.
The mailbox maintains one pointer to the next ring buffer record to be read by the BEP, and a second pointer to the next record to be written by the FEP. Only the FEP can write to the ring buffer array, and it is inhibited from writing there when the buffer is full (i.e., when the read and write indexes coincide.) The BEP copies each record from shared memory to its own private memory in order to process it, updating the read pointer and thus freeing space again in the ring buffer. When the ring buffer is empty, or the BEP has processed 100 records, it moves on to the next FEP's ring buffer.
Nine ring buffer record types are defined. Of these, one (fiducial pixels) was never implemented in the BEP, one (errors) accounts for a negligible portion of the traffic, and two (histogram and CC 1x3 events) have never been used since orbital activation. Event histograms are compiled by the BEP from TE 3x3 event records in the FEP. That leaves the following types:
Bias telemetry - Once a bias map is calculated,
the bias thief thread in the BEP goes through the FEPs in order and reads
their bias maps via the FEP/BEP memory-mapped interface, starting with
the row furthest from the framestore. The ring buffer is not involved. For
TE modes, unless biasCompressionSlotIndex
in
the parameter block is 255, the bias thief compresses the data
using the Huffman table in the specified slot.
From the resulting data, it constructs
dataCcBiasMap
or dataTeBiasMap
telemetry packets. A packet must contain a whole number of rows,
and if the "compression" algorithm expands a single-row packet to
more than 4096 bytes, that row will be transmitted in an
uncompressed packet.
Depending on how successfully compression goes, each
dataTeBiasMap
packet may hold from 1 to 10 rows of bias data.
(Compression has been surprisingly good, and we get 9 or 10 rows pretty
regularly, with a compression factor a bit under four.)
Total telemetry in the TE case is therefore
(# of chips) * (# of rows per chip) * (1 / rows per bias telemetry
packet) * 2608 bytes. For a full six-chip run, this works out to
aboout 9.5 megabytes uncompressed.
Event data - There are three words (12 bytes) of overhead in each data packet for raw and event processing modes. Any one packet contains data for only a single CCD, and apart from event histograms a new packet is started for each frame. Data types consume telemetry at the following rates:
TE or CC | type | data unit | words/unit | bits/unit |
TE | faint | event | 4 | 128 |
TE | VF | event | 10 | 320 |
TE | F+Bias | event | 7.375 | 236 |
TE | Graded | event | 1.8125 | 58 |
CC | 3x3 | event | 4 | 128 |
CC | Graded | event | 1.0625 | 34 |
TE | Raw | pixel | ~ 0.1 | ~3.7 |
CC | Raw | pixel | ~0.1 | ~3.7 |
TE | EvtHist | bin | 1 | 32 |
Each packet class of the BEP software has access to its own fixed pool of telemetry buffers within BEP bulk memory. (Originally, each packet class corresponded to an execution thread. With the advent of the "untricklebias" patch, the science thread began handling both science and biasThief buffers.) A thread will allocate a buffer from its pool, format a packet within the buffer, and "post" the buffer, registering it with an overall telemetry queue. The contents of buffers in the queue get sent to the RCTU on a first-in, first-out basis. The only priority mechanism among threads is the relative size of their buffer allocations. When a packet has been completely read out by the RCTU, its buffer is freed up for re-use by the thread that owns it.
Accordingly, when telemetry gets backed up, a thread may find it has a packet ready to write, but no free buffer within the appropriate telemetry pool. It must wait for a fresh buffer of the proper type to become available. While waiting, command manager and housekeeping threads may be forced to drop further packets. The number of dropped software housekeepig packets, and the opcode of the most recent dropped command, are noted in software housekeeping. When raw or event mode science buffers are sufficiently backed up, FEP ring buffers will fill, and the FEP will drop new frames.
The threads, the size of their buffer allocations, the number of packets those buffers can hold, and the total telemetry involved, are as indicated in the table below, adapted from pp. 125-126 of Reference [2].
Thread | Packet Type | Buffer size | Buffers in pool | Packet size | Telemetry when full | Bias Thief | dataCcBiasMap | 4092 | 20 | 1564 | 1564 |
Bias Thief | dataTeBiasMap | 4092 | 20 | 3300 | 66K |
Science | dataTeEvtHist | 2048 | 400 | 2048 | 800K |
Science | dataTeRaw | 2048 | 400 | ~1400 | ~560K |
Science | dataCcRaw | 2048 | 400 | ~1400 | ~560K |
Science | dataTeFaint (also cc3x3) |
2048 | 400 | ~350 | ~150K |
Science | dataTeVeryFaint | 2048 | 400 | ~600 | ~250K |
Command Mgr | commandEcho | 2048 | 4 | 520 | 2080 |
Memory Mgr | bepReadReply fepReadReply pramReadReply sramReadReply bepExecuteReply fepExecuteReply |
4092 | 1 | < 4092 | < 4092 |
DEA Hskpg | deaHousekeepingData | 1024 | 8 | 1024 | 8K |
Software Hskpg | swHousekeeping | 4092 | 8 | usually ~40 | ~320 |
Table notes:
dumpSysConfig
and
dumpHuffman
commands are bepReadReply
packets. They are
therefore part of the Memory Manager's telemetry allocation pool.
The ACIS instrument receives a stopScience
command.
What kinds and quantities of telemetry will it try to send to close
out the run? And what risks are there if the next observation starts
too soon?
Should the stopScience
arrive while bias is being
taken or telemetered, ACIS will try to finish sending the entire
bias map. Otherwise, the outstanding data may
consist of the combination of
scienceReport
packet.
Event modes. Faint, very faint and graded modes produce data packets of varying length. A fresh data packet begins with each new frame, and rarely will reported events fill out an entire 2048 byte science buffer. For each frame of each chip, there's also a short 18-word exposure record. Utilization of the science telemetry buffers by these modes is therefore fairly inefficient; their buffers will drain more rapidly than for raw and event histogram modes. Since their "frames" are half the size, CC modes will have only half the events available to fill out a frame's data packet, so their telemetry buffers will drain about twice as fast as for TEs.
Raw mode. The raw mode compression factor as of this writing is about 3.4. Background radiation being around its maximum, we may take that as an effective upper limit for now. Accumulated radiation damage may be expected to lower the compression factor slowly.
The worst case occurs when the ring buffers are full of data from the previous raw frame, and have just begun to receive data from a new frame. Total telemetry consists of six near-full FEP ring buffers (450 rows, compressible to about 200K bytes for each FEP), fullscience telemetry buffers (400 buffers at about 1400 bytes each), and six complete raw frames. For TEs, those frames will occupy ~ 440 * 6 = ~2.7 compressed megabytes; for CC, which uses "frames" of only 512 rows, the figure is ~ 1.9 compressed megabytes. Altogether, that yields a total of 4.6 (resp 3.2) megabytes. In format 2, the data is transmissible in 1570 seconds (26.2 minutes) for TE and 1070 seconds (18 minutes) for CC.
Event Histogram mode. Raw mode and event modes package their data into telemetry packets about as soon as they get it from the FEPs. They will allocate a telemetry buffer, format data into it, put it into the queue, and get ready to allocate the next one.
Event histogram mode uses a different scheme. All of the buffers needed to transmit a set of histograms are allocated at once. Event tallies are updated in place within those buffers until the histogram is complete, then the buffers are placed into the queue. While the histogram is being read out, a second set of buffers is allocated and the accumulation of the next histogram begins.
Accordingly, overall histogram size is limited by the need to store two full histograms within the science telemetry buffers. Each packet uses one buffer; the histogram for each node takes up nine packets (the final one rather small, but it uses a whole buffer). So each chip uses 9 * 4 = 36 science telemetry buffers, and five chips use 180 buffers. Six chips would use 216; since there are only 400 science buffers, that would preclude storing two full sets of histograms simultaneously. Consequently, we have limited our event histogram modes to five chips.
What are the consequences, should telemetry from one observation continue into the next? They aren't dire. In the worst cases, the first science run will be terminated prematurely. The result will be a bias map, or a set of frames, or a histogram, being only partially transmitted, which is likely to confuse CXC ground software; followed by an error flag in the science report packet.
In particular, except temporarily for bias telemetry until
the busCrash
patch is incorporated, we do
not need to be concerned about a FEP bus crash. Those have only
occurred, and can only occur,
when a FEP becomes unreadable for some reason other than a
commanded power shutdown. When the
BEP receives a WSPOW command which powers down the FEPs, it notes the
change in its own internal tables. Every time the BEP attempts to read
data from a FEP, it first checks its own records to see whether that
FEP is powered off or otherwise unavailable. (At least, this was the
intent of the software design. A bug which causes a bus crash if FEPs
are powered down during a bias computation will be fixed by the
busCrash
patch.)
Likewise, lingering processing from the previous observation cannot
trigger the sort of contention for FEP memory access that can lead to
latchups. The moment a new startScience
command is
received, any extant run is clobbered, and stops all attempts at
processing, other than issuing the scienceReport
packet.
Listed below, in descending order of severity, are the ill effects that can
result from too short an interval between a stopScience
and the subsequent observation.
The first three items result
in different
error messages, but are otherwise quite similar:
data transfer from the
FEPs to the BEP is interrupted, entailing loss of data.
If a bias is interrupted, bias maps will be incomplete; if raw or
event modes are interrupted, telemetry will include incomplete frames.
The sixth column of table 4.1 tells how long it takes, in format 2, for
FEPs to clear once the stopScience
command arrives.
If a bias was in progress, the transmitted bias map will be
incomplete. Raw modes and event modes will telemeter complete
packets, but only partial data for final frames. Event histograms
will be unaffected.
The BEP maintains a pair of system configuration tables, one
indicating requested state and one indicating actual state. On receipt
of a power command, the BEP will begin switching power
on a video board or FEP once a second until the actual state matches
the request. If the BEP finds a FEP requested in the parameter block
is powered down, it notes a FEP error in software housekeeping
(either a SWSTAT_FEPREPLY_POWEROFF, SWSTAT_FEPLOCK_POWEROFF, or
SWSTAT_FEPREC_POWEROFF, depending on what the BEP was doing when it
found out.) Then it continues polling the
remaining boards. If it ever finds all desired FEPs are powered off,
it will terminate the run, placing a FEP error termination code in
the scienceReport
packet.
startScience
command. The termination code
in the science report
will be SMTERM_CLOBBERED. In runs with bias, this can't happen,
since FEP access will be terminated by the WSPOW00000 command (see
case below). In a no-bias run, it will happen only if the
first and second runs have at least one FEP in common.
The science report's fepErrorCodes will contain 1's for those
FEPs which were powered off.
startScience
. The science report
will contain an SMTERM_STOPCMD as usual, but the fepErrorCodes will
be toggled on for the FEPs which could not complete.scienceReport
packet from the earlier observation.
This final table shows how long it takes to drain telemetry for the main modes. The numbers are rough upper limits; under many circumstances, the values will be significantly lower.
Mode | Telemetry in each FEP |
Telemetry in all FEPs |
Filled BEP Telemetry buffers |
Total bytes | Readout from FEPs (min) |
Full Readout (min) |
TE Bias | 350K | 2100K | 52K | 6200K | 13 | 13 |
CC Bias | 260 | 1564 | 1564 | 1564 | 1 sec. | 1 sec. |
TE Evnt Hist | - | - | 670K (2 hists) |
670K | - | 3.8 |
TE Raw | 750K | 4500K | 560K | 1300K* | 4.2 | 7.3 |
CC Raw | 420K | 2500K | 560K | 980K* | 2.3 | 5.4 |
TE Faint or CC 3x3 |
42K | 260K | 150K | 420K | 1.5 | 2.4 |
TE 5x5 | 55K | 330K | 250K | 580K | 1.8 | 3.3 |
TE Graded | 42K | 260K | 200K | 460K | 1.5 | 3.1 |