****************************************************************************** * * * File L_TL_Ini.A40 Rev. 18-DEC-1995 * * * * "Meaningful" Register Usage * * --------------------------- * * * * "Destroyable" Register Usage * * ---------------------------- * * R8, R9*, R10*, R11*, AR7 * * * * * Note that R9, R10, and R11 are used for communication with the * * Parameter Checking module * * * * Description of Module * * ===================== * * * * This is the module that Initializes the Local Tool Code. Note that * * there must be one of these modules for each Local Tool. In this first * * version of the code there is only one Local Tool and hence only one * * Local Tool Initialization module. * * * * Note that this Tool is designed to evaluate 4 Terms, with 4 separate * * sets of Local Parameters. These must be Terms #0, #1, #2, and #3. * * This Tool Initialization module knows where to look in the Data Block * * to find the Local Parameters for each of these 4 Terms. * * * * This module is called only when new Parameters are loaded (i.e. * * in response to a START message from COOR). * * * * It performs the following functions: * * * * * * (0) Check the Tool Number found in the Parameter Block * * (only for Term #0) * * (1) Receive and check the Reference Set Type used by * * this Tool (only for Term #0) * * (2) Receive, check, and store the Local Tool Parameters * * Note that this version of the code receives, checks, and * * stores 4 copies of the Local Tool Parameters, one for each * * of the 4 Terms that this Tool evaluates. * * (3) Generate any "derived constants" (i.e. Offsets) that * * will be used by the Local Tool and store them in * * known locations * * (4) Build the Header for the Derived Constants subsection * * of the Mark and Force Pass Section of the Data Block * * (5) Return a status code to the Parameter Checking module * * (6) Return to the calling module * * * * * * This module is for the EM 1x2 vs. Total 1x2 Tool, which also performs * * an Isolation (EM 1x2 vs. Total 3x3) cut. This is Tool #3 * ****************************************************************************** ****************************************************************************** * Include the DSP Program-Specific Constant Definitions * ****************************************************************************** .include "constant.inc" ****************************************************************************** * Define a module-specific macro * ****************************************************************************** ****************************************************************************** * * * Macro: GET_LOCAL_PARAMS * * * * Arguments: Term integer in the range [0..3] defining * * the Term Number we are getting Local * * Parameters for * * * * Purpose of macro * * ---------------- * * This macro receives the Local Parameters for a Term. It first checks * * the number of Local Parameters against the expected number of Local * * Parameters, and branches to a failure routine if there is an error. * * * * It then receives and range-checks the 2 Local Parameters for the * * Term, and branches to a failure routine if there is an error * ****************************************************************************** GET_LOCAL_PARAMS .macro Term Start_Get_Local_Params_? LDI *+AR7(1), R11 ; Get the number ; of Parameters ; for this Tool ; from the Dual Port ; Memory CMPI Number_of_Parameters_Expected,R11 ; Compare the number ; of Parameters for ; this Tool to the ; number of Parameters ; required. Bne Number_of_Parameters_Failure ; If the wrong number ; of Parameters are ; specified then ; branch to a failure ; exit point ADDI 1,R8 ; Increment the ; "Current Parameter ; Number" counter Get_First_Param_? LDF *+AR7(2), R11 ; Get this Tool's ; First Tool-Dependent ; Parameter (1x2 EM Et ; Threshold, it is ; a FLOAT, the units ; are GeV) from ; Dual Port Memory. CMPF 0.25, R11 ; Check the 1x2 EM ; Et Threshold against ; the LOWER limit BltAF Parameter_Range_Failure ; Branch to the Param. ; Range Failure routine ; if the Et Threshold ; is BELOW the LOWER ; limit. ; The next 3 ; instructions are ; also executed but ; ANNULLED if the ; branch is not ; taken LDI *+AR7(2) , R11 ; Re-load R11 with ; the Parameter from ; the Dual Port ; Memory, but load ; it as an INTEGER ; to be compatible ; with the reporting ; to TCC. NOP NOP CMPF 128.0, R11 ; Check the 1x2 EM ; Et Threshold against ; the UPPER limit BgtAF Parameter_Range_Failure ; Branch to the Param. ; Range Failure routine ; if the Et Threshold ; is ABOVE the UPPER ; limit ; The next 3 ; instructions are ; also executed but ; ANNULLED if the ; branch is not ; taken LDI *+AR7(2), R11 ; Re-load R11 with ; the Parameter from ; the Dual Port ; Memory, but load ; it as an INTEGER ; to be compatible ; with the reporting ; to TCC. NOP NOP MPYF 4.0, R11 ; Convert GeV to ; counts FIX R11, R10 ; Convert the floating- ; point counts into ; fixed-point counts. STI R10, @EM_Et_1x2_Thresh_:Term:_Loc ; Store the EM Et ; 1x2 Threshold. ADDI 1,R8 ; Increment the ; "Current Parameter ; Number" counter Get_Second_Param_? LDF *+AR7(3), R11 ; Get this Tool's ; 2nd Tool-Dependent ; Parameter ; (Isolation Ratio) ; Threshold, it is ; a FLOATING POINT) ; from the ; Dual Port Memory. ; Set AR7 for the CMPF 0.0, R11 ; Check the Ratio ; Threshold against ; the LOWER limit BltAF Parameter_Range_Failure ; Branch to the Param. ; Range Failure routine ; if the Ratio Thresh ; is BELOW the LOWER ; limit ; The next 3 ; instructions are ; also executed but ; ANNULLED if the ; branch is not ; taken LDI *+AR7(3), R11 ; Re-load R11 with ; the Parameter from ; the Dual Port ; Memory, but load ; it as an INTEGER ; to be compatible ; with the reporting ; to TCC. NOP NOP CMPF 2.0, R11 ; Check the Ratio ; Threshold against ; the UPPER limit BgtAF Parameter_Range_Failure ; Branch to the Param. ; Range Failure routine ; if the Ratio Thresh ; is ABOVE the UPPER ; limit ; The next 3 ; instructions are ; also executed but ; ANNULLED if the ; branch is not ; taken LDI *+AR7(3), R11 ; Re-load R11 with ; the Parameter from ; the Dual Port ; Memory, but load ; it as an INTEGER ; to be compatible ; with the reporting ; to TCC. NOP NOP STF R11, @Isolation_Ratio_Thresh_:Term:_Loc ; Store the Isolation ; Ratio Threshold ADDI 1,R8 ; Increment the ; "Current Parameter ; Number" counter Get_Third_Param_? LDF *+AR7(4), R11 ; Get this Tool's ; 3nd Tool-Dependent ; Parameter (EM ; Fraction Ratio ; Threshold, it is ; a FLOATING POINT) ; from the ; Dual Port Memory. CMPF 0.0, R11 ; Check the Ratio ; Threshold against ; the LOWER limit BltAF Parameter_Range_Failure ; Branch to the Param. ; Range Failure routine ; if the Ratio Thresh ; is BELOW the LOWER ; limit ; The next 3 ; instructions are ; also executed but ; ANNULLED if the ; branch is not ; taken LDI *+AR7(4), R11 ; Re-load R11 with ; the Parameter from ; the Dual Port ; Memory, but load ; it as an INTEGER ; to be compatible ; with the reporting ; to TCC. NOP NOP CMPF 2.0, R11 ; Check the Ratio ; Threshold against ; the UPPER limit BgtAF Parameter_Range_Failure ; Branch to the Param. ; Range Failure routine ; if the Ratio Thresh ; is ABOVE the UPPER ; limit ; The next 3 ; instructions are ; also executed but ; ANNULLED if the ; branch is not ; taken LDI *+AR7(4), R11 ; Re-load R11 with ; the Parameter from ; the Dual Port ; Memory, but load ; it as an INTEGER ; to be compatible ; with the reporting ; to TCC. NOP NOP STF R11, @EM_Frac_Ratio_Thresh_:Term:_Loc ; Store the EM Fract. ; Ratio Threshold ADDI 1,R8 ; Increment the ; "Current Parameter ; Number" counter Get_Fourth_Param_? LDI *+AR7(5), R11 ; Get this Tool's ; 3nd Tool-Dependent ; Parameter (Term_Type ; it is an INTEGER ; from the ; Dual Port Memory. STI R11, @Term_Type_:Term:_Loc ; Store the Term_Type ADDI 1,R8 ; Increment the ; "Current Parameter ; Number" counter Get_Fifth_Param_? LDF *+AR7(6), R11 ; Get this Tool's ; Fifth Tool-Dependent ; Parameter ; (Seed_Min_EM_Et_Cut) ; it is a FLOAT, the ; units are GeV) from ; Dual Port Memory. MPYF 4.0, R11 ; Convert GeV to ; counts FIX R11, R10 ; Convert the floating- ; point counts into ; fixed-point counts. STI R10, @Seed_Min_EM_Et_Cut_:Term:_Loc ; Store the Seed ; Min EM Et cut. ADDI 1,R8 ; Increment the ; "Current Parameter ; Number" counter Get_Sixth_Param_? LDF *+AR7(7), R11 ; Get this Tool's ; Sixth Tool-Dependent ; Parameter ; Seed_Min_Tot_Et_Cut ; it is a FLOAT, the ; units are GeV) from ; Dual Port Memory. MPYF 4.0, R11 ; Convert GeV to ; counts FIX R11, R10 ; Convert the floating- ; point counts into ; fixed-point counts. STI R10, @Seed_Min_Tot_Et_Cut_:Term:_Loc ; Store the Seed ; Min Tot Et cut. ADDI 1,R8 ; Increment the ; "Current Parameter ; Number" counter Get_Seventh_Param_? LDI *+AR7(8), R11 ; Get this Tool's ; Seventh ; Parameter ; (Seed_Max_Eta_Cut) ; it is an INTEGER, ; from ; Dual Port Memory. STI R11, @Seed_Max_Eta_Cut_:Term:_Loc ; Store the Seed ; Max Eta cut. ADDI 1,R8 ; Increment the ; "Current Parameter ; Number" counter Get_Eighth_Param_? LDF *+AR7(9), R11 ; Get this Tool's ; 8th t Tool-Dependent ; Parameter ; (Tot_5x5_Threshold) ; it is a FLOAT, the ; units are GeV) from ; Dual Port Memory. MPYF 4.0, R11 ; Convert GeV to ; counts FIX R11, R10 ; Convert the floating- ; point counts into ; fixed-point counts. STI R10, @Tot_Et_5x5_Thresh_:Term:_Loc ; Store the 5x5 ; Total Threshold ADDI 1,R8 ; Increment the ; "Current Parameter ; Number" counter .endm ****************************************************************************** * End of macro: GET_LOCAL_PARAMS * ****************************************************************************** ****************************************************************************** * Load Code into the .text Section * ****************************************************************************** .text Initialize_Tool: ****************************************************************************** * Check Tool Number of the Parameter Block passed to this Tool * * * * The calling module passes a pointer to the Local Tool Parameter Block * * for this Tool. Here we check the Tool Number of that Parameter Block. * * * ****************************************************************************** Check_Tool_Number: LDI @Local_Tool_Parameter_Handle,AR7 ; Load the pointer ; to this Tool's ; Local Parameters ; into AR7 LDI @Zero_Loc,R8 ; Zero the "Current ; Parameter Number" ; (which is stored ; in R8) LDI *AR7, R11 ; Get the Tool Number ; of the Parameter ; Block passed to ; this Tool CMPI @Tool_Number_Loc,R11 ; Compare the Tool ; Number found to ; this Tool's Tool ; Number Bne Parameter_Range_Failure ; If the Tool ID of ; the Parameter Block ; does not match the ; Tool ID of this Tool ; then branch to a ; failure routine ****************************************************************************** * Receive and Check Reference Set Type * * * * The calling module passes the Reference Set Type for this Tool in a * * memory location. This Tool checks to verify that the correct Reference * * Set Type (in this case EM) is specified. If there is a problem, this * * Tool exits this routine via a failure exit point * ****************************************************************************** * Comment out the Ref Set Type Check 18-DEC-1995 * for conversion to eWjj_Tool Check_Ref_Set_Type: * LDI @Reference_Set_Type_Loc,R11 ; Get the Reference * ; Set Type * * CMPI EM_Reference_Set_Type,R11 ; Check to see whether * ; the EM Et Ref Set * ; has been specified * * Bne Reference_Set_Type_Failure ; If an incorrect * ; Ref Set type has * ; been specified then * ; branch to a failure * ; routine * * ; if we have gotten to * ; this point then * ; we can begin * ; extracting and * ; checking the Tool * ; Dependent Local * ; Parameters. * ****************************************************************************** * Extract, Check, and Store Tool Parameters * * for each of the 4 Terms * * * * This section of the code extracts and checks the Tool Parameters from * * the Dual Port Memory. * * * * It extracts and checks the Tool Parameters for Terms #0, #1, #2, and #3 * * * * The calling module passes a pointer to the Local Tool Parameters for * * this Tool in a memory location. The Tool must read that memory location * * to discover where its Local Parameters are in Dual Port Memory. * * * * It checks the Tool Parameters for the following things: * * * * - This Term Entry in the parameter block belongs to this Tool Number, * * - that the proper number of parameters appear in the term entry * * - and that all data contained in this entry is within range and * * consistency checks that are built into this part of the Tool code. * * * * As it checks the Tool Parameters it stores them in known locations in * * the Global SRAM (i.e. the region of memory starting at $C000 0000) * * * * It generates a return code for the Parameter Checker also. * * * ****************************************************************************** Get_Parameters_for_Term_0: GET_LOCAL_PARAMS 0 ; Get the Local Parameters ; for Term #0 Get_Parameters_for_Term_1: ADDI One_Term_Local_Param_Block_Size, AR7 ; Point AR7 to the ; Local Parameters ; for Term #1 LDI @Zero_Loc, R8 ; Zero the ; "Current Parameter ; Number" counter LDI Term_Number_1, R11 ; Use R11 to set ; the Current Term STI R11, @Term_Number_Expected_Loc ; Number Expected ; to Term #1 GET_LOCAL_PARAMS 1 Get_Parameters_for_Term_2: ADDI One_Term_Local_Param_Block_Size, AR7 ; Point AR7 to the ; Local Parameters ; for Term #2 LDI @Zero_Loc, R8 ; Zero the ; "Current Parameter ; Number" counter LDI Term_Number_2, R11 ; Use R11 to set ; the Current Term STI R11, @Term_Number_Expected_Loc ; Number Expected ; to Term #1 GET_LOCAL_PARAMS 2 Get_Parameters_for_Term_3: ADDI One_Term_Local_Param_Block_Size, AR7 ; Point AR7 to the ; Local Parameters ; for Term #3 LDI @Zero_Loc, R8 ; Zero the ; "Current Parameter ; Number" counter LDI Term_Number_3, R11 ; Use R11 to set ; the Current Term STI R11, @Term_Number_Expected_Loc ; Number Expected ; to Term #1 GET_LOCAL_PARAMS 3 ; if we get to ; this point then ; all Parameters were ; OK and the correct ; Reference Set Type ; was specified. ; We can continue ; processing, ; generating the ; derived constants ****************************************************************************** * Generate and Store Derived Constants * * * * Next we need to generate and store the Derived Constants for this Local * * Tool. * * * * The only derived constants are the 3x3 Total Et Sum Offsets. * * Offsets. These are formed by adding up the Zero Responses for the 9 * * Total Et's which make up the 3x3 Total Et Sum at each of the 4 etas * * serviced by this Local DSP Node. * * * * The eta-dependent Zero Responses for individual Trigger Towers are * * already stored in a "relative eta" configuration so we simply have * * to add them up and generate the four 3x3 Total Et Sum Offsets. * * * * Note that 4 copies of each Derived Constant are actually stored, even * * though only one copy is used. The other 3 copies are only used in the * * DeBug Section Type 3 Entries for Terms #1, #2, and #3. This is a bit * * of a kludge but it makes the DMA List simpler and faster by minimizing * * the amount of time the DMA Controller spends "bootstrapping" its control * * registers. * ****************************************************************************** Generate_Derived_Constants: ; First build the 3x3 ; Tot Et Sum Offset for ; eta "n + 2" LDI @Eta_Nplus1_Tot_Et_Zeresp_Loc, R11 ; LOAD the Zero ; ^^^^ Response for ; eta "n + 1" ; into R11 ADDI @Eta_Nplus2_Tot_Et_Zeresp_Loc, R11 ; Add the Zero ; Response for ; eta "n + 2" ; to the sum in R11 ADDI @Eta_Nplus3_Tot_Et_Zeresp_Loc, R11 ; Add the Zero ; Response for ; eta "n + 3" ; to the sum in R11 MPYI 3, R11 ; Multiply the sum ; in R11 by 3 (to ; account for the ; fact that 3 TT's ; at each eta ; contribute to the ; 3x3 Tot Et Sum Offset STI R11, @Eta_Nplus2_3x3_Tot_Offset_Loc ; Store the 3x3 ; Tot Sum Offset for ; eta "n + 2" STI R11, @Eta_Nplus2_3x3_Tot_Off_1_Loc ; Store the 3x3 ; Tot Sum Offset for ; eta "n + 2" ; This copy is only ; used in the DeBug ; Section Type 3 Entry ; for Term #1 STI R11, @Eta_Nplus2_3x3_Tot_Off_2_Loc ; Store the 3x3 ; Tot Sum Offset for ; eta "n + 2" ; This copy is only ; used in the DeBug ; Section Type 3 Entry ; for Term #2 STI R11, @Eta_Nplus2_3x3_Tot_Off_3_Loc ; Store the 3x3 ; Tot Sum Offset for ; eta "n + 2" ; This copy is only ; used in the DeBug ; Section Type 3 Entry ; for Term #3 ; Then build the 3x3 ; Tot Et Sum Offset for ; eta "n + 3" LDI @Eta_Nplus2_Tot_Et_Zeresp_Loc, R11 ; LOAD the Zero ; ^^^^ Response for ; eta "n + 2" ; into R11 ADDI @Eta_Nplus3_Tot_Et_Zeresp_Loc, R11 ; Add the Zero ; Response for ; eta "n + 3" ; to the sum in R11 ADDI @Eta_Nplus4_Tot_Et_Zeresp_Loc, R11 ; Add the Zero ; Response for ; eta "n + 4" ; to the sum in R11 MPYI 3, R11 ; Multiply the sum ; in R11 by 3 (to ; account for the ; fact that 3 TT's ; at each eta ; contribute to the ; 3x3 Tot Et Sum Offset STI R11, @Eta_Nplus3_3x3_Tot_Offset_Loc ; Store the 3x3 Tot ; Et Sum Offset for ; eta "n + 3" STI R11, @Eta_Nplus3_3x3_Tot_Off_1_Loc ; Store the 3x3 ; Tot Sum Offset for ; eta "n + 3" ; This copy is only ; used in the DeBug ; Section Type 3 Entry ; for Term #1 STI R11, @Eta_Nplus3_3x3_Tot_Off_2_Loc ; Store the 3x3 ; Tot Sum Offset for ; eta "n + 3" ; This copy is only ; used in the DeBug ; Section Type 3 Entry ; for Term #2 STI R11, @Eta_Nplus3_3x3_Tot_Off_3_Loc ; Store the 3x3 ; Tot Sum Offset for ; eta "n + 3" ; This copy is only ; used in the DeBug ; Section Type 3 Entry ; for Term #3 ; Then build the 3x3 ; Tot Et Sum Offset for ; eta "n + 4" LDI @Eta_Nplus3_Tot_Et_Zeresp_Loc, R11 ; LOAD the Zero ; ^^^^ Response for ; eta "n + 3" ; into R11 ADDI @Eta_Nplus4_Tot_Et_Zeresp_Loc, R11 ; Add the Zero ; Response for ; eta "n + 4" ; to the sum in R11 ADDI @Eta_Nplus5_Tot_Et_Zeresp_Loc, R11 ; Add the Zero ; Response for ; eta "n + 5" ; to the sum in R11 MPYI 3, R11 ; Multiply the sum ; in R11 by 3 (to ; account for the ; fact that 3 TT's ; at each eta ; contribute to the ; 3x3 Tot Et Sum Offset STI R11, @Eta_Nplus4_3x3_Tot_Offset_Loc ; Store the 3x3 Tot ; Et Sum Offset for ; eta "n + 4" STI R11, @Eta_Nplus4_3x3_Tot_Off_1_Loc ; Store the 3x3 ; Tot Sum Offset for ; eta "n + 4" ; This copy is only ; used in the DeBug ; Section Type 3 Entry ; for Term #1 STI R11, @Eta_Nplus4_3x3_Tot_Off_2_Loc ; Store the 3x3 ; Tot Sum Offset for ; eta "n + 4" ; This copy is only ; used in the DeBug ; Section Type 3 Entry ; for Term #2 STI R11, @Eta_Nplus4_3x3_Tot_Off_3_Loc ; Store the 3x3 ; Tot Sum Offset for ; eta "n + 4" ; This copy is only ; used in the DeBug ; Section Type 3 Entry ; for Term #3 ; Then build the 3x3 ; Tot Et Sum Offset for ; eta "n + 5" LDI @Eta_Nplus4_Tot_Et_Zeresp_Loc, R11 ; LOAD the Zero ; ^^^^ Response for ; eta "n + 4" ; into R11 ADDI @Eta_Nplus5_Tot_Et_Zeresp_Loc, R11 ; Add the Zero ; Response for ; eta "n + 5" ; to the sum in R11 ADDI @Eta_Nplus6_Tot_Et_Zeresp_Loc, R11 ; Add the Zero ; Response for ; eta "n + 6" ; to the sum in R11 MPYI 3, R11 ; Multiply the sum ; in R11 by 3 (to ; account for the ; fact that 3 TT's ; at each eta ; contribute to the ; 3x3 Tot Et Sum Offset STI R11, @Eta_Nplus5_3x3_Tot_Offset_Loc ; Store the 3x3 Tot ; Et Sum Offset for ; eta "n + 5" STI R11, @Eta_Nplus5_3x3_Tot_Off_1_Loc ; Store the 3x3 ; Tot Sum Offset for ; eta "n + 5" ; This copy is only ; used in the DeBug ; Section Type 3 Entry ; for Term #1 STI R11, @Eta_Nplus5_3x3_Tot_Off_2_Loc ; Store the 3x3 ; Tot Sum Offset for ; eta "n + 5" ; This copy is only ; used in the DeBug ; Section Type 3 Entry ; for Term #2 STI R11, @Eta_Nplus5_3x3_Tot_Off_3_Loc ; Store the 3x3 ; Tot Sum Offset for ; eta "n + 5" ; This copy is only ; used in the DeBug ; Section Type 3 Entry ; for Term #3 ***** 18-DEC-1995 Add generation of the 5x5 Tot Offsets, without the ***** kludge of storing each one 4 extra times for the Derived Constants ***** section--we don't put these in the Derived Constants section ***** because nobody would ever look at them LDI @Eta_Nplus0_Tot_Et_Zeresp_Loc, R11 ; Build the 5x5 ; Tot Et Sum Offset ADDI @Eta_Nplus1_Tot_Et_Zeresp_Loc, R11 ; for eta "n + 2" ADDI @Eta_Nplus2_Tot_Et_Zeresp_Loc, R11 ; add 'em up and ; multiply by 5 ADDI @Eta_Nplus3_Tot_Et_Zeresp_Loc, R11 ADDI @Eta_Nplus4_Tot_Et_Zeresp_Loc, R11 MPYI 5, R11 STI R11, @Eta_Nplus2_5x5_Tot_Offset_Loc ; ship it LDI @Eta_Nplus1_Tot_Et_Zeresp_Loc, R11 ; Build the 5x5 ; Tot Et Sum Offset ADDI @Eta_Nplus2_Tot_Et_Zeresp_Loc, R11 ; for eta "n + 3" ADDI @Eta_Nplus3_Tot_Et_Zeresp_Loc, R11 ; add 'em up and ; multiply by 5 ADDI @Eta_Nplus4_Tot_Et_Zeresp_Loc, R11 ADDI @Eta_Nplus5_Tot_Et_Zeresp_Loc, R11 MPYI 5, R11 STI R11, @Eta_Nplus3_5x5_Tot_Offset_Loc ; ship it LDI @Eta_Nplus2_Tot_Et_Zeresp_Loc, R11 ; Build the 5x5 ; Tot Et Sum Offset ADDI @Eta_Nplus3_Tot_Et_Zeresp_Loc, R11 ; for eta "n + 4" ADDI @Eta_Nplus4_Tot_Et_Zeresp_Loc, R11 ; add 'em up and ; multiply by 5 ADDI @Eta_Nplus5_Tot_Et_Zeresp_Loc, R11 ADDI @Eta_Nplus6_Tot_Et_Zeresp_Loc, R11 MPYI 5, R11 STI R11, @Eta_Nplus4_5x5_Tot_Offset_Loc ; ship it LDI @Eta_Nplus3_Tot_Et_Zeresp_Loc, R11 ; Build the 5x5 ; Tot Et Sum Offset ADDI @Eta_Nplus4_Tot_Et_Zeresp_Loc, R11 ; for eta "n + 5" ADDI @Eta_Nplus5_Tot_Et_Zeresp_Loc, R11 ; add 'em up and ; multiply by 5 ADDI @Eta_Nplus6_Tot_Et_Zeresp_Loc, R11 ADDI @Eta_Nplus7_Tot_Et_Zeresp_Loc, R11 MPYI 5, R11 STI R11, @Eta_Nplus5_5x5_Tot_Offset_Loc ; ship it ****************************************************************************** * Generate Header for the Derived Constants subsection of the Mark and * * Force Pass section of the Data Block * * * * Recall the format of this header * * D D D D D D D D * * 3 2 2 1 1 0 0 0 * * 1 4 3 6 5 8 7 0 * * |------------|------------|--------------|----------| * * 1st Longword: | Number of elements | Entry Type | DSP Node | * * | (i.e. longwords to | of this Entry| ID in | * * | follow) in this | in the MFP | hex | * * | Entry in the MFP | section | | * * | section of the Data | (3 = Derived| | * * | Block | Constants) | | * * |---------------------------------------------------| * * * * Note that 4 copies of this Header are stored, one for each Term. * ****************************************************************************** LDHI Tool_3_Derived_Const_Length, R11 ; Load the number of elements ; in this Derived Constant ; Entry into the two MSBytes ; of R11 LDI MFP_Derived_Const_Entry_Type,R10 ; Load the Entry Type of ; this list into R10 MB1 R10, R11 ; And merge this Entry ; Type into the next to ; LSByte of R11 MB0 @This_LDSP_Node_ID_Loc, R11 ; Merge the ID of this ; LDSP Node into ; the LSByte of R11 STI R11, @MFP_DC_Term_0_Header_Loc ; And store this header ; in the appropriate ; memory location STI R11, @MFP_DC_Term_1_Header_Loc ; And store this header ; in the appropriate ; memory location STI R11, @MFP_DC_Term_2_Header_Loc ; And store this header ; in the appropriate ; memory location STI R11, @MFP_DC_Term_3_Header_Loc ; And store this header ; in the appropriate ; memory location ****************************************************************************** * Success Exit Point * * * * Now return to the calling module * ****************************************************************************** LDI Status_OK,R11 ; Store the Status OK ; message in R11 for returning ; to the calling module LDI @Zero_Loc,R10 ; Clear R10 RETS ; Return to the calling module ****************************************************************************** * Failure Processing * * * * We have found an error with one of the Parameters or the Reference * * Set Type. We need to set a return code to the calling module (the * * Parameter Checking module) and then return to the calling module. * * * ****************************************************************************** ****************************************************************************** * Local Tool-Dependent Term Parameter Failure Processing * * * * This is the processing corresponding to failures in Frame Parameter * * extraction and checking. The possible Local Parameter Failures are: * * * * Failure Description Error Code * * ------------------- ---------- * * Incorrect Local Tool Number (Tool ID) 1 * * Incorrect Number of Local Tool Parameters 2 * * Local Tool Parameter out of Range 3 * * Parameter Block Type Flag Mismatch in Header 4 * * Term Number Mismatch in Header 5 * * Reference Set Type Mismatch in Header 6 * * * * The Error Codes reserved for Local Parameter Failures are in the * * range 1 - 20 * * * * The Status response to the TCC is composed of 2 longwords: * * * * The first longword looks like: * * * * Bits Description * * ----- ----------- * * 7:0 Error Code (in the range 1-20, as described above) * * 15:8 Tool Number (found) * * 23:16 Term Number (expected) * * 31:24 Number of Parameters expected (if error code = 2) * * Which Parameter is bad (if error code = 3) * * Parameter Type Flag expected (if error code = 4) * * Reference Set Type expected (if error code = 6) * * * * The second longword looks like: * * * * Bits Description * * ----- ----------- * * 31:0 Tool Number (same as above) (if error code = 1) * * Number of Parameters found (if error code = 2) * * Value of bad Parameter (if error code = 3) * * Parameter Type Flag found (if error code = 4) * * Term Number found (if error code = 5) * * Reference Set Type found (if error code = 6) * * * ****************************************************************************** Reference_Set_Type_Failure: ; The Reference Set specified in the ; Local Parameter Block Header does not ; match the Reference Set Type used by ; this Tool. ; R11 contains the Reference Set Type ; found in the header LDI Reference_Set_Type_Error,R10 ; Load the error code ; for incorrect Ref ; Set Type into R10 LDI EM_Reference_Set_Type,R9 ; Load the Reference ; Set Type expected ; into R9 RETS ; Return to the ; calling module Number_of_Parameters_Failure: ; The Number of Parameters specified in ; the Local Parameter Block Header does not ; match the number of Parameters expected ; by this Tool ; R11 contains the number of Parameters ; specified in the header LDI Number_of_Local_Params_Error,R10 ; Load the error code ; for incorrect Number ; of Local Parameters ; into R10 LDI Number_of_Parameters_Expected,R9 ; Load the number of ; Parameters expected ; into R9 RETS ; Return to the ; calling module Parameter_Range_Failure: ; One of the Parameters specified in the ; Local Parameter Block is out of range. ; R11 contains the value of the bad Parameter, ; and R8 contains the Parameter Number ; of the bad Parameter. LDI Local_Param_Range_Error,R10 ; Load the error code ; for Local Parameter ; Range Checking error ; into R10 LDI R8,R9 ; Load the Parameter ; Number of the Bad ; Parameter into R9 RETS ; Return to the calling ; module ****************************************************************************** * This is the Bulkhead. This code should never be executed * ****************************************************************************** End_Of_L_Tl_Ini: ; These instructions should never be ; executed in the "normal" operation BR End_Of_L_Tl_Ini ; of the program. If the program ; counter becomes corrupted or BR End_Of_L_Tl_Ini ; if we have a bug in the program ; we MAY try to execute these BR End_Of_L_Tl_Ini ; instructions. If we get to these ; instructions the program will appear BR End_Of_L_Tl_Ini ; to halt. We could also use a ; TRAP instruction here, and jump to ; a service routine. ****************************************************************************** * Constants defined using assembler .set directives * ****************************************************************************** Number_of_Parameters_Expected .set 8 ; Specifies that this ; Tool Code requires ; 9 ; Local Parameters MFP_Derived_Const_Length .set 4*Tool_4_Derived_Const_Length + 4 ; Number of Tool Specific ; "Derived Constant" ; Entries in the MFP ; Recall that there will ; be 4 Type 3 Entries ; per LDSP, and each ; has a one-longword ; Header. ****************************************************************************** * Define constants and working variables in the Data Section * ****************************************************************************** .data MFP_Derived_Const_Data_Loc: ; The next 32 memory ; locations contain ; the "Derived Constant" ; part of the Mark ; and Force Pass data ; block. They are read ; out during Mark and ; Force Pass events MFP_DC_Term_0_Header_Loc: .space 1 ; Memory location to ; store the Header ; for the Derived ; Constant subsection ; of the MFP section of ; the Data Block for ; Term 0. Term_Number_0_Loc: ; Memory location to ; store the Term .word Term_Number_0 ; Number 0 Tool_Number_Loc: .word eWjj_Tool ; Memory location to ; store the Tool Number ; of this Local Tool Eta_Nplus2_3x3_Tot_Offset_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 2" Eta_Nplus3_3x3_Tot_Offset_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 3" Eta_Nplus4_3x3_Tot_Offset_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 4" Eta_Nplus5_3x3_Tot_Offset_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 5" EM_Et_1x2_Thresh_0_Loc: .word 38 ; Memory location to ; store the EM Et 1x2 ; Threshold for Term #0. ; The value ; stored here is a dummy ; value, the actual ; value is loaded from ; the Parameter Block. MFP_DC_Term_1_Header_Loc: .space 1 ; Memory location to ; store the Header ; for the Derived ; Constant subsection ; of the MFP section of ; the Data Block for ; Term 1. Term_Number_1_Loc: ; Memory location to ; store the Term .word Term_Number_1 ; Number 1 Tool_Number_1_Loc: .word eWjj_Tool ; Memory location to ; store the Tool Number ; of this Local Tool Eta_Nplus2_3x3_Tot_Off_1_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 2" ; This copy is only ; used in the Type 3 ; Entry, not in the ; actual processing Eta_Nplus3_3x3_Tot_Off_1_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 3" ; This copy is only ; used in the Type 3 ; Entry, not in the ; actual processing Eta_Nplus4_3x3_Tot_Off_1_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 4" ; This copy is only ; used in the Type 3 ; Entry, not in the ; actual processing Eta_Nplus5_3x3_Tot_Off_1_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 5" ; This copy is only ; used in the Type 3 ; Entry, not in the ; actual processing EM_Et_1x2_Thresh_1_Loc: .word 38 ; Memory location to ; store the EM Et 1x2 ; Threshold for Term #1. ; The value ; stored here is a dummy ; value, the actual ; value is loaded from ; the Parameter Block. MFP_DC_Term_2_Header_Loc: .space 1 ; Memory location to ; store the Header ; for the Derived ; Constant subsection ; of the MFP section of ; the Data Block for ; Term 2. Term_Number_2_Loc: ; Memory location to ; store the Term .word Term_Number_2 ; Number 2 Tool_Number_2_Loc: .word eWjj_Tool ; Memory location to ; store the Tool Number ; of this Local Tool Eta_Nplus2_3x3_Tot_Off_2_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 2" ; This copy is only ; used in the Type 3 ; Entry, not in the ; actual processing Eta_Nplus3_3x3_Tot_Off_2_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 3" ; This copy is only ; used in the Type 3 ; Entry, not in the ; actual processing Eta_Nplus4_3x3_Tot_Off_2_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 4" ; This copy is only ; used in the Type 3 ; Entry, not in the ; actual processing Eta_Nplus5_3x3_Tot_Off_2_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 5" ; This copy is only ; used in the Type 3 ; Entry, not in the ; actual processing EM_Et_1x2_Thresh_2_Loc: .word 38 ; Memory location to ; store the EM Et 1x2 ; Threshold for Term #2. ; The value ; stored here is a dummy ; value, the actual ; value is loaded from ; the Parameter Block. MFP_DC_Term_3_Header_Loc: .space 1 ; Memory location to ; store the Header ; for the Derived ; Constant subsection ; of the MFP section of ; the Data Block for ; Term 3. Term_Number_3_Loc: ; Memory location to ; store the Term .word Term_Number_3 ; Number 3 Tool_Number_3_Loc: .word eWjj_Tool ; Memory location to ; store the Tool Number ; of this Local Tool Eta_Nplus2_3x3_Tot_Off_3_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 2" ; This copy is only ; used in the Type 3 ; Entry, not in the ; actual processing Eta_Nplus3_3x3_Tot_Off_3_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 3" ; This copy is only ; used in the Type 3 ; Entry, not in the ; actual processing Eta_Nplus4_3x3_Tot_Off_3_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 4" ; This copy is only ; used in the Type 3 ; Entry, not in the ; actual processing Eta_Nplus5_3x3_Tot_Off_3_Loc .space 1 ; Memory location to ; store the 3x3 Tot Et ; Sum Offset for ; eta "n + 5" ; This copy is only ; used in the Type 3 ; Entry, not in the ; actual processing EM_Et_1x2_Thresh_3_Loc: .word 38 ; Memory location to ; store the EM Et 1x2 ; Threshold for Term #3. ; The value ; stored here is a dummy ; value, the actual ; value is loaded from ; the Parameter Block. ; end of the 4 "Derived ; Constant Type 3 DeBug ; Section" Entries Isolation_Ratio_Thresh_0_Loc: .float 2.0 ; Memory location to ; store the Isolation ; Ratio Threshold for ; Term #0. The ; value stored here is a ; dummy value, the actual ; value is loaded from ; the Parameter Block. EM_Frac_Ratio_Thresh_0_Loc: .float 2.0 ; Memory location to ; store the EM Fraction ; Ratio Threshold for ; Term #0. The ; value stored here is a ; dummy value, the actual ; value is loaded from ; the Parameter Block. Isolation_Ratio_Thresh_1_Loc: .float 2.0 ; Memory location to ; store the Isolation ; Ratio Threshold for ; Term #1. The ; value stored here is a ; dummy value, the actual ; value is loaded from ; the Parameter Block. EM_Frac_Ratio_Thresh_1_Loc: .float 2.0 ; Memory location to ; store the EM Fraction ; Ratio Threshold for ; Term #1. The ; value stored here is a ; dummy value, the actual ; value is loaded from ; the Parameter Block. Isolation_Ratio_Thresh_2_Loc: .float 2.0 ; Memory location to ; store the Isolation ; Ratio Threshold for ; Term #2. The ; value stored here is a ; dummy value, the actual ; value is loaded from ; the Parameter Block. EM_Frac_Ratio_Thresh_2_Loc: .float 2.0 ; Memory location to ; store the EM Fraction ; Ratio Threshold for ; Term #2. The ; value stored here is a ; dummy value, the actual ; value is loaded from ; the Parameter Block. Isolation_Ratio_Thresh_3_Loc: .float 2.0 ; Memory location to ; store the Isolation ; Ratio Threshold for ; Term #3. The ; value stored here is a ; dummy value, the actual ; value is loaded from ; the Parameter Block. EM_Frac_Ratio_Thresh_3_Loc: .float 2.0 ; Memory location to ; store the EM Fraction ; Ratio Threshold for ; Term #3. The ; value stored here is a ; dummy value, the actual ; value is loaded from ; the Parameter Block. Object_Type_Loc: .word Electron_Object_Type ; Memory location to ; store the Object Type ; of Objects found by this ; Tool Real_Data_Flag_Loc: .word Real_ObjectList_Entry_Type ; Memory location to ; store the "Real Data" ; flag List_Overrun_Flag_Loc .word ObjectList_Overrun_Flag ; Memory location to ; store the "Local ; List Overrun" flag Mark_Force_Pass_Data_Flag_Loc: ; Memory location to ; store the "Mark and .word MFP_ObjectList_Entry_Type ; Force Pass Data" flag Largest_Neighbor_ID_Loc: .space 1 ; Memory location to ; store the key to the ; ID of the "largest" ; EM Et neighbor Term_Number_for_This_Tool_Loc: .space 1 ; Temporary storage ; of the current ; Term Number ********** Memory locations added for eWjj Tool: Term_Type_0_Loc: .word 1 ; New Parameters ; for Term 0 Seed_Min_EM_Et_Cut_0_Loc: .word 50 Seed_Min_Tot_Et_Cut_0_Loc: .word 60 Seed_Max_Eta_Cut_0_Loc: .word 20 Tot_Et_5x5_Thresh_0_Loc: .word 120 Term_Type_1_Loc: .word 1 ; New Parameters ; for Term 1 Seed_Min_EM_Et_Cut_1_Loc: .word 51 Seed_Min_Tot_Et_Cut_1_Loc: .word 61 Seed_Max_Eta_Cut_1_Loc: .word 21 Tot_Et_5x5_Thresh_1_Loc: .word 121 Term_Type_2_Loc: .word 1 ; New Parameters ; for Term 2 Seed_Min_EM_Et_Cut_2_Loc: .word 52 Seed_Min_Tot_Et_Cut_2_Loc: .word 62 Seed_Max_Eta_Cut_2_Loc: .word 22 Tot_Et_5x5_Thresh_2_Loc: .word 122 Term_Type_3_Loc: .word 1 ; New Parameters ; for Term 3 Seed_Min_EM_Et_Cut_3_Loc: .word 53 Seed_Min_Tot_Et_Cut_3_Loc: .word 63 Seed_Max_Eta_Cut_3_Loc: .word 23 Tot_Et_5x5_Thresh_3_Loc: .word 123 Eta_Nplus2_5x5_Tot_Offset_Loc .space 1 ; Total Et 5x5 ; offsets Eta_Nplus3_5x5_Tot_Offset_Loc .space 1 Eta_Nplus4_5x5_Tot_Offset_Loc .space 1 Eta_Nplus5_5x5_Tot_Offset_Loc .space 1 Seed_EM_Et_Loc: .space 1 ; Seed EM Et Seed_Tot_Et_Loc: .space 1 ; Seed Tot Et ************* End of new eWjj memory locations ****************************************************************************** * Cross-References * ****************************************************************************** .def Initialize_Tool ; Symbols defined in this .def Eta_Nplus2_3x3_Tot_Offset_Loc ; module for use in other .def Eta_Nplus3_3x3_Tot_Offset_Loc ; modules .def Eta_Nplus4_3x3_Tot_Offset_Loc .def Eta_Nplus5_3x3_Tot_Offset_Loc .def Object_Type_Loc .def Real_Data_Flag_Loc .def Mark_Force_Pass_Data_Flag_Loc .def Term_Number_for_This_Tool_Loc .def Tool_Number_Loc .def MFP_Derived_Const_Length .def MFP_Derived_Const_Data_Loc .def List_Overrun_Flag_Loc .def EM_Et_1x2_Thresh_0_Loc .def Isolation_Ratio_Thresh_0_Loc .def EM_Frac_Ratio_Thresh_0_Loc .def EM_Et_1x2_Thresh_1_Loc .def Isolation_Ratio_Thresh_1_Loc .def EM_Frac_Ratio_Thresh_1_Loc .def EM_Et_1x2_Thresh_2_Loc .def Isolation_Ratio_Thresh_2_Loc .def EM_Frac_Ratio_Thresh_2_Loc .def EM_Et_1x2_Thresh_3_Loc .def Isolation_Ratio_Thresh_3_Loc .def EM_Frac_Ratio_Thresh_3_Loc .def Largest_Neighbor_ID_Loc .def Term_Type_0_Loc ; new symbols defined .def Seed_Min_EM_Et_Cut_0_Loc ; in this module for .def Seed_Min_Tot_Et_Cut_0_Loc ; the eWjj Tool .def Seed_Max_Eta_Cut_0_Loc .def Tot_Et_5x5_Thresh_0_Loc .def Term_Type_1_Loc .def Seed_Min_EM_Et_Cut_1_Loc .def Seed_Min_Tot_Et_Cut_1_Loc .def Seed_Max_Eta_Cut_1_Loc .def Tot_Et_5x5_Thresh_1_Loc .def Term_Type_2_Loc .def Seed_Min_EM_Et_Cut_2_Loc .def Seed_Min_Tot_Et_Cut_2_Loc .def Seed_Max_Eta_Cut_2_Loc .def Tot_Et_5x5_Thresh_2_Loc .def Term_Type_3_Loc .def Seed_Min_EM_Et_Cut_3_Loc .def Seed_Min_Tot_Et_Cut_3_Loc .def Seed_Max_Eta_Cut_3_Loc .def Tot_Et_5x5_Thresh_3_Loc .def Eta_Nplus2_5x5_Tot_Offset_Loc .def Eta_Nplus3_5x5_Tot_Offset_Loc .def Eta_Nplus4_5x5_Tot_Offset_Loc .def Eta_Nplus5_5x5_Tot_Offset_Loc .def Seed_EM_Et_Loc .def Seed_Tot_Et_Loc .ref Eta_Nplus0_EM_Et_Zeresp_Loc ; Symbols referenced in .ref Eta_Nplus1_EM_Et_Zeresp_Loc ; this module but .ref Eta_Nplus2_EM_Et_Zeresp_Loc ; defined in other .ref Eta_Nplus3_EM_Et_Zeresp_Loc ; modules .ref Eta_Nplus4_EM_Et_Zeresp_Loc .ref Eta_Nplus5_EM_Et_Zeresp_Loc .ref Eta_Nplus6_EM_Et_Zeresp_Loc .ref Eta_Nplus7_EM_Et_Zeresp_Loc .ref Eta_Nplus0_Tot_Et_Zeresp_Loc .ref Eta_Nplus1_Tot_Et_Zeresp_Loc .ref Eta_Nplus2_Tot_Et_Zeresp_Loc .ref Eta_Nplus3_Tot_Et_Zeresp_Loc .ref Eta_Nplus4_Tot_Et_Zeresp_Loc .ref Eta_Nplus5_Tot_Et_Zeresp_Loc .ref Eta_Nplus6_Tot_Et_Zeresp_Loc .ref Eta_Nplus7_Tot_Et_Zeresp_Loc .ref Term_Number_Loc .ref Reference_Set_Type_Loc .ref Local_Tool_Parameter_Handle .ref Zero_Loc .ref This_LDSP_Node_ID_Loc .ref Term_Number_Expected_Loc .end