NR HDL MIB Recovery for FR2
This example shows how to design a 5G NR master information block (MIB) recovery model that is optimized for HDL code generation and hardware implementation and that supports frequency range 1 (FR1) and frequency range 2 (FR2).
Introduction
5G cell towers can operate in either FR1 or FR2 frequency bands. FR1 covers frequencies up to 6 GHz, and FR2 covers frequencies above 6 GHz, including the millimeter wave band. This example introduces functionality that is required to support FR2 and the process of upgrading an existing FR1 design.
The Simulink® models described in this example are fixed-point HDL-optimized implementations of MIB recovery for 5G NR FR1 and FR2. This example is one of a related set, for more information see NR HDL Reference Applications Overview.
File Structure
This example uses these files.
Simulink Models
nrhdlMIBRecovery.slx
: This Simulink model combines the processing of the SSB detector and the SSB decoder into an integrated model that shows the complete MIB recovery process.nrhdlSSBDecodingCore.slx
: This model implements the SSB decoding algorithm.nrhdlSSBDetectionCore.slx
: This model implements the SSB detection algorithm.nrhdlDDCCore.slx
: This model implements a DDC to create sample streams for SIB1 and SSBs.nrhdlPolarDecodingChainCore.slx
: This model implements the common polar decoding chain.
Simulink Data Dictionary
nrhdlReceiverData.sldd
: This Simulink data dictionary contains bus objects that define the buses contained in the example models.
MATLAB Code
runMIBRecoveryModelFR2.m
: This script runs and verifies thenrhdlMIBRecovery
model with an FR2 waveform.nrhdlexamples
: This package contains the MATLAB reference code and utility functions for verifying the implementation models.
SSB Detection
This section describes the changes to the DDC and SSB detection algorithms in the NR HDL Cell Search example that are required to support FR2. It details the algorithmic requirements across the MATLAB reference and Simulink implementation, and describes the optimizations made for HDL code generation.
The SSB detection algorithm performs search and demodulation with a given subcarrier spacing (SCS). The SCS options are 15 kHz or 30 kHz for FR1 and 120 kHz or 240 kHz for FR2. To add FR2 functionality, the new SCS options must be supported. The detector searches for SSBs by downsampling the received signal to one of the rates shown in the table according to the SCS. The signal is then cross-correlated with the PSS sequences.
SCS (kHz) Sample Rate (MHz) _________ _________________ 15 3.84 30 7.68 120 30.72 240 61.44
To accommodate the increased bandwidth of the SSBs in FR2, an input sampling rate of 122.88 Msps is used (compared to 61.44 Msps for the FR1 design). This change is implemented in the nrhdlDDCCore
model. The SSB stage creates the SSB outputs using a single halfband to implement the filter and downsample from the 122.88 Msps input rate to the 61.44 Msps rate of the maximum 240 KHz SCS. The SIB1 stage and outputs are not currently used in the FR2 models. The nrhdlSSBDetectionCore
has an expected input rate of 61.44 Msps. The timing reference units are unchanged and still measured in samples at 61.44 Msps. The timing reference counters increment in steps of 16, 8, 2, and 1 for SCS of 15, 30, 120, and 240 kHz, respectively. The ssbData output from the nrhdlDDCCore
model is the input to the SCS selection
subsystem inside nrhdlSSBDetection
. This subsystem creates the data streams for each SCS option by successively downsampling the data with halfband filters. All four streams are aligned, enabling the timing reference to be maintained when switching between different subcarrier spacings. The overall signal processing chain implemented in the nrhdlDDCCore
and nrhdlSSBDetectionCore
is shown.
The selected SCS data stream is correlated against each of the three PSS sequences to detect SSBs. The FPGA implementation of these correlators in the time domain uses 576 DSPs, which is four times more than the version that supports only FR1. This change in resources is because the sampling rates reduce the amount of resource sharing that can be achieved in the filters. A frequency domain overlap-add method is used to minimize the DSP usage at the expense of an increase in latency. This figure shows the overlap-add correlation in the nrhdlSSBDetectionCore
model. The subsystem computes the four stages of the overlap-add method: FFT, multiplication by the three sets of frequency domain coefficients (one for each PSS), IFFT, and overlap and add of subsequent windows. This implementation uses one FFT, three complex multipiers, and three IFFTs, requiring 48 DSP blocks in total.
SSB Decoding
This section describes the updates required to add FR2 support to the SSB decoding algorithm. For a complete description of the FR1 model, see the NR HDL MIB Recovery example. The example details the algorithmic requirements across the MATLAB reference and Simulink implementation.
The SSB decoding algorithm decodes the broadcast channel (BCH) contained in the SSB. The decoding process outputs the MIB and the beam index of the detected SSB. In FR1, the maximum number of SSBs that can be independently beamformed is 8. FR2 supports transmitting 64 SSBs, each on their own beam. The contents of the BCH vary between FR1 and FR2 to accommodate the different maximum beam counts.
The nrhdlexamples.ssbDecode
function and nrhdlSSBDecodingCore
model accept Lmax
as an input. Lmax
is the maximum number of beams that can be transmitted by a cell tower, and its value depends on the carrier frequency. Valid settings for Lmax
are 4 or 8 for FR1 and 64 for FR2. Lmax
affects the descrambling in the BCH processing subsystem and how the final BCH payload is parsed.
MIB Recovery Simulation
Use the runMIBRecoveryModelFR2
script to run an FR2 MIB recovery simulation and to verify the results. The script displays its progress in the MATLAB Command Window. The simulation uses the nrhdlMIBRecovery
model, which combines the FR2 versions of the SSB detection and SSB decoding designs to create a full MIB Recovery system for FR2. The input stimulus for the simulation is an FR2 waveform containing an SS burst with these settings.
The SSB pattern is case D.
The subcarrier spacing is 120 kHz.
NCellID is 249.
The active SSBs are transmitted on SSB indices 24:31.
This script generates a plot that shows the resource grid of the burst waveform. The color of each resource element indicates its amplitude. The plot shows the eight transmitted SSBs. The SSBs are generated with different power levels to model what a UE typically receives.
The simulation searches for SSBs in the waveform by using the MATLAB reference. This table shows the SSBs detected during the search and their parameters. The SSB with the strongest PSS correlation is selected for demodulation and decoding to test the nrhdlMIBRecovery
model. The subcarrier spacing, PSS sequence, timing offset, and frequency offset estimate are passed into the model to specify which SSB to demodulate and decode. The table shows the final results of the decoding process. It includes the simulation and MATLAB reference results for comparison.
runMIBRecoveryModelFR2;
Searching for SSBs using the MATLAB reference. SSBs found by MATLAB reference: NCellID2 timingOffset pssCorrelation pssEnergy frequencyOffset ________ ____________ ______________ _________ _______________ 0 1.0918e+05 0.42856 0.9903 51134 0 1.1137e+05 0.76446 1.6985 49836 0 1.1576e+05 0.27392 0.66928 48771 0 1.1795e+05 4.138 7.8159 49815 0 1.2456e+05 0.58574 1.249 51829 0 1.2675e+05 1.2834 2.7073 49390 0 1.3113e+05 0.18099 0.49988 48119 0 1.3332e+05 0.59469 1.2165 47641 Demodulating the strongest SSBs using the MATLAB reference. Decoding the SSB using the MATLAB reference. Successfully decoded SSB with MATLAB reference Demodulating the strongest SSBs using Simulink model. Running nrhdlMIBRecovery.slx ### Starting serial model reference simulation build ### Model reference simulation target for nrhdlDDCCore is up to date. ### Model reference simulation target for nrhdlPolarDecodingChainCore is up to date. ### Model reference simulation target for nrhdlSSBDecodingCore is up to date. ### Model reference simulation target for nrhdlSSBDetectionCore is up to date. Build Summary 0 of 4 models built (4 models already up to date) Build duration: 0h 0m 0.81048s .......... Successfully decoded SSB with Simulink model MATLAB decoded information pbchPayload: 218103955 ssbIndex: 27 hrf: 0 err: 0 mib: [1×1 struct] Simulink decoded information pbchPayload: 218103955 ssbIndex: 27 hrf: 0 err: 0 mib: [1×1 struct] MATLAB decoded MIB parameters NFrame: 105 SubcarrierSpacingCommon: 120 k_SSB: 0 DMRSTypeAPosition: 2 PDCCHConfigSIB1: 0 CellBarred: 0 IntraFreqReselection: 0 Simulink decoded MIB parameters NFrame: 105 SubcarrierSpacingCommon: 120 k_SSB: 0 DMRSTypeAPosition: 2 PDCCHConfigSIB1: 0 CellBarred: 0 IntraFreqReselection: 0
HDL Code Generation and Implementation Results
To generate the HDL code for this example, you must have the HDL Coder™ product. Use the makehdl
and makehdltb
commands to generate HDL code and an HDL test bench for the nrhdlMIBRecovery/MIB Recovery subsystem. The resulting HDL code is synthesized for a Xilinx® Zynq®-7000 ZC706 evaluation board. This table shows the post place and route resource utilization results for the combined MIB Recovery model. The design meets timing with a clock frequency of 200 MHz.
Resource Usage _______________ _____ Slice Registers 62415 Slice LUTs 43381 RAMB18 44 RAMB36 10 DSP48 215