Optimize Code forARMCortex-M Processors
You can configure your model to replace generic code with ARM®CMSIS code that is optimized forARM Cortex®-M processors.
To measure the effects of optimization, you can perform Execution profiling before and after completing this procedure. For more information, seeReplace Code for Embedded Targets.
To enable the code replacement libraries forARM Cortex-M processors:
(Optional) To see the code replacement libraries that the code generation process will, enter:
crviewer('ARM Cortex-M')
Code Replacement Viewer opens and displays the code replacement libraries.
In the model, open theModelingtab and pressCTRL+Eto open the Configuration Parameters dialog box. Go toHardware Implementation>Hardware boardand ensure that theDevice vendoris set to
ARM compatible
andDevice typeisARM Cortex
.In the Configuration Parameters dialog box, expandCode Generation, and select theInterfacepane.
ClickSelectof代码替换库parameter. A
Choose one or multiple Code replacement libraries for code generation
dialog box is opened.SelectARM Cortex-Mto the selected code replacement libraries-prioritized and clickOK.