Maximum Calculator (max_calculator_xs)
Streams incoming I/Q data from the input port to the output port and makes the maximum I and maximum Q values available for reading via properties.
Design
I/Q data is continuously read from the input port and written to the output port.
All I/Q values in the input data are compared against maximum I/Q values stored in properties within the worker. If the I/Q values in the input exceed the current I/Q maximum values then the maximum values are updated with the new input values. The flags indicating the maximum value is valid are set true if a sample has been received since the last reset.
When the maximum I/Q value is read from the component, it sets the property to the minimum value that can be represented by a signed 16 bit integer, -32768, and the associated valid property is set to false to indicate no maximum value exists.
Interface
<?xml version="1.0"?>
<componentspec>
<!-- The max_i_is_valid/max_q_is_valid properties are *intentionally* placed
above max_i/max_q in this XML file to ensure that they are read before
the reset behavior caused by max_i/max_q property reads. -->
<property name="max_i_is_valid" type="bool" volatile="true" description="Indicates ``max_i`` is valid."/>
<property name="max_q_is_valid" type="bool" volatile="true" description="Indicates ``max_q`` is valid."/>
<property name="max_i" type="short" volatile="true" description="Maximum I value observed on input port since last read."/>
<property name="max_q" type="short" volatile="true" description="Maximum Q value observed on input port since last read."/>
<port name="input" producer="false" protocol="complex_short_timed_sample-prot"/>
<port name="output" producer="true" protocol="complex_short_timed_sample-prot"/>
</componentspec>
Opcode Handling
All opcodes are passed through this component without modification.
Properties
max_i_is_valid: Indicatesmax_iis valid.Type:
boolAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
True
Default value:
None
max_q_is_valid: Indicatesmax_qis valid.Type:
boolAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
True
Default value:
None
max_i: Maximum I value observed on input port since last read.Type:
shortAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
True
Default value:
None
max_q: Maximum Q value observed on input port since last read.Type:
shortAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
True
Default value:
None
Reading the max_i or max_q property will reset the value to the initial value of -32768 and clear the corresponding max_i_is_valid or max_q_is_valid property.
Ports
Inputs:
input: Primary input samples port.Protocol:
complex_short_timed_sample-protOptional:
False
Outputs:
output: Primary output samples port.Protocol:
complex_short_timed_sample-protOptional:
False
Implementations
Example Application
</application>
<application done="file_write">
<instance component="ocpi.core.file_read" connect="max_calculator_xs">
<property name="filename" value="input.bin"/>
</instance>
<instance component="ocpi.comp.sdr.instrument.max_calculator_xs" connect="file_write">
</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
Limitations
Limitations of max_calculator_xs are:
None
Testing
Tested platforms: None
Component testing not completed.