The invention discloses a PCIe (
Peripheral Component Interconnect Express) exchange switch testing device and a PCIe exchange switch testing method, and aims to overcome the defects of long testing time, incapability of comprehensively covering a testing scene and high testing cost in the prior art. The device comprises
root complex equipment,
executable equipment enumeration, storage
space allocation and test
process control. An upstream port of the to-be-tested PCIe exchange switch is connected with the
root complex device, and a downstream port of the to-be-tested PCIe exchange switch can be in extensible connection with the endpoint device or in
cascade connection with other PCIe exchange switches; the end point equipment supports EP-RC, EP-EP transaction routing and data return; the PCIe connector establishes a physical link. The method comprises the following steps: establishing a PCIe link, distributing a
bus number and the like, sending
test data by utilizing a DMA function, comparing
data consistency, marking an abnormal port, resending a test transaction, and
polling all ports to complete test coverage. According to the device and the method, the
test efficiency can be improved, the cost can be reduced, multi-
chip parallel test and abnormal port marking can be realized, and the device and the method are suitable for board-level function test and burn-in test of the PCIe exchange switch.