JACK WHITHAM    
       
    Home -> vlabif Protocol    

   
 
  On this page:  
 
   
 
  VL2 documentation:  
 
The vlabif protocol is used for communications between a vlabif module on a client PC and vlabifhw hardware device on an FPGA. The communications can take place using a conventional serial port or via a VL2 UART. Unlike the VL2 protocol (documented elsewhere), the vlabif protocol is not human readable. Messages are as short as possible in order to minimise the complexity of the hardware.

vlabifhw reference

vlabifhw commands
Command name Sent by Documentation
RX_COMMAND_INFO SoftwareFormat:
    0x70
Requests an information packet from the hardware.
RX_COMMAND_SEND_CHANNEL SoftwareFormat:
    0x71 <code> <data...>
Writes up to 15 bytes to a specific channel. The <code> byte is constructed from the channel number (low nibble) and the number of bytes (high nibble). The data follows the <code> byte. Escape codes are not used here; they are only used for data being received from the hardware.
TX_PACKET_INFO HardwareFormat:
    0x80 <code>
Provides information about the vlabifhw device. The high nibble of the <code> byte is the total number of channels (ext_channels) plus two. If this nibble is zero, then the total is 16.

The low nibble is the hardware version, currently always 1.

TX_PACKET_CHANNEL_DATA HardwareFormat:
    0x81 <channel_code> <data...>
Contains data that has been sent to a channel. The high nibble of the <channel_code> byte gives the channel number. It is followed by zero or more bytes of channel data. The data ends with a command. Note that if the data contains bytes that could be interpreted as commands (e.g. 0x81) then these will be preceded by the escape code 0x87. The same is true for the channel code.
TX_PACKET_READY HardwareFormat:
    0x82
Indicates that the hardware is ready for further commands.
TX_PACKET_OVERFLOW HardwareFormat:
    0x83 <code>
Indicates that a send operation on a specific channel has (partially or completely) failed due to the channel FIFO being full. The high nibble of <code> is the channel number. The low nibble is the counter value at the time of overflow. You can calculate the number of bytes that were successfully sent using the equation:
successfully_sent = ( outgoing_size - low_nibble ) - 1
where outgoing_size is the number of bytes that were written to the channel using RX_COMMAND_SEND_CHANNEL.
TX_PACKET_END_TX HardwareFormat:
    0x84
Indicates that a packet of data from a channel has finished.
TX_ESCAPE_CODE HardwareFormat:
    0x87
Indicates that the next byte is not a command and must be taken literally.
Debugger commands (sent to the highest numbered channel using RX_COMMAND_SEND_CHANNEL)
Command name Sent by Documentation
RX_COMMAND_CLOCK_STEP SoftwareFormat:
    0xa0 <count (high byte)> <count (low byte)>
The debug_clock output is stepped through <count> cycles. The command 0xa0 is echoed by the hardware.
RX_COMMAND_GET_DEBUG_CHAIN SoftwareFormat:
    0xa1 <length (high byte)> <length (low byte)>
The current value of the debug chain is downloaded. The debug chain length is specified in bytes. The command 0xa1 is echoed by the hardware followed by the debug chain bytes.
RX_COMMAND_SET_DEBUG_CHAIN SoftwareFormat:
    0xa2 <length (high byte)> <length (low byte)> <data...>
The current value of the debug chain is programmed. The debug chain length is specified in bytes, followed by the debug chain data. The command 0xa2 is echoed by the hardware.
RX_COMMAND_SET_CTRL SoftwareFormat:
    0xa3 <control byte>
The control byte is set. The bits of this byte correspond to control lines (0 = least significant):
Bit nameNumberDocumentation
RX_FREE_RUN_BIT0 When this bit is '1', the debug_clock output is cycled as quickly as possible (at half the frequency of the clk input).
RX_CLOCK_BIT1 Provided that ( RX_FREE_RUN_BIT or RX_FREE_RUN_BREAK_BIT ) = '0', the debug_clock output is set to the value of this bit.
RX_RESET_BIT2 The debug_reset output is set to the value of this bit.
RX_FREE_RUN_BREAK_BIT3 When this bit is '1' and the breakpoint input is '0', the debug_clock output is cycled as quickly as possible.
RX_CAPTURE_BIT4 The read and read/write registers in the debug chain are loaded from the hardware under test, updating the debug chain.
RX_READY_BIT5 The write and read/write register outputs from the debug chain are programmed from the current debug chain value.
RX_COMMAND_NOP SoftwareFormat:
    0xa4
The NOP command is echoed.



       
  Copyright (C) Jack Whitham 1997-2011