PCIe物理層邏輯部分基礎(二)

 

Mux會對來自數據鏈路層的數據(TLP&DLLP)插入一些控制字符,如下圖所示。這些控制字符只用於物理層之間的傳輸,接收端的設備的物理層接收到這些數據後,會將這些控制字符去除,在往上傳到其數據鏈路層

 當然,除了STP、SDP和END之外,還有一些其他的控制字符,如EDB(前面的文章詳細介紹過)、SKIP、COM等。如下圖所示:

Ordered Sets主要用於鏈路訓練等。每一個Ordered Set都是DW對齊(即四個字節),且Ordered Set開頭是一個叫做Comma(COM)的K字符(控制字符),隨後包含一些K字符或者D字符(數據字符)。

對於只有一個Lane的PCIe設備來說,Byte Striping並沒有什麼用,其主要用於多個Lane的數據流分配。x1(一個Lane)和x8(8個Lane)的例子分別如下兩張圖所示:

除此之外,還有一些其他的規則,主要是針對Mult-Lane的,對於一個Lane並沒有什麼影響:

x4(4個Lane)需要遵循以下的規則

·   STP and SDP characters are always sent on Lane 0.

·   END and EDB characters are always sent on Lane 3.

·   When an ordered set such as the SKIP is sent, it must appear on all lanes simultaneously.

·   When Logical Idles are transmitted, they must be sent on all lanes simultaneously.

·   Any violation of these rules may be reported as a Receiver Error to the Data Link Layer.

如下圖所示:

對於x8、x16、x32需要遵循以下的規則

· STP/SDP characters are always sent on Lane 0 when transmission starts after a period during which Logical Idles are transmitted. After that, they may only be sent on Lane numbers divisible by 4 when sending back‐to‐back packets (Lane 4, 8, 12, etc.).

· END/EDB characters are sent on Lane numbers divisible by 4 and then minus one (Lane 3, 7, 11, etc.).

· If a packet doesn’t end on the last Lane of the Link and there are no more packets ready to go, PAD Symbols are used as filler on the remaining lane numbers. Logical Idle can’t be used for this purpose because it must appear on all Lanes at the same time.

· Ordered sets must be sent on all lanes simultaneously.

· Similarly, logical idles must be sent on all lanes when they are used.

· Any violation of these rules may be reported as a Receiver Error to the Data Link Layer.

x8的例子如下圖所示:

0

【博文連載】PCIe掃盲——物理層邏輯部分基礎(二)

上一篇文章中提到了Mux會對來自數據鏈路層的數據(TLP&DLLP)插入一些控制字符,如下圖所示。當然,這些控制字符只用於物理層之間的傳輸,接收端的設備的物理層接收到這些數據後,會將這些控制字符去除,在往上傳到其數據鏈路層。

當然,除了STP、SDP和END之外,還有一些其他的控制字符,如EDB(前面的文章詳細介紹過)、SKIP、COM等。如下圖所示:

前面的文章中提到過Ordered Sets,其主要用於鏈路訓練等。每一個Ordered Set都是按照DW對齊的(即四個字節),且Ordered Set開頭也是一個叫做Comma(COM)的K字符(控制字符),隨後包含一些K字符或者D字符(數據字符)。

對於只有一個Lane的PCIe設備來說,Byte Striping並沒有什麼卵用,其主要用於多個Lane的數據流分配。x1(一個Lane)和x8(8個Lane)的例子分別如下兩張圖所示:

除此之外,還有一些其他的規則,主要是針對Mult-Lane的,對於一個Lane並沒有什麼影響:

x4(4個Lane)需要遵循以下的規則:

· STP and SDP characters are always sent on Lane 0.

· END and EDB characters are always sent on Lane 3.

· When an ordered set such as the SKIP is sent, it must appear on all lanes simultaneously.

· When Logical Idles are transmitted, they must be sent on all lanes simultaneously.

· Any violation of these rules may be reported as a Receiver Error to the Data Link Layer.

如下圖所示:

對於x8、x16、x32需要遵循以下的規則:

· STP/SDP characters are always sent on Lane 0 when transmission starts after a period during which Logical Idles are transmitted. After that, they may only be sent on Lane numbers divisible by 4 when sending back‐to‐back packets (Lane 4, 8, 12, etc.).

· END/EDB characters are sent on Lane numbers divisible by 4 and then minus one (Lane 3, 7, 11, etc.).

· If a packet doesn’t end on the last Lane of the Link and there are no more packets ready to go, PAD Symbols are used as filler on the remaining lane numbers. Logical Idle can’t be used for this purpose because it must appear on all Lanes at the same time.

· Ordered sets must be sent on all lanes simultaneously.

· Similarly, logical idles must be sent on all lanes when they are used.

· Any violation of these rules may be reported as a Receiver Error to the Data Link Layer.

x8的例子如下圖所示:

發送端的擾碼器(Scrambler)有一個16-bit的線性反饋寄存器(LFSR,Linear Feedback Shift Register),其實現了以下這個多項式:

具體的功能框圖如下圖所示:

關於擾碼器(Scrambler)還需要遵循以下這些規則:

· 不同的Lane的擾碼器必須是同步操作的;

· 擾碼器只對TLP和DLLP中的D字符(數據字符)以及邏輯空閒字符(00H,Logical Idle)作用,並不作用於K字符(控制字符)和Ordered Set中的D字符(如TS1、TS2等)

· 兼容性測試字符(Compliance Pattern Characters)並不被擾碼;

· COM字符(一種控制字符,不會被擾碼)可用於使發送端和接收端的擾碼器中的LFSR同時被初始化爲FFFFH;

· 擾碼器默認時被使能的,但是PCIe Spec允許將其臨時禁止,以用於測試用途。

PCIe中用到的K字符(控制字符)如下表所示:

其對應的8b/10b編碼如下表所示:

注:其中PAD字符主要用於Mult-Lane中,當一個包的長度比較短,有的Lane可能就沒有數據可以發了,這時候可以用PAD字符來填充。如本文的x8的例子所示。

Ordered Sets主要用於鏈路管理(Link Management)功能。對於Gen1和Gen2的PCIe來說,所有的Ordered Set都以COM作爲開頭。Ordered Sets是在每個Lane上同步發送的,即每一個Lane都會同時的發送相同的Ordered Sets,因此,Ordered Sets也可以被用於Lane De-skewing。除了鏈路訓練之外,Ordered Sets還被用於時鐘容差補償(Clock Tolerance Compensation)以及更改鏈路功耗狀態(Changing Link Power States)等。

對應的,主要有以下幾種Ordered Sets:TS1 and TS2 Ordered Set (TS1OS/TS2OS)、Electrical Idle Ordered Set (EIOS)、FTS Ordered Set (FTSOS)、SKP Ordered Set (SOS)和Electrical Idle Exit Ordered Set (EIEOS)。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章