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.

时间: 2024-08-01 22:45:02

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. Xilinx's "Endpoint Block Plus" core allows us to work at the transaction layer level, so it's just going to take us a few lines of code.Instead of

PCI Express(三) - A story of packets, stack and network

原文出处:http://www.fpga4fun.com/PCI-Express3.html Packetized transactions PCI express is a serial bus. Or is it? From the computer's perspective, it is a conventional bus where read and write transactions can be achieved. The trick is that all operation

PCI Express

1.1课题研究背景 在目前高速发展的计算机平台上,应用软件的开发越来越依赖于硬件平台,尤其是随着大数据.云计算的提出,人们对计算机在各个领域的性能有更高的需求.日常生活中的视频和图像信息包含大量的数据,对此计算机对这些海量信息的实时处理.高效传输和大容量存储都是今后计算机发展的趋势和目标. 总线是由多个部件和设备所共享的,是计算机通信接口的重要技术.为了简化硬件电路设计.简化系统结构,通常用一组线路配置适当的接口电路,与各部件和外围设备连接,这组共用的连接线路称为总线.采用总线结构便于部件和设备

PCI Express 系统体系结构标准教材

第1章 体系结构展望 1.1 第一代总线:ISA,EISA,VESA 第二代总线:PCI, AGP, PCI-X 第三代总线:PCIE 1.2 PCIE的存储器.IO和配置地址空间与PCI和PCI-X的地址空间相同.现有的驱动无需改动可以在PCIE运行 中断控制器在南桥 33MHz的PCI峰值带宽为4KB*33=133MB/s 1.3 I/O总线体系结构 1) PCI设备使用4个中断信号(INTA#,B,C,C) 触发中断控制器的中断请求,然后中断控制器向CPU声明INTR信号 2) 3种类型的

Ubuntu 16.04 RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller” 不能上网

来源:http://forum.ubuntu.org.cn/viewtopic.php?f=116&t=463646 1.执行如下命令 uname -a sudo lspci -knn sudo lshw -C network ifconfig ping 192.168.1.1 -c 4 tail /var/log/syslog -n 20 2.查看状态: [email protected]:~$ uname -aLinux gofox-To-be-filled-by-O-E-M 3.13.0-

PCI Express(五) - Xilinx wizard

原文地址:http://www.fpga4fun.com/PCI-Express5.html Xilinx makes using PCI express easy - they provide a free PCI Express core (called "Endpoint Block Plus") and a wizard to configure it, all that in their free version of ISE - ISE WebPack. So let's

PCI Express(二) - Topology

原文出处:http://www.fpga4fun.com/PCI-Express2.html Point-to-point architecture At 2.5Gbps, the PCI Express Gen1 line speed is a whopping 75 times faster than the 33MHz legacy PCI speed.How is that possible? only because PCI express is a point-to-point bu

PCI Express(一)

在FPGA4FUN上看到一篇介绍PCI-E的帖子,简单易懂,适合入门,特地搬过来 原文地址:http://www.fpga4fun.com/PCI-Express.html 前言: As PCI Express becomes common place in high-end FPGAs, let's see how easy FPGA vendors made the technology available. In particular, we look more closely at Xi

《PCI EXPRESS体系结构导读》读书笔记之第 1 章 PCI总线的基本知识(3)

PCI总线的中断机制 中断信号与中断控制器的连接关系 中断信号与PCI总线的连接关系 PCI桥规范并没有要求桥片传递其下PCI设备的中断请求.事实上多数PCI桥也没有为下游PCI总线提供中断引脚INTx#,管理其下游的PCI设备. 而同时又说,在PCI EXPRESS中的中断机制,用的是MSI中断机制.所以这种外部中断引脚的中断机制我就暂时不看了. 版权声明:本文为博主原创文章,欢迎垂询 email: [email protected]