Date: Mon, 21 Sep 1998 12:32:31 CST6CDT5,M4.1.0,M10.5.0 From: fortner@niuhep.physics.niu.edu To: LINNEMANN@pa.msu.edu CC: blazey@niuhep.physics.niu.edu Message-ID: <009CC8E4.5D74527D.21@niuhep.physics.niu.edu> Subject: draft l2 link protocol Level 2 Trigger Data Protocol (excerpted from SLIC TDR) The input and output data follows a uniform protocol throughout the L2 system. The hardware is based on the Cypress HOTLink serial driver (CY7B923) and receiver (CY7B933). The HOTLink will be operated at 160 Mbit/s in the D0 Level 2 trigger. Transmitted data is framed in bytes with two additional bits for a total of 10 bits per frame. Both the transmitter and receiver work from a 16 MHz clock. In normal operation the clock is supplied externally to the transmitter and decoded by the receiver for use on the receiver board. A local 16 MHz clock is supplied to the receiver to provide initial framing or reframing of the byte boundaries and to improve the internal PLL. The receiver clock should be within 0.1 % of the frequency of the transmitter clock. Information is transmitted on every clock cycle, if there is no data to transmit, a special character called K28.5 is sent. There is an internal framer that checks for a K28.5 when the HOTLink is required to reframe. In normal operation, reframing is disabled to prevent misframing on a pattern match which is out of phase. If reframe is asserted for more than 2048 bytes, then two K28.5 characters within 5 bytes of each other are required to reframe. The Cypress HotLink uses special characters which are identified by an additional bit on the chip (SC/D) to indicate non-data words. The definition of non-data words is common throughout the level 2 system and are listed in Table 1. TABLE 1. Special I/O Characters Character HOTLink Hex Null K28.5 05 Begin Event K28.0 00 End Event K23.7 08 Buffer Busy K28.1 01 Buffer Free K27.7 09 Synchronization Error K28.2 02 Initialization Complete K29.7 0A The null character is inserted by the transmitter whenever there is no data byte to send on a clock cycle. The receiver chip automatically removes this character from the data stream. In order to permit reframing between events, the transmitter will provide at least two null characters between events. The begin event character is used to indicate the beginning of data belonging to a new event on that link. The transmitter should send a 2-byte sequence of K28.5 followed by K28.0 at the beginning of each event to insure a reframing character as well as the required begin character. Detection of data words by the receiver after an end event char- acter without a begin event character will result in the receiver board issuing an L1 syn- chronization error to the serial command link, or transmitting a synchronization error character to a board with a serial command link. The end event character is used to signal a receiver that all data for an event has been transmitted. The transmitter should send a 2-byte sequence of K23.7 followed by K28.5 at the beginning of each event to insure a reframing character as well as the required end character. Most event transmissions should take place over a period of a few microsec- onds. Receiver boards should provide internal timing to identify that an event has contin- ued too long without an end character, and send a synchronization error in that case. The buffer busy character is used by level 2 boards that have no serial command link. The buffer busy identifies that one or more input buffers are full and no new level 1 triggers should be issued. Boards with a serial command link that receive this character should assert an L1 busy to the serial command link. Boards without a serial command link that receive this character should transmit the character on to a board that has a serial com- mand link. The buffer free character is used by level 2 boards that have no serial command link. The buffer free identifies that a prior condition that caused a buffer busy character to be sent is no longer present and level 1 triggers may resume. Boards with a serial command link that receive this character should clear L1 busy if no other device is requesting L1 busy from the board. Boards without a serial command link that receive this character should transmit the character on to the board that has a serial command link where the buffer busy character was sent. The synchronization error character is used by level 2 boards that have no serial com- mand link. The synchronization error identifies that the event that is present is not the expected event and an initialization request is needed to resynchronize events from the transmitter to the receiver. Boards with a serial command link that receive this character should assert an L1 error to the serial command link. Boards without a serial command link that receive this character should transmit the character on to a board that has a serial command link. If an event is corrupted through bit errors or loss of framing during transmission, then a synchronization error character may be transmitted. If the receiver can correct the prob- lem within the corrupted event, and correctly identify the next event that is received, then the receiver board may proceed without sending a synchronization error character. In this case there must be flags identifying a corrupted input event in the output data. The initialization complete character is used by level 2 boards that have no serial com- mand link. The initialization complete identifies that a system initialization requested by the trigger framework is complete and normal operation may resume. Boards with a serial command link that receive this character should use the character to determine when to indicate that an initialization cycle is complete. Boards without a serial command link that receive this character should transmit the character on to a board that has a serial com- mand link.