CDL Modules
Files
dprintf

Files

file  dprintf.cdl
 Debug text formatter.
 

Detailed Description

Modules

module dprintf::dprintf ( clock  clk,
input bit  reset_n,
input t_dprintf_req_4  dprintf_req,
output bit  dprintf_ack,
output t_dprintf_byte  dprintf_byte 
)

This module that takes an input debug request and converts it in to a stream of bytes. The debug request is similar to a 'printf' string, in that it allows formatted data.

A request is effectively a bytestream with an SRAM address. The byte stream consists of ASCII characters plus potentially 'video control' characters - all in the range 1 to 127, plus control codes of 0 or 128 to 255.

The code 0 is just skipped; it allows for simple alignment of data in the dprintf request.

A code of 128 to 191 is a zero-padded hex format field. The encoding is 8h10xxssss; x is unused, and the size ss is 0-f, indicating 1 to 16 following nybbles are data (msb first). The data follows in the succeeding bytes.

A code of 192 to 254 is a space-padded decimal format field. The The encoding is 8h11ppppss; the size is 0-3 for 1 to 4 bytes of data, in the succeeding bytes. The padding (pppp) is zero for no padding; 1 forces the string to be at least 2 characters long (prepadded with space if required); 2 is pad to 3 characters, and so on. The maximum padding is to a ten character output (pppp of 9).

A code of 255 terminates the string.

Parameters
[in]clkClock for data in and display SRAM write out
[in]dprintf_reqDebug printf request
[out]dprintf_ackDebug printf acknowledge
[out]dprintf_byteByte to output