Main Content

Requirements Table

Model formal requirements with input conditions

Since R2022a

  • Requirements Table block icon.

Libraries:
Requirements Toolbox

Description

The Requirements Table block models formal requirements. The block starts with evaluating conditions listed in the Precondition column. If the conditions are satisfied, you can check if other simulation data meet specified conditions in the Postcondition column, or execute desired actions, such as block outputs or functions, in the Action column. For more information, see Use a Requirements Table Block to Create Formal Requirements.

You can also constrain requirements based on physical limitations of your model by defining assumptions in the Assumptions tab. See Add Assumptions to Requirements.

You can configure this block only if you have Requirements Toolbox™.

Ports

Input

expand all

Input port, specified as a scalar, vector, or matrix. Each input data that you define has a corresponding input port.

Dependencies

To create input ports, open the block and create input data in the Symbols pane. See Define Data in Requirements Table Blocks.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | string | fixed point | enumerated | bus

Output

expand all

Output port, specified as a scalar, vector, or matrix. Each output data that you define has a corresponding output port.

Dependencies

To create output ports, open the block and create output data in the Symbols pane. See Define Data in Requirements Table Blocks.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | string | fixed point | enumerated | bus

Parameters

expand all

Main

Select how to display port labels on the Requirements Table block icon.

  • none – Do not display port labels.

  • FromPortIcon – Display the name of the input and output data.

  • FromPortBlockName – Display the name of the input and output data.

  • SignalName – If the signal connected to the port is named, display the signal name. Otherwise, display the name of the data.

Programmatic Use

Parameter: ShowPortLabels
Type: string scalar or character vector
Value: "none" | "FromPortIcon" | "FromPortBlockName" | "SignalName"
Default: "FromPortIcon"

Control user access to the contents of the Requirements Table block.

  • ReadWrite – Enable opening and modifying of Requirements Table block contents.

  • ReadOnly – Enable opening of the Requirements Table block.

  • NoReadOrWrite – Disable opening or modifying of the Requirements Table block.

Note

When you attempt to view the contents of a Requirements Table block whose Read/Write permissions parameter is NoReadOrWrite, the block does not respond. For example, when you double-click the Requirements Table block, Simulink does not open the table contents and does not display messages.

Programmatic Use

Parameter: Permissions
Type: string scalar or character vector
Value: "ReadWrite" | "ReadOnly" | "NoReadOrWrite"
Default: "ReadWrite"

Try to eliminate artificial algebraic loops that include the atomic unit during simulation.

  • off – Do not try to eliminate artificial algebraic loops that include the atomic unit.

  • on – Try to eliminate artificial algebraic loops that include the atomic unit.

Programmatic Use

Parameter: MinAlgLoopOccurrences
Type: string scalar or character vector
Value: "off" | "on"
Default: "off"

Specify whether entries in this block must run at the same rate or can run at different rates.

  • If entries in the Requirements Table block can run at different rates, specify the sample time as inherited (-1).

  • If entries must run at the same rate, specify the sample time, Ts, corresponding to this rate.

Programmatic Use

Parameter: SystemSampleTime
Type: string scalar or character vector
Value: "-1" | "[Ts 0]"
Default: "-1"

Code Generation

Select the code format that the block generates.

Auto

Simulink Coder™ chooses the optimal format for your system based on the type and number of instances of the Requirements Table block that exist in the model.

Inline

Simulink Coder inlines the Requirements Table block unconditionally.

Nonreusable function

Simulink Coder explicitly generates a separate function in a separate file. Requirements Table blocks with this setting generate functions that might have arguments depending on the Function interface (Simulink) parameter setting. You can name the generated function and file using parameters Function name (Simulink) and File name (no extension) (Simulink). These functions are not reentrant.

Reusable function

Simulink Coder generates a function with arguments that allows reuse of Requirements Table block code when a model includes multiple instances of the Requirements Table block.

This option generates a function with arguments that allows Requirements Table block code to be reused in the generated code of a model reference hierarchy that includes multiple instances of a Requirements Table block across referenced models. In this case, the Requirements Table block must be in a library.

Tips

  • When you want to represent multiple instances of a Requirements Table block as one reusable function, you can designate each of the instances as Auto or as Reusable function. It is best to use one or the other, as using both creates two reusable functions, one for each designation. The outcomes of these choices differ only when reuse is not possible. Selecting Auto does not allow control of the function or file name for the Requirements Table block code.

  • The Reusable function and Auto options both determine whether multiple instances of a Requirements Table block exist and the code can be reused. The options behave differently when it is impossible to reuse the code. In this case, Auto yields inlined code, or if circumstances prohibit inlining, separate functions for each block instance.

  • If you select Reusable function while your generated code is under source control, set File name options to Use subsystem name, Use function name, or User specified. Otherwise, the names of your code files change when you modify your model, which prevents source control on your files.

Dependency

  • This parameter requires Simulink Coder.

  • Setting this parameter to Nonreusable function or Reusable function enables the following parameters:

    • Function name options

    • File name options

    • Memory section for initialize/terminate functions (requires Embedded Coder® and an ERT-based system target file)

    • Memory section for execution functions (requires Embedded Coder and an ERT-based system target file)

  • Setting this parameter to Nonreusable function enables Function with separate data (requires a license for Embedded Coder and an ERT-based system target file).

Programmatic Use

Parameter: RTWSystemCode
Type: string scalar or character vector
Value: "Auto" | "Inline" | "Nonreusable function" | "Reusable function"
Default: "Auto"

Extended Capabilities

Version History

Introduced in R2022a

expand all