Constant generator (constant_l)
Constant generator.
Design
Generates a constant stream of samples whose values are set by the value property.
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="value" type="long" writable="true" default="0" description="Output 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="long_timed_sample-prot"/>
</componentspec>
Ports
Inputs:
None.
Outputs:
output: Primary output samples port.Protocol:
long_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
value: Output value.Type:
longAccess:
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
Parameters
Example application
<?xml version="1.0"?>
<application done="file_write">
<instance component="ocpi.comp.sdr.generator.constant_l" connect="file_write">
<property name="enable" value="true"/>
<property name="message_size" value="512"/>
<property name="discontinuity_on_value_change" value="true"/>
<property name="value" value="100"/>
</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_l are:
Setting
message_lengthto 0 or greater than theocpi_max_bytes_output/sample_size_byteswill result in undefined behaviour.
Testing
Component testing not completed.