glip
0.1.0-dev
The Generic Logic Interfacing Project
|
GLIP uses a custom data transmission protocol on top of JTAG to achieve reasonable performance. Two main factors limit the throughput over JTAG:
Considering those factors, the central idea of the GLIP JTAG protocol is the usage of very large transmissions, i.e. a very long shift register to achieve good performance. All communication is done in the JTAG data shift state (dshift). To further reduce the overhead introduced by round-trip delays, we chose a flow control protocol based on the opportunistic sending of data, which is then acknowledged by the FPGA or (if not acknowledged) retransmitted by the host.
Three types of communication messages are defined, which are described below.
Before starting the communication between the host and the target, the host needs to get the values of some configuration parameters, passed to glip_jtag_toplevel
at synthesis time.
Therefore, communication starts with a configuration discovery transmission, which is depicted below:
word 0 1 2 bit 15 0 15 0 15 0 +--------+------------+-----------+ req | 0xFFFF | 0x0000 | 0x0000 | +--------+------------+-----------+ +--------+------------+-----------+ resp | 0x0000 | WORD_WIDTH | NUM_WORDS | +--------+------------+-----------+
WORD_WIDTH
are the number of bits in a transmitted data wordNUM_WORDS
is the log2(size) of the receive buffer in words. The number of words is calculated as (1 << NUM_WORDS).GLIP supports the transmission of side-channel data in addition to the FIFO payload data. This data is transferred in the same way as the configuration discovery packet.
word 0 1 2 bit 15 0 15 0 15 0 +--------+------------+-----------+ req | 0xFFFF | SC | 0x0000 | +--------+------------+-----------+ +--------+------------+-----------+ resp | 0x0000 | ignored | ignored | +--------+------------+-----------+
SC
is a bitfield of side-channel data.
SC[0]
: logic reset (ctrl_logic_reset
)The basic idea of the data communication is the following.
The word width (WW
in the following diagram) is equal to the FIFO width on the logic side.
word 0 1 2 n+1 n+2 n+3 bit WW-1 0 WW-1 0 WW-1 0 WW-1 0 WW-1 0 WW-1 0 +-------------+-------------+-----------+/+-----------+--------------+--------------+ req | WR_REQ_SIZE | RD_REQ_SIZE | WR_WORD_1 |/| WR_WORD_n | 0x0000 | 0x0000 | +-------------+-------------+-----------+/+-----------+--------------+--------------+ +-------------+-------------+-----------+/+-----------+--------------+--------------+ resp | 0x0000 | 0x0000 | RD_WORD_1 |/| RD_WORD_n | WR_RESP_SIZE | RD_RESP_SIZE | +-------------+-------------+-----------+/+-----------+--------------+--------------+
WR_REQ_SIZE
: Number of words that are valid in the request, i.e. that should be written into the target-side FIFO. Setting this field to all-one (0xFF..FF) is not allowed, since this value has special meaning.RD_REQ_SIZE
: Number of words that are requested by the host for transmission. The target is free to send less data.WR_RESP_SIZE
: Number of words that have been successfully written into the target's FIFO, i.e. they are acknowledged by the target. All words which are not acknowledged need to be resent.RD_RESP_SIZE
: Number of valid words in the response from the target that should be written to the host-side FIFO (up to RD_REQ_SIZE
words).n
is the number of payload words (each being WW
bit wide). It is equal to MAX(WR_REQ_SIZE, RD_REQ_SIZE)
. n
can be at most 2*WW - 2
, since the 0xFF...FF value inside WR_REQ_SIZE
is reserved.WR_WORD_x
are the data words sent to the targetRD_WORD_x
are the data words received from the target