Thats_Me_Readout_Req IDNT ; Title of Thats_Me Readout_Req ; program section. SECTION Sect_Thats_Me_Readout_Req,4,C ; Declare a noncommon code ; section. Align to Longwords. *************************************************************************** * * * Thats_Me Readout_Req Routine Rev. 18-JUL-1994 * * * * * * * * This routine uses and does not restore Registers: D1, D2, D3, D4, * * D5, D6, D7, and A3. * * * * This routine receives the following information in the following * * registers: * * * * D1 holds the List of Specific Trig's Fired 15:0 for the * * Frame Code Section of the L15CT Data Block. * * * * D2 holds the Masks of Terms (i.e. the 5th longword of the * * Frame Code Section. It holds: * * in 0:7 the Mask of Terms that were to be Evaluated * * in 15:8 all zeros * * in 23:16 the Mask of Term that for which their evaluation is * * Incomplete (all zeros in this version of 68k_Service). * * in 31:24 the Mask of Terms that were returned to L15 FW M103. * * Set to $FF for MFP events else set $00 until later * * when we learn the Term Answers from the Global DSP. * * * * D3 holds the 2nd longword of the Type 0 Entry of the DeBug Section.* * * * D5 holds the Term Answers that we received from the Global DSP. * * * * D6 holds the Mark and Force Pass Mask for the Crate Header in D.B. * * * * D7 Holds the TAS Number for the Crate Header in the L15CT Data Blk.* * * *************************************************************************** *************************************************************************** * * * This section defines program-specific macros: * * * * WrIO: Write bit(s) to the IRONICS I/O card * * * *************************************************************************** WrIO MACRO ; Write byte to Ironics I/O Port. Not.B \1 ; Complement data byte \1. Move.B \1,\2 ; Move to Ironics port at adrs \2. Not.B \1 ; Complement data byte \1 to restore it. ENDM ************************************************************************* * * * We arrive here if there has been a "Thats_Me" event and we * * NEED to read it out. * * ------ * * * * * * We arrive here with: * * * * Register D7 holds the TAS Number stored in the Sync Word * * format that is needed for the Crate Header section of the * * L15CT Data Block. * * * * Register D6 holds the Mark and Force Pass Mask word for the * * Crate Header. * * * * Register D5, in its LSByte, holds the Term Answers that we * * received from the Global DSP . This is needed for the Frame * * Code section of the L15CT Data Block. * * * * Register D3 holds the 2nd longword of the Type 0 Entry * * of the DeBug Section. * * * * Register D2 holds the Masks of Terms (i.e. the 5th longword * * of the Frame Code Section. It holds: * * in 0:7 the Mask of Terms that were to be Evaluated * * in 15:8 all zeros * * in 23:16 the Mask of Term that for which their evaluation is * * Incomplete (all zeros in this version of 68k_Servic).* * in 31:24 the Mask of Terms that were returned to L15 FW M103. * * Set to $FF for MFP events else set $00 until later * * when we learn the Term Answers from the Global DSP. * * * * Register D1 holds the List of Specific Triggers Fired 15:0 * * that we need to put into the Framecode Section of the L1CT * * Data Block. * * * * * * The first step is: * * * * 1. Clear both the Readout Control and then the Path Select P2 * * Paddle Cards by pulsing the proper Ironics lines high. This * * also clears the EC Front-End Busy that is generated on the * * Path Select P2 Card. It is OK to clear these now because we * * have captured all of the information that we need to complete * * the "Thats_Me" event readout. * * * * Clear the Readout Control P2 paddle card and then * * Clear the Path Select P2 paddle card. * * * ************************************************************************* Begin_Thats_Me_Readout_Req: INCLUDE Ser68_Clear_RC_and_PS_1.Include ; Get the include file that ; clears the RC and PS P2's. ************************************************************************* * * * The next step is: * * * * 2. Check the software flag to see if we have a Fresh 214 Load * * Buffer. If we do not have a Fresh 214 Load Buffer then start * * the necessary RC servicing and wait here until we have a Fresh * * 214 Load Buffer. * * * * Note the sequence of steps that are taken if Fresh_Load_Buf_Availb * * is not set. The only way to get a Fresh Load Buffer is to swap * * 214 Buffers. Before you can swap 214 Buffers you need both * * VBD_Is_Ready and All_Data_In_Load_Buf to be asserted. The only * * way to get VBD_Is_Ready asserted is to run the Conclude VBD Cycle * * routine and, if the last event was a That's Me event, then the * * only way to get All_Data_In_Load_Buf asserted is to run the * * All_DSPs_to_Step_D0 routine. * ************************************************************************* ; If Fresh_Load_Buf_Availb flag ; is NOT set, then work here ; until it is set. TFLBA IF.B Fresh_Load_Buf_Availb #Flag_CLR THEN.S JSR Begin_Conclude_VBD_Cycle ; Try to Conclude VBD cycle. JSR Begin_All_DSPs_to_Step_D0 ; Try to move DSP's to Step D0. JSR Begin_Swap_Load_Read_Bufs ; Try to swap Read Load Buf. JMP TFLBA ; Test Fresh_Load_Buf_Availb ; again to see if it is set. ENDI ************************************************************************* * * * The next step is: * * * * 3. Load the dynamic words of the Crate Header into the 214 Load Buf. * * * * * * We arrive here with: * * * * Register D6 currently holding the Mark and Force Pass Mask Word. * * Register D7 currently holding the Sync Word. * * * * * * For now let's set the following "flags" in the Crate Header * * Data Validity Word: * * * * bits 7:0 all zero --> the rest of this Data Block is valid. * * bits 15:8 all zero --> the M103 L15 FW made a Decision Cycle. * * bits 23:16 all zero --> something about terminated early. * * bits 31:25 all zero --> no processing error were detected. * * * * * * Until this point D6 has been reserved for storing the Mark and * * Force Pass Mask Work and D7 has been reserved for storing the * * Sync Word. As soon as these are loaded into the 214 Load Buffer * * then D6 and D7 are free again for other uses. * * * ************************************************************************* Clr.L D4 ; Build the Data Validity Word. Move.L D7,BAHeaderVSB ; Load the Crate Header SYNC Word. Move.L D4,BAHeaderVSB+16 ; Load the Crate Header VALIDITY Word. Move.L D6,BAHeaderVSB+20 ; Load the Crate Header MFP Mask Word. ************************************************************************* * * * The next step is: * * * * 4. Finish Building the last word of the Frame Code Section and * * then load all 5 words of the Frame Code Section into 214 Load * * Buffer. * * * * As we arrive here with: * * * * Register D1 currently holding the Spec Trig Fired List 15:0 in the * * proper format for the 4th longword of this Frame Code Section. * * * * Register D2 currently holding the Masks of Terms (i.e. the 5th * * longword of the Frame Code Section. It holds: * * in 0:7 the Mask of Terms that were to be Evaluated * * in 15:8 all zeros * * in 23:16 the Mask of Term that for which their evaluation is * * Incomplete (all zeros in this version of 68k_Service). * * in 31:24 the Mask of Terms that were returned to L15 FW M103. * * Set to $FF for MFP events else set $00 until later * * when we learn the Term Answers from the Global DSP. * * * * Register D5 LSByte currently holding the Term Answers that we * * received from the Global DSP. These are in D5 7:0. * * * * * * Recall the format of the Frame Code Section of the L15CT Data Blk. * * * * 1nd Longword L15 CT Engine Control Starting Status * * 2rd Longword L15 CT Engine Control Finishing Status * * 3th Longword L15 CT Readout Control Finishing Status * * * * 4th Longword List of L1 Sp Trigger Fired for this Event * * (in bits 0:15) (upper 16 bits are zeroes) * * * * 5th Longword 0:8 Mask of Terms that were Evaluated in this * * L15 CT Cycle. * * 9:15 Mask of Terms that Passed this cycle of L15CT. * * 16:23 Mask of Terms for which their Evaluation * * was Incomplete (all zeros in this version * * of 68k_Service). * * 24:31 Mask of Terms returned to the L1.5 * * Hardware Framework M103. * * * * * * Until this point register D1 has been reserved for storing the * * Spec Trig's Fired List, register D2 has been reserved for storing * * the Masks of Terms, and register D5 has been reserved for storing * * the Terms Passed. As soon as this data is loaded into the 214 * * Load Buffer then these three registers are free again for other * * uses. * * * ************************************************************************* MoveA.L #BAFrameCodeVSB,A3 ; Get the Base Address of the ; Frame Code section into reg A3. Move.L #$00000001,(A3)+ ; Load the EC Starting Status. Move.L #$00000002,(A3)+ ; Load the EC Finishing Status. Move.L #$00000003,(A3)+ ; Load the RC Finishing Status. Move.L D1,(A3)+ ; Load the List of L1 Spec Trig Fired. ; Finish Building the Masks of Terms. ; D2 currently holds the Mask of ; Term that need to be Evaluated. AndI.L #$000000FF,D5 ; Select from D5 the Term Answers ; that we received from the Glb DSP. LSL.L #8,D5 ; Shift Term Answers into D5 15:8. ; "OR" D5 into the rest of the Masks Or.L D5,D2 ; of Terms which is contained in D2. ; Now we need to know if this is a ; MFP event. Test the software flag ; If_Transfer_Want_MFP_Transfer to ; see if this is an MFP event. IF.B If_Transfer_Want_MFP_Transfer #Flag_CLR THEN.S SWAP D5 ; If this NOT an MFP event then we Or.L D5,D2 ; need to put the Term Answers into ; bits 31:24 of the Masks of Terms. ENDI ; If this IS an MFP event then $FF is ; already in Masks of Terms 31:24. Move.L D2,(A3) ; Load the complete Masks of Terms: ; Evaluated, Passed, Incomplete, ; and Returned to L15 FW ; into the last longword of the ; Frame Code Section of L15CT Dt Blk. ************************************************************************* * * * The next step is: * * * * 5. The L15CT Data Block DeBug section always has a Type 0 Entry that * * comes from 68k_Services. The first longword of this Type 0 Entry * * is event to event static and is put in the 214 Buffers by the * * Initialize Data Structures routine. The second (and last) * * longword of the Type 0 Entry is event to event dynamic. * * * * The value of this second longword depends on whether or not this * * transfer (event) has MFP data. This second longword in the * * Type 0 Entry was build back in the "That's_Me_Processing" * * routine and was stored in register D3. * * * * We arrive here with register D3 holding this 2nd longwork of * * the Type 0 Entry of the DeBug Section. * * * * Because we are reading out this event, load the second longword * * of the Type 0 Entry into the MVME214 Load Buffer at this time. * * * * Until this point D3 has been reserved for storing the 2nd * * longword of the Type 0 Entry of the DeBug Section. As soon as * * this longword is loaded into the 214 Load Buffer then register * * D3 is free again for other uses. * * * ************************************************************************* ; Move the 2nd longword of the Move.L D3,BADeBugSectVSB+4 ; Type 0 Entry of the DeBug ; Section of the L15CT Data ; Block into the Load 214 Buf. ************************************************************************* * * * 6. The next step is: * * * * Now that 68k_Services has finished loading all of its data into * * the 214 Load Buffer, tell the Global DSP that it needs to start * * transfering its DSP data into the 214 Load Buffer. * * * * The Global DSP has been waiting at Step D3 until it hears from us * * whether or not it needs to transfer data into the 214 Load Buffer. * * * * The Global DSP knows to wait because, until we set it a NEW VALID * * "Transfer to 214 Required Word" it is only reading an old cleared * * previously valid "Transfer to 214 Required Word" which tells it * * to keep on waiting. * * * * * * Recall the Format of the "Transfer to 214 Required Word" * * * * D31 D24 D23 D16 D15 D8 D7 D0 * * -------------- -------------- -------------- -------------- * * | Reserved | | Reserved | | Reserved | |214Trans Req| * * -------------- -------------- -------------- -------------- * * * * * * The Transfer to 214 Required word is the third longword in the * * "68k_Services to all DSPs information block" on Hydra-II card "B". * * * * The 214 Transfer Required byte has the following format: * * * * $FF --> The previous valid 214 Transfer Flag has been cleared. * * $00 --> Tells the Global DSP not to Transfer to the 214 Load Buf. * * $01 --> Tells the Global DSP to begin a Transfer to the Load Buf. * ************************************************************************* Move.L #$00000001,Ser68_to_Hydra_B_Adrs+8 ; Set Transfer is Reqired ; on Global DSP card "B". Move.B #Flag_SET,Told_GDSP_to_Transfer ; SET the software flags ; that says we have TOLD ; the GDPS to transfer to ; the MVME214 memory. ************************************************************************* * * * The next step is: * * * * 7. Clear the software flag that says that we have a Fresh * * 214 Load Buffer. * * * * We waited until now to clear this software flag because we have * * been busy actually loading data into the 214 Load Buffer. * * * ************************************************************************* Clr.B Fresh_Load_Buf_Availb ; CLEAR Fresh_Load_Buf_Availb ************************************************************************* * * * The next step is: * * * * 8. Ok, we know that we are going to readout this event. We also * * know via the If_Transfer_Want_MFP_Transfer whether or not the * * Thats_Me_Processing routine wanted this current event to be an * * MFP event. So if If_Transfer_Want_MFP_Transfer is set then * * we need to set This_Transfer_is_MFP software flag so that the * * Swap_Load_Read_Buf routine will know to setup the long Word * * Count for the DeBug section of the Data Block. Then always * * Clear the If_Transfer_Want_MFP_Transfer flag to get ready for * * the next event. * ************************************************************************* Move.B If_Transfer_Want_MFP_Transfer,This_Transfer_is_MFP Clr.L If_Transfer_Want_MFP_Transfer ************************************************************************* * * * Steps 9 and 10. * * * * In this next section we will do two things: Print a character on * * the terminal screen (only if the print character prescale counter * * is at zero), and increment a counter in the 68k_Services to TCC * * Status Block. The character that we print and the counter that * * we increment depents on whether or not this is an MFP event. * * * * We can tell if this is an MFP event by examining the * * This_Transfer_is_MFP software flag. If this flag is SET then: * * increment the counter that indicates how many times we have * * processed a MFP event that was transfer to Level 2 and try to * * print an "F" on the terminal. If this flag is NOT set then: * * increment the counter that indicates how many times we have * * processed a normal "That's Me" event that was readout to Level 2 * * and try to print a "N" on the terminal screen. * * * ************************************************************************* ; Decriment the print SUBQ.L #1,Char_Print_Counter ; character prescale counter. ; Test if IF.B This_Transfer_is_MFP #Flag_SET THEN.S ; this is an ; MFP event. ; Yes, this is an MFP event. ; Increment the counter that ADDQ.L #1,Stat_Blk_to_TCC_Big_F_Count ; shows how many MFP Readout ; events have been processed. IF.L Char_Print_Counter #0 THEN.S ; Test if we can ; print a character. Move.L Char_Print_Ratio,Char_Print_Counter ; If we can print ; then reload the Move.L #$00000046,-(A7) ; print prescale JSR SendCharP1 ; counter and ; print an "F" on ENDI ; the terminal. ; This is not an MFP event. ELSE.S ; This is a normal "That's ; Me" event that is ; transfering to Level 2. ; Increment the counter that ADDQ.L #1,Stat_Blk_to_TCC_Big_N_Count ; shows how many "That's Me" ; Readout required events ; have been processed. IF.L Char_Print_Counter #0 THEN.S ; Test if we can ; print a character. Move.L Char_Print_Ratio,Char_Print_Counter ; If we can print ; then reload the Move.L #$0000004E,-(A7) ; print prescale JSR SendCharP1 ; counter and ; print an "N" on ENDI ; the terminal. ENDI ************************************************************************* * * * The last step is: * * * * 11. Jump to the top of the House Keeping Orbit. * * * ************************************************************************* JMP Begin_Orbit_Master ************************************************************************* * Define Constants: * * * ************************************************************************* ALIGN 4 ; Align to longword address. ************************************************************************* * * * Constants Section * * * ************************************************************************* XDEF Begin_Thats_Me_Readout_Req ; Symbol exported to ; other modules. XREF Readout_Ctrl_Port_4 ; Symbols used in this XREF Path_Select_Port_3 ; module but defined in ; another program module. XREF Flag_CLR XREF Flag_SET XREF Which_214_Is_Load_Buf XREF State_of_RC_FE_Busy XREF Fresh_Load_Buf_Availb XREF This_Transfer_is_MFP XREF If_Transfer_Want_MFP_Transfer XREF Told_GDSP_to_Transfer XREF Begin_Orbit_Master XREF Begin_Conclude_VBD_Cycle XREF Begin_All_DSPs_to_Step_D0 XREF Begin_Swap_Load_Read_Bufs XREF SendCharP1 XREF Ser68_to_Hydra_B_Adrs XREF BAFrameCodeVSB XREF BAHeaderVSB XREF BADeBugSectVSB XREF Char_Print_Ratio XREF Char_Print_Counter XREF Stat_Blk_to_TCC_Big_N_Count XREF Stat_Blk_to_TCC_Big_F_Count END