Timestamp Inserter (timestamp_inserter)

Inserts timestamps before sample opcode messages. Can be configured to insert a timestamp before every sample opcode, or only when requested.

Design

Passes all opcode messages received on the input port to the output port. When a Sample opcode message is received, a timestamp is optionally output via a Time opcode message before the Sample opcode message is passed onto the output.

On reception of a Sample opcode, if the property continuous_mode is true, a timestamp is generated and inserted as a Time opcode before the Sample opcode message. If continuous_mode is false, the timestamp is only generated and inserted if the property timestamp_pending is true.

When the worker inserts a Time opcode, it clears the timestamp_pending property to false. This also indicates that a timestamp insertion action has been been completed.

Thus if both continuous_mode and timestamp_pending are false, no timestamp insertion action shall occur, and the component just passes data through unchanged.

A block diagram of the component is as follows:-

Block Diagram

Figure 130: Block Diagram

Interface

<?xml version="1.0"?>
<componentspec>
  <property name="continuous_mode" type="bool" writable="true" default="true"
    description="Enables the insertion of a timestamp before each data message."/>
  <property name="timestamp_pending" type="bool" writable="true" volatile="true" default="true"
    description="Signals that a timestamp is to be inserted before a data message."/>
  <property name="leap_seconds" type="uchar" writable="true" default="0"
    description="Current number of leap seconds between UTC and GPS time."/>
  <property name="port_width" type="uchar" initial="true" writable="false" default="16"
    description="Defines the input data width in bits."/>
  <port name="input" producer="false" numberofopcodes="6" defaultbuffersize="16384"/>
  <port name="output" producer="true" numberofopcodes="6" defaultbuffersize="16384"/>
</componentspec>

Properties

  • continuous_mode: Enables the insertion of a timestamp before each data message. When true, timestamps are inserted before every sample opcode in the data stream. When false, single timestamps are inserted as governed by the timestamp_pending property.

    • Type: bool

    • Access:

      • Parameter: False

      • Writable: True

      • Initial: False

      • Volatile: False

    • Default value: true

  • timestamp_pending: Signals that a timestamp is to be inserted before a data message. When continuous_mode is false, setting timestamp_pending to true triggers a timestamp to be sent before the next sample opcode. The worker will set timestamp_pending to false when it has completed the insertion of the timestamp. When continuous_mode is true, the timestamp_pending value is ignored and the worker will set it to false.

    • Type: bool

    • Access:

      • Parameter: False

      • Writable: True

      • Initial: False

      • Volatile: True

    • Default value: true

  • leap_seconds: Current number of leap seconds between UTC and GPS time.

    • Type: uchar

    • Access:

      • Parameter: False

      • Writable: True

      • Initial: False

      • Volatile: False

    • Default value: 0

  • port_width: Defines the input data width in bits.

    • Type: uchar

    • Access:

      • Parameter: False

      • Writable: False

      • Initial: True

      • Volatile: False

    • Default value: 16

Ports

Inputs:

  • input: Primary input samples port.

    • Protocol: None

    • Optional: False

Outputs:

  • output: Primary output samples port.

    • Protocol: None

    • Optional: False

Implementations

Example Application

<?xml version="1.0"?>
<application done="file_write">
  <instance component="ocpi.core.file_read" connect="timestamp_inserter">
    <property name="filename" value="input.bin"/>
  </instance>
  <instance component="ocpi.comp.sdr.interface.timestamp_inserter" connect="file_write">
    <property name="port_width" value="16"/>
    <property name="continuous_mode" value="true"/>
    <property name="timestamp_pending" value="true"/>
  </instance>
  <instance component="ocpi.core.file_write">
    <property name="filename" value="output.bin"/>
  </instance>
</application>

Dependencies

The dependencies to other elements in OpenCPI are:

  • HDL OpenCPI dependencies:

  • RCC OpenCPI dependencies:

  • components/util/common/opcodes.hh

There is also a dependency on:

  • HDL specific dependencies:

  • ieee.std_logic_1164

  • ieee.numeric_std

  • ieee.math_real

  • RCC specific dependencies:

  • <chrono>

Limitations

The limitations of timestamp_inserter are:

  • Multiple triggering of the timestamp_pending property will result in only one timestamp being inserted before an input message.

  • Whilst the component is “protocol-less”, it is assumed it will be used with one of the the timed sample protocols.

Testing

Tested platforms: None

Component testing not completed.