Main Content

Multicore Simulation of Test Signals for a Radar Receiver

This example simulates a monostatic radar system. It uses dataflow domain in Simulink® to automatically partition the data-driven portions of the radar system into multiple threads and thereby improving the performance of the simulation by executing it on your desktop's multiple cores.

Introduction

The dataflow execution domain allows you to make use of multiple cores in the simulation of computationally intensive systems. This example shows how dataflow as the execution domain of a subsystem improves simulation performance of the model. To learn more about dataflow and how to run Simulink models using multiple threads, seeMulticore Execution using Dataflow Domain.

Monostatic Radar with One Target

This example simulates a simple end-to-end monostatic radar. Rectangular pulses are amplified by the transmitter block then propagated to and from a target in free-space. Noise and amplification are then applied in the receiver preamp block to the return signal, followed by a matched filter. Range losses are compensated for and the pulses are noncoherently integrated.

Setting up the Dataflow Subsystem

This example uses dataflow domain in Simulink to make use of multiple cores on your desktop to improve simulation performance. TheDomainparameter of the dataflow subsystem in this model is set asDataflow. You can view this by selecting the subsystem and then accessing Property Inspector. To access Property Inspector, in the Simulink Toolstrip, on the Modeling tab, in the Design gallery select Property Inspector or on the Simulation tab, Prepare gallery, select Property Inspector.

Dataflow domains automatically partition your model into multiple threads for better performance. Once you set theDomainparameter toDataflow, you can use theMulticoretab analysis to analyze your model to get better performance. TheMulticoretab is available in the toolstrip when there is a dataflow domain in the model. To learn more about theMulticoretab, seePerform Multicore Analysis for Dataflow.

Analyzing Concurrency in Dataflow Subsystem

For this example theMulticoretab mode is set toSimulation Profilingfor simulation performance analysis.

It is recommended to optimize model settings for optimal simulation performance. To accept the proposed model settings, on theMulticoretab, clickOptimize. Alternatively, you can use the drop menu below theOptimizebutton to change the settings individually. In this example the model settings are already optimal.

On theMulticoretab, click theRun Analysisbutton to start the analysis of the dataflow domain for simulation performance. Once the analysis is finished, the Analysis Report and Suggestions window shows how many threads the dataflow subsystem uses during simulation.

在分析模型,分析和报告Suggestions window shows one thread because the data dependency between the blocks in the model prevents blocks from being executed concurrently. By pipelining the data dependent blocks, the dataflow subsystem can increase concurrency for higher data throughput. The Analysis Report and Suggestions window shows the recommended number of pipeline delays as Suggested for Increasing Concurrency. The suggested latency value is computed to give the best performance.

The following diagram shows the Analysis Report and Suggestions window where the suggested latency is 5 for the Dataflow Subsystem.

Click theAcceptbutton to use the recommended latency for the dataflow subsystem. This value can also be entered directly in the Property Inspector forLatencyparameter. Simulink shows the latency parameter value using$Z^{-n}$tags at the output ports of the dataflow subsystem.

The Analysis Report and Suggestions window now shows the number of threads as 4 meaning that the blocks inside the dataflow subsystem simulate in parallel using 4 threads.Highlight threadshighlights the blocks with colors based on their thread allocation as shown in theThread Highlighting Legend.显示管道延迟shows where pipelining delays were inserted within the dataflow subsystem using$Z^{-n}$tags.

Multicore Simulation Performance

We measure the performance improvement of using dataflow domain by comparing the execution time taken for running the model with and without using dataflow. Execution time is measured using the sim command, which returns the simulation execution time of the model. These numbers and analysis were published on a Windows® desktop computer with Intel® Xeon® CPU W-2133 @ 3.6 GHz 6 Cores 12 Threads processor.

Simulation execution time for multithreaded model = 18.90s Simulation execution time for single-threaded model = 36.01s Actual speedup with dataflow: 1.9x

Summary

This example shows how dataflow execution domain can improve performance in simulation of a radar system by using multiple cores on the desktop.