nr hdl mib recovery -凯发k8网页登录
this example shows how to design a 5g nr synchronization signal block (ssb) decoding and master information block (mib) recovery model optimized for hdl code generation and hardware implementation.
introduction
the simulink® models described in this example are fixed-point hdl optimized implementations of ssb decoding and mib recovery for 5g nr frequency range 1 (fr1). this example is one of a related set, for more information see .
mib recovery requires ssb detection, demodulation, and decoding. this example focuses on ssb decoding. ssb detection and demodulation are described in the nr hdl cell search example. this example introduces the ssb decoding simulink model and uses the matlab reference to generate test input and verify the behavior of the model. then, the example describes a simulink model that combines ssb detection, demodulation, and decoding to recover mib from a baseband waveform.
after an ssb has been detected and demodulated, it needs to be decoded to extract the mib contents. ssb decoding requires demodulation reference signal (dmrs) search, channel estimation and phase equalization, and broadcast channel (bch) decoding steps as shown in the figure below.
file structure
this example uses these files.
simulink models
nrhdlssbdecoding.slx
: this simulink model simulates the behavior of the ssb decoding step of the mib recovery process.nrhdlmibrecovery.slx
: this simulink model combines the processing of the ssb detector and the ssb decoder into an integrated model illustrating the complete mib recovery process.nrhdlssbdecodingcore.slx
: this model implements the ssb decoding algorithm.nrhdlpolardecodingchaincore.slx
: this model implements the common polar decoding chain.nrhdlssbdetectionfr1core.slx
: this model implements the ssb detection algorithm.nrhdlddcfr1core.slx
: this model implements a ddc to create sample streams for sib1 and ssbs.
simulink data dictionary
nrhdlreceiverdata.sldd
: this simulink data dictionary contains bus objects that define the buses contained in the example models.
matlab code
runssbdecodingmodel.m
: this script uses the matlab reference to implement the cell search algorithm, then runs thenrhdlssbdecoding
simulink model. the script verifies the operation of the model using 5g toolbox and the matlab reference code.runmibrecoverymodel.m
: this script uses the matlab reference to perform the search mode of the ssb detection algorithm, then runs thenrhdlmibrecovery
simulink model. the script verifies the operation of the model using 5g toolbox and the matlab reference code.nrhdlexamples
: package containing the matlab reference code and utility functions for verifying the implementation models.
nr hdl ssb decoding
this figure shows the nrhdlssbdecoding
model. the top level of the model reads the signals from the matlab base workspace, passes them to the ssb decoding subsystem, and writes the outputs back to the workspace. the parsemib subsystem takes the pbchpayload and interprets the bit fields to produce the mib parameter outputs.
ssb decoding subsystem
the ssb decoding
subsystem references the nrhdlssbdecodingcore
and nrhdlpolardecodingchaincore
models. the subsystem performs dmrs search, channel estimation and equalization, qpsk symbol demodulation, descrambling, rate recovery, polar decoding, and crc decoding. this processing is split over two models to allow for the nrhdlpolardecodingchaincore
to be shared between the ssb decoding and sib1 coreset0 decoding in the example. this section describes the inputs and outputs of that model.
inputs
startprocessing: 1-bit control signal which indicates when all data has been written and that cellid and lmax are valid.
cellid: 10-bit unsigned number which provides cell id number for the detected ssb.
lmax: 2-bit unsigned number which indicates the maximum number of ssbs in a burst. a value of 0 indicates 4 ssbs and a value of 1 indicates 8 ssbs.
data: 16-bit signed complex-valued signal carrying the 4 ofdm symbols of the ssb.
datavalid: 1-bit control signal to validate data.
reset: 1-bit control signal to reset the processing.
outputs
pbchstatus: 2-bit unsigned value indicating the progress of the pbch decoding operation. see below for more information on the possible values of this signal.
bchstatus: 3-bit unsigned value indicating the progress of the bch decoding operation. see below for more information on the possible values of this signal.
ssbindex3lsb: 3-bit unsigned value that is the 3 least significant bits of the ssb index calculated by the dmrs search process and lmax.
pbchpayload: 32-bit unsigned value that contains the mib and additional pbch timing data.
validout: 1-bit control signal to validate ssbindex3lsb and pbchpayload.
nextssb: 1-bit control signal to indicate when the core can begin processing the next ssb. can be used to pace inputs for back-to-back ssb decodes.
pbch status signal states
0
: idle1
: reading in data for ssb grid2
: performing dmrs search3
: performing pbch symbol demodulation
bch status signal states
0
: idle1
: performing rate recovery2
: performing polar decoding3
: crc error (end state)4
: crc pass, mib detected (end state)
ssb decoding model
this diagram shows the top level of the nrhdlssbdecodingcore
model. the input data is 4 ofdm symbols containing the synchronization signal block (ssb), with the values scaled within the range /-1. the model starts processing when all of the ssb data has been input to the model and startprocessing is asserted. the startprocessing signal also indicates that the ncellid and lmax inputs are valid.
the ssb buffer dmrs search
subsystem performs the dmrs search. incoming data is stored in a ram buffer where it is held until startprocessing is asserted, indicating that all required information is available to start the dmrs search process. the dmrs search reads the dmrs symbols from the ram and correlates with the 8 possible dmrs sequences, selecting the strongest correlation value to determine ibar_ssb. once the dmrs search has been completed ibar_ssb is used to generate the reference dmrs required for channel estimation. the reference dmrs is output from the model along with the received pbch symbols and associated dmrs. this is used to drive the nrhdlpolardecodingchaincore
model.
the extract payload subsystem performs descrambling and deinterleaving of the payload bits returned from the nrhdlpolardecodingchaincore
model.
polar decoding chain model
the nrhdlpolardecodingchain
model performs channel estimation and equalization, qpsk symbol demodulation, descrambling, rate recovery, and polar and crc decoding. this signal processing chain is common for the decoding of both the bch and downlink control information (dci).
the channel est equalize
subsystem performs channel estimation using the received data and the reference dmrs. the channel estimate applies linear interpolation between dmrs locations within an ofdm symbol, but does not average across time in case of any residual carrier frequency offset. phase equalization of the qpsk symbols is then performed, followed by qpsk demodulation and descrambling, using the descrambling shift index and ncellid inputs to seed the scrambler. subsequent processing performs rate recovery, polar decoding, and crc decoding of the descrambled data. the polar rate recover
subsystem includes signal scaling and wordlength reduction to prepare the data for polar decoding. the scaled, rate-recovered soft bits are then passed to the nr polar decoder block, which also performs crc decoding. the err output port from the nr polar decoder block indicates if decoding was successful or encountered any errors.
ssb decoding simulation setup
the block diagram shows the simulation setup implemented by this example. 5g toolbox™ functions are used to generate a test waveform. matlab reference code for the ssb detector is then used to search for and demodulate the strongest ssb within the waveform. this result provides test input for the ssb decoding stage. the test data is passed to both matlab and simulink implementations, and the outputs are compared to verify the operation of the simulink model.
the test bench options
section of the runssbdecodingmodel
script includes these variables to configure the simulation:
simulationcase: specifies the configuration of the generated waveform. the table shows the set of simulation cases.
simulation case ssb pattern subcarrier spacing common pdcch config sib1 snr db strongest ssb index lmax _______________ ___________ _________________________ _________________ ______ ___________________ ____ "simcase 1" "case c" 30 164 50 4 8 "simcase 2" "case b" 15 100 6 3 4 "simcase 3" "case a" 30 4 20 2 8 "simcase 4" "case a" 15 84 7 0 4
numsubframes: specifies the number of 1 ms subframes generated as input stimulus.
ssb decoding simulation
use the runssbdecodingmodel
script to run an ssb decoding simulation. the script displays its progress at the matlab command prompt. the final results of decoding the ssb in matlab and simulink are displayed, showing that they match exactly. plots of the dmrs search correlation strength and the equalized pbch qpsk symbols show that the signals from matlab and simulink match closely.
runssbdecodingmodel;
generating test waveform. selected simulation case: simulation case ssb pattern subcarrier spacing common pdcch config sib1 snr db strongest ssb index lmax _______________ ___________ _________________________ _________________ ______ ___________________ ____ "simcase 1" "case c" 30 164 50 4 8 searching for ssbs using the matlab reference. demodulating the strongest ssb using the matlab reference. decoding the ssb using the matlab reference. mib successfully decoded by matlab reference decoding the ssb using the simulink model. running nrhdlssbdecoding.slx ### starting serial model reference simulation build. ### successfully updated the model reference simulation target for: nrhdlpolardecodingchaincore ### successfully updated the model reference simulation target for: nrhdlssbdecodingcore build summary simulation targets built: model action rebuild reason =================================================================================================================== nrhdlpolardecodingchaincore code generated and compiled. nrhdlpolardecodingchaincore_msf.mexa64 does not exist. nrhdlssbdecodingcore code generated and compiled. nrhdlssbdecodingcore_msf.mexa64 does not exist. 2 of 2 models built (0 models already up to date) build duration: 0h 2m 8.5501s .......... mib successfully decoded by simulink model matlab decoded information pbchpayload: 17637376 ssbindex: 4 hrf: 0 err: 0 mib: [1×1 struct] simulink decoded information pbchpayload: 17637376 ssbindex: 4 hrf: 0 err: 0 mib: [1×1 struct] matlab decoded mib parameters nframe: 0 subcarrierspacingcommon: 30 k_ssb: 0 dmrstypeaposition: 3 pdcchconfigsib1: 164 cellbarred: 0 intrafreqreselection: 0 simulink decoded mib parameters nframe: 0 subcarrierspacingcommon: 30 k_ssb: 0 dmrstypeaposition: 3 pdcchconfigsib1: 164 cellbarred: 0 intrafreqreselection: 0
mib recovery model
the nrhdlmibrecovery
model connects the for ssb decoding and ssb detection models to create a complete mib recovery implementation. this model can be used to recover mib from baseband 5g waveforms.
the status signal from the detector is used to start the ssb decoder when it has reached state 8, indicating that demodulation is complete, sss has been found, and the demodulated grid has been output. when the ssb decoder has the demodulated grid and received the startprocessing signal it will decode the ssb, outputting the pbch payload which is then parsed to extract the mib data.
mib recovery operations
the design operates in one of two modes - search or demodulation. a full mib recovery consists of one or more searches followed by a demodulation operation. the mib recovery operations extend the cell search operations in the nr hdl cell search example.
1. search mode
the search mode behavior is unchanged from the cell search design. the ssb detector searches for ssbs at the specified subcarrier spacing and frequency offset by correlating against each pss sequence. the operation outputs a list of the detected ssbs, defined by a timing offset and pss sequence id.
2. demodulation mode
the demodulation mode operation is extended from the cell search design by including the ssb decoder. the demodulated ssb grid from the ssb detector is decoded by the ssb decoder. in single demodulation mode, one ssb is demodulated and decoded to return a single mib result. in repeat demodulation mode, the ssb grid is decoded after each demodulation to return mib results for each repetition.
mib recovery simulation
use the runmibrecoverymodel
script to run this model and compare against the matlab reference.
the test bench options
section of the runmibrecoverymodel
script includes these variables to configure the simulation:
simulationcase: specifies the configuration of the generated waveform.
numsubframes: specifies the number of 1 ms subframes generated as input stimulus.
searchinsimulink: specifies whether to run the search step in matlab (false) or simulink (true). performing the search in matlab reduces the simulation time and is sufficient for verifying the demodulation and decoding operations. performing the search in simulink allows you to verify the
nrhdlmibrecovery
model in search mode.repeatdemoden: specifies single or repeat demodulation mode.
hdl code generation and implementation results
to generate the hdl code for this example, you must have an hdl coder™ license. use the makehdl
and makehdltb
commands to generate hdl code and an hdl test bench for nrhdlssbdecoding/ssb decoding
or nrhdlmibrecovery/mib recovery
subsystems. the resulting hdl code was synthesized for a xilinx® zynq®-7000 zc706 evaluation board. the table shows the post place and route resource utilization results. the design meets timing with a clock frequency of 150 mhz.
resource utilization for nrhdlssbdecoding model:
resource usage _______________ _____ slice registers 9113 slice luts 11619 ramb18 8 ramb36 5 dsp48 37
resource utilization for nrhdlmibrecovery model:
resource usage _______________ _____ slice registers 43828 slice luts 32272 ramb18 20 ramb36 5 dsp48 246
to deploy the nrhdlmibrecovery
model to a hardware platform and recover mib from off the air signals, see the deploy nr hdl reference applications on fpgas and socs example.