The Generic Logic Interfacing Project
For FPGA targets GLIP provides HDL (usually Verilog) modules as an interface between the communication interface and your logic. Those logic interfaces share a common interface if at all possible to make switching between the different communication methods in hardware as easy as in software. This page describes this generic interface. For details on the individual backend implementations refer to the backend documentation.
The toplevel module of the HDL code is commonly called
glip_BACKEND_toplevel and contains three four groups of signals: the GLIP FIFO interface, the GLIP control interface, clock and reset signals and an external communication interface specific to the backend.
fifo_out_dataport is an input from the GLIP side, thus marked as IN in the tables below. In your design it's an output.
The FIFO interface is the interface between your logic and GLIP. Whatever you write into the FIFO in your logic will come out of the FIFO at the host PC, and the other way around. The signals are named from a target point of view, the
fifo_out_ signals are the outgoing FIFO from the target to the host PC. The
fifo_in_ signals are incoming data, data coming from the host PC and being received at your logic.
Depending on the used backend the width of the FIFO interface (i.e. the number of parallel data signals) might be configurable, or fixed. The width is always given in full bytes, i.e. 8 bit, 16 bit, etc. In the table below
FIFO_WIDTH describes the width of the FIFO interface.
Some GLIP backends support more than one communication channel. Each channel is a completely independent FIFO with its own set of data and control signals. All signals of the same type are combined into one input/output signal, i.e.
fifo_out_valid is the
fifo_out_valid signal for channel 0,
fifo_out_valid is the same signal for channel 1. In the table below
NCHAN describes the number of supported channels.
|fifo_out_data||NCHAN*FIFO_WIDTH||IN||the data to write to the host PC|
|fifo_out_valid||NCHAN||IN||the data on |
|fifo_out_ready||NCHAN||OUT||the FIFO is ready to receive new data|
|fifo_in_data||NCHAN*FIFO_WIDTH||OUT||the data received from the host PC|
|fifo_in_valid||NCHAN||OUT||the data on |
|fifo_in_ready||NCHAN||IN||the logic is ready to receive new data|
On the host side, all reads and writes are done in bytes (see glip_read() and glip_write() for example). On the logic side the FIFO might be wider than one byte, e.g. 2 or 4 byte (
FIFO_WIDTH being 16 or 32 [bit] respectively). This leaves the question of how the stream of bytes is mapped into wider FIFO registers. In GLIP, all FIFOs are Big Endian. For a 2 byte (16 bit) wide FIFO on the target this means: the first byte written by glip_write() will be the most significant byte of the FIFO (i.e.
fifo_out_data[15:8]), and the second byte will be the least significant byte (i.e.
All FIFOs are "First Word Fall Through". For reading from the FIFO this means, as soon as the FIFO is not empty any more, the valid signal is high and data can be read from the data port. The "ready" signal serves as a acknowledge signal, i.e. as soon as ready and valid are both high, the data word is considered read and (if available) the next word can be read from the FIFO.
The control interface gives you the possibility to transfer side-channel information between the host PC and the target device. The signals of the control interface are not interpreted or used by GLIP itself, from the user point of view they are just signals which can be triggered on the host PC and can be used on the logic side for any purpose.
|ctrl_logic_rst||1||OUT||a reset of the user logic is requested|
All signals facing the user logic (the
ctrl_ signals) are in the clock domain given by the
clk signal. Internally, the communication logic provided by GLIP might operate within a different clock domain, depending on what external interfaces are being used. In this case, GLIP contains adequate clock-domain crossing mechanisms to hide this complexity from your logic.
Two reset signals are available:
rst should be connected to the system-wide reset tree also containing the Power On Reset (POR), possibly an external reset button, etc. It can be used to reset the logic inside GLIP to be able to receive data from a communication partner.
com_rst is the communication reset. This reset is triggered by the host (e.g. the PC) when connecting to the target (e.g. the FPGA) to create a common system state and bring up the communication. The
com_rst signal can be used by the logic attached to GLIP to initialize higher-level protocols for example (i.e. a communication protocol building on top of the GLIP FIFO interface).
|rst||1||IN||user-supplied synchronous reset signal|
|com_rst||1||OUT||communication logic reset (host-triggered)|
To do its work GLIP needs to interface with some communication interface on the FPGA. Depending on the used interface the used signals vary greatly. Thus this interface is specific to each GLIP backend and not standardized in any way. To reduce confusion, those signal names never start with