FPGA-based Train Onboard PCIe Board Design and Implementation
FPGA-based Train Onboard PCIe Board Design and Implementation
Implementation
Xiao Qi Chen1,a LI Yan Zhang 2,b
School of Automation and Electrical Engineering, Dalian School of Computer and Communication Engineering, Dalian
Jiaotong University Jiaotong University
Dalain, China Dalian, China
e-mail: [email protected] e-mail: [email protected]
Authorized licensed use limited to: Synopsys. Downloaded on October 11,2023 at 10:31:16 UTC from IEEE Xplore. Restrictions apply.
B. FPGA circuit design
Host(X86)
In the FPGA circuit design, the main connection circuits are
Driver
the circuits of the PCIe interface, the crystal circuit, and the
connection of the power supply module. According to the chip
PCIe female datasheet, the crystal device used is NB6N11S. The NB6N11S
connector is a differential 1:2 Clock and will accept Any Level input
signals: LVPECL, CML, LVCMOS, LVTTL, or LVDS. These
signals will be translated to LVDS and two identical copies of
Data I/O PCIe male Clock or Data will be distributed, operating up to 2.0 GHz or
Board(FPGA) connector 2.5 Gb/s, respectively. The NB6N11S has a wide input
common mode range from GND + 50 mV to VCC − 50 mV.
Qsys
PCIe control Combined with the 50 Ω internal termination resistors at the
inputs, the NB6N11S is ideally suited for converting a wide
variety of differential or single-ended clock or data signals to a
DMA typical 350 mV LVDS output level. LVDS output level. The
specific circuit design is shown in Figure 3.
On Chip Memory
203
Authorized licensed use limited to: Synopsys. Downloaded on October 11,2023 at 10:31:16 UTC from IEEE Xplore. Restrictions apply.
PETn0~3 and PERp0~3, PERn0~3 a total of 16 signals, A. PCIe bus standard
composed of 8 pairs of differential signals, of which 4 pairs of In the PCI bus data transmission, data are from the
PET signals are used to send links, 4 pairs of PER signals are transmitting end to the receiving end to complete the overall
used to receive links. The specific circuit design is data sending and receiving. The PCIe structure system, data
shown in Figure. 4. initially generated by the transmitter device core layer, through
the transaction layer, data link layer and physical layer, and
ultimately sent out, while the receiving end by the physical
layer to receive the data uploaded to the core layer of the
device.[3] PCIe bus hierarchy composed of structural diagrams
as shown in Figure 6.
Device A Device B
IV. FPGA SOFTWARE PROGRAMME DESIGN AND Electrical Sub_block Electrical Sub_block
IMPLEMENTATION
According to the content of the overall system design block RX TX RX TX
diagram, the FPGA system program design, the core Link
component of the FPGA program is the PCIe Hard IP Core,
mainly responsible for PCIe protocol analysis, the transport
layer interface to provide users with the use of the system
design, to determine the relevant interfaces and then carry out
the data transmission, and then the system needs to use the
DMA module, the PCIe data has a key role in data transmission.
Data transmission has a key role, can reduce the PCIe Figure 6. PCIe bus hierarchy
transmission data on the core chip resource occupation, and has
a certain impact on the speed of PCIe digital transmission. 1) Transaction Layer
FPGA system block diagram shown in Figure 5. Transaction Layer is the external interface layer of PCIE
protocol, the user frames and parses the data in this layer, the
packets generated in this layer are called TLP (Transaction
Layer Packets).[4] In addition, Transaction Layer also has the
Data
DMA
function of flow control based on credit, which supports
TX different forms of data transmission for different types of
Data transactions.
Data
PCIe Hard IP 2) data link layer
The data link layer acts as an intermediate stage between
RX On Chip Memory the transaction layer and the physical layer and its main
responsibilities include link management and data integrity
including error detection and correction.[5] The data link layer
receives the TLP packets from the transaction layer on the
transmission link adding the sequence number and checksum to
the physical layer, and the link layer is very dutiful and caches
Figure 5. Block diagram of FPGA system
the packets delivered by the transaction layer and retransmits
them if a transmission error is detected until they are received
correctly or until it is determined that the link communication
has failed. Link layer also has link management functions, and
there is a corresponding packet, called " DLLP (Data Link
204
Authorized licensed use limited to: Synopsys. Downloaded on October 11,2023 at 10:31:16 UTC from IEEE Xplore. Restrictions apply.
Layer Packet)" [6] The packet is to achieve the data exchange Within Qsys, each module needs to satisfy Avalon's address
between the two components, and there is no routing function, allocation between them. The specific allocation method can be
in other words, if a packet of data to reach the receiving end selected from the system's automatic allocation, or the address
across mountains and rivers, the middle of the countless allocation can be customized according to the needs of the
stations, the DLLP packet The DLLP packet exchanges data actual system design, but it must satisfy the requirements of
only between two stations, and mainly implements the Qsys. The specific address allocation is shown in Table 1
functions of flow control, power management, answering
mechanism and virtual channel.[7] TABLE I. AVALON ADDRESS ALLOCATION TABLE
3) physical layer
DMA interface
The physical layer is divided into two parts, one logical
sublayer and one electrical sublayer. The logical sublayer Dma read Dma write
module is responsible for the data exchange with the data link 0x0000 0000- 0x0000 0000-
layer, will receive the link layer transactions again encapsulated, PCIe_ip_txs
0x001f ffff 0x001f ffff
to receive the electrical sublayer transactions for parsing, and 0x0020 000- 0x0020 000-
OnChipMemory_s1
will carry out 8B/10B encoding or 128B/130B encoding[8], to 0x0020 0fff 0x0020 0fff
carry out the transfer between the conversion and polarity
reversal, etc., and the electrical sublayer is more responsible for After Generate within Qsys, the Schematic and Memory-
the clock data recovery, equalisation and other electrical Mapped Interconnect tools check that the data flow and
operations.[9][10] The specific TLP packet transmission and interface connections are as expected, as shown inthe following
reception process is shown in Figure 7. figure 8.
Transmit Receive
205
Authorized licensed use limited to: Synopsys. Downloaded on October 11,2023 at 10:31:16 UTC from IEEE Xplore. Restrictions apply.
Monitoring
software
Host
I/O
Board
Figure 11. Data captured within the FPGA at the Signal Tap side
Figure 9. Topology of the test environment
VI. CONCLUSIONS
B. Test results This system design, the PCIe interface in the continuous
A simple driver was designed by using the devmem read and write loopback test, in line with the design of the
character device, which will access the physical memory space expected transmission speed as well as the interface of the data
of the PCIe device according to the PCIe device number, map transmission accuracy also meets the design requirements. The
the physical memory space to the user space, and then read and transmission capability of the train's on-board data board has
write to it, thus realizing the test in the linux environment. The been improved, laying the foundation for the future
results of 1000 consecutive reads and writes to the development of data I/O boards, and in the follow-up, the
corresponding memory within the simple driver and the results remaining on-chip resources and pins of the FPGA chip can be
displayed within Linux are shown in Figure 10. utilized for the construction of the acquisition interface to
realize data transmission; as well as the realization of a
heterogeneous platform with ARM and other chips to carry out
more development in the area of data transmission.
REFERENCES
[1] Changxian LI, Yang LIU, Tong ZHANG et al. Research on UIC
gateway for interconnection, interoperability and interoperability among
moving trains[J]. China Railway Science,2013,34(06):110-116.
[2] Guochong Zhen, Huisi Su, Jianjun Chen et al. Design and
implementation of FPGA-based PCIe interface for data transmission[J].
Foreign Electronic Measurement Technology, 2021, 40(12): 72-
76.DOI:10.19652/j.cnki.femt.2102917.
[3] BAI Y, ZHANG X, YANG Q, etal. Multi-channel data acquisition card
under new acquisition and trans – mission architecture of high frequency
ground wave radar [J].Sensors2021, 21: 1128
[4] PCI Special Interest Group. PCI Express base specification revision 1.0a
[EB/OL]. [2014-07-21]. http: //netyi.net/Book.
[5] Longqian Li, Hua Fang, Jiao Feng et al. Design and implementation of
FPGA-based PCIe interface logic[J]. Journal of Terahertz Science and
Electronic Information, 2022, 20(04):385-392.
[6] BUDRUK R. PCI Express system architecture[M]Translated by TIAN Y
Figure 10. Linux side test results M WANG S ZHANG B. Beijing: Electronic Industry Press 2005.
Electronic Industry Press 2005.
This test has set up a trigger in Signal Tap, which will [7] MA M J ZHU J B. Architecture and principle of PCI PCI-X and PCI
retain the waveform after reading the data, and in this way Express[M]. Beijing: Tsinghua University Press 2007.
verifies that this 1000 consecutive read/write test does realize [8] Jian LIU, Huifang LI. Design and realization of PCIe-based FC data
the data transfer process inside the FPGA. As a result, the 32- acquisition storage scheme[J]. Foreign Electronic Measurement
bit 0x111103E7 data is captured in the corresponding interface Technology, 2013, 32 (10):42-44.DOI:10.19652/j.cnki.femt.2013.10.014.
within Signal Tap. The specific results are shown in Figure 11 [9] Guangliang He. Design and implementation of DMA controller based on
PCIE bus[J]. Information Technology and Network Security, 2018,
37(04): 131-135. DOI: 10.19358/j.issn.2096-5133.2018.04.030.
[10] Lisi Li, Zhihua Cui, Ye Yin et al. Design and verification of FPGA-
based DMA controller for PCIe bus[J]. Computer Measurement and
Control, 2014, 22(04):1166-1168. DOI:10.16526/j.cnki.11-
4762/tp.2014.04.108.
206
Authorized licensed use limited to: Synopsys. Downloaded on October 11,2023 at 10:31:16 UTC from IEEE Xplore. Restrictions apply.