摘 要:隨著高速數據采集設備傳輸帶寬的日益提高,開發者需要采用新的計算機總線進行數據傳輸。這里敘述了使用EP2SGX90系列FPGA完成PCI-Express協議轉換,多種DMA工作方式及相關寄存器的作用。以鏈式DMA傳輸方式為例,詳細介紹該傳輸方式下的寄存器設置及在驅動程序中的實現范例。實驗表明,用FPGA實現協議轉換,總線持續傳輸速率最高可以達到1.2 Gb/s,滿足大多數高速數據采集設備的要求。在此摒棄了采用專用總線接口芯片的傳統方法,將開發者的邏輯設計和總線協議轉換放到同一個FPGA芯片中,不但節省了硬件成本,利用其可編程特性,大大提高了設計可擴展性,同樣的硬件很容易完成由PCIE 1.0到PCIE 2.0的升級。
關鍵詞:PCIE總線; 可編程器件; DMA傳輸; 高速數據采集設備
中圖分類號:TN40; TP336 文獻標識碼:A
文章編號:1004-373X(2010)14-0109-03
Application of FPGA in PCI Express Bus Interface
SHEN Hui, ZHANG Ping
(Nanjing Institute of Electronic Technology, Nanjing 210000, China)
Abstract: Along with increase of transmission bandwidth of the high-speed data acquisition systems, the designers have to use the new computer bus to complete the data transmission. The implementation of PCI-Express protocol transform with aplication of FPGA of EP2SGX90 series, the functions of multiple DMA operation modes and the relative register are described. Taking the chained transmissin mode as an example, the register setup in the chained DMA transmission mode and the implementation in the driver are introduced in detail. By this means, the continuous transmission rate of the bus is up to 1.2 GB. The experiment indicates that it can be applied to mass of data acquisition designs. One FPGA chip is adopted to accomplish the logic control and protocol transform of PCI-Express instead of the special bus interface chip. It lowers the design cost and improves the expandability of design. It is is for the same hardware to upgrade the PCIE1.0 to PCIE2.0.
Keywords: PCIE bus; FPGA; DMA transfer; high-speed data acquisition equipment
0 引 言
PCIE(PCI express)是用來互聯諸如計算機和通信平臺應用中外圍設備的第三代高性能I/O總線。PCIE體系結構繼承了第二代總線體系結構最有用的特點,采用與PCI相同的使用模型和讀/寫通信模型,支持各種常見的事務。其存儲器、I/O和配置地址空間與PCI的地址空間相同。由于地址空間模型沒有變化,所以現有的OS和驅動軟件無需進行修改就可以在PCIE系統上運行[1]。
PCIE是串行協議,與原有的PCI并行總線相比,它沒有大量的數據和控制線,對于硬件電路設計者來說,省去了很多硬件設計工作[2]。PCIE的傳輸速度遠遠大于PCI總線,PCIE 1.1版本單個鏈路的單向吞吐量能達到250 MB/s。對于需要與主機進行大容量傳輸的系統來說,該總線標準的優勢是非常明顯的[3-4]。……