Translate

2013년 10월 1일 화요일

Short Packet Structure

Packet Header (4 bytes)
  • Data Identifier (DI) * 1byte: Contains the Virtual Channel[7:6] and Data Type[5:0].
  • Packet Data * 2byte:Length is fixed at two bytes
  • Error Correction Code (ECC) * 1byte:allows single-bit errors to be corrected and 2-bit errors to be detected.
Packet Size
  • Fixed length 4 bytes
The first byte of any packet is the DI (Data Identifier) byte.
  • DI[7:6]:These two bits identify the data as directed to one of four virtual channels.
  • DI[5:0]:These six bits specify the Data Type.



Long Packet Structure

Packet Header (4 bytes)
  • Data Identifier (DI) * 1byte:Contains the Virtual Channel[7:6] and Data Type[5:0].
  • Word Count (WC) * 2byte:defines the number of bytes in the Data Payload.
  • Error Correction Code (ECC) * 1byte:allows single-bit errors to be corrected and 2-bit errors to be detected.
Data Payload (0~65535 bytes)
  • Length = WC × bytes
Packet Footer (2 bytes):Checksum
  • If the payload has length 0, then the Checksum calculation results in FFFFh
  • If the Checksum isn’t calculated, the Checksum value is 0000h
Packet Size
  • 4 + (0~65535) + 2 = 6 ~ 65541 bytes



Data Types for Processor-sourced Packets


Error Correction Code

 P7 = 0
 P6 = 0
 P5 = D10^D11^D12^D13^D14^D15^D16^D17^D18^D19^D21^D22^D23
 P4 = D4^D5^D6^D7^D8^D9^D16^D17^D18^D19^D20^D22^D23
 P3 = D1^D2^D3^D7^D8^D9^D13^D14^D15^D19^D20^D21^D23
 P2 = D0^D2^D3^D5^D6^D9^D11^D12^D15^D18^D20^D21^D22
 P1 = D0^D1^D3^D4^D6^D8^D10^D12^D14^D17^D20^D21^D22^D23
 P0 = D0^D1^D2^D4^D5^D7^D10^D11^D13^D16^D20^D21^D22^D23


Checksum

unsigned char xx[] = {0x01,0x5a,0x5a,0x03,0x08,0x2A, 0x00,0x01
                                          ,0x00,0xF8,0x00,0xF6,0x57,0x00,0X00,0xE5};

typedef unsigned short  U16;
typedef unsigned char   U8;

U16 CRC_kjh;
U16 crc16_update(U16 crc, U8 a);

int main()
{
            U16 crc,k;
            crc = 0xFFFF;
            for (k=0; k<1; k++) crc = crc16_update(crc, xx[k]);
            CRC_kjh = crc;
}

U16 crc16_update(U16 crc, U8 a)
{
            int j;
            crc ^=a;
                        for (j = 0; j < 8; ++j)
                       {
                              if (crc & 1) crc = (crc >> 1) ^ 0x8408;
                              else crc = (crc >> 1);
                       }
             return crc;
}



Data type for Peripheral-to-Processor LP Transmissions

Detailed format description
  • Packet structure for peripheral-to-processor transactions is the same as for
  • the processor-to-peripheral direction

 For a single-byte read response, valid data shall be returned in the first byte The second byte shall be sent as 00h

If the peripheral does not support Checksum it shall return 0000h


Peripheral-to-Processor LP Transmissions

Peripheral-to-processor transactions are of four basic types
  • Tearing Effect (TE):trigger message (BAh)
  • Acknowledge:trigger message (84h)
  • Acknowledge and Error Report:short packet (Data Type is 02h)
  • Response to Read Request:short packet or long packet - Generic Read Response、DCS Read Response(1byte, 2byte, multi byte)
Feature
  • BTA shall take place after every peripheral-to-processor transaction 
  • Multi-Lane systems shall use Lane 0 for all peripheral-to-processor transmissions
  • Reverse-direction signaling shall only use LP mode of transmission