主要内容

Simulink 模块注意事项

R2026b
名称、数学运算、端口和子系统、信号布线、逻辑和位运算

对 Simulink® 模块名称、数学运算、端口和子系统、信号布线以及逻辑和位运算应用高完整性规范。

建模规范

全部展开

hisl_0031:模型文件名Use naming conventions for model file names
hisl_0032:模型元素名称Naming conventions for model elements that produce valid identifiers in generated code
hisl_0001:Abs 模块的使用Avoid unsupported data types and protect against integer overflow for the Abs block
hisl_0002:余数和倒数运算的使用To support robustness of generated code, when using the Math Function block with remainder-after-division (rem) or reciprocal (reciprocal) operations
hisl_0003:平方根运算的使用To support robustness of generated code, when using the Square Root operations
hisl_0028:Reciprocal Square Root 模块的使用Protect inputs of the Reciprocal Square Root block to avoid undesirable results in generated code
hisl_0004:自然对数和以 10 为底的对数运算的使用Protect against invalid inputs to logarithm operations
hisl_0005:Product 模块的使用Protect divisor inputs from becoming singular matrices in Product blocks
hisl_0029:Assignment 模块的使用Initialize array fields before first use in the Assignment block to avoid undesirable results in generated code
hisl_0066:Gain 模块的使用Set the Gain block value to a nonzero value other than 1 to support traceability of generated code
hisl_0067:防止除以零计算Protect the divisor from going to zero in divide operations to improve robustness of generated code
hisl_0006:While Iterator 模块的使用Set maximum number of iterations for While Iterator blocks to support bounded iterative behavior
hisl_0007:For Iterator 或 While Iterator 子系统的使用Avoid using sample time-dependent blocks within For Iterator or While Iterator subsystems
hisl_0008:For Iterator 模块的使用Configure For Iterator blocks to support bounded iterative behavior in generated code
hisl_0010:If 模块和 If Action Subsystem 模块的使用Connect If block outports to If Action Subsystem blocks and use else conditions to support verifiable generated code
hisl_0011:Switch Case 模块和 Action Subsystem 模块的使用To support verifiable generated code, when using the Switch Case block
hisl_0024:输入端口接口定义Define data type, port dimensions, and sample time for inports to support strong typing and unambiguous model behavior
hisl_0025:输入接口的最小/最大值设计设定Provide design minimum and maximum ranges for inport interfaces to support precise input interface specification
hisl_0026:输出接口的最小/最大值设计设定Provide design minimum and maximum ranges for outport interfaces to support precise output interface specification
hisl_0075:库链接的使用Avoid disabled and parameterized library links for consistent simulation and code generation (自 R2022a 起)
hisl_0077:输出端口接口定义Define data type, port dimensions, and sample time for outport interfaces (自 R2022b 起)
hisl_0078:是否使用相同的建模模式Account for identical and similar modeling patterns to reduce code complexity (自 R2024a 起)
hisl_0079:到根输入/输出端口的连接Adhere to internal connection constraints on root-level Inport and Outport blocks to improve traceability (自 R2024a 起)
hisl_0015:Merge 模块的使用Use Merge blocks with mutually exclusive conditionally executed subsystems to support unambiguous behavior
hisl_0021:一致的向量索引方法Use a consistent vector indexing method within a model to reduce the risk of indexing errors
hisl_0022:索引信号的数据类型选择Use an appropriate data type for index signals to prevent unexpected results and enable correct data access
hisl_0023:变体模块的验证Configure Variant block activation time to simplify consistency testing between a model and generated code
hisl_0034:Signal Routing 模块的使用Avoid the ~= operator on floating-point data types in Switch blocks to improve model robustness
hisl_0016:计算关系运算符的模块的使用Avoid using equality and inequality operators on floating-point data types
hisl_0017:计算关系运算符的模块的使用 (2)Configure relational operator blocks to produce unambiguous behavior in generated code
hisl_0018:Logical Operator 模块的使用Configure the Logical Operator block to produce unambiguous behavior in generated code
hisl_0073:移位运算的使用Avoid shift operations greater than or equal to the bit-width to prevent violations of coding standards
hisl_0033:Lookup Table 模块的使用Keep out-of-range protection enabled in Lookup Table blocks to protect against out-of-range inputs or indices
hisl_0072:引用模型的可调参数的使用Use Simulink.Parameter objects to define tunable parameters and prevent unintended loss of tunability
hisl_0073:移位运算的使用Avoid shift operations greater than or equal to the bit-width to prevent violations of coding standards