TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
tt_vuart Struct Reference

In-memory ring buffer descriptor for Tenstorrent virtual UART. More...

#include <uart_tt_virt.h>

Data Fields

uint32_t magic
uint32_t rx_cap
uint32_t rx_head
uint32_t rx_tail
uint32_t tx_cap
uint32_t tx_head
uint32_t tx_oflow
uint32_t tx_tail
uint32_t version
uint8_t buf []

Detailed Description

In-memory ring buffer descriptor for Tenstorrent virtual UART.

This in-memory ring buffer descriptor describes two ring buffers in a contiguous section of uncached memory. Following the descriptor, there are tx_cap bytes of space for the transmit buffer, followed by rx_cap bytes of space for the receive buffer.

The tx_head, tx_tail, rx_head, and rx_tail variables are all up-counters (which may wrap around the 2^32 limit). Therefore, the transmit buffer should be read at an offset of zero added to the appropriate counter modulo tx_cap, and the receive buffer should be read at an offset of tx_cap added to the appropriate counter modulo rx_cap.

This convention mitigates ambiguity between empty and full buffers. A buffer is empty when the head and tail indices are equal. A buffer is full when the tail index is equal to the head index plus the buffer capacity.

Since this descriptor is intended to be shared between both a device, it is important to clarify that the transmit (tx) and receive (rx) directions are from the perspective of the device and should be reversed when viewed from the host. See also tt_vuart_role.

TODO: add a nice ascii-art diagram.

Field Documentation

◆ buf

uint8_t tt_vuart::buf[]

◆ magic

uint32_t tt_vuart::magic

Magic number used to identify the virtual uart in memory

◆ rx_cap

uint32_t tt_vuart::rx_cap

Receive buffer capacity, in bytes

◆ rx_head

uint32_t tt_vuart::rx_head

◆ rx_tail

uint32_t tt_vuart::rx_tail

Receive head counter

◆ tx_cap

uint32_t tt_vuart::tx_cap

Receive tail counter Transmit buffer capacity, in bytes

◆ tx_head

uint32_t tt_vuart::tx_head

◆ tx_oflow

uint32_t tt_vuart::tx_oflow

Transmit head counter

◆ tx_tail

uint32_t tt_vuart::tx_tail

Number of transmit overflows (device to host)

◆ version

uint32_t tt_vuart::version

Transmit tail counter Version info MS-Byte to LS-Byte [INST.MAJOR.MINOR.PATCH]


The documentation for this struct was generated from the following file: