Constant Generator (constant_xs)
Constant generator.
Design
Generates a constant stream of samples whose values are set by the real_value and imaginary_value properties.
The component can be enabled or disabled during run time. When enabled values are produced whenever the output is ready. When the component is disabled no output values are generated.
The generated output values are settable during run time. There is an option to output a discontinuity message after a change in output value.
The size of the generated stream messages can be set during run time and must be between 1 and ocpi_max_bytes_output/sample_size_bytes.
Interface
<?xml version="1.0"?>
<componentspec>
<property name="enable" type="bool" writable="true" default="true" description="Enables / disables the output."/>
<property name="message_length" type="ushort" writable="false" initial="true" default="512"
description="Output message length. Must not be 0."/>
<property name="real_value" type="short" writable="true" default="0" description="Output real value."/>
<property name="imaginary_value" type="short" writable="true" default="0" description="Output imaginary value."/>
<property name="discontinuity_on_value_change" type="bool" writable="true" default="false"
description="Sets if a discontinuity opcode is generated when the value property is changed."/>
<port name="output" producer="true" protocol="complex_short_timed_sample-prot"/>
</componentspec>
Ports
Inputs:
None.
Outputs:
output: Primary output samples port.Protocol:
complex_short_timed_sample-protOptional:
False
Opcode Handling
Will generate messages with sample opcode. Discontinuity opcode messages will only be generated if discontinuity_on_value_change is set.
Properties
enable: Enables / disables the output.Type:
boolAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
False
Default value:
true
message_length: Output message length. Must not be 0.Type:
ushortAccess:
Parameter:
FalseWritable:
FalseInitial:
TrueVolatile:
False
Default value:
512
real_value: Output real value.Type:
shortAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
False
Default value:
0
imaginary_value: Output imaginary value.Type:
shortAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
False
Default value:
0
discontinuity_on_value_change: Sets if a discontinuity opcode is generated when the value property is changed.Type:
boolAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
False
Default value:
false
Implementations
Example Application
<?xml version="1.0"?>
<application done="file_write">
<instance component="ocpi.comp.sdr.generator.constant_xs" connect="file_write">
<property name="enable" value="true"/>
<property name="message_size" value="512"/>
<property name="discontinuity_on_value_change" value="true"/>
<property name="real_value" value="100"/>
<property name="imaginary_value" value="-200"/>
</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
Limitations of constant_xs are:
Setting
message_lengthto 0 or greater thanocpi_max_bytes_output/sample_size_bytesresults in unsupported behaviour.
Testing
Tested platforms: None
Component testing not completed.