MCM numbering in the gateDB =========================== The situation ------------- So far, there is no non-ambiguous numbering and identification scheme for MCMs: the TRAP ID, while possibly unique, is often written into the chip with errors, so that this laser number, when read from the TRAP, is no longer unique. On the other hand, the MCM "IDs", consisting of a nutzen number and the location within the nutzen, are also not unique, because some nutzen numbers were used twice. In the original implementation of the gateDB, it was not yet known that the MCM ID is ambiguous, and this number was chosen as a primary key for the table of MCMs. Later, an example of an ambiguous MCM ID was found, and a workaround (a.k.a. a dirty hack) had to be implemented to cope with this problem: if a non-unique MCM ID was found, the second MCM was assigned an artificial number (999xxxx) as the MCM ID, losing the information about which MCM this might have been. As some problems came up with the entering of MCMs into the DB, it was decided to change the gateDB to handle these numbers in a cleaner way (August 2007). Numbers in the gateDB --------------------- laser_num is the number read out from the TRAP chip by software, this should be the same number as the TRAP ID if no write errors occured, but this has not been checked. As this is is the only number accessible by software, it is an important means of automatically identifying an MCM. However, due to write errors, the number is ambiguous, and not usable as a primary key for a DB. The laser_num is always less than about 260000 (0x3FFF), due to the number of bits available in the TRAP. label_num is what was formerly referred to as the MCM ID. As the old MCM IDs turned out not be be unique, they can no longer be used as primary keys, but only as a second, less ambiguous way to identify and MCM than the laser_num. The name label_num is due to the number being printed on the label on each MCM. This number consists of a batch number (1 digit), a nutzen number (4 digits) and a position on the nutzen (2 digits between 1 and 4). mcm_id is an artificial MCM number, generated automatically by the RDBMS. It has no meaning in real life, and is only used for internal bookkeeping. Entering MCMs into the gateDB ----------------------------- As there does not seem to be a production log specifying the MCMs used for each ROB, this information has to be entered at one stage of testing the ROBs. Historically this was the ROC test stand, because this is where the software was first developed, but it should be done in the ROB tester, because reading the numbers on the labels is simpler there. The numbers are entered into the gateDB with a script called check_laser_ids.pl, which is now available in version 2.0. The script parses a logfile of a test, containing information about which laser ID was read from each MCM on a ROB. For each MCM, it first checks if there is already an MCM in this position, and compared the laser ID from the DB with the one from the logfile. If the numbers are the same, it assumes that the information in the DB is correct and goes to the next one to avoid unnecessary updates of the DB. If the laser IDs differ, or if the position is not yet occupied by an MCM in the DB, the script tries to determine the MCM label number from Stefan's MCM DB using the test data from the MCM test stand in Karlsruhe, provided by Venelin. If only one MCM is found that has this laser ID, the script assumes that this is the correct label number and enters an MCM with this label_num and the laser_num from the logfile into the gateDB. If there is no MCM with this laser ID, the user is asked to enter the MCM as printed on the label by hand. This case usually indicates that not all test results have been uploaded to the MCM DB, and Stefan and/or Venelin should be contacted to update the MCM DB. If several MCMs have been found with the same laser number, the user is given a list of possible MCM label numbers to chose from, or can still enter the number by hand. After the user has entered the MCM label number, an entry for the MCM is inserted with this number and the laser number from the logfile. If another MCM was located at this position before, it is relocated to a location called "removed mcm", indicating that this MCM has probably been removed in the repair of a ROB.