GPS HDL Reference Applications Overview
Wireless HDL Toolbox™ contains examples that implement global positioning system (GPS) receiver algorithms in Simulink®. The following are the list of available examples:
GPS HDL Acquisition and Tracking Using C/A Code: This example performs acquisition and tracking on a GPS baseband waveform. Acquisition computes the coarse estimates of Doppler frequency offset and C/A code phase offset. It also detects the pseudo random noise IDs (PRNIDs) of satellites that are present in the GPS waveform. Tracking fine-tunes the estimates and corrects them to recover the legacy navigation (LNAV) symbols.
GPS HDL Data Decode: This example performs bit synchronization, frame synchronization, and data decoding on the LNAV symbols. You can use the GPS HDL Acquisition and Tracking Using C/A Code example to extract the LNAV symbols. The extracted LNAV symbols are decoded to obtain GPS navigation message and then extract GPS parameters from the navigation message.
Construct GPS Receiver Model
You can integrate the GPS HDL Acquisition and Tracking Using C/A Code and GPS HDL Data Decode examples and generate the HDL code. The following section provides the steps on how to integrate the Simulink models in these examples and generate the HDL code for the integrated model.
Copy Files
Open the GPS HDL Acquisition and Tracking Using C/A Code example and click Open Script to open its example folder.
Copy the files from this example folder to a new folder and name it as
GPS HDL Receiver
.Open the GPS HDL Data Decode example and click Open Script to open its example folder.
Copy the files from this example folder to the
GPS HDL Receiver
folder.
Now, the GPS HDL Receiver
folder contains all the files related
to GPS HDL Acquisition and Tracking Using C/A Code and GPS HDL Data Decode examples.
Create GPS HDL Receiver Model
In Simulink, open a new model and save it as
gpshdlReceiver.slx
in theGPS HDL Receiver
folder.Open the
gpshdlAcquisitionTracking
model in theGPS HDL Receiver
folder.Except the
Diagnostic Decoder
subsystem, copy theInput Configuration
andAcquisition and Tracking
subsystems along with the connecting input blocks to thegpshdlReceiver
model.Open the
gpshdlDataDecode
model in theGPS HDL Receiver
folder.Except the input blocks to the
Data Decode
subsystem, copy theData Decode
andPrepare Outputs
subsystems till the To Workspace blocks to thegpshdlReceiver
model.Close the
gpshdlAcquisitionTracking
andgpshdlDataDecode
models.Connect the lnavSym and valid output ports of the
Acquisition and Tracking
subsystem to the lnavSym and valid input ports of theData Decode
subsystem.Connect each of the PRNID, coarseDopplerOffset, and fineDopplerOffset output ports of the
Acquisition and Tracking
subsystem to a Terminator block.Connect the coarseCodePhOffset and fineCodePhOffset output ports of the
Acquisition and Tracking
subsystem to an Add block with +- signs to compute the code phase offset.Connect the Add block output to a To Workspace block with a variable name
codePhOffset
.Connect the input reset signal of the
Acquisition and Tracking
subsystem to an Upsample block and set the Upsample factor, L parameter toparam.modelUpSampFac
.Add a Constant block and set the Constant value parameter to
false(numSatDataDecode,1)
.Connect the Constant block output and the Upsample block output to a Logical Operator block with OR logic.
Connect the Logical Operator block output to the reset input port of the
Data Decode
subsystem and also to the Delay block, which is connected to the reset input port ofPrepare Outputs
subsystem.Run this command in the MATLAB command prompt to avoid storing all the simulation outputs into a single variable and also ignore precision loss of parameters in the model:
set_param('gpshdlReceiver','ReturnWorkspaceOutputs','off','ParameterPrecisionLossMsg','off')
This is how your model looks after you complete the above steps successfully.
Initialize GPS HDL Receiver Model
Open and run the
gpshdlDataDecodeInit
script and then run thegpshdlAcquisitionAndTrackingUsingCACodeInit
script from theGPS HDL Receiver
folder.In the
gpshdlReceiver
model, set the Stop Time parameter tostopTime
.In the SIMULATION > SIMULATE tab, change the simulation mode from
Normal
toAccelerator
.Select the area in the
gpshdlReceiver
model, shown with the shaded region in the figure, right-click and select Create Subsystem. Name the subsystem asHDL DUT
.Run the
hdlsetup('gpshdlReceiver')
command in the MATLAB command prompt to setup the model for HDL code generation.
Because the Acquisition and Tracking
subsystem runs at a high
sample rate of 196.608 Msps and the Data Decode
subsystem runs at
a very low sample rate of 50 samples-per-second, the model takes long time to
simulate. So, it is suggested to use this model only for HDL code generation.
To generate HDL code and HDL test bench for the gpshdlReceiver
model, use makehdl
and makehdltb
functions
with the HDL DUT
subsystem. This table shows the post place and
route resource utilization when synthesized for a Xilinx®
Zynq®- 7000 ZC706 evaluation board. The
maximum frequency of operation is 204.12 MHz.
Resources | Usage |
---|---|
Slice LUT | 80,643 |
Slice Registers | 101,230 |
DSP48 | 257 |
RAMB36 | 160 |
RAMB18 | 50 |