**************************************************************************** * * * File: Temp_1.ASM * * * * This is the program section for the first test program of DSP L15 Cal * * Trig filtering. * * * * First we will scan through the Trigger Towers that this DSP Node is * * responsible for (i.e. eta's n+2,n+3,n+4,n+5) and look for Trigger * * Towers that are above the L15 Ref Set. * * * * When we find a Trig Tower above its entry in the L15 Ref Set we will * * set a bit in a mask and then branch immediately to the L15 algorithm * * processing before finishing the scan for Trig Towers above the L15 * * Ref Set. This is because we do not want to have to scan through the * * mask to see where in eta and phi to run the L15 algorithm because it * * will take almost as long to scan the mask as it took to build it in * * the first place. * * * * The L1 rack data and the L15 Ref Set data in loaded via an include * * file. The layout of this data is explained in the include file. It * * is stored in internal memory B3 and can thus be used with either * * CONF 1 or CONF 2. * * * * When a tower is found above L15 Ref Set then a routine is called * * to execute the L15 Algorithm. There are 4 versions of this * * algorithm stored in program memory. They differ only in the details * * of their "hard wired" addressing (i.e. was the Trigger Tower above * * the L15 Ref Set an eta n+2, n+3, n+4, or n+5 tower). * * * * Recall the arrangement of eta's in the racks: * * * * Rack Rack #1 Rack #2 * * Signal -------------------- --------------------- * * Names n n+1 n+2 n+3 n+4 n+5 n+6 n+7 * * * * This DSP Node -------------------------- * * is Responsible n+2 n+3 n+4 n+5 * * for these eta's * * * * * * For convenients only the n+3 version of the L15 algorithm will be coded.* * * * AR0 is the Aux Reg increment value * * AR1 is the pointer to Rack 1 EM data. * * AR2 is the pointer to Rack 2 EM data. * * AR3 is the pointer to Rack 1 L15 Ref Set data. * * AR4 is the pointer to Rack 2 L15 Ref Set data. * * AR5 is the counter for the phi index. * * AR6 is the pointer to the summation list. * * AR7 is * * * * * * * * * * * * * * * **************************************************************************** .Text ; Make this a Program Section. .PS 0fb00h ; Set the Prog Sect address i.e. right ; after the DSKD monitor. .Entry ; Declare this the entry point. Cnst2 .Set 0002h ; The value 2 is loaded into AR0 so ; that AR0 may be used to "double ; increment" other Auxiliary Registers ; by using "*0+" addressing. Rk1EM .Set 0600h ; The beginning address of Rack 1 EM Et ; Data. Rk2EM .Set 0640h ; The beginning address of Rack 2 EM Et ; Data. Rk1Tot .Set 0680h ; The beginning address of Rack 1 Total ; Et Data. Rk2Tot .Set 06C0h ; The beginning address of Rack 2 Total ; Et Data. RS1Data .Set 0700h ; The beginning address of Rack 1 ; L15 Reference Set data. RS2Data .Set 0780h ; The beginning address of Rack 2 ; L15 Reference Set data. PhiCnt .Set 0031 ; This this the number of loops to make ; through the Phi Index in order to ; have loop through all of the phi's ; looking for Trigger Towers above ; the L15 Reference Set. Because of ; the BANZ instruction this will run ; through the eta loop 32 times. BegInt: CONF 1 ; B0 is Program Space $FA00:$FBFF ; B1 is Data Space $0400:$05FF ; B2 is Data Space $0060:$007F ; B3 is Data Space $0600:$07FF RSXM ; Clear the sign extend bit is the Status ; Reg #1. i.e. all positive numbers. IntStr: LRLK AR0,Cnst2 ; Aux Reg 0 will be used for *0+ adrsing. LRLK AR1,Rk1EM ; Aux Reg 1 points to Rack 1 EM data. LRLK AR2,Rk2EM ; Aux Reg 2 points to Rack 2 EM data. LRLK AR3,RS1Data ; Aux Reg 3 points to Rack 1 L15 Ref Set. LRLK AR4,RS2Data ; Aux Reg 4 points to Rack 2 L15 Ref Set. ; Move the pointer for Rack 1 and 2 to ; skip over eta's n and n+1 for both ; the rack data and the Ref Set data. LARP AR1 ; Select Aux Reg 1, i.e. Rack 1 data. ADRK 1 ; Skip Rack 1 data for eta n and n+1. LARP AR3 ; Select Aux Reg 3, i.e. Ref Set Rack 1. ADRK 2 ; Skip Ref Set 1 data for eta n and n+1. LDPK 8 ; Select Data Page #8 i.e. adrs 400h. StrPhi: LRLK AR5,PhiCnt ; Aux Reg 5 will be the loop counter for ; running through all 32 phi's. LARP AR1 ; Select Aux Reg 1, i.e. Rack 1 EM data. ; Everything is now set for looping over ; all 32 phi's looking for Trigger Towers ; that are above the L15 Ref Set. Loop1: LAC *,0,AR3 ; Load Rack 1 EM data for eta's n+2, n+3 ; Set ARP=3 i.e. select Rack 1 Ref Set ; data. Do not left shift of the data. AND LowByt ; Mask the high byte i.e. keep eta n+2. SUB *+,0,AR1 ; Subtract the Ref Set data for eta n+2. ; Increment the Ref Set data pointer. ; Do not shift the Ref Set data. ; Set ARP=1 i.e. select Rack 1 EM data. BLZ NxTst3 ; If Tower n+2 was not above threshold ; then the next test is tower n+3. CALL HotN2 ; Call the routine for the L15 algorithm ; for an eta n+2 Trigger Tower above ; l15 Ref Set. NxTst3: LAC *0+,0,AR3 ; Load Rack 1 EM data for eta's n+2, n+3. ; Set ARP=3 i.e. select Rack 1 Ref Set ; data. Do not left shift of the data. ; Add 2 to the Rack 1 EM data pointer. AND HiByte ; Mask the low byte i.e. keep eta n+3. SUB *0+,0,AR3 ; Subtract the Ref Set data for eta n+3. ; Add 2 to the Ref Set data pointer. ; Do not shift the Ref Set data. ; Keep ARP=3 i.e. select Rack 1 Ref ; Set data. BLZ NxTst4 ; If Tower n+3 was not above threshold ; then the next test is tower n+4. CALL HotN3 ; Call the routine for the L15 algorithm ; for an eta n+3 Trigger Tower above ; l15 Ref Set. NxTst4: SUB *+,0,AR2 ; This SUB is just a fast way to ; increment the pointer to the Rack 1 ; Ref Set data i.e. now it points to ; the next phi eta n+2. ; Set ARP=2 i.e. select Rack 2 EM data. ; Now do the 2 eta's from the second ; rack before switching to the next ; higher Phi Index. LAC *,0,AR4 ; Load Rack 2 EM data for eta's n+4, n+5 ; Set ARP=4 i.e. select Rack 2 Ref Set ; data. Do not left shift of the data. AND LowByt ; Mask the high byte i.e. keep eta n+4. SUB *+,0,AR2 ; Subtract the Ref Set data for eta n+4. ; Increment the Ref Set data pointer. ; Do not shift the Ref Set data. ; Set ARP=2 i.e. select Rack 2 EM data. BLZ NxTst5 ; If Tower n+4 was not above threshold ; then the next test is tower n+5. CALL HotN4 ; Call the routine for the L15 algorithm ; for an eta n+4 Trigger Tower above ; l15 Ref Set. NxTst5: LAC *0+,0,AR4 ; Load Rack 2 EM data for eta's n+4, n+5. ; Set ARP=4 i.e. select Rack 2 Ref Set ; data. Do not left shift of the data. ; Add 2 to the Rack 2 EM data pointer. AND HiByte ; Mask the low byte i.e. keep eta n+5. SUB *0+,0,AR4 ; Subtract the Ref Set data for eta n+5. ; Add 2 to the Ref Set data pointer. ; Do not shift the Ref Set data. ; Keep ARP=4 i.e. Rack 2 Ref Set data. BLZ NxTst2 ; If Tower n+5 was not above threshold ; then the next test is tower n+2. CALL HotN5 ; Call the routine for the L15 algorithm ; for an eta n+5 Trigger Tower above ; l15 Ref Set. NxTst2: SUB *+,0,AR5 ; This SUB is just a fast way to ; Increment by 2 the Rack 2 pointer. ; Ref Set data i.e. now it points to ; the next phi eta n+2. ; Set ARP=5 i.e. select the Aux Reg ; for the phi loop counter. BANZ Loop1,*-,AR1 ; Test to see if we have looked at all ; 32 phi's. Set ARP=1 to select the ; Rack 1 EM data. ; We exit via the BANZ instruction when ; all 32 phi's have been scanned. The ; next instruction will be the first ; one to execute after scanning all ; 32 phi's for Trigger Towers above ; the L15 Reference Set. IN InTar,PA3 ; Read Port Address 1 and store it in ; address $0410. We are currently on ; data memory page 8 so all is OK. ; This is just to make a wire wiggle ; outside of the chip. LARP AR5 ; Select Aux Reg 5. This is the phi ; loop control register which will ; need to be initialized again before ; starting the phi loop again. B IntStr ; Jump to the start of the Phi Loop Idle HotN2: Idle HotN3: Idle HotN5: Idle HotN4: LAC *,8,AR2 ; This is the beginning of the L15 ; algorithm for n+4 Trigger Towers ; above the L15 Ref Set. We arrive ; here with ARP=2 i.e. the Rack 2 ; EM data. AR2 still contains the ; address of the EM tower that was ; above L15 Ref Set. Get the n+4, ; n+5 data. 8 left shifts. Keep ARP=2. SACL EMPrt1 ; Store eta n+4, phi cent in EMPrt1. ZALS *0+,0,AR2 ; Load Rack 2 EM Et for eta n+4, n+5. ; No shifts. Add 2 to AR2 i.e. next ; phi. Keep ARP=2 i.e. Rack 2 EM. AND HiByte ; Mask the low byte i.e. keep eta n+5. SACL EMPrt2 ; Store eta n+5, phi cent in EMPrt2. LAC *,8,AR2 ; Load Rack 2 EM Et for eta n+4, n+5, ; phi = cent+1. Shifts by 8. ; Keep ARP=2 i.e. Rack 2 EM. SACL EMPrt3 ; Store eta n+4, phi cent+1 in EMPrt3. ZALS *0-,0,AR2 ; Load Rack 2 EM Et for eta n+4, n+5, ; phi=Cent+1. No shifts. Sub 2 from ; AR2. Keep ARP=2 i.e. Rack 2 EM. AND HiByte ; Mask the low byte i.e. keep eta n+5. SACL EMPrt4 ; Store eta n+5, phi cent+1 in EMPrt4. SBRK 0002h ; Subtract 2 from AR2, now phi = cent-1. LAC *,8,AR2 ; Load Rack 2 EM Et for eta n+4, n+5, ; phi = cent-1. Shifts by 8. ; Keep ARP=2 i.e. Rack 2 EM. SACL EMPrt5 ; Store eta n+4, phi cent-1 in EMPrt5. ZALS *0+,0,AR1 ; Load Rack 2 EM Et for eta n+4, n+5, ; phi=Cent-1. No shifts. Add 2 to ; AR2. Set ARP=1 i.e. Rack 1 EM. ; AR2 is now back to the value that ; it arrived with in this routine. AND HiByte ; Mask the low byte i.e. keep eta n+5. SACL EMPrt6 ; Store eta n+5, phi cent-1 in EMPrt6. ZALS *0-,0,AR1 ; Load Rack 1 EM Et for eta n+2, n+3, ; phi=Cent+1. No shifts. Sub 2 from ; AR1. Keep ARP=1 i.e. Rack 1 EM. ; AR1 is now phi = cent. AND HiByte ; Mask the low byte i.e. keep eta n+3. SACL EMPrt7 ; Store eta n+3, phi cent+1 in EMPrt7. ZALS *0-,0,AR1 ; Load Rack 1 EM Et for eta n+2, n+3, ; phi=Cent. No shifts. Sub 2 from ; AR1. Keep ARP=1 i.e. Rack 1 EM. ; AR1 is now phi = cent-1. AND HiByte ; Mask the low byte i.e. keep eta n+3. SACL EMPrt8 ; Store eta n+3, phi cent in EMPrt8. ZALS *,0,AR1 ; Load Rack 1 EM Et for eta n+2, n+3, ; phi=Cent-1. No shifts. ; Keep ARP=1 i.e. Rack 1 EM. ; AR1 is still phi = cent-1. AND HiByte ; Mask the low byte i.e. keep eta n+3. SACL EMPrt9 ; Store eta n+3, phi cent in EMPrt9. ADRK 4 ; Put AR1 back to phi = Cent+1 i.e. ; the value that it arrived with. ; Now all the 9 EMprt% to make the 3x3 ; EM Et sum. ZAC ; Clear the accumulator. ADD EMPrt1 ; Get EM Et Part 1 ADD EMPrt2 ; Get EM Et Part 2 ADD EMPrt3 ; Get EM Et Part 3 ADD EMPrt4 ; Get EM Et Part 4 ADD EMPrt5 ; Get EM Et Part 5 ADD EMPrt6 ; Get EM Et Part 6 ADD EMPrt7 ; Get EM Et Part 7 ADD EMPrt8 ; Get EM Et Part 8 ADD EMPrt9 ; Get EM Et Part 9 ; The accumulator now holds the 3x3 EM ; Et. The LSB of the sum is in ; accumulator bit 8, accumulator bits ; 0:7 are zero. SACH EMPrt2 ; Store the High Accumulator in EMPrt2. SACL EMPrt1 ; Store the High Accumulator in EMPrt1. LARP 2 ; Select Aux Reg 2 i.e. the Aux Reg that ; we arrived with in this routine. RET ; Return to the calling routine. .Data ; Declare a Data Memory Program Section. .DS 0400h ; Set the Data Memory Address at the ; beginning of internal memory B1. LowByt: .Word 00FFh ; Mask for the lower byte. HiByte: .Word 0FF00h ; Mask for the upper byte. SumEm: .Word 0000h ; Memory location for building the 3x3 ; EM Et sum. EMPrt1: .Word 0000h ; 1st of 9 parts of the 3x3 EM Et Sum. EMPrt2: .Word 0000h ; 2nd of 9 parts of the 3x3 EM Et Sum. EMPrt3: .Word 0000h ; 3rd of 9 parts of the 3x3 EM Et Sum. EMPrt4: .Word 0000h ; 4th of 9 parts of the 3x3 EM Et Sum. EMPrt5: .Word 0000h ; 5th of 9 parts of the 3x3 EM Et Sum. EMPrt6: .Word 0000h ; 6th of 9 parts of the 3x3 EM Et Sum. EMPrt7: .Word 0000h ; 7th of 9 parts of the 3x3 EM Et Sum. EMPrt8: .Word 0000h ; 8th of 9 parts of the 3x3 EM Et Sum. EMPrt9: .Word 0000h ; 9th of 9 parts of the 3x3 EM Et Sum. InTar: .Word 0000h ; Target memory location for the IN read. .ListOff .Include "TempX2.ASM" ; Get the Rack and L15 Ref Set data. .ListOn .End