Embedded CoderCapabilities for Code Generation fromMATLAB代码
The Embedded Coder®product extends theMATLAB®代码r™product with capabilities that you can use for embedded software development. You can generate code that has the clarity and efficiency of professional handwritten code. For example, you can:
生成紧凑而快速的代码,这对于实时模拟器,目标快速原型制作板,用于质量生产中使用的微处理器以及嵌入式系统至关重要。
Customize the appearance of generated code.
优化针对应用程序特定要求的生成的代码。
Enable tracing options that help you to verify the generated code.
The Embedded Coder product extends theMATLAB编码器具有以下选项和C/C ++代码生成的优化产品。
Goal | Project Setting | 代码配置对象属性 | 更多信息 |
---|---|---|---|
执行时间处理时间 | |||
Control generation of floating-point data and operations | 金宝app仅支持纯粹的数字 | 纯净的库德 |
N/A。 |
Simplify array indexing in loops in the generated code | Simplify array indexing | EnableStrengthReduction |
简化乘法以在循环中的数组索引 |
在生成的代码中替换功能和运算符,以满足特定于应用程序的代码要求 | 代码更换库on the自定义代码tab | 代码ReplacementLibrary |
Embedded Coder offers additional libraries and the ability to create and use custom code. See代码Replacement Customization。 |
创建和注册功能和运营商的特定应用程序实现 | N/A。 | N/A。 | 代码Replacement Customization |
代码外观 | |||
Specify use of single-line or multiline comments in the generated code | 评论样式 | 评论标准 |
指定C/C ++代码的评论样式 |
Include MATLAB source code as comments with traceability tags. In the code generation report, the traceability tags link to the corresponding MATLAB source code | MATLAB源代码作为注释 | MATLABSourceComments |
在生成的C/C ++代码中包括评论 |
Generate MATLAB function help text in the function banner | MATLAB function help text | MATLABFcnDesc |
在生成的C/C ++代码中包括评论 |
将if-elseif-else模式转换为开关案例语句 | 将if-elseif-else模式转换为开关案例语句 | convertiftoswitch |
Controlling C Code Style |
指定外部关键字包含在生成的外部功能的声明中 | 在功能声明中保存外部关键字 | 保存ExternInfcndecls |
N/A。 |
Specify the level of parenthesization in the generated code | Parentheses | ParenthesesLevel |
N/A。 |
指定是否用生成代码中的签名的左侧位移来替换乘以两个功率 | Use signed shift left for fixed-point operations and multiplication by powers of 2 | EnableSignedLeftShifts |
Control Signed Left Shifts in Generated Code |
指定是否允许在生成代码中签名正确的位移动 | 允许签名整数的正确班 | EnableSignedRightShifts |
N/A。 |
Control data type casts in the generated code | Casting modeon theAll Settingstab | CastingMode |
Control Data Type Casts in Generated Code |
指定生成代码的缩进样式 | 缩进样式on theAll Settingstab 凹痕尺寸on theAll Settingstab |
凹陷风格 IndentSize |
Specify Indent Style for C/C++ Code |
在生成代码中的线路断裂之前指定最大列数 | Column limiton theAll Settingstab | ColumnLimit |
N/A。 |
Specify custom names for MATLAB data types in generated code | Enable custom data type replacement | EnableCustomReplacementTypes 替换类型 |
自定义数据类型更换 |
Import custom data type definitions from external header files | 从外部标头文件导入自定义类型 | Isextern HeaderFiles |
从外部标头文件导入自定义数据类型定义 |
自定义生成的C/C ++文件名称 | 生成的源和标头文件名称格式 | CustomFilenamest |
自定义从MATLAB代码生成的C/C ++文件名 |
Customize generated global variable identifiers | Global variables | CustomSymbolStrGlobalVar |
Customize Generated Identifiers |
Customize generated global type identifiers | 全球类型 | CustomSymbolstrype |
Customize Generated Identifiers |
在全局类型标识符中自定义生成的字段名称 | 全局类型的字段名称 | CustomSymbolstrfield |
Customize Generated Identifiers |
Customize generated local functions identifiers | Local functions | CustomSymbolStrFcn |
Customize Generated Identifiers |
Customize generated identifiers for local temporary variables | 本地临时变量 | customsymbolstrtmpvar |
Customize Generated Identifiers |
自定义恒定宏的生成的标识符 | Constant macros | CustomSymbolStrMacro |
Customize Generated Identifiers |
Customize generated identifiers for EMX Array types (Embeddable mxArray types) | EMX数组类型 | customsymbolstremxarray |
Customize Generated Identifiers |
Customize generated identifiers for EMX Array (Embeddable mxArrays) utility functions | EMX阵列实用程序功能 | customsymbolstremxarrayFcn |
Customize Generated Identifiers |
Customize function interface in the generated code | 需要初始化功能on theAll Settingstab 需要终止功能on theAll Settingstab |
IncludeInitializeFcn IncludeTerminateFCN |
N/A。 |
Customize file and function banners | N/A。 | CodeTemplate |
|
在生成代码中的全局变量的控制声明和定义 | N/A。 | N/A。 | |
Debugging | |||
生成静态代码指标报告,包括生成的文件信息,行数和内存使用情况 | Static code metrics | GenerateCodeMetricsReport |
Generating a Static Code Metrics Report for Code Generated from MATLAB Code |
生成一个代码替换报告,该报告总结了所选代码替换库中使用的替换 | 代码更换 | GenerateCodeReplacementReport |
|
Highlight single-precision, double-precision, and expensive fixed-point operations in the code generation report | 突出显示潜在的数据类型问题 | 亮点植物 |
Highlight Potential Data Type Issues in a Report |
自定义代码 | |||
在生成的代码中替换功能和运算符,以满足特定于应用程序的代码要求 | 代码更换库 | 代码ReplacementLibrary |
Embedded Coder offers additional libraries and the ability to create and use custom code. See代码Replacement Customization。 |
创建和注册功能和运营商的特定应用程序实现 | N/A。 | N/A。 | 代码Replacement Customization |
Verification | |||
MATLAB源代码和生成的C/C ++代码之间的交互跟踪 | Enable Code Traceability | EnableTraceability |
MATLAB代码和生成的C/C ++代码之间的交互跟踪 |
Verify generated code using software-in-the-loop and processor-in-the-loop execution | N/A。 | 验证模式 |
通过软件和处理器执行的软件验证 |
在执行软件中的调试代码 | 启用SIL源级调试on theDebuggingpane | SILDebugging |
调试在SIL执行期间生成的代码 |
配置文件执行时间在循环和处理器中执行期间 | 启用SIL/PIL的入口点执行分析on theDebuggingpane | 代码ExecutionProfiling |
执行时间处理时间Profiling for SIL and PIL |
Verify and profile ARM optimized code | 硬件板on the硬件pane | 硬件 |
|
运行polyspace®通过使用集成工作流对生成的C/C ++代码进行验证 | N/A。 | N/A。 | Polyspace Verification of C/C++ Code Generated by MATLAB Coder |