This Wiki page describes a systemverilog module which logs the Avalon-ST transactions to a log and PCAP(Packet Capture) file for easier debug. The module can be instantiated using QSYS or as a traditional systemverilog module.
A filename for the LOG and PCAP files can be set when instantiating the module. If the filename is left blank it will create a filename based on the design hierarchy which will be unique.
The _hw.tcl file is the QSYS component declaration for the "Avalon-ST Protocol Analyzer" component. In order for the QSYS tool to see the component you must first add the directory to it's IP Search Path. In Qsys goto "Tools" followed by "options". Click on the "IP Search Path" category and add the directory where the _hw.tcl file is stored.
Now the component is available on in the Library. It can now be found under the "Avalon Verification Suite", "Altera Avalon-ST Protocol Analyzer".
Single channel capture to PCAP file format, shown in Wireshark.
Multichannel Capture in Wireshark
The PCAP file format does not allow for any channel information to be stored. To work around this I've used the ts_sec (timestamp seconds) field to indicated the channel number. In order for the frames to be displayed correctly you must configure time display format in wireshark as shown in the picture below.