该机制假设用户还有接收Non-Posed的空间,且将要延迟接收Non-Posted。该机制使用rx_np_ok信号,防止用户在置低rx_np_ok信号后,core继续发送多于两个的Non-Posted请求。第二种机制为Receive Request for Non-Posted,该机制假设用户在能够接收Non-Posted时会向core发送请求。该机制允许用户使用rx_np_req信号控制Non-Posted队列。上述机制在生成IP core时必须选择,两者是互斥的。
? Receive Non-Posted Throttling
用户必须在其还可以接收的倒数第二个Non-Posted TLP的m_axis_rx_tlast信号之前两个周期时置低rx_np_ok,这不是严格要求,但是是最低要求。当rx_np_ok置低时,Posted和Completion会超过Non-Posted到达。当用户能够继续接收Non-Posted时,必须使能rx_np_ok。此时,之前被延时的Non-Posted会继续传送(Non-Posted优先级高于Posted和Completion)。注意,不能将rx_np_ok置低过长时间,避免出现超时。该机制如下图所示。
根据上述描述,Receive Non-Posted Throttling机制要求用户的接收侧至少能够缓冲3个Non-Posted TLP。
3.1.1.1 Designing with the 64-Bit Transaction Layer Interface 3.1.1.2 Designing with the 128-Bit Transaction Layer Interface
在128bit的PCIe接口中,rx_is_sof[4:0]和rx_is_eof[4:0]是比较重要的,他们用于指明新的package起始于128bit中的哪一个DWORD,或指明原package结束于128bit中的哪一个DWORD。当原package和新的package出现在同一个128bit中时,rx_is_sof[4:0]和rx_is_eof[4:0]是对应的,且有相互关系的。如下图所示。
rx_is_sof[4]和rx_is_eof[4]用于指示起始或结束,rx_is_sof[3:0]和rx_is_eof[3:0]用于指示起始或结束的位置。由于本地接口的最小单位是DWORD,所以rx_is_sof[3:0]和rx_is_eof[3:0]的低两位没有作用。
所以在Xilinx的示例工程中的PIO_RX_ENGINE.v文件中,当C_DATA_WIDTH等于128时,有如下语句。其中m_axis_rx_tuser[14]相当于rx_is_sof[4],m_axis_rx_tuser[13]相当于rx_is_sof[3]。所以,sof_present指示package的起始,sof_right表示新package起始于128bits接口的低64bits,sof_mid表示package起始于128bits接口的高64bits。
wire sof_present = m_axis_rx_tuser[14];
wire sof_right = !m_axis_rx_tuser[13] && sof_present; wire sof_mid = m_axis_rx_tuser[13] && sof_present;
注意:rx_is_sof[3:0]的取值并不是任意的。注意阅读pg504的Table 3-6到Table 3-9,这4个表格列出了合法的取值。比如rx_is_sof[3:0]只出现过两种取值:1000和0000。
4. Customizing and Generating the Core 4.1 Graphical User Interface(GUI)
4.1.1 Customizing the Core
1) PCIe Block Location Selection
选择PCIe Core的位置,如“X0Y0 & X0Y1”or “X0Y2 & X0Y3”等,与FPGA上的物理位
置是对应的。
2) ID和Class Code的设置 尚不明确。
3) Prefetchability
使用该功能时,必须保证预取动作不会破坏数据。比如,当从FIFO中读取数据时,不正确的预取操作可能破坏不该读出的数据。
当core设置为“Endpoint for PCIe(non-Legacy)”时,如果prefectchable使能,则每个bar(除bar5外)必须支持64位地址。该限制对Legacy Endpoint无效。
5. Debugging
具体见clock debug。在Vivado中生成PCIe的IP core后,其顶层文件中会给出系统时钟的接口,即sys_clk。这个信号是这样定义的,“input sys_clk”,是一个单端信号。而PCIe的同步参考时钟是差分的,如何将差分时钟连接至sys_clk?
其
解
决
方
法
可
以
参
考
以
下
网
址
,
http://forums.xilinx.com/t5/PCI-Express/sys-clk-type-mismatch-the-clock-type-defined-in-the-IP-core-top/td-p/383223#M4846,具体如下。
Which IP version are you using ?If this is 7 series integrated block for PCI Express please refer PG054
page
-
337,
http://www.xilinx.com/support/documentation/ip_doc
umentation/plbv46_pcie/v4_07_a/plbv46_pcie.pdf.
It states that \on the serial transceiver, and the userdesign should instantiate the IBUFDS_GTE2 primitive in the user design\
Syntax
refclk_ibuf : IBUFDS_GTE2
port map( O => sys_clk, ODIV2 => open, I => sys_clk_p, IB => sys_clk_n, CEB => '0');
If this is Vivado you can right click on .xci and generate example design where you can see
the same in top level xilinx_pcie_2_1_ep_7x.v/.vhd
7 Series FPGAsGTX/GTH Transceivers
User Guide
参考ug476_7Series_Transceivers.pdf。
1. Board Design Guidelines
1.1 Pin Description and Design Guidelines
1.1.1 GTX/GTH Transceiver Pin Descriptions
MGTXRXP[3:0]/MGTXRXN[3:0]:相应GTX的输入。 MGTHRXP[3:0]/MGTHRXN[3:0]:相应GTH的输入。 MGTXTXP[3:0]/MGTXTXN[3:0]:相应GTX的输出。 MGTHTXP[3:0]/MGTHTXN[3:0]:相应GTH的输出。
MGTAVTTRCAL:输入,为端接阻抗校准电路提供偏置电流。 MGTRREF:输入,端接阻抗校准电路的输入电阻。
MGTAVCC:输入,内部模拟电路的电源。Refer to thepackage pin definitions to identify in whichpower supply group a specific GTX/GTHtransceiver Quad is located. The nominalvoltage is 1.0 VDC.
MGTAVTT:输入,transceiver和receiver端接电路模拟供电。
MGTVCCAUX:输入,the auxiliary analogQPLL voltage supply for the transceivers. Most packages have multiple groups ofpower supply connections in the packagefor MGTVCCAUX. Refer to the package pindefinitions to identify in which powersupply group a specific GTX/GTHtransceiver Quad is located. The nominalvoltage is 1.8 VDC.
1.1.2 Termination Resistor Calibration Circuit
在一个GTX/GTH的Quad column中,共享一个阻抗校准电路。The RCAL circuit is associated with the GTX/GTH transceiver Quad that is the RCALmaster. The RCAL master performs the termination resistor calibration duringconfiguration of the FPGA and then distributes the calibrated values to all of theGTX/GTH transceiver Quads in the column. The Quad in which the RCAL circuit islocated must be powered on.
上图中,100欧姆电阻两端的走线不仅要等长,而且几何外形要一致。
1.1.3 Analog Power Supply Pins
GTX/GTH的电源(MGTAVCC, MGTAVTT, MGTVCCAUX)在封装内部有各自的电源平面(planes)。有些封装的器件,每个电源有多个平面。这种情况下,电源管脚的名字会加上_G#后缀,以区分该电源属于哪个电源组。如果一组电源对应的所有Quads均不使用,则这些电源管脚可以开路或接地。