% **************************************************************************************** *** EDtimex.mc : Timer Exerciser microcode *** Revision 1.1 *** *** Purpose : This test exercises timers 0 - 15d. It replaces the page 16d portion of standard KERNEL. *** Minimum Hardware : Standard 4 CPU boards. *** Approximate Run Time : 6d seconds. *** Written by : C. Thacker, Feb. 25, 1979 *** Modified by : K. Mayekawa, Feb. 28, 1980 *** Standardize title page and code format. *** Modified by : C. Thacker, May 3, 1980 Standardized assembly with timex.cm, fixed for new d0lang. **************************************************************************************** **************************************************************************************** *SubTest Description: * SubTest 0: Timer Initilization (Task 14) Clears the timers and sets up the refresh timer. * SubTest 1: Timer Wakeup routine (Task 14) Timer wakeups come here. If the timer 15d expires, memory is refreshed and a new value is added to the timer, then Mouse halt is checked. If any of the timers 0-14d expires, it is restarted and timeout counter for that timer is set to TimeOut. * SubTest 2: Check Timeout routine (Task 0) Loads the timers 0-14d, sets a timeout value for these timers to TimeOut, then checks for timeouts. **************************************************************************************** *BreakPoints: * Fail : The timer was not restarted (timeout register was not set to TimeOut) when it expired. * Passed-EDtimex-Test: Passed all tests, and all passes. * WrongSlotExpired : Wrong timer slot expired. Timer slots should expire from 14d to 0 sequentially. *Note: The program also breaks at MouseHalt. **************************************************************************************** *BreakPoint Logic Analyzer Sync Points: * There is no short looping capability for this exerciser. **************************************************************************************** *Loading and Reading Timers: * Timers are loaded from the ALUA bus by functions LOADTIMER and ADDTOTIMER. * Also they can be read as an external R source(TIMER). * When loading or adding to timers, bits are divided as follows: * Bits 0 - 3 : new state (loaded by both LOADTIMER and ADDTOTIMER) * Bits 4 - 11 : new data to be loaded (by LOADTIMER) or new data to be added * to the current data (by ADDTOTIMER) * Bits 12 - 15 : slot number to be loaded **************************************************************************************** *Special Reg. Definition: * RM[20b] - RM[36b]: contains timeout values for each slot. set to TimeOut(=40b) when timers are started initially. Each time through the BigLoop, these timeouts are decremented. If one of the timeouts becomes zero, a breakpoint occurs. The maintenance panel is also incremented, so if you kill the breakpoint at FAIL, you will see if any errors occur by noting a nonzero panel. Whenever a timer expires normally, it is restarted and its associated timeout register is set to TimeOut. Thus, we should never see a zero value in any of the timeout registers. * InnerCount: incremented each time through the BigLoop, i.e. each time TimeOuts for all slots 0 through 14d are decremented by one. * MaxInnerCount: contains the maximum value for InnerCount. When InnerCount=MaxInnerCount, the program completes one pass, resets InnerCount, and goes back to the start of the program if PassCount=0]; *reset expectedslot if negative ExpectedSlot _ 16c; T _ (Tslot) OR (TimerValue); TimerTemp _ T; ADDTOTIMER[TimerTemp]; *Set RM[20b + Tslot] to TimeOut - if this register ever becomes zero, *the main program will restart the timer and cause an error. Tslot _ (Tslot) + (20c); *Array of count words is in RM[20b]-RM[36b] T_STKP; Tslot _ T, STKP _ Tslot; Tslot _ (Tslot) XOR (377C); STACK _ TimeOut; STKP _ Tslot, RETURN; *restore stackpointer *SubTest 2 (Check Timeout routine) SETTASK[0]; ONPAGE[1]; start: go: SubTest _ 2C; InnerCount _ 0C; *reset InnerCount CLEARMPANEL, CALL[SwitchTo14]; *Notify timer initialization stuff *come back here after timer initialization SetTimers: SubTest _ 2C; Tslot0 _ T _ (16C), GOTO[StartTLoop]; *switch to Task 14, InitTimers SwitchTo14: SubTest _ 0C; Tslot0 _ TimerInitlocL; Tslot0 _ (Tslot0) OR (TimerInitLocH); APC&APCTask _ TSlot0; RETURN; StartTLoop: CALL[StartTimer]; *start timer, set count to TimeOut Tslot0 _ T _ (Tslot0)-1; GOTO[BigLoop, ALU<0]; GOTO[StartTLoop]; BigLoop: Tslot0 _ T _ (16C); MainLoop: Temp _ T; NOP; *make the loop longer Temp _ (Temp) + (20c); SubTest _ 1C, TASK; CheckTimeout: SubTest _ 2C; STKP _ Temp; STACK _ (STACK) - (1C), GOTO[NoFail,R>=0]; *slot Tslot0 got restarted in time Fail: BREAKPOINT,INCMPANEL; GOTO[go]; NoFail: Tslot0 _ T _ (Tslot0) - (1C); GOTO[MainLoop, ALU>=0]; InnerCount _ T _ (InnerCount) + (1C); *increment InnerCount LU _ (MaxInnerCount) - (T); GOTO[OnePassFinished, ALU=0]; *finished one pass ? GOTO[BigLoop]; OnePassFinished: PassCount _ T _ (PassCount) + (1C); *increment PassCount LU _ (MaxPass) - (T); GOTO[Passed-EDtimex-Test, ALU=0]; *finished all passes ? GOTO[go]; Passed-EDtimex-Test: PassCount _ 0C, GOTO[go], BREAKPOINT; ********** SUBROUTINE: StartTimer ********** * * to load the timer whose slot is in Tslot0 and * to set RM[Tslot0 + 20b] to TimeOut StartTimer: USECTASK; T _ APC&APCTASK; Rlink0 _ T; T _ Tslot0; *Tslot0 has the slot number Temp _ T; Temp _ (Temp) OR (TimerValue); T _ lsh[Tslot0,6]; Temp _ (Temp) - (T); *subtract (slot number x 4) from TimerValue LoadTimer[Temp]; T _ Tslot0; Temp _T; Temp _ (Temp) + (20c); STKP _ Temp; *set count to TimeOut STACK _ TimeOut; Temp _ T; *restore the slot number APC&APCTASK _ Rlink0; RETURN; END; (1792)\9597f8 23f0