This forum is for sharing information about SiTCP. Please do not hesitate to post any questions, comments or answers within the scope of this purpose.
How to know the usage of the TX FIFO?
投稿日時 2018/5/31 0:54
I want to know the usage of the TX fifo in order to know whether there is enough space to write a data package with certain length. In the wrapper file ,only the TCP_TX_FULL signal is provided. I found a signal TCP_TX_FILL[15:0] which is not pull out in the wrapper. This looks like the usage of the TX fifo. I try to read this signal but the result is strange. When I continue writing to the FIFO until TCP_TX_FULL is 1, then the TCP_TX_FILL[15:0] was read as 0x7FD5. But when I only write some data to the FIFO, for example, 1000 bytes, the fifo is not full, but the TCP_TX_FILL[15:0] was always 0. So what's the problems?
投稿日時 2018/5/31 11:13
TCP_TX_FILL [15: 0] indicates the number of bytes stored in the buffer in the SiTCP library.
32k and 16k in the library name indicate the size of the transmission buffer.
TCP_TX_FULL indicates that it is almost full.
Therefore, it becomes 1 when TCP_TX_FILL [15: 0] is almost buffer size.
The data in the transmission buffer is stored until the response confirmation from the communication partner.
Since it is abnormal that TCP_TX_FILL [15: 0] stays 0 when writing data, please tell me the library file name for analysis.
Please rewrite the wrapper file as necessary.
However, it is recommended to use only TCP_TX_FULL as the interface of transmission data.
投稿日時 2018/5/31 12:12
The library used is XC6SSiTCPlib32K_V11.rar
投稿日時 2018/5/31 12:50
Thank you for reporting the file name of the library.
We investigated XC6SSiTCPlib32K_V11, but we could not find a problem.
Probably it is assumed that one of the following is caused.
- Updating TCP_TX_FILL [15: 0] takes 2 clocks from writing.
- Operation is not guaranteed if data is written exceeding the buffer size.
投稿日時 2018/5/31 13:44
I write 1000 bytes to the FIFO, and this was later confirm by reading from TCP and the read back data was 1000 bytes exactly. I try different numbers of writing but the TX_FILL was always 0. Only by continous writing until TX_FULL is 1, the TX_FILL can be read as 0x7FE5.
投稿日時 2018/5/31 13:49
The TX_FILL is update with which clock? the system clock (130M) or the 125M clk?
投稿日時 2018/5/31 14:03
The interfaces between the library and user circuits are all synchronized with CLK (port name in WRAP_SiTCP_GMII_XC6S_32K).
投稿日時 2018/5/31 21:52
I think I may understand the problem. I write 1000 (or other value) bytes to the FIFO and then stop writing. The data will quickly be transfered to the PC by SiTCP, and the FIFO become empty again when I read the TX_FILL by the RBCP bus.
投稿日時 2018/5/31 22:32
Your understanding is correct.
The time from the end of writing to reading TX_FILL [15: 0] must be very short.
If reading with RBCP, a circuit that holds the value of TX_FILL [15: 0] is required.