Pseudo-random Binary Sequence (PRBS) Synchroniser (prbs_synchroniser_b_c)
Synchronises with a stream of pseudo-random boolean symbols and detects errors compared with the ideal pseudo-random binary sequence (PRBS).
Design
A PRBS is a deterministic sequence that is statistically similar to a truly random sequence. A PRBS synchroniser automatically aligns a local PRBS sequence generator to the same state as an input PRBS sequence. Once aligned the input PRBS sequence can be compared against the ideal, locally generated, PRBS so that differences between the sequences can be identified. Typically a PRBS synchroniser is used to count the errors that have occurred in the input PRBS pattern due to noise and errors in a communications system.
A PRBS is defined by a polynomial that determines the length of the PRBS before it repeats. The polynomial of the PRBS synchroniser should be set to the same polynomial as the PRBS generator that is being used to generate the input sequence.
While synchronised the an internal bits_checked_counter property will increment with each new input sample. Additionally, while synchronised the error_counter property will increment for each input PRBS symbol that does not match the locally generated PRBS symbol. If error_counter exceeds error_threshold errors occur within check_period input samples, the system will assume synchronisation with the input PRBS has been lost and attempt to resynchronise. Each time the system assumes loss of synchronisation the sync_loss_counter property is incremented.
The PRBS synchroniser component can be used in two modes:
Without the output port of the PRBS synchroniser connected. In this mode the four counter properties
bits_checked_counter,error_counter,bits_received_counterandsync_loss_counter, provide the output from the component.An application using the PRBS synchroniser can be run for a set length of time and the counter properties read at the end of execution, or using the OpenCPI Application Control Interface (ACI) the
enableproperty can be modified during runtime to start and stop bit error rate tests as desired; the counter properties can be read during runtime via the ACI.With the output port of the PRBS synchroniser is connected and the status information provided by the output port. This mode is typically use when an understanding of the pattern of bit errors is required i.e. do the errors appear in bursts. The counter properties can still be used in this mode.
Interface
<?xml version="1.0"?>
<componentspec>
<!-- The PRBS bit is the least significant bit. All other bits are 0 -->
<property name="polynomial_taps" type="uchar" arraylength="6" parameter="true" writable="false" default="31,28"
description="Taps of PRBS polynomial."/>
<property name="enable" type="bool" writable="true" default="true" description="When true the PRBS synchroniser is enabled."/>
<property name="invert_input" type="bool" writable="true" default="false"
description="When false the LFSR feedback bit is calculated from an XOR of the register values at each of the
``polynomial_taps``."/>
<property name="check_period" type="ushort" writable="true" default="100"
description="Period over which the component counts errors in order to detect synchronisation loss."/>
<property name="error_threshold" type="ushort" writable="true" default="40"
description="Number of errors that can occur in the check_period before the component registers a loss of synchronisation with
the PRBS."/>
<!-- LINT EXCEPTION: xml_012: 1: Counter does not require default value -->
<property name="bits_checked_counter" type="ulonglong" volatile="true" writable="false"
description="Counts the number of bits that have been checked for errors."/>
<!-- LINT EXCEPTION: xml_012: 1: Counter does not require default value -->
<property name="error_counter" type="ulonglong" volatile="true" writable="false"
description="Counts the number of errors detected."/>
<!-- LINT EXCEPTION: xml_012: 1: Counter does not require default value -->
<property name="bits_received_counter" type="ulonglong" volatile="true" writable="false"
description="Counts the total number of bits received by the component, regardless of synchronisation state."/>
<!-- LINT EXCEPTION: xml_012: 1: Counter does not require default value -->
<property name="sync_loss_counter" type="ulonglong" volatile="true" writable="false"
description="Counts the number of times synchronisation with the PRBS has been lost."/>
<property name="counter_update" type="bool" writable="true" default="true"
description="When true the volatile counter properties will update continuously. Setting low pauses updating the properties so
they can be read via the ACI as a group."/>
<port name="input" producer="false" protocol="bool_timed_sample-prot"/>
<port name="output" producer="true" optional="true" protocol="char_timed_sample-prot"/>
</componentspec>
Ports
Inputs:
input: Primary input samples port.Protocol:
bool_timed_sample-protOptional:
False
Outputs:
output: Primary output samples port. The meaning of the output values is shown in the table below.Protocol:
char_timed_sample-protOptional:
True
Output value |
Meaning |
|---|---|
|
Local PRBS is not synchronised with input PRBS. |
|
Invalid. |
|
Local PRBS is synchronised with input PRBS. Last input bit received matched local PRBS. |
|
Local PRBS is synchronised with input PRBS. Last input bit received did not match the local PRBS. |
|
Local PRBS is checking synchronisation with input PRBS. |
|
Invalid. |
Opcode Handling
The PRBS synchronisation operation is applied on data with sample opcodes only. Input sample opcode message boundaries are preserved on output sample opcode messages.
Discontinuity opcode messages causes the PRBS synchroniser to be reset prior to the opcode being passed to the output.
All other opcodes pass through this component without any effect. When the enable property is set to False messages with the sample opcode are not passed through the component, however all other opcodes are still passed through.
Properties
polynomial_taps: Taps of PRBS polynomial. Is an array of up to six unsigned chars, meaning a maximum of six taps can be specified. If the PRBS polynomial is \(x^7+x^6+1\) thenpolynomial_tapsshould be set to7,6. There is no need to specify the \(x^0\) term as this is implied.Type:
ucharArray dimensions:
['6']
Access:
Parameter:
TrueWritable:
FalseInitial:
FalseVolatile:
False
Default value:
31,28
enable: When true the PRBS synchroniser is enabled. Whenfalsethe value ofbits_checked_counter,error_counter,bits_received_counterandsync_loss_counterare reset to 0.Type:
boolAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
False
Default value:
true
invert_input: When false the LFSR feedback bit is calculated from an XOR of the register values at each of thepolynomial_taps.Type:
boolAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
False
Default value:
false
check_period: Period over which the component counts errors in order to detect synchronisation loss. Should be set longer than any period of expected burst errors. Must not be set to 0.Type:
ushortAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
False
Default value:
100
error_threshold: Number of errors that can occur in the check_period before the component registers a loss of synchronisation with the PRBS.Type:
ushortAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
False
Default value:
40
bits_checked_counter: Counts the number of bits that have been checked for errors. Does not include inputs bits received while the component is not synchronised to the input PRBS.Type:
ulonglongAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
True
Default value:
None
error_counter: Counts the number of errors detected.Type:
ulonglongAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
True
Default value:
None
bits_received_counter: Counts the total number of bits received by the component, regardless of synchronisation state.Type:
ulonglongAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
True
Default value:
None
sync_loss_counter: Counts the number of times synchronisation with the PRBS has been lost.Type:
ulonglongAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
True
Default value:
None
counter_update: When true the volatile counter properties will update continuously. Setting low pauses updating the properties so they can be read via the ACI as a group.Type:
boolAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
False
Default value:
true
The below table gives the polynomials the component is built for.
Polynomial |
|
Period |
|---|---|---|
\(x^7 + x^6 + 1\) |
7, 6 |
127 |
\(x^9 + x^5 + 1\) |
9, 5 |
511 |
\(x^{11} + x^9 + 1\) |
11, 9 |
2,047 |
\(x^{15} + x^{14} + 1\) |
15, 14 |
32,767 |
\(x^{16} + x^{14} + x^{13} + x^{11} + 1\) |
16, 14, 13, 11 |
65,535 |
\(x^{17} + x^{14} + 1\) |
17, 14 |
131,071 |
\(x^{20} + x^3 + 1\) |
20, 3 |
1,948,575 |
\(x^{23} + x^{18} + 1\) |
23, 18 |
8,388,607 |
\(x^{29} + x^{27} + 1\) |
29, 27 |
536,870,911 |
\(x^{31} + x^{28} + 1\) |
31, 28 |
2,147,483,647 |
Implementations
prbs_synchroniser_b_c(HDL)
Example Application
<?xml version="1.0"?>
<application done="file_write">
<instance component="ocpi.core.file_read" connect="prbs_synchroniser_b_c">
<property name="filename" value="input.bin"/>
</instance>
<instance component="ocpi.comp.sdr.communication.prbs_synchroniser_b_c" connect="file_write">
<property name="polynomial_taps" value="31,28"/>
<property name="error_threshold" value="40"/>
<property name="check_period" 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
Limitations
Limitations of prbs_synchroniser_b_c are:
A maximum of 6 taps can be specified i.e. \(x^a + x^b + x^c + x^d +x^e + x^f + 1\).
The
check_periodproperty must not be set to 0.
Testing
Tested platforms: None
Component testing not completed.