This is a Verilog protocol decoder for PCI express. It decodes ordered sets, DLLPs and TLPs from the PIPE interface. The purpose is to be able to see the exact packet and time of transmission for PCI Express in simulation to aid in debug. For example, it could be used to check when a memory write is performed due to an MSI interrupt being asserted.
The decoder connects to a single PIPE interface. It supports x1, x2, x4 and x8 interfaces. Connections should be made as follows:Setup and connection to the Altera PCI express IP
Decoder input port Connection to Receiver Connection to Transmitter
reset !pcie_resetn !pcie_resetn
clk clk250 for gen1, clk500 for gen2 clk250 for gen1, clk500 for gen2
rxdatax <name>_rxdata0_ext <name>_txdata0_ext
rxdatakx <name>_rxdatak0_ext <name>_txdatak0_ext
rxx_en <name>_rxvalid0_ext <name>_txelecidle0_ext
The decoder only supports the unscrampled interface so the scrambling must be tunred off by setting test_in to 1 in your testbench. If you are using the Altera PCIe BFM it is easiest to set this bit in the BFM where the other test_in assignments are made.
Output files and formatting
The decoder creates three output files at pwd: pcie_logfile.log, pcie_logfile.log_dllp, pcie_logfile.log_tlp. The name of the generated files may be changed by modifying the parameter LOGFILE_NAME in the instantiation.
.log contains all decoded symbols: ordered sets, DLLPs, TLPs
.log_dllp contains only DLLPs
.log_tlp contains only TLPs
Each of these files are csv files which contain the decoded packet fields and the time when the packet was decoded. The full data packet is provided also.