Sink (sink)

The sink component allows a non-optional output port of another component to be terminated.

Design

The sink component can either take input data whenever it is available, or never take any input data. Any input data that is taken is discarded. The mode of operation is set by the take_data property. The sink component is typically used for testing purposes.

When take_data is true sink will enter the finished control state if it receives an EOF (End-Of-File) message on its input port. When take_data is false sink will never enter the finished control state.

Interface

<?xml version="1.0"?>
<componentspec>
  <property name="take_data" type="bool" writable="true" default="true"
    description="Selects if data will be taken from the input port. When true, input data is taken and discarded. When false, no
      data is taken from the input port."/>
  <port name="input" producer="false" numberofopcodes="6" defaultbuffersize="16384"/>
</componentspec>

Opcode Handling

No protocol is specified for the sink component. It will take data from its input port regardless of the opcode value.

Properties

  • take_data: Selects if data will be taken from the input port. When true, input data is taken and discarded. When false, no data is taken from the input port.

    • Type: bool

    • Access:

      • Parameter: False

      • Writable: True

      • Initial: False

      • Volatile: False

    • Default value: true

Ports

Inputs:

  • input: Primary input samples port.

    • Protocol: None

    • Optional: False

Outputs:

None.

Implementations

Example Application

<?xml version="1.0"?>
<application done="sink">
  <instance component="ocpi.core.file_read" connect="gain_s_l">
    <property name="filename" value="input.bin"/>
  </instance>
  <instance component="ocpi.comp.sdr.math.gain_s_l" connect="sink">
    <property name="gain" value="2"/>
  </instance>
  <instance component="ocpi.comp.sdr.interface.sink">
    <property name="take_data" value="true"/>
  </instance>
</application>

Dependencies

The dependencies to other elements in OpenCPI are:

  • None

There is also a dependency on:

  • ieee.std_logic_1164

Limitations

Limitations of sink are:

  • Sink has no protocol associated with its input, however its input interface has been configured to be compatible with the timed_sample collection of protocols. Usage with other protocols may result in undefined behaviour.

Testing

Tested platforms: None

Component testing not completed.