天天看點

PCIE TLP header fields

最近在看PCIE 資料,整理了一些筆記

       以下是TLP header 字段的總結

header filed header location filed Use 備注
Fmt[1:0] bits 6:5 of byte 0

00b :3 DW header, no data

01b :4 DW header, no data

10b :3 DW header, with data

11b :4 DW header, with data

common
Type[4:0] bits 4:0 of byte 0

0 0000 :MRd ,Fmt[1:0] 00 or 01,Memory Read Request

0 0001 :MRdLk ,Fmt[1:0] 00 or 01,Memory Read Request-Locked

0 0000 :MWr ,Fmt[1:0] 10 or 11,Memory Write Request

0 0010 :IORd ,Fmt[1:0] 00,I/O Read Request

0 0010 :IOWr,Fmt[1:0] 10,I/O Write Request

0 0100 :CfgRd0,Fmt[1:0] 00,Configuration Read Type 0

0 0100 :CfgWr0,Fmt[1:0] 10,Configuration Write Type 0

0 0101 :CfgRd1,Fmt[1:0] 00,Configuration Read Type 1

0 0101 :CfgWr1,Fmt[1:0] 10,Configuration Write  Type 1

1 0r2r1r0:Msg,Fmt[1:0] 01,Message Request,r2r1r0 specifies the Message routing mechanism

1 0r2r1r0:MsgD,Fmt[1:0] 11,Message Request with data payload

0 1010 :Cpl,Fmt[1:0] 00,Completion without Data– Used for I/O and Configuration Write Completions and Read Completions (I/O, Configuration, or Memory) with Completion Status other than Successful Completion.

0 1010 :CplD,Fmt[1:0] 10,Completion with Data – Used for Memory, I/O, and Configuration Read Completions

0 1011 :CplLk,Fmt[1:0] 00,Completion for Locked Memory Read without Data – Used only in error case

0 1011 :CplDLk,Fmt[1:0] 10,Completion for Locked Memory Read –otherwise like CplD.

common
TC[2:0] bits [6:4] of byte 1

Traffic Class,  differentiation of transactions into eight traffic

classes

common
 Attr[1:0]  bits [5:4] of byte 2

bit 5: relaxed ordering,允許某些事務(TRANSACTION)提前執行,而不是按先前的執行順序,進而提高系統性能

          0:Default Ordering,PCI Strongly Ordered Model

          1:Relaxed Ordering,PCI-X Relaxed Ordering Model

bit 4 :No Snoop

          0:Default,Hardware enforced cache coherency

expected

          1:No Snoop,Hardware enforced cache coherency

not expected

common
TD bit 7 of byte 2 1b indicates presence of TLP digest in the form of a single DW at the end of the TLP common
EP bit 6 of byte 2

Error Forwarding:indicates the TLP is poisoned

optional

common

(Write Request (Posted or Non-Posted) or a

Read Completion)

Length[9:0] bits 1:0 of byte 2 bits 7:0 of byte 3

 Length of data payload in DW

00 0000 0001b:1 DW

00 0000 0010b:2 DW

…                      :...

11 1111 1111b:1023 DW

00 0000 0000b:1024 DW

common
Address[63:0]

64bits address :

all bits of byte8-15

32bits address :

bits of byte8-11

address routing 
bus Number[7:0] Bits 7:0 of Byte 8 specify the destination Device for the TLP ID routing 
Device Number[4:0] Bits 7:3 of Byte 9
Function Number[2:0] Bits 2:0 of Byte 9
Request ID[15:0] all bits of byte 4-5

[15:8]:bus Number[7:0]

[7:3] :Device Number

[2:0]:Function Number

Transaction ID is included with all Requests and Completions
tag[7:0] bits [7:0] of byte 6?

由産生請求包的器件生成的,如果請求器件需要應答,則每個Tag[7:0]是獨一無二的

1.By default, only the lower 5 bits of the Tag field are used with the remaining upper 3 bits required to be all 0’s

2.If the Extended Tag Field Enable(Device Control Register ) bit  is set,the maximum is increased to 256(default 32), and the entire Tag field is used

3.For Requests which do not require Completion (Posted Requests), the value in the Tag[7:0] field is undefined and may contain any value

Request ID+Tag = Transaction ID
first  DW BE[3:0] bits[3:0] of Byte7

[0]: affected data Byte 0

[1]: affected data Byte 1

[2]: affected data Byte 2

[3]: affected data Byte 3

Memory, I/O, and Configuration Requests
Last DW BE[3:0]  bits[7:4] of Byte7

[0]: affected data Byte N-4

[1]: affected data Byte N-3

[2]: affected data Byte N-2

[3]: affected data Byte N-1

Assuming the data referenced is N bytes in length (Byte 0 to Byte N-1)

Completer ID[15:0] all bits of byte 4-5

Identifies the Completer

[15:8]:bus Number[7:0]

[7:3] :Device Number

[2:0]:Function Number

Completion
Completion Status[2:0] bit 7:5 of byte6

Indicates the status for a Completion

000b: Successful Completion (SC),請求(Request)被正确的處理

001b: Unsupported Request (UR),表示請求是非法的或者不能被Completer所識别的

010b: Configuration Request Retry Status (CRS),Completer暫時不能響應的配置請求,需要Requester稍後再次嘗試

100b: Completer Abort (CA),Completer可以響應該請求,但是卻發生了其他的錯誤,該錯誤是Uncorrectable Error

all others: Reserved

Completion
BCM

Byte Count Modified

must not set by PCI Express Completers, and may only be set by PCI-X completers

Completion
Byte Count[11:0]

bit 3:0 of byte6

bit 7:0 of byte7

 The remaining byte count for Request

0000 0000 0000b :  4096 bytes

0000 0000 0001b : 1 byte

……

1111 1111 1111b : 4095 bytes

Completion
tag[7:0] bit 7:0 of byte10 in combination with the Requester ID field, corresponds to the Transaction ID Completion
Lower Address[6:0] bit 6:0 of byte11 lower byte address for starting byte of Completion Completion
僅針對pcie 1.0a,不同的版本會有所不同

繼續閱讀