PCI Express(四) - The transaction layer
原文出处:http://www.fpga4fun.com/PCI-Express4.html
感觉没什么好翻译的,都比较简单,主要讲了TLP的帧结构
In the transaction layer, we receive "packets". There is a 32-bits bus and the packets arrive on the bus (packet lengths are always multiples of 32-bits). Maybe one packet will says "write data 0x1234 at address 0xABCD", and another will say "read from address 0xDCBA (and return a response packet)".
There are many types of packets: memory read, memory write, I/O read, I/O write, message, completion, etc... Our job in the transaction layer is to accept packets and issue packets. The packets are presented to us in a specific format called "transaction layer packets" (TLPs), and each 32-bits data arriving on the bus is called a "double word" (or DW in short).
So a packet (oops sorry, a TLP) is a bunch of DWs.
How a TLP looks
TLPs are pretty simple to interpret. Here's a general view of their structure.
The header contains 3 or 4 DWs but the most important fields are part of the first DW.
The "Fmt" field tells how long is the header, and if a data payload is present.
Then together with "Type", it describes the TLP operation. The remainder of the TLP header content depends of the TLP operation.
For example, here's a 32-bits memory write TLP header, where you can see that the write address is at the end of the header (and the write data is not shown as it is in the payload after the header).
The "Fmt" field is "10" which means "3 DW, with data". That makes sense, a memory write needs data to write, so upon getting the data payload after the header, we write that data to some memory (or use it somehow) and we are done with it. The Field "Length" tells how many DWs are in the payload (from 0 to 1023). Commonly, it's a single DW to write, in which case length is equal to 1 and the total TLP length is 4 DWs (3 for the header and 1 of the payload).
Now what about a memory read? Somehow we have to return data.
Completion with data
If the TLP is a memory read instead of a write, we have to execute the read and then respond. There is a special TLP for that response, it is called CplD (completion with data) and its payload contains the data that we want to return.
Let's take a closer look at the 32-bit memory read TLP header - it is very similar to the 32-bit memory write we had previously.
One difference is the Fmt=00, which means "no data". Makes sense, we don't need data to do a read, just an address. But we now have to respond with data. And as important, the response will need to be routed back to whoever asked for the read... Do you see the problem?
Ok, we received a read request. Did it come from the CPU? Or from the interrupt controller? Or from a graphic card? After all, many devices are capable of issuing such request. The answer is given in the "Requester ID" - it shows who requested the read. So when we create the CplD TLP, we have to recopy the "Requester ID" in it. This way, it'll be routed where it belongs by the PCI Express bridge(s). BTW, we also have to recopy the "Tag" (which is useful in case of multiple reads pending).
TLP size
A typical 32-bit address/data memory read TLP is made of 3 DWs in the header and no payload (so 96 bits total), while a similar memory write is made of 4 DWs (3 for the header and 1 for the payload). That's not very efficient in term of bandwidth because of the TLP header overhead, so it is better to use bigger TLP payloads when possible. A TLP payload can theoretically be as big as 1023 DWs, pretty handy for burst reads and writes, although PCs can limit the maximum size to a lower value (32 DWs is typical).
For more information, check the official PCI Express specification by googling something like PCI_Express_Base_11.pdf
Enough with theory, let's have some fun and play with the Xilinx PCI Express wizard.
PCI Express(四) - The transaction layer的更多相关文章
- PCI Express(六) - Simple transactions
原文地址:http://www.fpga4fun.com/PCI-Express6.html Let's try to control LEDs from the PCI Express bus. X ...
- PCI Express(三) - A story of packets, stack and network
原文出处:http://www.fpga4fun.com/PCI-Express3.html Packetized transactions PCI express is a serial bus. ...
- Down to the TLP: How PCI express devices talk (Part I)
http://xillybus.com/tutorials/pci-express-tlp-pcie-primer-tutorial-guide-1 Down to the TLP: How PCI ...
- PCI Express
1.1课题研究背景 在目前高速发展的计算机平台上,应用软件的开发越来越依赖于硬件平台,尤其是随着大数据.云计算的提出,人们对计算机在各个领域的性能有更高的需求.日常生活中的视频和图像信息包含大量的数据 ...
- Down to the TLP: How PCI express devices talk (Part II)
http://xillybus.com/tutorials/pci-express-tlp-pcie-primer-tutorial-guide-2 Data Link Layer Packets A ...
- [中英对照]How PCI Express Works | PCIe工作原理
How PCI Express Works | PCIe工作原理 PCI Express is a high-speed serial connection that operates more li ...
- 002 PCI Express体系结构(二)
一.PCI总线的信号定义 PCI总线是一条共享总线,在一条PCI总线上可以挂接多个PCI设备.这些PCI设备通过一系列信号与PCI总线相连,这些信号由地址/数据信号.控制信号.仲裁信号.中断信号等多种 ...
- 001 PCI Express体系结构(一)
一 .PCI总线的基本知识 PCI总线作为处理器系统的局部总线,主要目的是为了连接外部设备,而不是作为处理器的系统总线连接Cache和主存储器.但是PCI总线.系统总线和处理器体系结构之间依然存在着紧 ...
- PCI Express(五) - Xilinx wizard
原文地址:http://www.fpga4fun.com/PCI-Express5.html Xilinx makes using PCI express easy - they provide a ...
随机推荐
- <我是一只IT小小鸟>读书笔记
这篇文章给我感触最深的是开篇蒋宇东所出的一道选择题--今后的发展选择有三条:A.做一辈子IT民工:B.将大学时欠下来的债补上:C.改行. 他们用自己的成长故事告诉师弟师妹们:一定要弄清楚上大学首要的任 ...
- RabbitMQ/JAVA 客户端连接测试
这里是一个简单的helloworld测试. 这里在eclipse平台中实现 细节不再赘述.重点是导入rabbitmq-java-client的jar包 下载地址:http://www.rabbitmq ...
- vmware12用 unlocker206能不能解锁 OS X系统
先下载UnLocker2061.zip 2. 选择虚拟机右键--> 属性 3.将下载的unlocker2061解压后文件放入VMware安装目录下 选择win-install.cmd文件 右 ...
- D - Prepared for New Acmer
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Pract ...
- 网络数据包收发流程(四):协议栈之packet_type
进入函数netif_receive_skb()后,skb正式开始协议栈之旅.先上图,协议栈大致过程如下所示:跟OSI七层模型不同,linux根据包结构对网络进行分层.比如,arp头和ip头都是紧跟在以 ...
- 今天<人人都能弹吉他>免费版获得了苹果的新品推荐
今天改了一天程序, 来回测来回改, 准备提交一个新版本了. 傍晚跑步回来, 看了一下今天的下载量, 竟然比昨天多了. 然后就想, 难不成被苹果推荐了? 上线一看, 果然, 而且美国和中国两大市场都在新 ...
- hdu 1016
这是一道考搜索的题目.这道题我用深搜解决了,不过说实话自己对于深搜理解得并不深刻,在这里对于这一题总结一下. 这道题输入为一个实数n,要求输出有1~n这n个数所组成的所有素数环(这是素数环),素数环的 ...
- Linux学习方法
应该如何提问? 先要尝试自己解决 - 帮助 - 文档 - 示例 提问的智慧 - 问题详尽 - 贴图
- Sublime Text 2 配置
设置Python的Tab缩进为四个空格,打开一个Py文件 # Preferences---->Settings-More---->Syntax Specific-User # 贴入如下代码 ...
- 淘宝ip库接口调用
function ip($ip) { $url="http://ip.taobao.com/service/getIpInfo.php?ip=".$ip; $ipi ...