Throttle (throttle_s)

Restricts maximum throughput of data on a streaming interface.

Design

The throttle component allows the rate that data samples are taken from its input to be limited. Data samples are passed through unmodified.

The component uses a phase accumulator to allow any data rate to be selected. The step_size property controls the amount that the phase accumulator is incremented each FPGA clock cycle. The maximum possible throughput through a component is when there is one input and output on every FPGA clock cycle.

The higher step_size is set the closer the throughput allowed through the throttle will be to the maximum possible throughput.

The value of step_size for a given throughput (in boolean samples/second) is given by (73).

(73)\[\texttt{step_size} = \left \lfloor \frac{2^{32} R}{T_{fpga}} \right \rfloor\]

In (73):

  • \(R\) is the desired throughput.

  • \(T_{fpga}\) is the FPGA clock rate.

The component will only take samples from the input if its output is also ready. This means the step_size actually sets the maximum allowable throughput. The actual throughput will depend on how often the components connected to the throttle’s input and output ports are ready to give or take data.

If data is always ready at the component’s input and and the component’s output is always ready to take data then the maximum throughput set by step_size will be achieved.

If the zero_pad_when_not_ready property is set to True the component will attempt to output samples exactly at the data rate set by the step_size property. This is done by adding output data samples, with a value of zero, when then input is not ready but an output sample is required to maintain the set output data rate. This mode is typically used when interfacing with digital to analogue converters that are expecting a continuous stream of samples at a specified data rate. In this mode the actual achieved output rate is still limited by how often the output is ready to accept data as it is not possible to output a sample on to an OpenCPI interface if the interface is not ready.

Interface

<?xml version="1.0"?>
<componentspec>
  <property name="step_size" type="ulong" writable="true" default="2147483547"
    description="Step size of the throttle phase accumulator.`"/>
  <property name="enable" type="bool" writable="true" default="true"
    description="Enables or disables the throttle. If enable is false data will pass through unrestricted. If enable is true data
      will be throttled to the maximum rate specified by ``step_size``."/>
  <property name="zero_pad_when_not_ready" type="bool" writable="true" default="false"
    description="When enabled the component will enforce the output data rate by padding the output with zeros when there is no
      valid input data."/>
  <port name="input" producer="false" protocol="short_timed_sample-prot"/>
  <port name="output" producer="true" protocol="short_timed_sample-prot"/>
</componentspec>

Ports

Inputs:

  • input: Primary input samples port.

    • Protocol: short_timed_sample-prot

    • Optional: False

Outputs:

  • output: Primary output samples port.

    • Protocol: short_timed_sample-prot

    • Optional: False

Opcode Handling

All opcodes pass through this component at the throttled data rate.

Properties

  • step_size: Step size of the throttle phase accumulator.`. Setting this property to zero is not supported and untested - it will likely result in no data being passed by the component.

    • Type: ulong

    • Access:

      • Parameter: False

      • Writable: True

      • Initial: False

      • Volatile: False

    • Default value: 2147483547

  • enable: Enables or disables the throttle. If enable is false data will pass through unrestricted. If enable is true data will be throttled to the maximum rate specified by step_size.

    • Type: bool

    • Access:

      • Parameter: False

      • Writable: True

      • Initial: False

      • Volatile: False

    • Default value: true

  • zero_pad_when_not_ready: When enabled the component will enforce the output data rate by padding the output with zeros when there is no valid input data.

    • Type: bool

    • Access:

      • Parameter: False

      • Writable: True

      • Initial: False

      • Volatile: False

    • Default value: false

Implementations

Example Application

<?xml version="1.0"?>
<application done="file_write">
  <instance component="ocpi.core.file_read" connect="throttle_s">
    <property name="filename" value="input.bin"/>
  </instance>
  <instance component="ocpi.comp.sdr.interface.throttle_s" connect="file_write">
    <property name="step_size" value="2147483648"/>
    <property name="enable" value="true"/>
    <property name="zero_pad_when_not_ready" value="false"/>
  </instance>
  <instance component="ocpi.core.file_write">
    <property name="filename" value="output.bin"/>
  </instance>
</application>

Dependencies

The dependencies to other elements in OpenCPI are:

  • None.

There is also a dependency on:

  • ieee.std_logic_1164

  • ieee.numeric_std

Limitations

Limitations of throttle_s are:

  • zero_pad_when_not_ready should only be used with a data opcode.

Testing

Tested platforms: None

Component testing not completed.