Binary Data Flow Gate (packet_gate_b)
- Passes input binary samples to output port when metadata detected on ‘input_start’ port and discards input samples when metadata detected on ‘input_close’ port.
metadata_id = 0 metadata_value = 0
Design
The `packet_gate_b` component has two input ports and one output port. It is designed to pass through binary data received on the ‘input_open’ port to the output port once a metadata opcode is detected on the ‘input_open’ port. Until a metadata message is received on this port, all incoming binary data is discarded. If the gate is in an open state, samples will continue to flow until a metadata message is received on the ‘input_close’ port. All data samples and opcode messages received on the ‘input_close’ port are discarded. Once a metadata message is received on this port, all data samples received on the ‘input_open’ port are discarded, however, all opcode messages except metada are allowed to pass.
A block diagram representation of the component function is given in metadata_gate_b-diagram.
Figure 224: Packet Gate Component Usage.
Interface
<?xml version="1.0"?>
<componentspec>
<property name='gate_open' type='bool' default='false' writable='true'/>
<port name="input_open" producer="false" protocol="bool_timed_sample-prot"/>
<port name="input_close" producer="false" optional="true" protocol="bool_timed_sample-prot"/>
<port name="output" producer="true" protocol="bool_timed_sample-prot"/>
</componentspec>
Opcode Handling
All opcodes except ‘metadata’ are passed from input_open port to output when they are received. Opcodes received on the input_close port are discarded.
Properties
gate_openType:
boolAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
False
Default value:
false
Ports
Inputs:
input_open: Primary input samples port and header detect.Protocol:
bool_timed_sample-protOptional:
False
input_close: Tail detect.Protocol:
bool_timed_sample-protOptional:
True
Outputs:
output: Primary output samples port.Protocol:
bool_timed_sample-protOptional:
False
Implementations
Example Application
<?xml version="1.0"?>
<application done="file_write">
<instance component="ocpi.core.file_read" connect="splitter_b">
<property name="filename" value="input.bin"/>
</instance>
<instance component="ocpi.comp.sdr.interface.splitter"/>
<instance component="ocpi.comp.sdr.communication.pattern_detector_b"
name="start_pattern" connect="packet_gate_b" from="output" to="input_open">
<property name="pattern" value="0x55555555faceface"/>
<property name="bitmask" value="0x7fffffffffffffff"/>
</instance>
<instance component="ocpi.comp.sdr.communication.pattern_detector_b"
name="stop_pattern" connect="packet_gate_b" from="output"
to="input_close">
<property name="pattern" value="0x5efacefa55555555"/>
<property name="bitmask" value="0x7fffffffffffffff"/>
</instance>
<connection>
<port instance="splitter" name="output_1"/>
<port instance="start_pattern" name="input"/>
</connection>
<connection>
<port instance="splitter" name="output_2"/>
<port instance="stop_pattern" name="input"/>
</connection>
<instance component="ocpi.comp.sdr.communication.packet_gate_b" connect="file_write"/>
<instance component="ocpi.core.file_write">
<property name="filename" value="output.bin"/>
</instance>
</application>
Dependencies
The dependencies to other elements in OpenCPI are:
None
Limitations
Limitations of metadata_gate_b are:
Must be used with components that generate metadata opcodes to trigger an ‘open’ or ‘close’ gate event. For example, pattern_detector_b.
Testing
Tested platforms: None