Message Length Adjuster (message_length_adjuster)

Combines multiple smaller sample messages into larger ones, or splits larger sample messages into smaller ones.

Design

The component is capable of taking successive sample messages received at the input and combining them to produce output messages with up to a maximum of message_size samples, where message_size is a property. Conversely the component is also capable of taking larger messages received at the input and splitting them to produce multiple smaller output sample messages.

In the event that the number of samples received at the input is less than message_size, the timeout property allows the output message to be sent. This prevents samples being buffered indefinitely. Setting timeout to 0 disables the time-out.

If the time interface is unavailable, the component will operate as normal but the time-out function will not work, and messages will be held indefinitely until the message length is received.

The original message order is preserved which means that if a non-sample opcode is received and samples are already buffered waiting for message_size samples to be received, these buffered samples will be output before the non-sample opcode.

Interface

<?xml version="1.0"?>
<componentspec>
  <property name="width" type="uchar" writable="false" initial="true" default="8" description="The number of bits per sample."/>
  <property name="message_size" type="ushort" writable="true" default="16384"
    description="Sets the maximum number of samples per message"/>
  <property name="timeout" type="ulong" writable="true" default="0"
    description="Sets the 32-bit binary fraction of a second. After this period a message less than ``message_size`` samples is
      output if less than that total was previously received. Setting to 0 disables the time out."/>
  <port name="input" producer="false" numberofopcodes="6" defaultbuffersize="16384"/>
  <port name="output" producer="true" numberofopcodes="6" defaultbuffersize="16384"/>
</componentspec>

Ports

Inputs:

  • input: Primary input samples port.

    • Protocol: None

    • Optional: False

Outputs:

  • output: Primary output samples port.

    • Protocol: None

    • Optional: False

Opcode Handling

All received message types are passed through this component and the ordering unchanged. Two or more consecutive input sample opcodes may be condensed into fewer larger output sample opcodes or larger samples may be split into smaller output sample opcodes.

Properties

  • width: The number of bits per sample. Must be a non-zero multiple of 8.

    • Type: uchar

    • Access:

      • Parameter: False

      • Writable: False

      • Initial: True

      • Volatile: False

    • Default value: 8

  • message_size: Sets the maximum number of samples per message. If message_size times width is greater than ocpi_buffer_size_output the maximum number of samples per message will be limited to ocpi_buffer_size_output.

    • Type: ushort

    • Access:

      • Parameter: False

      • Writable: True

      • Initial: False

      • Volatile: False

    • Default value: 16384

  • timeout: Sets the 32-bit binary fraction of a second. After this period a message less than message_size samples is output if less than that total was previously received. Setting to 0 disables the time out.

    • Type: ulong

    • Access:

      • Parameter: False

      • Writable: True

      • Initial: False

      • Volatile: False

    • Default value: 0

Implementations

  • message_length_adjuster (HDL)

  • message_length_adjuster (RCC)

Example Application

<?xml version="1.0"?>
<application done="file_write">
  <instance component="ocpi.core.file_read" connect="message_length_adjuster">
    <property name="filename" value="input.bin"/>
  </instance>
  <instance component="ocpi.comp.sdr.interface.message_length_adjuster" connect="file_write">
    <property name="message_size" value="16384"/>
    <property name="timeout" value="0"/>
  </instance>
  <instance component="ocpi.core.file_write">
    <property name="filename" value="output.bin"/>
  </instance>
</application>

Dependencies

The dependencies to other elements in OpenCPI are:

There is also a dependency on:

  • ieee.std_logic_1164

  • ieee.numeric_std

  • ieee.math_real

Limitations

  • The setting of the timeout property has been tested but limitations of the testing framework means that the timing of the timeout trigger has not been fully verified.

  • Very small values for the timeout property may cause the time-out to always trigger before any messages are read - resulting in the RCC implementation only processing time-outs and not messages, meaning no data is processed through the component.

Testing

Tested platforms: None

Component testing not completed.