上一篇文章中提到了Mux會(huì)對(duì)來(lái)自數(shù)據(jù)鏈路層的數(shù)據(jù)(TLP&DLLP)插入一些控制字符,如下圖所示。當(dāng)然,這些控制字符只用于物理層之間的傳輸,接收端的設(shè)備的物理層接收到這些數(shù)據(jù)后,會(huì)將這些控制字符去除,在往上傳到其數(shù)據(jù)鏈路層。
當(dāng)然,除了STP、SDP和END之外,還有一些其他的控制字符,如EDB(前面的文章詳細(xì)介紹過(guò))、SKIP、COM等。如下圖所示:
前面的文章中提到過(guò)Ordered Sets,其主要用于鏈路訓(xùn)練等。每一個(gè)Ordered Set都是按照DW對(duì)齊的(即四個(gè)字節(jié)),且Ordered Set開(kāi)頭也是一個(gè)叫做Comma(COM)的K字符(控制字符),隨后包含一些K字符或者D字符(數(shù)據(jù)字符)。
對(duì)于只有一個(gè)Lane的PCIe設(shè)備來(lái)說(shuō),Byte Striping并沒(méi)有什么卵用,其主要用于多個(gè)Lane的數(shù)據(jù)流分配。x1(一個(gè)Lane)和x8(8個(gè)Lane)的例子分別如下兩張圖所示:
除此之外,還有一些其他的規(guī)則,主要是針對(duì)Mult-Lane的,對(duì)于一個(gè)Lane并沒(méi)有什么影響:
x4(4個(gè)Lane)需要遵循以下的規(guī)則:
· 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.
如下圖所示:
對(duì)于x8、x16、x32需要遵循以下的規(guī)則:
· 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的例子如下圖所示:
發(fā)送端的擾碼器(Scrambler)有一個(gè)16-bit的線性反饋寄存器(LFSR,Linear Feedback Shift Register),其實(shí)現(xiàn)了以下這個(gè)多項(xiàng)式:
具體的功能框圖如下圖所示:
關(guān)于擾碼器(Scrambler)還需要遵循以下這些規(guī)則:
· 不同的Lane的擾碼器必須是同步操作的;
· 擾碼器只對(duì)TLP和DLLP中的D字符(數(shù)據(jù)字符)以及邏輯空閑字符(00H,Logical Idle)作用,并不作用于K字符(控制字符)和Ordered Set中的D字符(如TS1、TS2等);
· 兼容性測(cè)試字符(Compliance Pattern Characters)并不被擾碼;
· COM字符(一種控制字符,不會(huì)被擾碼)可用于使發(fā)送端和接收端的擾碼器中的LFSR同時(shí)被初始化為FFFFH;
· 擾碼器默認(rèn)時(shí)被使能的,但是PCIe Spec允許將其臨時(shí)禁止,以用于測(cè)試用途。
PCIe中用到的K字符(控制字符)如下表所示:
其對(duì)應(yīng)的8b/10b編碼如下表所示:
注:其中PAD字符主要用于Mult-Lane中,當(dāng)一個(gè)包的長(zhǎng)度比較短,有的Lane可能就沒(méi)有數(shù)據(jù)可以發(fā)了,這時(shí)候可以用PAD字符來(lái)填充。如本文的x8的例子所示。
Ordered Sets主要用于鏈路管理(Link Management)功能。對(duì)于Gen1和Gen2的PCIe來(lái)說(shuō),所有的Ordered Set都以COM作為開(kāi)頭。Ordered Sets是在每個(gè)Lane上同步發(fā)送的,即每一個(gè)Lane都會(huì)同時(shí)的發(fā)送相同的Ordered Sets,因此,Ordered Sets也可以被用于Lane De-skewing。除了鏈路訓(xùn)練之外,Ordered Sets還被用于時(shí)鐘容差補(bǔ)償(Clock Tolerance Compensation)以及更改鏈路功耗狀態(tài)(Changing Link Power States)等。
對(duì)應(yīng)的,主要有以下幾種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)。
注:關(guān)于鏈路管理以及Ordered Sets等詳細(xì)內(nèi)容,會(huì)在后續(xù)的博文中介紹。
-
PCIe
+關(guān)注
關(guān)注
15文章
1247瀏覽量
82909 -
物理層
+關(guān)注
關(guān)注
1文章
152瀏覽量
34454
原文標(biāo)題:【博文連載】PCIe掃盲——物理層邏輯部分基礎(chǔ)(二)
文章出處:【微信號(hào):ChinaAET,微信公眾號(hào):電子技術(shù)應(yīng)用ChinaAET】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論