Programmer’s Guide

Buffer allocation

The I3C IP block uses a single shared SRAM, the ‘message buffer’, to implement all of the logical queues and data FIFOs within the design, including both the Controller and the Target sides.

The allocation of this buffer is entirely under software control, and should be determined by which queues and FIFOs are being used, along with their anticipated data rates. The configuration must be set before enabling either Controller or Target operation.

The hardware provides a default configuration so that the IP block is operable after coming out of reset, even if the configuration has not been modified. It should, however, be noted that this configuration is conservative and anticipates the heaviest use case with all supported Virtual Targets configured and used; if fewer Virtual Targets are activated, the configuration should be modified to achieve better use of the memory.

The default buffer allocation, with the queues and FIFOs arranged in ascending order of buffer offset (in DWORDs) is shown below:

DescriptionRegisterMin offset (incl).Max offset (incl).
Controller Tx DataCTRL_TXBUF_CONFIG0x000x7f
Controller Rx DataCTRL_RXBUF_CONFIG0x800xff
Command QueueCOMMAND_QUEUE_CONFIG0x1000x11f
Response QueueRESPONSE_QUEUE_CONFIG0x1200x12f
IBI Data QueueIBI_CONFIG0x1300x1af
IBI Status DescsIBI_STAT_CONFIG0x1b00x1cf
Target 0 Tx DataTARG_TXBUF_CONFIG_00x1d00x20f
Target 1 Tx DataTARG_TXBUF_CONFIG_10x2100x24f
Target 2 Tx DataTARG_TXBUF_CONFIG_20x2500x28f
Target 3 Tx DataTARG_TXBUF_CONFIG_30x2900x2cf
Target Rx DataTARG_RXBUF_CONFIG0x2d00x36f
Target IBI DataTARG_IBI_CONFIG0x3700x3af
Target 0 Tx DescsTARG_TXDESC_CONFIG_00x3b00x3b7
Target 1 Tx DescsTARG_TXDESC_CONFIG_10x3b80x3bf
Target 2 Tx DescsTARG_TXDESC_CONFIG_20x3c00x3c7
Target 3 Tx DescsTARG_TXDESC_CONFIG_30x3c80x3cf
Target Rx DescsTARG_RXDESC_CONFIG0x3d00x3df
Target IBI StatDTARG_IBIDESC_CONFIG0x3e00x3ef
Target ASync EventTARG_ASYNC_CONFIG0x3f00x3ff

Each of the queues/FIFOs has a configuration register that specifies the minimum and maximum offsets, in DWORDs, within the message buffer. Both offsets are inclusive and it is the responsibility of the software to ensure overlaps do not occur because otherwise undefined behavior will result.

Timer Intervals

The IP block contains a number of timers for measuring the duration of I3C bus states, such as the ‘Bus Available’ and ‘Bus Idle’ conditions. The longest of these time intervals is the 50ms ‘Dead Bus Recovery’ interval, whilst the shortest interval is the ‘Bus Available’ condition at just 1 microsecond.

In order to support this wide variation in time intervals across the large range of supported IP clock frequencies, the timer granularity (in IP clock cycles) varies on a per-timer basis as illustrated by the following tables, at the extremes of the supported clock frequency range.

Minimum supported clock frequency, 50MHz:

TimerDefault IntervalWidth (bits)Shift amountUnit at 50MHzMax interval
Command Retrying800uss.785.1us1.5ms
Targ Bus Idle200uss.761.3us360us
TE0 Recovery60uss.74320ns100us
Targ Reset5uss.7020ns7.5us
Targ Bus Avail1uss.7020ns3.5us
Read stalled150uss.761.3us310us
Ctrl Bus Avail1uss.7020ns3.5us
Dead Bus Recov50mss.714330us92ms

Maximum supported clock frequency, 1.5GHz

TimerDefault IntervalWidth (bits)Shift amountUnit at 1.5GHzMax interval
Command Retrying800uss.7135.5us1.7ms
Targ Bus Idle200uss.7111.4us370us
TE0 Recovery60uss.79340ns100us
Targ Reset5uss.7521ns7.7us
Targ Bus Avail1uss.7521ns3.7us
Read stalled150uss.7111.4us320us
Ctrl Bus Avail1uss.7521ns3.7us
Dead Bus Recov50mss.719350us94ms

All times are quoted to two significant figures. It may be seen from the above tables how the shift amount achieves almost exactly the same granularity of timer adjustment despite the large disparity in IP clock frequency.

The timers are independent of each other and share no logic or synchronization beyond the fact that they are all updated by the single IP clock signal.

If the hardware-calculated default interval is found to be inadequate, e.g. in the event of oscillator frequency inaccuracy, an adjustment may be made by software using the appropriate field of INTERVAL_TIME0 or INTERVAL_TIME1 as illustrated below. The adjustment values are reset to 0, meaning that the unmodified default interval is used.

Time intervals are specified as two’s complement 8-bit signed offsets added to the default values calculated by the hardware:

  • interval_clks = (hw_default_us * clks_per_us) + (signed_adj << shift)

The shift values, as illustrated in the tables above, are adjusted according to log2(clks_per_us) with the result that the adjustment has about the same time range, irrespective of the IP clock frequency.

Clock frequencies:

  • 50MHz to 64MHz, both inclusive: base weighting applies and the shift value are as shown in the 50MHz table above.
  • From 64MHz (exclusive) to 128MHz (inclusive): adjustments have twice the base weighting; shifts are increased by 1.
  • From 128MHz (excl.) to 256MHz (incl.): adjustments have 4 times the base weighting; shifts are increased by 2…
  • From 256MHz (excl.) to 512MHz (incl.): adjustments have 8 times the base weighting.
  • From 512MHz (excl.) to 1024MHz (incl.): adjustments have 16 times the base weighting.
  • From 1024MHz (excl.) to 1500MHz (incl.): adjustments have 32 times the base weighting; shifts are increased by 5.