!!!! 4 0 1 926117588 0000 ! AGILENT 3070 STANDARD TESTMAIN Revision: "B380:1(full)" ! STANDARD VERSION !############################################################################## ! This "main" program sequences execution of testplan subroutines and ! assumes that the current working directory is already set to the ! appropriate board directory. ! This testmain has included the code to support the following optional ! features: ! Data Logging for PushButton QSTATS, QSTATS-II and PRPlus ! Chek-Point (pin tests) ! Boundary Scan ! Once the testplan is working, you may selectively enable ! any combination of the features by changing the 'flag' variables ! in the subroutine "Set_Custom_Options". Use the following command: ! find "! Other"&" parameters" ! takes you to option settings ! ! Turn learn on and run the testplan on a known good board. After the ! learning run is successfully completed, the testplan is ready for ! customization, debug and production testing. ! Analog limits are logged by standard testmain if and only if the ! learn flag is on. Limits must be logged once each time they change ! in order for PushButton Q-STATS or Q-STATS II to produce histograms. ! ! If flash is to be programmed on this board, the testplan needs to have the ! locations marked !flash! modified or reviewed. Please review the flash ! manual for full explanation. Key elements include: ! ! full disabling of buses and upstream control lines is required for safety ! use ID check for digital test subroutine to ensure proper part placement ! Cycle power if required to three-state upstream devices ! ! Miscellaneous string variable size declarations: dim InvOn$[5], InvOff$[4] dim Testmain_Revision$[25] dim Batch$[12], Oper$[25], Testplan$[14], Testrev$[4] dim Board$[14], Board_Rev$[14], Known_Good$[1] dim Proc_Step$[5], Log_Path$[80] ! The following is used in the power-supply setup routine for parallel ! power supplies. It holds masks for comparison. dim Psgroup(1:16) option bit 32 ! Prevents range error when comparing Psgroup with MSB set ! INITIALIZE BREAK AND ERROR TRAPPING on break recover Break_Trap on error recover Error_Trap ! INITIALIZE VARIABLES call Initializations ! SET UP FAILURE ACKNOWLEDGMENT acknowledge all failures ! MAIN LOOP FOR REPEATEDLY TESTING A BOARD ! (executed only once if "learning") Wait_For_Start: Pass_Fail_Reported = False Logging_Started = False Tests_On_This_Board = 0 print | print Place_Board_Prompt$ wait for start if Serializing then print using "@" Serial$ = fn Get_Serial_Num$(Serial_Prompt$) Known_Good$ = "n" if Serial$ = Known_Good_Board$ then Known_Good$ = "y" if Using_AwareTest = True then ! remove special characters Serial_New$ = fn Remove_Special_Characters$(Serial$) Path$ = Serial_Number_Directory$ & Serial_New$ & Serial_Suffix$ enter Path$,, Err if Err then ! serial number file was not found -- board was not tested on AXI if AXI_Tested_Override = False then print Not_AXI_Tested$ goto Wait_For_Start else ! Add custom code here if serial number is missing and ! you do not want to completely skip the PC board test end if end if end if end if if Using_Multiple_Versions and Version_Prompting = Per_Board then call Get_Version_Label if nrun = 1 or Version_Inits_Needed then call Do_Version_Inits end if end if ! RE-TEST AFTER PIN-TEST FAILURE ChekPoint_Retry: print using "@,/" if Serializing then print But$; Serial$ Tests_On_This_Board = Tests_On_This_Board + 1 if Tests_On_This_Board > 1 then print Rep_Test$ ! START LOGGING FOR THIS BOARD report is Report_Printer$ if Logging then call Start_Logging Logging_Started = True ! Also used as reporting flag ! ACTIVATE VACUUM IN PREPARATION FOR TEST if Tests_On_This_Board = 1 then call VacuumOn ! CHECK FIXTURE CONTACT, THEN ! LEARN OR TEST (OR RE-TEST) BOARD unpowered if (not learning) and Chek_Point_Mode = Pretest then if not fn Chek_Point_OK then goto Cleanup end if call Test_Sections ! IF ANY BOARD FAILED TEST, TRY TO FIX IT BY RUNNING PIN TEST Cleanup: if boardfailed and Status <> Failed_In_Preshorts then if Tests_On_This_Board = 1 and Chek_Point_Mode = Failures then unpowered if fn Chek_Point_OK then goto ChekPoint_Retry end if end if ! REMOVE BOARD FROM TESTHEAD AND GENERATE PASS/FAIL MESSAGE ! THEN TERMINATE LOGGING (IF ENABLED) AND REPORTING faoff Pass_Fail_Reported = True Eject_Ticket : image 13/ if boardfailed then print " ** ";Fail_Msg$;" **" copy Fail_File$ over "/dev/tty" if Status = Failed_Pin_Test then print " ** ";Pin_Msg$;" **" end if if learning then Status = Failed_In_Learn if Serializing then report Serial_Nr$ & Serial$ ! Command to print the HP-UX hostname on the report printer. Unnecessary for CycleCnt, ! but nice when multiple HP 3070's are present. execute "echo Host Name: `hostname` > " & Report_Printer$; nowindow, nowait ! Command to print the fixture ID to the report printer. if CycleCnt then execute "echo Fixture ID: " & FixtureID$ & " > " & Report_Printer$;nowindow, report using Eject_Ticket if Using_Buffered_Reporting then report out else print " ** ";Pass_Msg$;" **" copy Pass_File$ over "/dev/tty" if Using_AwareTest = True then enter Path$,, Err ! check to see if serial number file exists ! Err = 100009 (File Not Found) if not Err then ! Do not create new serial number files enter "date +%Y%m%d%H%M |"; Passed_Datetime$ assign @SNF,Err to Path$; write, append if Err then ! problems writing to serial number file print SNF_Error_Msg$ | print " ";errm$ beep !! print | print Stop_Msg$ !! stop else output @SNF; "passed3070 = " & Passed_Datetime$ assign @SNF to * end if end if end if end if report is * if Logging then log board end Status log out Log_Path$ & datetime$ & System$ & th$ log clear end if report clear clear failures Logging_Started = False ! END PROGRAM IF LEARNING. OTHERWISE RETURN TO MAIN LOOP if learning then learn off print | print Learning_Off_Msg$ | print Stop_Msg$ beep stop end if goto Wait_For_Start ! END OF MAIN LOOP ! INTERRUPT HANDLING ! This is the normal entry for Break/Stop detection ! Break_Trap: off break off error print " ";Break_Msg$ unpowered,Err if Err then print errmlong$ if Logging and Logging_Started then log board end Break_Code log out Log_Path$ & datetime$ & System$ & th$ log clear end if faoff, Err if Err then print errmlong$ goto Abort ! This is the normal entry for errors occurring in Basic statements ! Error_Trap: off error print errmlong$ beep SaveErrn = errn unpowered,Err if Err then print errmlong$ ! IF A BOARD IS PRESENT, FAIL IT ! THEN TERMINATE LOGGING (IF ENABLED) AND REPORTING if Logging_Started and not Pass_Fail_Reported then fail device report Board_Not_Tested$ print " ** ";Fail_Msg$;" **" copy Fail_File$ over "/dev/tty" if Status = Failed_Pin_Test then print " ** ";Pin_Msg$;" **" end if if Serializing then report Serial_Nr$ & Serial$ report using Eject_Ticket if Using_Buffered_Reporting then report out, Err report is *, Err report clear end if if Logging_Started and Logging then log using """{@RPT~80|"",80a,""}""" ; errm$(SaveErrn) log board end Error_Code, SaveErrn log out Log_Path$ & datetime$ & System$ & th$ log clear end if ! REMOVE THE BOARD FROM THE TESTHEAD faoff, Err if Err then print errmlong$ if learning or Err then goto Abort on error recover Error_Trap goto Wait_For_Start ! ABORT PROGRAM: UNRECOVERABLE ERROR, LEARN ERROR OR STOP KEY Abort: off break off error report is *, Err log is *, Err beep if (nrun=1) and not Did_First_Run_Inits then print No_Init_Warning$ clear nrun else if Version_Inits_Needed then print No_Version_Init_Warning$ clear nrun end if end if print " ";Stop_Msg$ beep stop end ! END OF ERROR TRAPS ! Test/Learn Sections ! [ Assumes unpowered mode. ] ! Note concerning LEARN MODE: some sections are not truly "learned" but are ! run in learn mode for other reasons. For example, analog tests may be run ! in learn mode in order to log limits information used by Pushbutton QSTATS, ! and preshorts/shorts are run "just in case" -- to avoid bad learns & damage. ! To keep a section from being run in learn mode, place 'if not learning then' ! just before that section and place 'end if' just after it. !############################################################################# sub Test_Sections global PreshortsMsg$, ShortsMsg$, PowerMsg$, DigitalMsg$, AnalogMsg$ global DigitalFuncMsg$, AnalogPoweredMsg$, BScanIncktMsg$, BScanIntconMsg$ global Status, Failed_In_Preshorts, Failed_In_Shorts, Failed_In_Functional global Failed_In_Digital, Failed_In_Power_Supplies, Failed_In_Analog global Logging, True, False, Passed global Mode$, Using_BScan, Failed_In_BScan global TestJetMsg$, Failed_In_TestJet global PolarityMsg$, Failed_In_Polarity_Check global BScanPShortsMsg$ global ConnectCheckMsg$, Failed_In_ConnectCheck global Failed_In_Flash, FlashProgMsg$, Programming, No_program, Flash global AnalogClusterMsg$, Failed_In_Analog_Cluster print tab(5);Mode$;PreshortsMsg$ Status = Failed_In_Preshorts call Pre_Shorts if boardfailed then subexit print tab(5);Mode$;ShortsMsg$ Status = Failed_In_Shorts call Shorts if boardfailed then subexit if Logging or not learning then print tab(5);Mode$;AnalogMsg$ Status = Failed_In_Analog call Analog_Tests if boardfailed then subexit end if print tab(5);Mode$;TestJetMsg$ Status = Failed_In_TestJet call TestJet if boardfailed then subexit print tab(5);Mode$;PolarityMsg$ Status = Failed_In_Polarity_Check call Polarity_Check if boardfailed then subexit print tab(5);Mode$;ConnectCheckMsg$ Status = Failed_In_ConnectCheck call Connect_Check if boardfailed then subexit print tab(5);Mode$;AnalogClusterMsg$ Status = Failed_In_Analog_Cluster call Analog_Cluster_Tests if boardfailed then subexit powered print tab(5);PowerMsg$ Status = Failed_In_Power_Supplies call Setup_Power_Supplies if boardfailed then subexit if Using_BScan then print tab(5);Mode$;BScanPShortsMsg$ Status = Failed_In_Shorts call BScan_Powered_Shorts_Tests if boardfailed then call Disconnect_Power_On_Board subexit end if print tab(5);Mode$;BScanIntconMsg$ Status = Failed_In_BScan call BScan_Interconnect_Tests if boardfailed then call Disconnect_Power_On_Board subexit end if print tab(5);Mode$;BScanIncktMsg$ call BScan_Incircuit_Tests if boardfailed then call Disconnect_Power_On_Board subexit end if !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! print "Test Programmer Action Reminder:" print "Evaluate, act, and then delete this 'pause' section." pause ! Comment out pause and print statements above when evaluation complete. !! This 'pause' section is placed here to remind the test programmer !! that some powered tests may depend upon the TCK/TMS signals of !! boundary scan chains/devices being held in a stable state. !! When the testplan is run, the tests are properly sequenced !! to assure that the disabled state is set; however, board level !! circuitry may interfere with the persistence of the disabled state. !! You may need to take additional measures; for example, you may !! place your own pullup/down resistor in the fixture to assure a !! stable TMS and/or TCK, or utilize a GP relay to disable some TCK !! oscillator, etc. !! For further explanation, see the Boundary-Scan Manual for the !! section titled 'Maintaining Persistence of Boundary-Scan Disables'. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! When Boundary-Scan tests are complete, you may need to produce !! a hard reset on the board-under-test to bring the ICs back into !! operational mode. One way of doing this is to cycle power to the !! board using the following call: !! call Cycle_Power_On_Board ! Cycle Power to reset digital state of board !! Power cycling is time consuming and may not be necessary. Some boards !! may not need any resetting. Others may have a digital reset node !! you can toggle with a digital test to reset the board. !! !! When you have evaluated the needs of this board and modified this !! section, remove the pause and these comments. You should take care !! to document the action you have taken for future reference. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! end if print tab(5);Mode$;DigitalMsg$ Status = Failed_In_Digital call Digital_Tests if boardfailed then subexit print tab(5);Mode$;DigitalFuncMsg$ Status = Failed_In_Functional call Functional_Tests if boardfailed then subexit print tab(5);Mode$;AnalogPoweredMsg$ Status = Failed_In_Functional call Analog_Functional_Tests if boardfailed then subexit !! Only add the following powersupply setup if it is necessary to cycle !! power. Perhaps to get FPGAs or other ASICs to a three-state condition. !! !!!flash! unpowered ! Only if volatile logic exists upstream !! !! !flash! put any required gprelays here !! !! !flash! powered ! if unpowered above, also use the following only if !! ! digital devices aren't interferring !! !! print tab(5);PowerMsg$ !! !! Status = Failed_In_Power_Supplies !! !! call Setup_Power_Supplies !! !! if boardfailed then subexit if Programming = Flash then if Mode$="Learning" then subexit print tab(5); FlashProgMsg$ Status = Failed_In_Flash !! Add the device name to be tested here ex: Device_new$="u2" !! If multiple devices are installed, duplicate !! the next 2 lines for each device Device_new$="" !flash! call Program_flash(Device_new$) if boardfailed then subexit end if Status = Passed subend ! Pin Test Subroutines !############################################################################## def fn Chek_Point_OK ! This is the subroutine for forcing the testing of pin contacts. ! If this routine is called before Test_sections (Chek_Point_Mode = Pretest), ! then the internal status will be set to Passed or Failed_Pin_Test. ! If this routine is called after test (Chek_Point_Mode = Failures), then the ! internal status is modified only if failures occur. ! ! The meaning of the function is slightly different when it is called before ! test versus after test. If called before test, the function returns true ! if, no matter how many times it was cycled, pin test did finally pass. ! If called after test, the function returns true if pin test failed but ! passed after retry. ! ! Note: fn Pinsfailed is external to testmain. ! global Pin_Msg$, Passed, Chek_Point_Msg$ global Retry_PinTest$, Recycle_Vacuum$, Status, True, False global Cycle_Vacuum$, Failed_Pin_Test, Max_Times_To_Fix_Contact global Logging, Serial$, Known_Good$, Chek_Point_Mode, Pretest, Failures if learning then return (False) Attempts = 0 print tab(5); Chek_Point_Msg$ loop Contact_Passed = not fn Pinsfailed if not Contact_Passed then Status = Failed_Pin_Test else if Chek_Point_Mode = Pretest then Status = Passed end if Attempts = Attempts + 1 exit if Contact_Passed or (Attempts > Max_Times_To_Fix_Contact) print Pin_Msg$ question Retry_PinTest$, Retry exit if not Retry if Logging and Chek_Point_Mode = Pretest then if Status = Failed_Pin_Test then log board end Failed_Pin_Test end if question Cycle_Vacuum$, Cycle if Cycle then faoff question Recycle_Vacuum$ call VacuumOn unpowered end if if Chek_Point_Mode = Pretest then clear failures if Logging then log board start Serial$, Known_Good$ end if end loop if Chek_Point_Mode = Failures then if Contact_Passed and Attempts > 1 then if Logging then log clear for retest log board end Failed_Pin_Test end if clear failures report clear end if return (Contact_Passed and Attempts > 1) else return (Contact_Passed) end if fnend ! Backtrace Subroutine !############################################################################## sub Backtrace (Test$) global Confirming$, Confirm_Failed$ find start node Test$ ! get first node to probe loop exit if btdone if (external test (btnode$)) then ! perform external test call External_Test (BT_Pass, BT_Results) else test node btnode$ ! perform digital functional test BT_Pass = nodepass BT_Results = noderesults call Print_Results (BT_Pass, BT_Results) end if find next node btnode$, BT_Pass, BT_Results ! next node to probe if btconfirm then ! confirm the diagnosis find next node btnode$, BT_Pass, BT_Results, confirm print Confirming$ end if if btreset then ! restart from new failing node find next node btnode$, BT_Pass, BT_Results, reset print Confirm_Failed$ & btnode$ & """" end if end loop make diagnosis ! report failed node information subend !############################################################################## ! Sample External Test Subroutine for Backtracing sub External_Test (BT_Pass, BT_Results) ! Sample external test ! Perform test as needed based on value of BT_Key$ ! Set Pass=1 for pass or Pass=0 for fail ! Results must be -150000 for an external test BT_Key$ = exttest$ BT_Pass = 1 BT_Results = -150000 subend !############################################################################## ! Decode and print backtrace node test results sub Print_Results (BT_Pass, BT_Results) global BT_Passed$, BT_SR_Fail$, BT_CRC_Fail$, BT_Notest$, BT_Indeter$ global BT_Interm$, BT_Incons$, BT_Open$, BT_NResults$ BT_Node$ = "node """ & btnode$ & """" if BT_Pass then ! node passed print BT_Node$; tab(23); BT_Passed$ else if BT_Results > 0 then ! node failed SR test print BT_Node$; tab(23); BT_SR_Fail$; BT_Results else if BT_Results <= 0 and BT_Results >= -65535 then ! node failed CRC test call Decode_crc ( -BT_Results, BT_Crc$ ) print BT_Node$; tab(23); BT_CRC_Fail$; BT_Crc$; """" else if BT_Results = -100000 then ! node not tested print BT_Node$; tab(23); BT_Notest$ else if BT_Results = -160000 then ! node was indeterminate print BT_Node$; tab(23); BT_Indeter$ else if BT_Results = -200005 then ! node was intermittent print BT_Node$; tab(23); BT_Interm$ else if BT_Results = -200006 then ! node was inconsistent print BT_Node$; tab(23); BT_Incons$ else if BT_Results = -200010 then ! node has an open trace print BT_Node$; tab(23); BT_Open$ else print BT_Node$; tab(23); BT_NResults$; BT_Results end if ! BT_Results = -200010 end if ! BT_Results = -200006 end if ! BT_Results = -200005 end if ! BT_Results = -160000 end if ! BT_Results = -100000 end if ! BT_Results < 1 and BT_Results > -100000 end if ! BT_Results > 0 end if ! BT_Pass subend !############################################################################## ! Format a 16 bit crc value to an ASCII CRC sub Decode_crc (BT_Value, BT_Crc$) option bit 32 BT_Crc$ = "0000" BT_Temp = binand (BT_Value, hti("0000000F")) BT_Crc$[4;1] = chr$(fn HexChar(BT_Temp)) BT_Temp = binand (BT_Value, hti("000000F0")) / 16 BT_Crc$[3;1] = chr$(fn HexChar(BT_Temp)) BT_Temp = binand (BT_Value, hti("00000F00")) / 256 BT_Crc$[2;1] = chr$(fn HexChar(BT_Temp)) BT_Temp = binand (BT_Value, hti("0000F000")) / 4096 BT_Crc$[1;1] = chr$(fn HexChar(BT_Temp)) subend !############################################################################## ! Build a hex character def fn HexChar (A) if A >= 0 and A < 10 then return (A + 48) else if A >= 10 and A < 16 then return (A + 87) else return 63 end if end if fnend !############################################################################ ! Data Logging Subroutines sub Start_Logging global Analog_Sample_Rate, QSTATS_Mode, Histo, Board$, Tests_On_This_Board global Proc_Step$, Batch$, Oper$, Board_Rev$, Testplan$ global Testrev$, Known_Good$, Serial$, Version_Label$ if learning then log level is all else if rnd < Analog_Sample_Rate * (QSTATS_Mode = Histo) then log level is analog without nhls, pins else log level is failures without nhls, pins end if end if print "Log level: ";lli$;"; Report level: ";rli$;"; Board type: ";Board$ PS$ = Proc_Step$ if Tests_On_This_Board = 1 then log board Board$, PS$, Batch$, Oper$, Board_Rev$, Testplan$, Testrev$, "", "", Version_Label$ end if log board start Serial$, Known_Good$ print subend !############################################################################ def fn Get_Serial_Num$(Prompt$) global Serial_Length, Bad_Serial_Image$, Default_Serial_Number$ loop print using """"&Prompt$&""",#" Ident$="" input "",Ident$ if Ident$ = "" then Ident$ = Default_Serial_Number$ exit if Ident$ = Default_Serial_Number$ exit if (len(Ident$) = Serial_Length) or not Serial_Length print using Bad_Serial_Image$; len(Ident$), Serial_Length end loop return (Ident$) ! return (lwc$(Ident$)) fnend !############################################################################## ! If the Board name contains any invalid characters, stop processing. sub Verify_Board_Names global Stop_Msg$, Bad_Board_Name$, Board$ Found_Bad = 0 if fn IllegalChars_In_Board_Name(Board$) then Found_Bad = 1 print Bad_Board_Name$ | print " ";Board$ end if if Found_Bad then print | print Stop_Msg$ beep stop end if subend !############################################################################## ! Check to see if the Board name contains any invalid characters, now only ! check spaces. Return 1 if yes, and 0 if no. def fn IllegalChars_In_Board_Name (Board$) global True, False if len (Board$) > 0 and pos (Board$, " ") > 0 then return True else return False end if fnend !############################################################################## sub Create_Log_Queue global Log_Path$, Directory_Exists, Queue_Error_Msg$, Stop_Msg$ create dir Log_Path$, Err Err = Err and (Err <> Directory_Exists) if Err then print Queue_Error_Msg$ | print " ";errm$ print | print Stop_Msg$ beep stop end if subend !############################################################################## sub Setup_Logging global Serial$, Default_Serial_Number$, Testplan$, Batch$ global Known_Good_Board$, Using_PRPlus, Proc_Step$, Oper_Id_Prompt$ global Board$, Oper$, Known_Good_Prompt$ global Serializing randomize Proc_Step$ = "btest" Batch$ = datetime$ !Set to a unique identifier so that Q-STATS II can ! calculate interboard handling and system idle times Testplan$ = Board$ Default_Serial_Number$ = "default_SN" & th$ Serial$ = Default_Serial_Number$ Known_Good_Board$= "" Oper$ = "" if Using_PRPlus then print using """"&Oper_Id_Prompt$&""",#" input "",Oper$ end if if Serializing then Known_Good_Board$ = fn Get_Serial_Num$(Known_Good_Prompt$) subend !############################################################################## ! Initialization Subroutines sub Initializations global Logging, Using_Buffered_Reporting, Report_Printer$, Using_PRPlus global Serializing, Logging_Started, First_Run$, Testmain_Revision$ global Did_First_Run_Inits, QSTATS_Mode global True, False, Off, No_Histo, Histo, Pretest, Failures global Version_Inits_Needed, Using_Multiple_Versions global Per_Run, Per_Board, Version_Prompting global Programming, No_programmming, Flash, Using_AwareTest Testmain_Revision$="B380:1(full)" True = 1 False = 0 Off = 0 No_Histo = 1 Histo = 2 Pretest = 1 Failures = 2 Per_Run = 1 Per_Board = 2 No_program = 0 Flash = 1 Version_Inits_Needed = False call Set_Custom_Options call Initialize_Board_Constants ! external to testmain call Initialize_Constants call Verify_Board_Names Logging_Started = False Logging = (QSTATS_Mode <> Off) or Using_PRPlus if Using_PRPlus then Serializing = True if Using_AwareTest then Serializing = True ! call Get_Board_Revision ! to interactively set Board_Rev$ call Print_Startup_Message ! prints out many variables' values acknowledge all failures learn capacitance off if Using_Buffered_Reporting then buffered reporting on else buffered reporting off end if report is Report_Printer$ printer is * if Logging then call Setup_Logging call Create_Log_Queue else log level is none end if if Using_PRPlus then report level is all else report level is report end if if nrun = 1 then print First_Run$ load board !'object checking on/off' statement goes here. Default is 'on' object checking on end if if Using_Multiple_Versions and Version_Prompting = Per_Run then call Get_Version_Label end if if nrun = 1 or Version_Inits_Needed then call Do_Version_Inits Did_First_Run_Inits=True end if subend !############################################################################## sub Print_Startup_Message global Board$, Board_Rev$, Using_PRPlus, QSTATS_Mode, Histo global Analog_Sample_Rate, Chek_Point_Mode, Failures global Report_Printer$, Using_Buffered_Reporting, Testmain_Revision$ global Serializing, Serial_Length, Using_BScan global CycleCnt print using "@,2/" print "BOARD TYPE" print " Name: ";Board$ print " Revision: ";Board_Rev$ print "AGILENT 3070 TESTMAIN" print " Report Printer: ";Report_Printer$ print " Revision: ";Testmain_Revision$ ! Build list of options to be printed ! O1$ is first line, O2$ is second line O1$ = " Options: " if Using_PRPlus then O1$=O1$&" PR+" if QSTATS_Mode then O1$=O1$&" QSTATS" if Chek_Point_Mode then O1$=O1$&" Chek-Point" if Chek_Point_Mode = Failures then O1$=O1$&"-Failures" else O1$=O1$&"-Pretest" end if end if if Using_BScan then O1$ = O1$ & " Boundary-Scan" if (O1$=" Options: ") then O2$=O1$ else print O1$ O2$= " " end if if Serializing then O2$=O2$&" Serializing("&val$(Serial_Length)&")" if learning then O2$=O2$&" LEARNING" if Using_Buffered_Reporting then O2$=O2$&" Buffered-Reporting" if QSTATS_Mode = Histo then O2$=O2$&" Histograms("&val$(Analog_Sample_Rate)&")" end if ! Adds "CycleCnt" to the list of options printed. if CycleCnt then O2$=O2$&" CycleCnt" if not (O2$ = " ") then print O2$ print using "3/" subend !############################################################################## sub Get_Board_Revision global Board_Rev$, Board_Rev_Prompt$ if Board_Rev$ = "" then print using """" & Board_Rev_Prompt$ & """,#" input "",Board_Rev$ end if subend !############################################################################## sub Do_Version_Inits global Version_Inits_Needed, Chek_Point_Mode, True, False, Off, Logging unpowered faoff call Characterize if Chek_Point_Mode <> Off then ! preload pins into testhead memory Log_Level_Reset = False if lli$ = "all" then log level is none ! turn off digital datalogging Log_Level_Reset = True ! for 'ignore all failures' end if ignore all failures Err = fn Pinsfailed ! external to testmain acknowledge all failures if Log_Level_Reset = True then log level is all ! reset datalogging end if Version_Inits_Needed = False subend !############################################################################## sub Get_Version_Label global Version_Label$, Version_Prompt$, True, False global Version_Inits_Needed Old_Version$ = bvi$ Version_Inits_Needed = True loop Version_Label$ = "" print using """" & Version_Prompt$ & """,#" input "", Version_Label$ if Version_Label$ = "" or Version_Label$ = "*" then board version is *, Err else board version is Version_Label$, Err end if exit if not Err print errmlong$ end loop if bvi$ = Old_Version$ then Version_Inits_Needed = False end if subend !############################################################################## def fn Replace_Character$(Char$) Val = num(Char$) if Val < 9 then String$ = "%00" & val$(Val) else if Val < 99 then String$ = "%0" & val$(Val) else String$ = "%" & val$(Val) end if end if return(String$) fnend def fn Replace_All_Chars$(String$, Char$) To_Return$ = "" String_Loop: String_Loc = pos(String$, Char$) if String_Loc = 0 then To_Return_New$ = To_Return$ & String$ else To_Return_New$ = To_Return$ & String$[1;String_Loc - 1] & fn Replace_Character$(Char$) String$ = String$[String_Loc + 1] end if To_Return$ = To_Return_New$ if String_Loc <> 0 then goto String_Loop return(To_Return$) fnend def fn Remove_Special_Characters$(String$) ! used only with AwareTest. Replaces all characters that cannot be ! used in an NT filename with their ASCII equivalent. To_Replace$ = fn Replace_All_Chars$(String$, "%") To_Replace$ = fn Replace_All_Chars$(To_Replace$, "|") To_Replace$ = fn Replace_All_Chars$(To_Replace$, "\") To_Replace$ = fn Replace_All_Chars$(To_Replace$, "/") To_Replace$ = fn Replace_All_Chars$(To_Replace$, "<") To_Replace$ = fn Replace_All_Chars$(To_Replace$, ">") To_Replace$ = fn Replace_All_Chars$(To_Replace$, "*") To_Replace$ = fn Replace_All_Chars$(To_Replace$, "?") To_Replace$ = fn Replace_All_Chars$(To_Replace$, ":") To_Replace$ = fn Replace_All_Chars$(To_Replace$, " ") To_Replace$ = fn Replace_All_Chars$(To_Replace$, """") return(To_Replace$) fnend !############################################################################## !############################################################################## sub Initialize_Constants global PreshortsMsg$, ShortsMsg$, PowerMsg$, DigitalMsg$, AnalogMsg$ global DigitalFuncMsg$, AnalogPoweredMsg$ global Break_Detected, Mode$, Board_Not_Tested$ global True, False, InvOn$, InvOff$, First_Run$, Board_Rev_Prompt$ global Pass_Msg$, Fail_Msg$, Pass_File$, Fail_File$, Stop_Msg$, Break_Msg$ global No_Init_Warning$, Rep_Test$, Place_Board_Prompt$, Learning_Off_Msg$ global BT_Passed$, BT_SR_Fail$, BT_CRC_Fail$, BT_Notest$, BT_Indeter$ global BT_Interm$, BT_Incons$, BT_Open$, BT_NResults$ global Confirming$, Confirm_Failed$ global Failed_In_Learn, Failed_Pin_Test, Failed_In_Preshorts, Failed_In_Shorts global Failed_In_Analog, Failed_In_Power_Supplies, Failed_In_Digital global Failed_In_Functional, Failed_In_BScan, Passed, Failed global Directory_Exists, Log_Path$, System$, Queue_Error_Msg$, Board$ global Break_Code, Error_Code global But$, Serial_Prompt$, Bad_Serial_Image$, Oper_Id_Prompt$ global Known_Good_Prompt$, Serial_Nr$ global Retry_PinTest$, Cycle_Vacuum$, Recycle_Vacuum$ global Pin_Msg$, Max_Times_To_Fix_Contact global BScanIntconMsg$, BScanIncktMsg$, Chek_Point_Msg$ global TestJetMsg$, Failed_In_TestJet global PolarityMsg$, Failed_In_Polarity_Check global BScanPShortsMsg$, No_Version_Init_Warning$ global Version_Label$, Version_Prompt$ global ConnectCheckMsg$, Failed_In_ConnectCheck global Failed_In_Flash, FlashProgMsg$ global Programming, No_program, Flash global Serial_Number_Directory$, Not_AXI_Tested$, Serial_Suffix$ global AnalogClusterMsg$, Failed_In_Analog_Cluster global Bad_Board_Name$ Break_Detected = False InvOn$ = chr$(27)&"&dB"&chr$(7) ! chr$(7) rings bell InvOff$ = chr$(27)&"&d@" Passed = 0 Failed = 1 Failed_Pin_Test = 2 Failed_In_Learn = 3 Failed_In_Shorts = 4 Failed_In_Analog = 6 Failed_In_Power_Supplies = 7 Failed_In_Digital = 8 Failed_In_Functional = 9 Failed_In_Preshorts = 10 ! Status codes 11, 12 reserved for use by EFS Failed_In_BScan = 8 ! Equate to Failed_In_Digital Failed_In_TestJet = 14 Failed_In_Polarity_Check = 15 Failed_In_ConnectCheck = 16 Failed_In_Flash = 18 Failed_In_Analog_Cluster = 17 Error_Code = 80 Break_Code = 82 Directory_Exists = 100312 Log_Path$ = "/var/hp3070/qm/logdata/testerq/"&Board$&"/" enter "uname -n |";System$ ! gets hostname (without domain) Max_Times_To_Fix_Contact = 4 ! MUST BE >= 1 Pin_Msg$ = "FIXTURE CONTACT PROBLEM" O$ = InvOn$&"Press YES"&InvOff$ O$ = O$&" to retry Pins Test, "&InvOn$&"NO"&InvOff$ Retry_PinTest$ = O$&" to test a new board." O$ = InvOn$&"Press YES"&InvOff$&" to cycle vacuum, " Cycle_Vacuum$ = O$&InvOn$&"NO"&InvOff$&" Otherwise." O$ = InvOn$&"Press YES"&InvOff$ Recycle_Vacuum$ = O$&" to turn vacuum on and continue testing." Queue_Error_Msg$ = "Cannot create directory to queue up log data. Error is:" But$ = "Board Under Test: " Serial_Prompt$ = InvOn$&"Enter"&InvOff$&" Board Identifier: " O$ = "/,""Identifier has wrong length ("",dd,""), must be " Bad_Serial_Image$ = O$&""",dd,""."",/" Oper_Id_Prompt$ = InvOn$&"Enter"&InvOff$&" Operator Identifier: " Known_Good_Prompt$ = InvOn$&"Enter"&InvOff$&" Verification Board Identifier: " Rep_Test$ = "Repeating test of this board!" First_Run$ = "Please stand by -- doing first-run initializations" No_Init_Warning$ = "** WARNING: FIRST RUN INITIALIZATIONS NOT COMPLETED --" No_Init_Warning$ = No_Init_Warning$ & " CLEARING NRUN **" O$ = "** WARNING: VERSION CHANGE INITIALIZATIONS NOT" No_Version_Init_Warning$ = O$ & " COMPLETED -- CLEARING NRUN **" Pass_File$ = "/var/hp3070/util/pass" Fail_File$ = "/var/hp3070/util/fail" Board_Not_Tested$ = "Board not tested." Pass_Msg$ = "P A S S E D" Fail_Msg$ = "F A I L E D" Stop_Msg$ = "P R O G R A M S T O P P E D" Break_Msg$ = "Break/Stop detected." Place_Board_Prompt$ = "Place board on fixture and "&InvOn$&"press START" Board_Rev_Prompt$ = InvOn$&"Enter"&InvOff$&" Board Revision: " Confirming$ = "Confirming diagnosis..." Confirm_Failed$ = "Confirm failed; restarting at node """ Learning_Off_Msg$ = "Learning turned off" if learning then Mode$ = "Learning " else Mode$ = "Testing " end if PreshortsMsg$ = "Preshorts" ShortsMsg$ = "Shorts" PowerMsg$ = "Setting Up Power Supplies" DigitalMsg$ = "Digital Incircuit" AnalogMsg$ = "Analog Unpowered" AnalogClusterMsg$ = "Analog Cluster" TestJetMsg$ = "TestJet" PolarityMsg$ = "Polarity Check" ConnectCheckMsg$ = "Connect Check" DigitalFuncMsg$ = "Digital Functional" AnalogPoweredMsg$ = "Analog Powered and Mixed" BScanIntconMsg$ = "Boundary Scan Interconnect" BScanIncktMsg$ = "Boundary Scan Incircuit" BScanPShortsMsg$ = "Boundary Scan Powered Shorts" FlashProgMsg$ = "Programming Flash" Serial_Nr$ = "Serial #: " BT_Passed$ = "passed" BT_SR_Fail$ = "failed vector " BT_CRC_Fail$ = "failed CRC is """ BT_Notest$ = "was not tested" BT_Indeter$ = "was indeterminate" BT_Interm$ = "was intermittent" BT_Incons$ = "was inconsistent" BT_Open$ = "has an open trace" BT_NResults$ = "noderesults= " Chek_Point_Msg$ = "Testing Pin Contact" Version_Label$ = "" Version_Prompt$ = InvOn$&"Enter"&InvOff$&" Version Label: " Serial_Number_Directory$ = "AXI_passed_boards/" Serial_Suffix$ = ".SNF" Not_AXI_Tested$ = "Board did not pass AXI; cannot test on Agilent 3070." SNF_Error_Msg$ = "Error accessing serial number file. Error is: " Bad_Board_Name$ = "Board name contains space, cannot proceed:" subend !############################################################################## sub Set_Custom_Options ! All variables likely to need to be changed are initialized here. ! The Usage flag(s) can be set True or False to selectively enable or ! disable the code needed for each indicated subsystem or feature. global Using_PRPlus, QSTATS_Mode, Testrev$ global Analog_Sample_Rate global Serializing, Serial_Length global Chek_Point_Mode, Using_BScan global Report_Printer$, True, False, Using_Buffered_Reporting global Off, Pretest, Failures, No_Histo, Histo global Per_Run, Per_Board, Version_Prompting global Failed_In_Flash, FlashProgMsg$, Programming, No_program, Flash global AXI_Tested_Override global CycleCnt ! Usage flag(s) QSTATS_Mode = Off ! Choose {Off, No_Histo, Histo} Chek_Point_Mode = Failures ! Choose {Off, Pretest, Failures} Using_PRPlus = False ! Paperless Repair Plus. Serializing = False ! Will get set True if Using_PRPlus. Using_Buffered_Reporting = True ! Report failures during board handling Using_BScan = False ! Boundary Scan Programming = No_program ! Choose {Flash, No_program} CycleCnt = True ! Enables /opt/cyclecnt/client.sh ! Other parameters Report_Printer$ = "/dev/rpr"&th$ ! Final report destination. Testrev$ = "RevA" ! Update this faithfully. Analog_Sample_Rate = .10 ! Meaningful if QSTATS_Mode = Histo Serial_Length = 28 ! Board Id Length (0 = no checking) Version_Prompting = Per_Board ! Choose {Per_Board, Per_Run} ! Used only on multiple version board AXI_Tested_Override = False ! Choose {True, False} ! Used only on AwareTest board subend !! !! TESTPLAN MODIFICATIONS !FLASH! !! !! Flash programming should be the last operation performed during in-circuit !! testing. If any previous test fails, flash RAM programming should not be !! attempted until manufacturing faults are corrected. Five testplan !! modifications are required. !! !! If you wish to UPDATE AN EXISTING testplan to handle flash, add the !! following to the testplan: !! !! 1. In "sub Test_sections" put: !! global Failed_In_Flash, FlashProgMsg$, Programming, No_program, Flash !! !! !! after: !! !! call Analog_Functional_Tests !! if boardfailed then subexit !! !! Only add the following powersupply setup if it is necessary to cycle !! power. Perhaps to get FPGAs or other ASICs to a three-state condition. !! !!!flash! unpowered ! Only if volatile logic exists upstream !! !! !flash! put any required gprelays here !! !! !flash! powered ! if unpowered above, also use the following only if !! ! digital devices aren't interferring !! !! print tab(5);PowerMsg$ !! !! Status = Failed_In_Power_Supplies !! !! call Setup_Power_Supplies !! !! if boardfailed then subexit !! To integrate the Program flash subroutine add the following after !! the analog functional call !! if Programming = Flash then !! !! if Mode$="Learning" then subexit !! print tab(5); FlashProgMsg$ !! Status = Failed_In_Flash !! !! !! Add the device name to be tested here ex: Device_new$="u2" !! !! If multiple devices are installed, duplicate !! !! the next 2 lines for each device !! !! Device_new$="" !! call Program_flash(Device_new$) !! if boardfailed then subexit !! end if !! !! 3. In sub Initializations add: !! global Programming, No_programmming, Flash !! !! No_program = 0 !! Flash = 1 !! !! 4. In sub Initialize_Constants add: !! !! global Failed_In_Flash, FlashProgMsg$ !! global Programming, No_program, Flash !! !! after: !! Failed_In_ConnectCheck = 16 !! !! add: !! Failed_In_Flash = 18 !! !! after: !! BScanPShortsMsg$ = "Boundary Scan Powered Shorts" !! !! add: !! FlashProgMsg$ = "Programming Flash" !! !! 5. In sub Set_Custom_Options: !! !! add: !! global Failed_In_Flash, FlashProgMsg$, Programming, No_program, Flash !! !! after: !! !! Using_BScan = False ! Boundary Scan !! !! add: !! !! Programming = Flash !choose {Flash, No_program} !! !! 6. At the end of the testplan add the following subroutine: !! With Programming set to Flash, the subroutine will call the !! appropriate test. !******************************************************************** sub Program_Flash (Device$) global Report_Printer$, Logging global Report_level$, Log_level$ ! Verify Manufacturer ID and device ID codes. test Device$ & ":id" !optional: This is already in digital for ICT if dutfailed then print tab (2) ; Device$ ;tab(8); ": Device ID failed" subexit ! if the wrong device is installed, exit the program subroutine end if !remove reporting and logging while verifying device states Report_level$ = rli$ report level is none if Logging then log level is none end if print tab(8); "Verifying Status" safeguard none !flash! This board meets design for On-Board Programming ! criteria for safeguard none to be safe ! Programming runs very slowly with safeguard on test Device$ & ":crc" if not dutfailed then print tab(15);Device$; tab(29); ": Pre-programmed" call Cleanup_flash subexit ! if the device is already properly programmed, exit subroutine else pass device !clears dutfailed, boardfailed if only failure print tab(15); Device$;tab(29); ": Contains incorrect data" end if ! Verify device is blank. test Device$ & ":blank" if dutfailed then pass device !clears dutfailed, boardfailed if only failure print tab(15) ; Device$; tab(29); ": Not blank" print tab(8); "Erasing" !flash! call Setup_power_supplies_program ! add any necessary programming ! voltages to a new subroutine test Device$ & ":erase" end if if dutfailed then pass device !clears dutfailed, boardfailed if only failure test Device$ & ":erase" if dutfailed then call Cleanup_flash !flash! move above erase test if full report ! of failing erase tests is desired print tab(8);Device$; " :Erase failed" subexit ! if the device cannot be erased end if !if dutfailed second erase end if !if dutfailed first erase print tab(8); "Device is blank" print tab(8); "Programming device" A=msec test Device$ & ":program" B=(msec-A)/1000 if dutfailed then print tab(8); "Programming Failed" if not dutfailed then print tab(8); "Programming complete in "; B;" seconds" print tab(8); "Verifying device" !flash! call Setup_power_supplies ! return to normal voltages call Cleanup_flash !flash! move above program test for full reporting clear failures buffered reporting on test Device$ & ":crc" if dutfailed then print tab(15);Device$;tab(29) ;" : Contains incorrect data" if not dutfailed then print tab(15);Device$;tab(29) ;" : Contains correct data" subexit subend !############################################################################ sub Cleanup_Flash global Logging, Using_Buffered_Reporting, Report_Printer$, Using_PRPlus global Report_level$, Log_level$ if Report_level$ = "all" then report level is all if Report_level$ = "none" then report level is none if Report_level$ = "log" then report level is log if Report_level$ = "report" then report level is report if Logging then call Set_Log_Level end if subend !############################################################################ ! Data Logging Subroutines sub Set_Log_Level global Sampling, Analog_Sample_Rate, QSTATS_Mode, Histo if learning then log level is all else if Sampling then log level is analog without nhls, pins else log level is failures without nhls, pins end if end if subend !! ! END OF TESTMAIN sub Initialize_Board_Constants global CycleCnt, FixtureID$ ! Replace "01234" with actual Fixture ID. if CycleCnt then FixtureID$ = "01234" subend sub VacuumOn global CycleCnt, FixtureID$ ! The VacuumOn subroutine becomes the single place where vacuum is activated. ! Replace all faon commands with calls to VacuumOn instead. print "Incrementing Cycle Count." ! Uncomment the if statement below that corresponds to your operating system: ! - Uncomment "/opt/cyclecnt/client.sh" for HP-UX. ! - Uncomment "C:\CycleCnt\client.bat" for Windows. ! if CycleCnt then execute "/opt/cyclecnt/client.sh " & FixtureID$; nowindow, nowait ! if CycleCnt then execute "C:\CycleCnt\client.bat " & FixtureID$; nowindow, nowait faon 1.5 ! Warning: Reducing the value for 'faon' from the default value of 1.5 ! can potentially cause testhead damage. subend