Sunday 17 August 2014

Debug Infrastructure Documentation

Debug infrastructure provides an easy interface for a developer to output data from the FPGA board for debugging. It is also useful for end users in case of troubleshooting.

The BIG PICTURE:


The debug data is collected into the debug_module which then breaks the data into bytes and sends them to UART module and USB_top module. These module send data via CDC/UART to host.

How to use?

The output of UART/CDC are bytes. So to convert them to human readable format and hence allow easy debugging, a program fpga_debug.c has been provided which reads data from the fpga and then outputs data in correct format.

To compile fpga_debug.c
> cd tools
> make

To run debugging program
> ./fpga_debug

How to add new debug data? 

  • Route the data into debug_module
  • Break it into bytes and add to uart_byte_array
  •  Change value of "constant N_BYTES  : integer" appropriately
  • In fpga_debug.c add code to parse and output the new data
You are done!

Output Bytes:


Byte
Description
1
Device State
5:2
Resolution of Source
6
Input frame rate in fps
7
Output frame rate in fps
8
Frame write time in ms
9
Frame Processing Time in ms
10
No. of frames dropped for every frame processed
13:11
No. of bytes in a frame


NOTE: To use UART port, exar device driver should be installed. But the driver does not allow CDC port to function along with it. So you can use either UART or CDC but not both.

Video



No comments:

Post a Comment