fxpOptimizationOptions class
Specify options for data type optimization
描述
这fxpOptimizationOptions
对象使您可以指定在数据类型优化过程中使用的选项和约束。
Construction
创建一个opt
= fxpoptimizePtions()fxpOptimizationOptions
object with default values.
创建一个nopt
= fxpoptimizePtions(名称,价值
)fxpOptimizationOptions
object with property values specified by one or more名称,价值
pair arguments.Name
must appear inside single quotes (''
)。您可以按任何顺序指定几个名称值对参数Name1,Value1,...,NameN,ValueN
.
特性
最大值
—执行的最大迭代次数
50(default) |scalar integer
执行的最大迭代次数,指定为标量整数。优化过程通过不同的解决方案进行迭代,直到找到理想的解决方案,达到最大迭代次数或达到另一个停止标准。万博 尤文图斯
例子:opt.MaxIterations = 75;
数据类型:双倍的
MaxTime
—Maximum amount of time for the optimization to run (in seconds)
600(default) |scalar
Maximum amount of time for the optimization to run, specified in seconds as a scalar number. The optimization runs until it reaches the time specified, an ideal solution, or another stopping criteria.
例子:opt.MaxTime = 1000;
数据类型:双倍的
耐心
—Maximum number of iterations where no new best solution is found
10(default) |scalar integer
Maximum number of iterations where no new best solution is found, specified as a scalar integer. The optimization continues as long as the algorithm continues to find new best solutions.
例子:opt.Patience = 15;
数据类型:双倍的
已经rbosity
—Level of information displayed at the command line during the optimization
'High'
(default) |'Moderate'
|'沉默的'
这level of information displayed at the command line during the optimization process, specified as either'High'
,'Moderate'
, or'沉默的'
.
'沉默的'
- Nothing is displayed at the command line until the optimization process is finished'Moderate'
- Information is displayed at each major step of the optimization process, including when the process is in the preprocessing, modeling, and optimization phases.'High'
- 在优化过程的每次迭代中,在命令行中显示信息,包括是否找到了新的最佳解决方案以及解决方案的成本。
例子:opt.Verbosity = 'Moderate';
数据类型:char
|string
AllowableWordLengths
—Word lengths that can be used in your optimized system under design
[2:128]
(default) |scalar integer|向量的整数
指定在设计下的优化系统中可以使用的单词长度。使用此属性来定位优化过程的邻域搜索。优化的最终结果使用单词长度在AllowableWordLengths
and word lengths compatible with hardware constraints specified in the硬件实现模型的窗格。
例子:Opt.AllowableWordLength = [8:11,16,32];
数据类型:双倍的
目标函数
—目的ive function to use during optimization search
'BitWidthSum'
(default) |“OperatorCount”
目的ive function to use during optimization search, specified as one of these values:
'BitWidthSum'
- 最小化总宽度总和。“OperatorCount”
- 最小化生成的C代码中运算符的估计计数。This option may result in a lower program memory size for C code generated from Simulink®楷模。这
“OperatorCount”
objective function is not suitable for FPGA or ASIC targets.Note
使用
“OperatorCount”
在优化目标函数,model must be ready for code generation. For more information about determining code generation readiness, seeCheck Model and Configuration for Code Generation(Embedded Coder).
数据类型:char
useParallel
—Whether to run iterations in parallel
错误的
(default) |true
Whether to run iterations of the optimization in parallel, specified as a logical. Running the iterations in parallel requires a Parallel Computing Toolbox™ license. If you do not have a Parallel Computing Toolbox license, or if you specify错误的
, the iterations run in serial.
数据类型:logical
高级选项
—优化的其他选项
object
Additional advanced options for optimization.高级选项
is an object containing additional properties that can affect the optimization.
财产 | 描述 |
---|---|
performenighborhoodSearch |
|
EnforceLooseCoupling |
Some blocks have a parameter that forces inputs to share a data type, or forces the output to share the same data type as the input.
|
UseDerivedRangeAnalysis |
Depending on the model configuration, derived range analysis may take longer than simulation of the model. |
仿真季节 |
定义在优化期间使用A的其他模拟方案万博1manbetxSimulink.SimulationInput object. For an example, see使用多个模拟方案优化数据类型. |
SafetyMargin |
Enter a safety margin, specified as a positive scalar value indicating the percentage increase in the bounds of the collected range. The safety margin is applied to the union of all collected ranges, including simulation ranges, derived ranges, and design ranges. |
DataTypeOverride |
在优化范围收集阶段进行模拟时,模型中指定的数据类型的覆盖数据类型。
|
hangeuns万博1manbetxupport |
Some blocks are not supported for fixed-point conversion. For more information, see不支持定点数据类型的块万博1manbetx.
|
PerformSlopeBiasCancellation |
|
InstrumentationContext |
[模型'/subsystem'] - 限制仪器以最小,最大和溢出记录,以将优化范围收集步骤限制为子系统。子系统必须位于顶级模型下,并包含在设计中的系统。 |
Methods
addSpecification | 在系统中指定已知数据类型 |
addtolerance | 为优化系统指定数字公差 |
显示特异性 | Show specifications for a system |
展示耐力 | 显示针对系统指定的公差 |
Copy Semantics
处理。要了解处理课程如何影响复制操作,请参见复制对象.
例子
Create anfxpOptimizationOptions
目的
Create anfxpOptimizationObject
具有默认属性值。
options = fxpOptimizationOptions();
使用DOT语法编辑创建后的属性。
options.Patience = 15; options.AllowableWordLengths = [8,16,32]; options.AdvancedOptions.UseDerivedRangeAnalysis = true
options = fxpOptimizationOptions with properties: MaxIterations: 50 MaxTime: 600 Patience: 15 Verbosity: High AllowableWordLengths: [8 16 32] ObjectiveFunction: BitWidthSum UseParallel: 0 Advanced Options AdvancedOptions: [1x1 DataTypeOptimization.AdvancedFxpOptimizationOptions]
Create anfxpOptimizationOptions
具有非默认设置的对象
Use property name-value pairs to set properties at object creation.
options = fxpOptimizationOptions('Patience',15,“允许wordlength”,[8,16,32])
options = fxpOptimizationOptions with properties: MaxIterations: 50 MaxTime: 600 Patience: 15 Verbosity: High AllowableWordLengths: [8 16 32] ObjectiveFunction: BitWidthSum UseParallel: 0 Advanced Options AdvancedOptions: [1x1 DataTypeOptimization.AdvancedFxpOptimizationOptions]
Specify advanced options.
options.AdvancedOptions.UseDerivedRangeAnalysis = 1
options = fxpOptimizationOptions with properties: MaxIterations: 50 MaxTime: 600 Patience: 15 Verbosity: High AllowableWordLengths: [8 16 32] ObjectiveFunction: BitWidthSum UseParallel: 0 Advanced Options AdvancedOptions: [1x1 DataTypeOptimization.AdvancedFxpOptimizationOptions]
导入fxpOptimizationOptions
对象进入定点工具
You can import anfxpOptimizationOptions
对象进入定点工具,以在应用中执行数据类型优化。通过导入fxpOptimizationOptions
object rather than specifying settings manually in the app, you can easily save and restore your settings.
Open the model.
model ='ex_controllerHarness';Open_System(模型);
要指定优化的选项,例如允许的单词长度和迭代次数,请使用fxpOptimizationOptions
object.
options = fxpOptimizationOptions(“允许wordlength”, [2:32],'MaxIterations',3E2,'Patience', 50);
用控制器
选定子系统。
fxptdlg('ex_controllerHarness/Controller')
在定点工具中,选择New > Optimized Fixed-Point Conversionto start the data type optimization workflow.
In theSetuppane, underAdvanced Options,选择从下拉菜单导入的优化选项对象。点击进口.
扩展设置menu in the toolstrip to confirm that the optimization options were applied.
已经rsion History
matlab命令
您单击了与此MATLAB命令相对应的链接:
通过在MATLAB命令窗口中输入该命令。Web浏览器不支持MATLAB命令。万博1manbetx
选择一个网站
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
您还可以从以下列表中选择一个网站:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
美洲
- América Latina(Español)
- 加拿大(英语)
- 美国(英语)