Introduction to Hardware and Software Components which are Capable of Ensuring Necessary Functionality of the ELEFANT ASIC by David Ando Abstract: This document details a test bench design which ensures functionality of ELEFANT ASICs. The different hardware and software components which make up the testing bench are discussed briefly to provide a necessary understanding of the test setup to avoid mistakes by the user, to allow modification to the test bench, and to operate the test equipment. The limitations and capabilities of the current test bench design, in both hardware and software, are discussed when appropriate. Introduction The test bench which ensures functionality of the ELEFANT ASICs consists of multiple hardware and software components. The different aspects of both the hardware and software elements of the testing bench will be detailed. In depth descriptions are given of the code used to implement automation of the testing bench. In addition operation of the simple and automated graphical user interface will be described. Hardware Components GPIB bus: The different hardware components communicate over a fast 1+ megabyte/second GPIB bus. Care must be taken to keep the total length of the GPIB cables to a minimum, as speed decreases and errors increase with length. Maximum GPIB cable length should not exceed 20 meters, but can function up to 40 meters. Power Mac 7300: The Power Mac is running MacOS 8. It has a 180 MHz 604e processor, 256k L2 cache, and a 32 bit PCI bus. Connected to the PCI bus is a PCI GPIB card, and a PCI 1200 card. The GPIB card is in slot 0, and the PCI 1200 card is in slot 1. For configuration information of the different cards, or for changing settings, the PCI cards can be controlled from two different control panels, NI-DAQ and NI-488 Config, which are located in the path Macintosh HD:System Folder:Control Panels. DAQ 8-bit PCI 1200 Card: This PCI card has no use in the current testing bench because of its pathetic performance. The card has a lousy speed of 3kb per second data acquisition rate because of various factors: e.g. the card is capable of only 8-bit data transfers through the 32-bit PCI bus, programming interrupts, and system overhead. The PCI 1200 card has eight analog input channels, 24 digital IO lines, three 16-bit counters, and two DACs for output. Although this card is useless for data acquisition, it would be useful for various control applications. For example TDC reset has to be manually pushed, and the PCI 1200 card would be perfect for automating this process in the future. PCI GPIB NI-488.2 Card This card is very fast, and allows data acquisition rates of over 1 megabyte/second. Currently the GPIB card timing is configured for as slow as the card will allow. This is because there are some unreliable devices on the GPIB bus, the Amrel devices, that can not handle anything but the slowest timing speed. Having the GPIB bus at the slowest possible speed does have an effect on the data acquisition rate, but the marginal speed gain from increasing the timing speed is of less importance than reliable control of the GPIB devices. HP Logic Analyzer: referred to as HP_PG on GPIB bus The HP Logic Analyzer is a mainframe with four different cards plugged in to it. There are two Pattern Generator Cards, one Logic Analyzer card, and one Intermodule Card. The function of the Logic Analyzer is to interface with the ELEFANT TEST BOARD which holds the ELEFANT chip. The Logic Analyzer is controlled remotely via the GPIB bus from the Mac when testing programs are run on the Power Mac. The limitation of the GPIB interface built in to the Logic Analyzer is that the working directory can not be set remotely. In order for the remote mode on the Logic Analyzer to work, the working directory must be set immediately after the Logic Analyzer is turned on. This is done by changing the current working directory to /SYSTEM/ELEFANT under the Hard Disk Menu. Amrel Direct Current Power Supplies: referred to as DC_PS and DC_PS2 on GPIB bus DC_PS is responsible for supplying the Vdd Å 5 volts for the ELEFANT ASIC. This power supply is at address 20, but can be changed via the front control panel. To turn off the power for Vdd use the GPIB command GPIBwrite ÒOUT1 0Ó. DC_PS2 is responsible for supplying the 8 volts power to the test board. This power supply is at address 22. LeCroy Pulse Generators: referred to as LC_PG and LC_PG2 on GPIB bus LC_PG provides the FADC and TDC signals. Channel A of LC_PG provides FADC signals, and channel B supplies the TDC signals. Has an address on the GPIB bus of 3. LC_PG2 provides a the clock signal for the ELEFANT ASIC. Has an address on the GPIB bus of 4. Software Components Igor: Igor is a user interface to the PCI GPIB card and PCI 1200 card, plus a programming environment. The user interface to Igor consists of a command line. The programming environment consists of an interpreted macro language, a full object code compiler, and a plug in type support for binaries to extend the capabilities of Igor. The binaries that can be used to extend Igor, called XOPs, can be made with Metroworks, or any other object code compiler. The interpreted macro language is a mixture to both C and BASIC. Programs written in the macro language are slow, but easy to code. To view the macro language code open the Procedure window. The syntax, Macro MacroName(), signifies some interpreted macro language code, and it is terminated with a End statement. Code that is compiled into object code by Igor is signified with Function FunctionName(), and is terminated with a End statement. The command line interface is used to execute Macros and built in commands. To start the Macro which builds the graphical user interface for the testing routines, the user would type StartGraphicalUserInterface() in the command line. For a command that is built into Igor, like Beep, just type Beep and return at the command line. It is also important to note that Igor is case insensitive at all times. Important Macros: StartGraphicalUserInterface() Initializes Hardware, and then makes a graphical user interface so a user can interact with the underlying code. Note: Once StartGraphicalUserInterface() is run, it can not be run again unless all panels are closed. This Macro is found in the procedure window called Òthe testingÓ. The procedure first creates all global variables with InitGlobals(), sets up GPIB with SetupGPIB(), and initializes the PCI 1200 card with Init1200(). After initialization, this macro builds three windows with displaywindow(), info(), and useful(), which build the respective windows "Message", "Information Input Panel", and "Utility". This macro can be run by pressing open apple and 0 (zero) at the same time. StartTestingRightNow() Starts the testing directly from the command line by executing the main loop of the testing procedure. Does not initialize hardware, so StartGraphicalUserInterface() must be run first. This macro can be accessed in the main procedure window by pressing open apple and M at the same time. After turning on the power to the chip, the current draw is read with ReadLoad(). Next the clock is turned on, and then the digital tests begin with the macro DigitalLoop(). After the various digital tests are done the FADC Pattern is loaded into the HP Logic Analyzer memory with the DownLoadFADCPattern() macro. There is a long pause of 20 seconds caused by the Sleep/t operation because the program needs to give the HP Logic Analyzer time to load the entire pattern into memory. Now we prepare for the FADC tests with RunPG() and making the user press the TDC reset button. The FADC test are started with the FADCall() macro. After the FADC tests are done the SaveAll() macro will ask for a path to store the data from the FADC tests, and then store them. The macros fadc_dnl_all(),fadc_inl_all(), analyse_tdc(dt), and ChannelLimits() all analyse the FADC data and prepare it for display on the screen in the Message panel. SetVdd(string) Sets the voltage of Vdd to the numeric value of the string passed to SetVdd(). String must be an numerical value from 0 to 10. Do not include units such as Volts. SetVoltageTo8() Supplies the ELEFANT TEST BOARD with 8 V DC power. TurnPowerOff() Turns off Vdd, eight volt power to the board, and the TDC signals. SetFreq(string) Sets the frequency of the clock to anywhere from 40 to 70 MHz. The value of the string should be just a number between 40 and 70. NO UNITS. ClockOn() Turns on the clock to the ELEFANT TEST BOARD. Sets the frequency of the clock to whatever frequency it was set to last time. ClockOff() Disables the clock to the ELEFANT TEST BOARD, while saving all settings on the LeCroy. ReadLoad() Determines the current draw of the ELEFANT chip in amps, and sets the global variable ivdd to that value. The problem with ReadLoad() is when to execute it. The current draw of the Preproduction Chip has a huge swing in how much power it draws, depending on what it is doing. Current draw can vary from .07 to .13 amps. If the ELEFANT chip fails ReadLoad() then there is a short somewhere, or the chip is in backwards. There is a safeguard in case the chip is put in backwards; the current will be limited to 300 miliamps to avoid damage. For additional safety there will be an automatic shutdown of power if the chip fails the ReadLoad() macro. DigitalLoop() Performs a series of tests at nominal and worst case scenarios for the digital section of the ELEFANT ASIC. The tests are performed at 64 MHz with a Vdd=5V, 59 MHz with a Vdd=5.3V, 68 MHz with a Vdd=5.3V, 59 MHz with a Vdd=4.5V, 68 MHz with a Vdd=4.5V, and a comprehensive digital test at 64 MHz with a Vdd=5V. The voltages vary from 4.5 V to 5.3 V to simulate worst case scenarios in power supply from a real life operating environment. The clock is changed from 59 MHz to 68 MHz to find out if the chip can operate within reasonable limits. DigitalLoop() relies on the macros DigitalTest() and RepeatTest() to interface with the hardware and determine if the digital section passes. DigitalTest() DigitalTest() will test the functionality of the digital section of the ELEFANT chip by putting it in test mode, and writing data to different RAM locations on the chip. The buffers are then read back and compared with the data that was written. If the output is identical to the input then the digital section passes, otherwise FailedChip() is called. FADCall() Performs all the FADC tests. The parameters used in the testing are global variables t0, dt, v0, dv, and npoints. These variables can have their value changed when the Message window is in a show testing results mode. Fadc_Inl_All(variable) Calculates the dnl of all channels. This is implemented as a function to give the utmost speed. The variable dv is the step size. ChannelLimits() A macro that prepares data to be shown to the user, and gives values to variables that will be used to see if the chip passed the FADC tests. Defines the global variables min_fadc_slope, max_fadc_slope, min_fadc_zero, max_fadc_zero, min_tdc_zero, max_tdc_zero via the WaveStats command. WaveStats is a command built into Igor that will analyze wave variables. Fadc_Inl_All() Calculates the inl of all channels. This is implemented as a function to give the utmost speed. AnalogFailure() This macro will test the all the threshold values for the analog FADC testing. If something fails then the macro FailedChip() will be called with a string providing a description of which threshold failed. FailedChip(string) This macro will put a window to the screen and alert the user that a failure occurred and where in the program that this failure occurred. When a failure occurs the program execution is not stopped, but continues normally after FailedChip is done. The string should contain a short description of where the failure occurred in the program execution. NIGPIB XOP: The NIGPIB XOP is an extension to Igor that allows the National Instruments card to be accessed from a macro or command line. Unfortunately the NIGPIB XOP uses the same 32 byte buffer for both read and write operations through the NI PCI GPIB card. During some reads, some data may be left in the buffer, which will lead to unexpected results in the next GPIBread operation. To remedy this problem you MUST do a GPIB ClearBuffer operation after every GPIBread operation. When switching to another device, using the GPIB device command, always issue a GPIB ClearBuffer command before switching. Operation Testing Process: Operation of the test bench is simple. The user must first insert a chip into the chip carrier while wearing a static bracelet. The user then enters the graphical user interface and only needs to click the button labeled "Start Testing" to begin testing functionality of a ELEFANT ASIC. Occasionally a dialog box, accompanied by music, will appear and the user must follow the directions given in order to continue. User Interface: Operation of the testing bench is most easily done from the graphical user interface provided by the macro StartGraphicalUserInterface(). The graphical user interface consists of three panels, a Message Panel, Utility, and Information Input Panel. The Information Input Panel has a box for inputting the chip number, a status bar indicating whether power is on, a button for running the macro StartTestingRightNow(), and a checkbox which determines what is displayed in the Message Panel. The box for inputting the chip number changes the value of the global variable ChipIDNumber. The variable ChipIDNumber is incremented by one after a chip has been completely tested, or when the macro StartTestingRightNow() is complete. The idea behind having the checkbox, and automatically incrementing ChipIDNumber is to hide complicated configuration information from a user that may not understand the configuration information, and to make sure that all the user is required to do is press the button called "Start Testing". The default setting for the Message Panel is a large button which will make noise when clicked. The purpose of this button is to keep the user awake. When the checkbox is checked in the Information Input Panel the numerous threshold testing global variables are displayed in the Message Panel, and the music button is killed. In the Message Panel, when results are being shown, many of the global variables can have their value changed, but beware that the values of all global variables are returned to their default value after running macro InitAll() or macro StartGraphicalUserInterface(). The global variables that deal with the Max and Min threshold variables for testing can be easily recognized in the code because they all start with a T. The letter T prefix indicates that the variable holds a testing threshold value. These Max and Min variables are used to test if the chip has failed an FADC test. The variables with a prefix T, are used to compare the results from the FADC test in the macro AnalogFailure(). If a variable from the FADC test breaks a threshold variable starting with a T, then the macro FailedChip() is called. If the user continually gets the FailedChip() window then he or she should ask a knowledgeable supervisor to adjust the offending threshold variable in the Message window less restricting. The panel Utility contains four buttons, one to turn off the power, and another to turn on the power. The button labeled "Kill these panels NOW!!" will kill the graphical user interface. Killing the user interface allows the user to run macro StartGraphicalUserInterface() again after previously running it. The button to close all files will close all open files within Igor. All files should be closed when Igor returns an error complaining about having too many files open. Conclusion: A test bench has been made which has a flexible software control program that can be easily modified and understood. In addition it is optimized where ever possible for speed of operation. The operation of the test bench is also very simple and automated, only requiring the user to press the TDC reset button twice and respond to errors. A complete graphical user interface has been built to allow the user to start all necessary functions by simply using the mouse. Care has been taken in designing the test bench to handle errors properly, and to make sure that in all conditions the ELEFANT chip can't be damaged.