This is documentation on the software pattern register that is used to control selective readout of WFD channels. The pattern is stored in the global array wfd_spr[1..18] of integer. You can access an individual bit by type-casting it as bit32. The best way to see how that is done is to look at the code in procedure wfd_patreg, which is in user_procedure.pas. The array contains separate information for each supermodule (even though this is slightly wasteful since a given uVaX never reads out more than one SM- the resulting code is simpler to read and understand): wfd_spr[1..6] contains the pattern for full readout wfd_spr[7..12] contains the pattern for window readout wfd_spr[13..18] contains the total STOP delay in 5 ns tics The following table shows how the bits of wfd_patreg are mapped into WFD channels and MACRO tank ends. wfd_spr tank name (both ends read out) wfd channel end-0 end-1 Bit 0 B01 B03 B05 B07 $00 $01 Bit 1 B02 B04 B06 B08 02 03 Bit 2 B09 B11 B13 B15 04 05 Bit 3 B10 B12 B14 B16 06 07 Bit 4 C01 C03 C05 C07 08 09 Bit 5 C02 C04 C06 C08 0A 0B Bit 6 C09 C11 C13 C15 0C 0D Bit 7 C10 C12 C14 C16 0E 0F Bit 8 W01 W03 W05 W07 10 11 Bit 9 W02 W04 W06 --- 12 13 Bit 10 E01 E03 E05 E07 14 15 Bit 11 E02 E04 E06 --- 16 17 Bit 12 W08 W10 W12 W14 18 19 Bit 13 W09 W11 W13 --- 1A 1B Bit 14 E08 E10 E12 E14 1C 1D Bit 15 E09 E11 E13 --- 1E 1F Bit 16 T01 T03 T05 T07 20 21 Bit 17 T02 T04 T06 T08 22 23 Bit 18 T09 T11 T13 T15 24 25 Bit 19 T10 T12 T14 T16 26 27 Bit 20 N01 N03 N05 N07 28 29 Bit 21 N02 N04 N06 --- 2A 2B Note 1) We may change the location of T17 to an empty slot in E or W face Note 2) For SM-6, the South face takes the place indicated for the North face Using the above table it is possible to map a bit pattern from a MACRO trigger unit into the appropriate WFD readout pattern. This is done in the code of procedure wfd_patreg. Note that wfd_patreg typically accesses 32 bits at a time, so this procedure is called after two 16 bit trigger readout have been performed. For reference, I include the following tables from my notes. The table entry is the wfd_spr bit number. TOHM trigger bit: EQUIP 27 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 WORD: =============================================================== -- -- -- -- -- -- -- -- 1 0 1 0 1 0 1 0 1 -- -- -- -- -- -- -- -- 3 2 3 2 3 2 3 2 2 --------------------------------------------------------------- -- -- -- -- -- -- -- -- 5 4 5 4 5 4 5 4 3 -- -- -- -- -- -- -- -- 7 6 7 6 7 6 7 6 4 --------------------------------------------------------------- -- -- -- -- -- -- -- -- - 8 9 8 9 8 9 8 5 -- -- -- -- -- -- -- -- - 10 11 10 11 10 11 10 6 --------------------------------------------------------------- -- -- -- -- -- -- -- -- - 12 13 12 13 12 13 12 7 -- -- -- -- -- -- -- -- 20 14 15 14 15 14 15 14 8 --------------------------------------------------------------- -- -- -- -- -- -- -- -- 17 16 17 16 17 16 17 16 9 -- -- -- -- -- -- -- -- 19 18 19 18 19 18 19 18 10 --------------------------------------------------------------- -- -- -- -- -- -- -- -- 22 21 22 21 22 21 22 21 11 --------------------------------------------------------------- Note 1) I am driving the readout off the 'trigger' bits; the upper bits are the 'activity' bits and are presently unused. Subject to change. Note 2) Equip 27 does not have words 7-11 in the data yet, because the hardware isn't ready. So these definitions could be considered a proposal. Note 3) Note that tank 17 has been placed in bit-07 of the 8th word. The table entry is the wfd_spr bit number. LIP trigger bit: EQUIP 14 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 WORD: =============================================================== 19 18 19 18 19 18 19 18 17 16 17 16 17 16 17 16 1 TOP 7 6 7 6 7 6 7 6 5 4 5 4 5 4 5 4 2 CENTER --------------------------------------------------------------- 3 2 3 2 3 2 3 2 1 0 1 0 1 0 1 0 3 BOTTOM -- 14 15 14 15 14 15 14 -- 10 11 10 11 10 11 10 4 EAST --------------------------------------------------------------- -- 12 13 12 13 12 13 12 -- 8 9 8 9 8 9 8 5 WEST -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 6 ADJSM ---------------------------------------------------------------